True if two fields are equal, False otherwise.
Two fields are equal if ...
Note that a field may be equal to a single element field list, for example f.equals(f[0:1]) and f[0:1].equals(f) are always True.
See also
cf.FieldList.equals, set_equals
Examples 1: |
---|
>>> b = f.equals(g)
Parameters: |
|
---|---|
Returns: |
|
Examples 2: |
>>> f.Conventions
'CF-1.0'
>>> g = f.copy()
>>> g.Conventions = 'CF-1.5'
>>> f.equals(g)
True
In the following example, two fields differ only by the long name of their time coordinates. The traceback shows that they differ in their domains, that they differ in their time coordinates and that the long name could not be matched.
>>> g = f.copy()
>>> g.coord('time').long_name += ' different'
>>> f.equals(g, traceback=True)
Domain: Different coordinate: <CF Coordinate: time(12)>
Field: Different domain properties: <CF Domain: (128, 1, 12, 64)>, <CF Domain: (128, 1, 12, 64)>
False