Hi Melissa,
Would it be possible to include a sort() method to TrajectoryGroup which is sorting the trajectories based on their IDs in trajids?
The trajectory files that I have are named in a logical, unique way, e.g. YYYY-MM-DD-HH.txt. I thought of something like pandas DataFrame sorting function. An easy way would be to load trajectories and trajids in a DataFrame and apply its sort function. That would imply though to import pandas. For now, when I create my TrajectoryGroup I use
import pysplit as pys
traj_dir = r'/my/directory/to/files/*'
trajGroup = pys.make_trajectorygroup(traj_dir)
which imports all trajectory files in that directory but in a random order. For plotting it would be cool to have the trajGroup in order.
It's been a while- if you have any ideas you've implemented I'd welcome a PR. In my experience I have not noticed the trajectories imported in any order but either alphabetical or perhaps by date modified.
Hi Melissa, Would it be possible to include a
sort()
method toTrajectoryGroup
which is sorting the trajectories based on their IDs intrajids
?The trajectory files that I have are named in a logical, unique way, e.g.
YYYY-MM-DD-HH.txt
. I thought of something likepandas
DataFrame sorting function. An easy way would be to loadtrajectories
andtrajids
in aDataFrame
and apply its sort function. That would imply though to importpandas
. For now, when I create my TrajectoryGroup I usewhich imports all trajectory files in that directory but in a random order. For plotting it would be cool to have the trajGroup in order.
Cheers, Nic