cfdm.core.CoordinateReference.del_coordinate

CoordinateReference.del_coordinate(key, default=ValueError())[source]

Remove a reference to a coordinate construct.

New in version (cfdm): 1.7.0

Parameters
key: str

The construct key of the coordinate construct.

Parameter example:

key='dimensioncoordinate1'

Parameter example:

key='auxiliarycoordinate0'

default: optional

Return the value of the default parameter if the coordinate construct has not been set. If set to an Exception instance then it will be raised instead.

Returns

The removed coordinate construct key.

Examples

>>> r = cfdm.core.CoordinateReference()
>>> r.set_coordinates(['dimensioncoordinate0', 'auxiliarycoordinate1'])
>>> r.coordinates()
{'auxiliarycoordinate1', 'dimensioncoordinate0'}
>>> r.del_coordinate('dimensioncoordinate0')
'dimensioncoordinate0'
>>> r.coordinates()
{'auxiliarycoordinate1'}
>>> r.del_coordinate('dimensioncoordinate0', 'not set')
'not set'