cfdm.CellMethod.identity

CellMethod.identity(default='')[source]

Return the canonical identity for the cell method construct.

By default the identity is the first found of the following:

  1. The method, preceded by ‘method:’

  2. The value of the default parameter.

New in version (cfdm): 1.7.0

See also

identities

Parameters
default: optional

If no identity can be found then return the value of the default parameter.

Returns

The identity.

Examples

>>> f = cfdm.example_field(1)
>>> c = f.get_construct('cellmethod1')
>>> c.get_method()
'maximum'
>>> c.identity()
'method:maximum'
>>> c.del_method()
'maximum'
>>> c.identity()
''
>>> c.identity(default='no identity')
'no identity'