cfdm.Field.nc_group_attributes

Field.nc_group_attributes(values=False)[source]

Return the selection of properties to be written as netCDF group attributes.

New in version (cfdm): 1.8.6

Parameters
values: bool, optional

Return the value (rather than None) for any group attribute that has, by definition, the same value as a construct property.

Returns
dict

The selection of properties requested for writing to netCDF group attributes.

Examples:

>>> f.nc_group_attributes()
{'comment': None}
>>> f.nc_set_group_attribute('foo')
>>> f.nc_group_attributes()
{'comment': None, 'foo': None}
>>> f.nc_set_group_attribute('foo', 'bar')
>>> f.nc_group_attributes()
{'comment': None, 'foo': 'bar'}
>>> f.nc_group_attributes(values=True)
{'comment': 'forecast comment', 'foo': 'bar'}
>>> f.nc_clear_group_attributes()
{'comment': None, 'foo': 'bar'}
>>> f.nc_group_attributes()
{}