Skip to content

Commit

Permalink
Add test for saving poses with fps info
Browse files Browse the repository at this point in the history
  • Loading branch information
lochhh committed Nov 24, 2023
1 parent 9780411 commit 3d99063
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_unit/test_save_poses.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,21 +292,21 @@ def test_to_sleap_analysis_file_invalid_dataset(
)

@pytest.mark.parametrize(
"sleap_h5_file",
"sleap_h5_file, fps",
[
"SLEAP_single-mouse_EPM.analysis.h5",
"SLEAP_three-mice_Aeon_proofread.analysis.h5",
"SLEAP_three-mice_Aeon_mixed-labels.analysis.h5",
("SLEAP_single-mouse_EPM.analysis.h5", 30),
("SLEAP_three-mice_Aeon_proofread.analysis.h5", None),
("SLEAP_three-mice_Aeon_mixed-labels.analysis.h5", 50),
],
)
def test_to_sleap_analysis_file_returns_same_h5_file_content(
self, sleap_h5_file, new_h5_file
self, sleap_h5_file, fps, new_h5_file
):
"""Test that saving pose tracks from a SLEAP analysis file
to a SLEAP-style .h5 analysis file returns the same file
contents."""
sleap_h5_file_path = POSE_DATA.get(sleap_h5_file)
ds = load_poses.from_sleap_file(sleap_h5_file_path)
ds = load_poses.from_sleap_file(sleap_h5_file_path, fps=fps)
save_poses.to_sleap_analysis_file(ds, new_h5_file)

with h5py.File(sleap_h5_file_path, "r") as file_in, h5py.File(
Expand Down

0 comments on commit 3d99063

Please sign in to comment.