cf.Flags.equals

Flags.equals(other, rtol=None, atol=None, ignore_fill_value=False, verbose=None, traceback=False)[source]

True if two groups of flags are logically equal, False otherwise.

Note that both instances are sorted in place prior to the comparison.

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.

ignore_fill_value: bool, optional

If True then data arrays with different fill values are considered equal. By default they are considered unequal.

traceback: deprecated at version 3.0.0.

Use verbose instead.

Returns
bool

Whether or not the two instances are equal.

Examples

>>> f
<CF Flags: flag_values=[1 0 2], flag_masks=[2 0 2], flag_meanings=['medium' 'low' 'high']>
>>> g
<CF Flags: flag_values=[2 0 1], flag_masks=[2 0 2], flag_meanings=['high' 'low' 'medium']>
>>> f.equals(g)
True
>>> f
<CF Flags: flag_values=[0 1 2], flag_masks=[0 2 2], flag_meanings=['low' 'medium' 'high']>
>>> g
<CF Flags: flag_values=[0 1 2], flag_masks=[0 2 2], flag_meanings=['low' 'medium' 'high']>