Skip to content

Commit

Permalink
Backport fixes from PR #203. [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Nov 14, 2023
1 parent 56dca87 commit 954c545
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1120,11 +1120,10 @@ def _split_molecules(frame, pdb, reference, work_dir, property_map={}):

# Create a triclinic space from the information in the frame file.
if isinstance(frame, _SireIO.AmberRst7):
# Get the box dimensions and angles. Take the values, since the
# units are wrong.
# Get the box dimensions and angles.
degree = _SireUnits.degree
dimensions = [x.value() for x in frame.box_dimensions()]
angles = [x.value() * degree for x in frame.box_angles()]
angles = [x.to(degree) * degree for x in frame.box_angles()]
box = _SireVol.TriclinicBox(*dimensions, *angles)
else:
box = _SireVol.TriclinicBox(frame.box_v1(), frame.box_v2(), frame.box_v3())
Expand Down
14 changes: 12 additions & 2 deletions python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,10 @@ def rotateBoxVectors(
try:
prop_name = property_map.get("coordinates", "coordinates")
cursor = cursor.rotate(
center=center, matrix=rotation_matrix, map={"coordinates": prop_name}
center=center,
matrix=rotation_matrix,
rotate_velocities=False,
map={"coordinates": prop_name},
)
except:
pass
Expand All @@ -1227,7 +1230,10 @@ def rotateBoxVectors(
try:
prop_name = property_map.get("velocity", "velocity")
cursor = cursor.rotate(
center=center, matrix=rotation_matrix, map={"coordinates": prop_name}
center=center,
matrix=rotation_matrix,
rotate_velocities=False,
map={"coordinates": prop_name},
)
except:
pass
Expand All @@ -1240,12 +1246,14 @@ def rotateBoxVectors(
cursor = cursor.rotate(
center=center,
matrix=rotation_matrix,
rotate_velocities=False,
map={"coordinates": prop_name},
)
prop_name = property_map.get("coordinates", "coordinates") + "1"
cursor = cursor.rotate(
center=center,
matrix=rotation_matrix,
rotate_velocities=False,
map={"coordinates": prop_name},
)
except:
Expand All @@ -1257,12 +1265,14 @@ def rotateBoxVectors(
cursor = cursor.rotate(
center=center,
matrix=rotation_matrix,
rotate_velocities=False,
map={"coordinates": prop_name},
)
prop_name = property_map.get("velocity", "velocity") + "1"
cursor = cursor.rotate(
center=center,
matrix=rotation_matrix,
rotate_velocities=False,
map={"coordinates": prop_name},
)
except:
Expand Down
5 changes: 2 additions & 3 deletions python/BioSimSpace/Trajectory/_trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,11 +1120,10 @@ def _split_molecules(frame, pdb, reference, work_dir, property_map={}):

# Create a triclinic space from the information in the frame file.
if isinstance(frame, _SireIO.AmberRst7):
# Get the box dimensions and angles. Take the values, since the
# units are wrong.
# Get the box dimensions and angles.
degree = _SireUnits.degree
dimensions = [x.value() for x in frame.box_dimensions()]
angles = [x.value() * degree for x in frame.box_angles()]
angles = [x.to(degree) * degree for x in frame.box_angles()]
box = _SireVol.TriclinicBox(*dimensions, *angles)
else:
box = _SireVol.TriclinicBox(frame.box_v1(), frame.box_v2(), frame.box_v3())
Expand Down
14 changes: 12 additions & 2 deletions python/BioSimSpace/_SireWrappers/_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,10 @@ def rotateBoxVectors(
try:
prop_name = property_map.get("coordinates", "coordinates")
cursor = cursor.rotate(
center=center, matrix=rotation_matrix, map={"coordinates": prop_name}
center=center,
matrix=rotation_matrix,
rotate_velocities=False,
map={"coordinates": prop_name},
)
except:
pass
Expand All @@ -1175,7 +1178,10 @@ def rotateBoxVectors(
try:
prop_name = property_map.get("velocity", "velocity")
cursor = cursor.rotate(
center=center, matrix=rotation_matrix, map={"coordinates": prop_name}
center=center,
matrix=rotation_matrix,
rotate_velocities=False,
map={"coordinates": prop_name},
)
except:
pass
Expand All @@ -1188,12 +1194,14 @@ def rotateBoxVectors(
cursor = cursor.rotate(
center=center,
matrix=rotation_matrix,
rotate_velocities=False,
map={"coordinates": prop_name},
)
prop_name = property_map.get("coordinates", "coordinates") + "1"
cursor = cursor.rotate(
center=center,
matrix=rotation_matrix,
rotate_velocities=False,
map={"coordinates": prop_name},
)
except:
Expand All @@ -1205,12 +1213,14 @@ def rotateBoxVectors(
cursor = cursor.rotate(
center=center,
matrix=rotation_matrix,
rotate_velocities=False,
map={"coordinates": prop_name},
)
prop_name = property_map.get("velocity", "velocity") + "1"
cursor = cursor.rotate(
center=center,
matrix=rotation_matrix,
rotate_velocities=False,
map={"coordinates": prop_name},
)
except:
Expand Down

0 comments on commit 954c545

Please sign in to comment.