cf.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, preceeded by ‘method:’
  2. The value of the default parameter.

New in version 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:

>>> c.get_method()
'minimum;
>>> c.identity()
'method:minimum'
>>> c.identity(default='no identity')
'method:minimum'
>>> c.del_method()
'minimum'
>>> c.identity()
''
>>> c.identity(default='no identity')
'no identity'