xarray_dataclasses.datamodel module#
Submodule for data expression inside the package.
- class DataModel(entries: ~typing.Dict[str, ~xarray_dataclasses.datamodel.AttrEntry | ~xarray_dataclasses.datamodel.DataEntry] = <factory>)[source]#
Bases:
object
Data representation (data model) inside the package.
- Parameters:
entries (Dict[str, AttrEntry | DataEntry]) –
- property attrs: List[AttrEntry]#
Return a list of attribute entries.
- property coords: List[DataEntry]#
Return a list of coordinate entries.
- property data_vars: List[DataEntry]#
Return a list of data variable entries.
- property data_vars_items: List[Tuple[str, DataEntry]]#
Return a list of data variable entries with keys.
- entries: Dict[str, AttrEntry | DataEntry]#
Entries of data variable(s) and attribute(s).
- classmethod from_dataclass(dataclass: Type[DataClass[PInit]] | DataClass[PInit]) DataModel [source]#
Create a data model from a dataclass or its object.
- Parameters:
dataclass (Type[DataClass[~PInit]] | DataClass[~PInit]) –
- Return type:
- property names: List[AttrEntry]#
Return a list of name entries.