cf.Coordinate.equals

Coordinate.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 ATOL function is used.

rtol : float, optional

The relative tolerance for all numerical comparisons, By default the value returned by the 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=set('name',))
True

Previous topic

cf.Coordinate.dump

Next topic

cf.Coordinate.expand_dims

This Page