diff --git a/src/somd2/runner/_runner.py b/src/somd2/runner/_runner.py index ad09f2e..93f11f5 100644 --- a/src/somd2/runner/_runner.py +++ b/src/somd2/runner/_runner.py @@ -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 (