cf.Domain.fromconstructs

classmethod Domain.fromconstructs(constructs, copy=False)[source]

Create a domain from existing metadata constructs.

The new domain act as a view to the given constructs, i.e. changes to the domain, such as the addition or removal of a construct, will also affect the input Constructs instance.

New in version (cfdm): 1.7.0

Parameters
constructs: Constructs

The constructs from which to create the new domain. Cell method and field ancillary constructs are ignored.

copy: bool, optional

If True then deep copy the metadata constructs prior to initialisation. By default the metadata constructs are not copied.

Returns
Domain

The domain created from a view of the constructs.

Examples:

>>> f = cf.example_field(0)
>>> d = cf.Domain.fromconstructs(f.constructs)
>>> d
<Domain: {1, 5, 8}>