Function Unit Tests¶
- test.test_calculations.test_calculate_feature_positions()¶
For an input shape of \((N,6)\):
The output should not be NoneType
The output shape should be (N,6).
The output should contain only real, finite values.
The norm of the difference between the head and tail of a fish should always be equal to the standard fish length, \(\ell\).
- test.test_calculations.helper_test_interaction(interactions, N)¶
For an input shape of \((N,6)\):
The output should not produce NoneType
The output shape should be \((N,3)\).
The matrix should not contain any infinite or complex entries.
The norm of all rows in the output matrix should be greater than 0. (All interactions are non-zero in magnitude by definition.)
- test.test_calculations.test_compute_interaction_pairwise()¶
- test.test_calculations.test_compute_interaction_barnes_hut()¶
- test.test_calculations.test_calculate_feature_velocities()¶
For an input shape of \((N,6)\):
The output should not be NoneType
The output shape should be \((N,6)\).
There should be no infinite values.
All values must be nonzero.
- test.test_calculations.test_calculate_system_derivative()¶
For an input shape of \((N,6)\):
The output shape should be \((N,6)\).
The output shape should contain only real, floating-point numbers.
The derivative for the full state should not be zero.
- test.test_fish.test_positions_and_orientations()¶
For an input shape of \((N,6)\),
Neither should be NoneType
Both should return an output shape of \((N,3)\)
They should not be identical.
Put together, they should produce the original matrix.
- test.test_fish.helper_test_fish(random_fish, bounds)¶
Should not be a NoneType object.
Should have a length of 6.
The orientation should be a unit vector.
The position should be within bounds.
The orientation should be within the angular perturbation maximum.
- test.test_fish.helper_test_system(system, bounds)¶
Should have a shape of \((N,6)\).
There should be no duplicate entries.
- test.test_fish.test_generate_system()¶
- test.test_fish.test_normalize_orientation_vectors()¶
For an input shape of \((N,6)\):
Normalization should not produce a NoneType object.
The output should have an identical shape.
All of the orientation vectors should be unit vectors.