RectGrid.approx_equals

RectGrid.approx_equals(self, other, atol)[source]

Test if this grid is equal to another grid.

Parameters
other :

Object to be tested

atolfloat

Allow deviations up to this number in absolute value per vector entry.

Returns
equalsbool

True if other is a RectGrid instance with all coordinate vectors equal (up to the given tolerance), to the ones of this grid, False otherwise.

Examples

>>> g1 = RectGrid([0, 1], [-1, 0, 2])
>>> g2 = RectGrid([-0.1, 1.1], [-1, 0.1, 2])
>>> g1.approx_equals(g2, atol=0)
False
>>> g1.approx_equals(g2, atol=0.15)
True