Skip to content
Snippets Groups Projects
Commit cd781c08 authored by Andi Gerken's avatar Andi Gerken
Browse files

Added more documentation

Preparing to tag and release
parent 9602ba19
No related branches found
No related tags found
No related merge requests found
Pipeline #36451 passed
......@@ -4,3 +4,6 @@ pdoc --html robofish.io robofish.evaluate --html-dir docs --force
## Code coverage:
pytest --cov=src --cov-report=html
## Flake
flake8 --ignore E203 --max-line-length 88
[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools", "wheel", "pytest", "pandas", "deprecation"] # PEP 508 specifications.
requires = ["setuptools", "wheel"] # PEP 508 specifications.
[flake8]
max-line-length = 88
extend-ignore = "E203"
This diff is collapsed.
......@@ -334,13 +334,18 @@ def validate_positions_range(world_size, positions, e_name):
def validate_orientations_length(orientations, e_name):
ori_lengths = np.linalg.norm(orientations, axis=1)
# import matplotlib.pyplot as plt
#
# plt.plot(ori_lengths)
# plt.show()
# Check if all orientation lengths are all 1. Different lengths cause warnings.
assert_validate(
np.isclose(ori_lengths, 1).all(),
"The orientation vectors were not unit vectors. Their length was in the range [%.2f, %.2f] when it should be 1"
"The orientation vectors were not unit vectors. Their length was in the range [%.4f, %.4f] when it should be 1"
% (min(ori_lengths), max(ori_lengths)),
e_name,
strict_validate=False,
strict_validate=True,
)
......
import pytest
import robofish.evaluate
from robofish.io import utils
import numpy as np
def test_get_all_poses_from_paths():
valid_file_path = utils.full_path(__file__, "../../resources/valid.hdf5")
poses, frequency = robofish.evaluate.get_all_poses_from_paths([valid_file_path])
# (1 input array, 1 file, 2 fishes, 100 timesteps, 4 poses)
assert np.array(poses).shape == (1, 1, 2, 100, 4)
assert frequency == 25
import robofish.io
from robofish.io import utils
from pathlib import Path
from testbook import testbook
import sys
......@@ -29,6 +29,8 @@ def test_example_basic():
# This test can be executed manually. The CI/CD System has issues with testbook.
def manual_test_example_basic_ipynb():
from testbook import testbook
# Executing the notebook should not lead to an exception
with testbook(str(ipynb_path), execute=True) as tb:
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment