Skip to content

Commit

Permalink
Merge pull request #203 from OpenBioSim/fix_sire_api_updates
Browse files Browse the repository at this point in the history
Internal updates due to Sire API fixes
  • Loading branch information
lohedges authored Nov 13, 2023
2 parents 621149b + 90c476f commit d1d0acb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 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
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,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 @@ -1241,12 +1244,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 @@ -1258,12 +1263,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 @@ -1167,7 +1167,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 @@ -1176,7 +1179,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 @@ -1189,12 +1195,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 @@ -1206,12 +1214,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 d1d0acb

Please sign in to comment.