Skip to content
Permalink
Browse files

Merge pull request #839 from dwhswenson/faster_traj_from_mdtraj

Improve performance on trajectory_from_mdtraj
  • Loading branch information...
dwhswenson committed Jun 20, 2019
2 parents 2a40256 + a3709d2 commit bd9d31dfdec4f09b0c2c4cc282be927aac2c4e7b
Showing with 6 additions and 5 deletions.
  1. +6 −5 openpathsampling/engines/openmm/tools.py
@@ -220,6 +220,11 @@ def trajectory_from_mdtraj(mdtrajectory, simple_topology=False,
empty_vel = u.Quantity(np.zeros(mdtrajectory.xyz[0].shape),
vel_unit)

if mdtrajectory.unitcell_vectors is not None:
box_vects = u.Quantity(mdtrajectory.unitcell_vectors, u.nanometers)
else:
box_vects = [None] * len(mdtrajectory)


engine = TopologyEngine(topology)

@@ -231,11 +236,7 @@ def trajectory_from_mdtraj(mdtrajectory, simple_topology=False,
else:
vel = empty_vel

if mdtrajectory.unitcell_vectors is not None:
box_v = u.Quantity(mdtrajectory.unitcell_vectors[frame_num],
u.nanometers)
else:
box_v = None
box_v = box_vects[frame_num]

statics = Snapshot.StaticContainer(
coordinates=coord,

0 comments on commit bd9d31d

Please sign in to comment.
You can’t perform that action at this time.