Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal updates due to Sire API fixes #203

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading