Skip to content
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

Make TrajectoryCollection indexable #365

Open
raybellwaves opened this issue Feb 22, 2024 · 1 comment
Open

Make TrajectoryCollection indexable #365

raybellwaves opened this issue Feb 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@raybellwaves
Copy link
Collaborator

Give a TrajectoryCollection you can index it using traj_collection.get_trajectory(traj_id_col VALUE).

I would like to be able to do traj_collection[0] which would do unique traj_id_col VALUES[0].

This will get a bit tricky if you have values "z", "y", "x". Should 0 return "x" or "z".

Either way I think mostly for exploration whatever the order of .unique() returns can be used. get_trajectory should still be encouraged but I feel a __getitem__ will help with quick exploration

@raybellwaves raybellwaves added the enhancement New feature or request label Feb 22, 2024
@anitagraser
Copy link
Collaborator

Hi Ray. Could you elaborate how this differs from TrajectoryCollection.tajectories[0]

An example would be great to help me understand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants