zcollection.meta.Variable#
- class zcollection.meta.Variable(name, dtype, *, dimensions=None, attrs=None, compressor=None, fill_value=None, filters=None)[source]#
Bases:
object
Handle the metadata of a dataset variable.
- Parameters:
name (str) – Name of the variable.
dtype (DTypeLike) – Data type of the variable.
dimensions (Sequence[str] | None) – Names of the dimensions of the variable. Defaults to None.
attrs (Sequence[Attribute] | None) – Attributes of the variable. Defaults to None.
compressor (numcodecs.abc.Codec | None) – Compression codec for the variable. Defaults to None.
fill_value (Any | None) – Fill value for the variable. Defaults to None.
filters (Sequence[numcodecs.abc.Codec] | None) – Filters for the variable. Defaults to None.
Warning
If the variable uses filters, the
fill_value
parameter must be the value that results from decoding the filter. For example, if the filter isFixedScaleOffset(0, 1000)
and the desiredfill_value
is65536
, then thefill_value
parameter must be65536 / 1000 = 65.536
.Attributes
Attributes of the variable.
Compression codec for the variable.
Dimensions of the variable.
Data type of the variable.
Fill value for the variable.
Filter codecs for the variable.
Variable name.
Public Methods
from_config
(data)Create a new variable from the given variable configuration.
Get the variable metadata.
Create a new variable without any attribute.
Special Methods