cfdm.DomainTopology.has_cell

DomainTopology.has_cell()[source]

Whether the cell type has been set.

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.

New in version (cfdm): 1.11.0.0

Returns
bool

True if the cell type has been set, otherwise False.

Examples

>>>
>>> d = cfdm.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