cfdm.CFDMImplementation.has_property

CFDMImplementation.has_property(parent, prop)[source]

Return True if a property exists.

Parameters:
parent:

The object containing the property.

Returns:
bool

True if the property exists, otherwise False.

Examples

>>> w = cfdm.implementation()
>>> d = cfdm.DimensionCoordinate(
...     properties={
...         'standard_name': 'latitude', 'units': 'degrees_north'},
...     data=cfdm.Data(range(180))
... )
>>> d
<DimensionCoordinate: latitude(180) degrees_north>
>>> w.has_property(d, 'units')
True
>>> b = cfdm.Bounds(
...     properties={
...         'standard_name': 'latitude', 'units': 'degrees_north'},
...     data=cfdm.Data(numpy.arange(360).reshape(180, 2))
... )
>>> b
<Bounds: latitude(180, 2) degrees_north>
>>> w.has_property(b, 'long_name')
False