cfdm.core.DomainTopology.get_cell

DomainTopology.get_cell(default=ValueError())[source]

Return the cell type.

The cell type indicates the common spatial dimensionality of the cells, one of:

  • 'point': A point is zero-dimensional and has no boundary

    vertices.

  • 'edge': An edge is one-dimensional and corresponds to a

    line connecting two boundary vertices.

  • 'face': A face is two-dimensional and corresponds to a

    surface enclosed by a set of edges.

Added in version (cfdm): 1.11.0.0

Parameters:
default: optional

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

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

Returns:

The value of the cell type.

Examples

>>> d = cfdm.core.DomainTopology()
>>> d.has_cell()
False
>>> d.set_cell('face')
>>> d.has_cell()
True
>>> d.get_cell()
'face'
>>> d.del_cell()
'face'
>>> d.get_cell()
Traceback (most recent call last):
    ...
ValueError: DomainTopology has no 'cell' component
>>> print(d.get_cell(None))
None