Skip to content

Commit

Permalink
Merge pull request #82 from chrisjonesBSU/fix-scale-charge
Browse files Browse the repository at this point in the history
Fix charge units when charge is 0
  • Loading branch information
chrisjonesBSU committed Oct 23, 2023
2 parents 9ecb702 + fb96ced commit f4bf132
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flowermd/base/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@ def _scale_charges(self):
abs_charge = sum(abs(charges))
if abs_charge != 0:
for site in self.gmso_system.sites:
site.charge -= abs(site.charge if site.charge else 0) * (
net_charge / abs_charge
)
site.charge -= abs(
site.charge if site.charge else 0 * u.Unit("C")
) * (net_charge / abs_charge)

def to_gsd(self, file_name):
"""Write the system's `hoomd_snapshot` to a GSD file."""
Expand Down

0 comments on commit f4bf132

Please sign in to comment.