Skip to content

Commit

Permalink
speed up traj_from_mdraj (don't recalc unitcells)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwhswenson committed Jun 15, 2019
1 parent 2a40256 commit a3709d2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions openpathsampling/engines/openmm/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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,
Expand Down

0 comments on commit a3709d2

Please sign in to comment.