movement icon indicating copy to clipboard operation
movement copied to clipboard

Expose loading functions from main module interface

Open vigji opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe. I find it a bit cumbersome to remember every time that loading functions need to be imported from movement.io.load_poses or whatever other module.

Describe the solution you'd like I'm sure you people have been discussing about this and maybe do not want to prematurely expose functions from a module and then force people to refactor their code if you move those functions/rename etc. I guess this must be the issue, as otherwise since any movement-related project would at some point import functions from the io module additional dependencies loading time should not really be a factor here.

However, since every project indeed starts with such imports, I would really like to be able to use a function to load my files directly from the movement module interface (movement.load_file? movement.load_pose?)

What are your thoughts on this?

vigji avatar Dec 10 '24 14:12 vigji

Sounds like a good idea to me.

adamltyson avatar Dec 10 '24 15:12 adamltyson

Agree the current imports are cumbersome, especially for io. Just to clarify, is this sth like the interface you envision?

import movement as mvt

# instead of movement.io.load_poses.from_file()
mvt.load_poses(file_path)

# instead of movement.io.load_bboxes.from_file()
mvt.load_bboxes(file_path)

niksirbi avatar Dec 10 '24 16:12 niksirbi

yup! I see how that would entail renaming functions from current load_poses module, but maybe that can be done gradually with duplication and warnings. I feel it would be important to lower friction for an entry user :)

vigji avatar Dec 10 '24 16:12 vigji

Yeah, we could do that gradually end with deprecation warnings...

niksirbi avatar Dec 10 '24 17:12 niksirbi