cf.CellMeasure.equals

CellMeasure.equals(other, rtol=None, atol=None, traceback=False, ignore=())[source]

True if two variables are logically equal, False otherwise.

Parameters :
other :

The object to compare for equality.

atol : float, optional

The absolute tolerance for all numerical comparisons, By default the value returned by the cf.ATOL function is used.

rtol : float, optional

The relative tolerance for all numerical comparisons, By default the value returned by the cf.RTOL function is used.

traceback : bool, optional

If True then print a traceback highlighting where the two instances differ.

ignore : iterable, optional

Omit these CF properties from the comparison.

Returns :
out : bool

Whether or not the two instances are equal.

Examples

>>> f.equals(f)
True
>>> g = f + 1
>>> f.equals(g)
False
>>> g -= 1
>>> f.equals(g)
True
>>> f.setprop('name', 'name0')
>>> g.setprop('name', 'name1')
>>> f.equals(g)
False
>>> f.equals(g, ignore=['name'])
True

Previous topic

cf.CellMeasure.dump

Next topic

cf.CellMeasure.expand_dims

This Page