cf.Constructs.new_identifier

Constructs.new_identifier(construct_type)[source]

Return a new, unused construct key.

New in version (cfdm): 1.7.0

Parameters
construct_type: str

The construct type for which the identifier is being created.

Parameter example:

construct_type='dimension_coordinate'

Returns
str

The new construct identifier.

Examples

>>> f = cf.example_field(0)
>>> c = f.constructs
>>> c.keys()
['domainaxis0',
 'domainaxis1',
 'domainaxis2',
 'dimensioncoordinate0',
 'dimensioncoordinate1',
 'dimensioncoordinate2',
 'cellmethod0']
>>> c.new_identifier('domain_axis')
'domainaxis3'
>>> c.new_identifier('cell_method')
'cellmethod1'