Support for (exact) Equality Operator for Grid Instances
Two instances of Grid
may be compared for exact equality in value via ==
operator.
The two instances are considered equal if and only if:
- the underlying
MultiIndexSet
instances are equal, and - the generating points are equal.
Note that because generating points are of floating type, the equality check via ==
is exact in nature (without any tolerance specifications).
Although this kind of comparison maybe restrictive, it is useful for many sanity checks and tests involving instances of the class.
In the future, a more loose equality check (e.g., isclose()
, almost_equal
or something similar) may be implemented, say, as a context manager such that the tolerance may be specified.