Skip to content

Commit

Permalink
Use isclose to compare HMR factor to 1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Nov 15, 2023
1 parent 7cd5f7a commit b9840b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/somd2/runner/_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,10 @@ def _repartition_h_mass(system, factor=1.0):
if not isinstance(factor, float):
raise TypeError("'factor' must be of type 'float'")

from math import isclose

# Early exit if no repartitioning is required.
if factor == 1.0:
if isclose(factor, 1.0, abs_tol=1e-4):
return

from sire.morph import (
Expand Down

0 comments on commit b9840b0

Please sign in to comment.