openmmtools.utils.is_quantity_close¶
-
openmmtools.utils.is_quantity_close(quantity1, quantity2, rtol=1e-10, atol=0.0)[source]¶ Check if the quantities are equal up to floating-point precision errors.
Parameters: - quantity1 : simtk.unit.Quantity
The first quantity to compare.
- quantity2 : simtk.unit.Quantity
The second quantity to compare.
- rtol : float, optional
Relative tolerance (default is 1e-10).
- atol : float, optional
Absolute tolerance (default is 0.0).
Returns: - True if the quantities are equal up to approximately 10 digits.
Raises: - TypeError
If the two quantities are of incompatible units.