cfdm.CFDMImplementation.get_data_shape

CFDMImplementation.get_data_shape(parent, isdata=False)[source]

Return the shape of the data array.

Parameters:
parent:

The object containing the data array.

isdata: bool

If True then the parent is already a data object

Returns:
tuple

The shape of the data array.

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.get_data_shape(d)
(180,)
>>> 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.get_data_shape(b)
(180, 2)