Skip to content

Simplify Trajectory.__getattr__ - #879

Merged
dwhswenson merged 4 commits into
openpathsampling:masterfrom
dwhswenson:traj_getattr
Dec 9, 2019
Merged

Simplify Trajectory.__getattr__#879
dwhswenson merged 4 commits into
openpathsampling:masterfrom
dwhswenson:traj_getattr

Conversation

@dwhswenson

@dwhswenson dwhswenson commented Nov 21, 2019

Copy link
Copy Markdown
Member

This simplifies Trajectory.__getattr__ and may fix #878.

It adds a small restriction on snapshot "features" -- if you have a snapshot feature named foo, and if you create a function-type snapshot feature called trajectory_foo, then trajectory_foo must be a function that takes a trajectory and returns the values for foo. (I don't think this is going to cause any problems for anyone.)

I'm using those trajectory function features for the following: With the OpenMM engine, a trajectory returns a simtk.unit.Quantity wrapping a numpy array of the results of some snapshot feature, as opposed to making a list/numpy array containing multiple Quantity objects. I've now moved the code that supports this behavior into the OpenMM engine (as trajectory function features specific to it), instead of the base Trajectory object.

This allows us to remove more OpenMM-specific code that made Trajectory.__getattr__ a much more complicated and hard-to-maintain function before.

@dwhswenson

Copy link
Copy Markdown
Member Author

I'll merge this in 48 hours (Sunday 8 December) if no comments. I'll assume that it does fix the problem in #878 that @IdsTeepe raised.

@dwhswenson dwhswenson added this to the 1.1 milestone Dec 7, 2019
@dwhswenson
dwhswenson merged commit 8ded0f1 into openpathsampling:master Dec 9, 2019
This was referenced Dec 11, 2019
@dwhswenson
dwhswenson deleted the traj_getattr branch January 21, 2020 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to export rejected trajectories to mdtraj.Trajectory on gromacs_engine

1 participant