cf.Field.equivalent

Field.equivalent(other, rtol=None, atol=None, traceback=False)[source]

True if and only if two fields are logically equivalent.

Equivalence is defined as:

  • Both fields must have the same dentity as returned by the identity methods.

  • Both fields’ data arrays being the same after accounting for different but equivalent:

    • units
    • size one dimensions (if squeeze is True),
    • dimension directions (if use_directions is True)
    • dimension orders (if transpose is set to a dictionary).
  • Both fields’ domains must have the same dimensionality and where a dimension in one field has an identity inferred a 1-d coordinate, the other field has a matching dimension whose identity inferred is inferred from a 1-d coordinate with an equivalent data array.

Parameters :
other :

The object to compare for equivalence.

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 objects differ.

Returns :
out : bool

Whether or not the two objects are equivalent.

Previous topic

cf.Field.equals

Next topic

cf.Field.equivalent_data

This Page