ffsim.SupportsApproximateEquality

class ffsim.SupportsApproximateEquality(*args, **kwargs)[source]

Bases: Protocol

An object that can be compared approximately.

Methods

_approx_eq_(other, rtol, atol)

Return whether the object is approximately equal to another object.

_approx_eq_(other, rtol, atol)[source]

Return whether the object is approximately equal to another object.

See the documentation of np.isclose for the interpretation of the tolerance parameters rtol and atol.

Parameters:
  • other (Any) – The object to compare to.

  • rtol (float) – Relative numerical tolerance.

  • atol (float) – Absolute numerical tolerance.

Return type:

bool

Returns:

True if the objects are approximately equal up to the specified tolerance, and False otherwise.