Skip to content

Commit

Permalink
Handle multiple velocity properties per molecule. [closes #196]
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Nov 7, 2023
1 parent 4b0ba24 commit b9189d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,8 @@ def addMolecules(self, molecules):
num_vels = num_vels + num_pert_vels

# Not all molecules have velocities.
if num_vels > 0 and num_vels != self.nMolecules():
print(num_vels, self.nMolecules())
if num_vels > 0 and num_vels < self.nMolecules():
_warnings.warn(
"Not all molecules have velocities. The 'velocity' property will be removed."
)
Expand Down Expand Up @@ -2384,7 +2385,8 @@ def _set_water_topology(self, format, is_crystal=False, property_map={}):
The format to convert to: either "AMBER" or "GROMACS".
is_crystal : bool
Whether to label as rystal waters.
Whether to label as crystal waters. This is only used when solvating
so that crystal waters aren't removed when adding ions.
property_map : dict
A dictionary that maps system "properties" to their user defined
Expand Down
5 changes: 3 additions & 2 deletions python/BioSimSpace/_SireWrappers/_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def addMolecules(self, molecules):
num_vels = num_vels + num_pert_vels

# Not all molecules have velocities.
if num_vels > 0 and num_vels != self.nMolecules():
if num_vels > 0 and num_vels < self.nMolecules():
_warnings.warn(
"Not all molecules have velocities. The 'velocity' property will be removed."
)
Expand Down Expand Up @@ -2304,7 +2304,8 @@ def _set_water_topology(self, format, is_crystal=False, property_map={}):
The format to convert to: either "AMBER" or "GROMACS".
is_crystal : bool
Whether to label as rystal waters.
Whether to label as crystal waters. This is only used when solvating
so that crystal waters aren't removed when adding ions.
property_map : dict
A dictionary that maps system "properties" to their user defined
Expand Down

0 comments on commit b9189d2

Please sign in to comment.