-
Notifications
You must be signed in to change notification settings - Fork 126
Expose load_dataset and load_multiview_dataset from top-level movement module (closes #361)
#863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| """Tests for top-level imports from the movement package.""" | ||
|
|
||
|
|
||
| def test_load_dataset_importable_from_top_level(): | ||
| """Test that load_dataset can be imported from movement directly.""" | ||
| from movement import load_dataset | ||
|
|
||
| assert callable(load_dataset) | ||
|
|
||
|
|
||
| def test_load_multiview_dataset_importable_from_top_level(): | ||
| """Test that load_multiview_dataset can be imported from movement.""" | ||
| from movement import load_multiview_dataset | ||
|
|
||
| assert callable(load_multiview_dataset) | ||
|
|
||
|
|
||
| def test_top_level_load_dataset_is_same_as_io(): | ||
| """Top-level load_dataset is the same object as movement.io.load's.""" | ||
| from movement import load_dataset | ||
| from movement.io.load import load_dataset as io_load_dataset | ||
|
|
||
| assert load_dataset is io_load_dataset | ||
|
Comment on lines
+4
to
+23
|
||
|
|
||
|
|
||
| def test_top_level_load_multiview_dataset_is_same_as_io(): | ||
| """Top-level load_multiview_dataset is the same as movement.io.load's.""" | ||
| from movement import load_multiview_dataset | ||
| from movement.io.load import ( | ||
| load_multiview_dataset as io_load_multiview_dataset, | ||
| ) | ||
|
|
||
| assert load_multiview_dataset is io_load_multiview_dataset | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-exporting from
movement.io.loadmeans importingmovementdoes not triggermovement.io.__init__(which importsload_poses/load_bboxesto populate_LOADER_REGISTRY). As a result,movement.load_dataset(...)will raiseValueError("Unsupported source software")because the registry is empty. Re-export frommovement.ioinstead, or ensure loader modules are imported (e.g., lazy-importload_poses/load_bboxesinsideload_datasetwhen the registry is empty).