neuroinformatics-unit / movement

Python tools for analysing body movements across space and time
http://movement.neuroinformatics.dev
BSD 3-Clause "New" or "Revised" License
77 stars 7 forks source link

Consider renaming `load_poses` and `save_poses` to `load_dataset` and `save_dataset` #199

Open niksirbi opened 1 month ago

niksirbi commented 1 month ago

Perhaps there is scope for renaming the load_poses module to load_dataset (and save_poses to save_dataset accordingly).

The syntax for loading/saving data will change from:

from movement.io import load_poses, save_poses

ds = load_poses.from_dlc_file(dlc_file_path)
save_poses.to_sleap_analysis_file(sleap_file_path)

to:

from movement.io import load_dataset, save_dataset

ds = load_dataset.from_dlc_file(dlc_file_path)
save_dataset.to_sleap_analysis_file(sleap_file_path)

That syntax makes more sense now, because "poses" is a bit ambiguous, while we've fully defined what a "dataset" is. Moreover, we intend to handle data with single keypoints and also bounding-boxes, which are not "poses" strictly speaking. The downside is that commands become a bit longer, and it will be a major breaking change in the API.

We could also do load_ds and save_ds, but I'm not sure I want to introduce abbreviations in the first movement functions that a user encounters.

This issue arose while discussing PR #194 with @sfmig.

sfmig commented 3 weeks ago

also relevant for #201, which suggests adding a bounding box dataset