-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from portugueslab/fix-free-tests
Fix tests
- Loading branch information
Showing
3 changed files
with
47 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
""" | ||
Rerun this file if the logic of freely-swimming experiments changes | ||
""" | ||
|
||
import flammkuchen as fl | ||
|
||
from bouter import free | ||
from bouter.tests import ASSETS_PATH | ||
|
||
|
||
def create_assets(): | ||
source_dataset_path = ASSETS_PATH / "freely_swimming_dataset" | ||
experiment = free.FreelySwimmingExperiment(source_dataset_path) | ||
|
||
bouts, continuity = experiment.get_bouts() | ||
velocities_df = experiment.compute_velocity() | ||
|
||
velocities = velocities_df[ | ||
["vel_f{}".format(i_fish) for i_fish in range(experiment.n_fish)] | ||
] | ||
|
||
bouts_summary = experiment.get_bout_properties() | ||
|
||
# Load computed velocities | ||
fl.save( | ||
source_dataset_path / "test_extracted_bouts.h5", | ||
dict( | ||
bouts_summary=bouts_summary, | ||
bouts=bouts, | ||
continuity=continuity, | ||
velocities=velocities, | ||
), | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
create_assets() |
Binary file modified
BIN
+59.7 KB
(170%)
bouter/tests/assets/freely_swimming_dataset/test_extracted_bouts.h5
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters