cfdm.core.Parameters.del_parameter

Parameters.del_parameter(parameter, default=ValueError())[source]

Delete a parameter.

New in version (cfdm): 1.7.0

Parameters
parameter: str

The name of the parameter to be deleted.

default: optional

Return the value of the default parameter if the parameter has not been set.

If set to an Exception instance then it will be raised instead.

Returns

The removed parameter value.

Examples

>>> f = cfdm.core.Parameters()
>>> f.set_parameter('earth_radius', 6371007)
>>> f.has_parameter('earth_radius')
True
>>> f.get_parameter('earth_radius')
6371007
>>> f.del_parameter('earth_radius')
6371007
>>> f.has_parameter('earth_radius')
False
>>> print(f.del_parameter('earth_radius', None))
None
>>> print(f.get_parameter('earth_radius', None))
None