Skip to content

Commit

Permalink
fix charge units when charge is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjonesBSU committed Oct 23, 2023
1 parent 54f1bf4 commit 8d4e043
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 8d4e043

Please sign in to comment.