zcollection.partitioning.sequence.Sequence#
- class zcollection.partitioning.sequence.Sequence(variables, dtype=None)[source]#
Bases:
Partitioning
Initialize a partitioning scheme for a sequence of variables.
A sequence is a combination of variables constituting unique monotonic keys. For example, the orbit number (
cycle
) and the half-orbit number (pass
) of a satellite.- Parameters:
variables (Sequence[str]) – A list of strings representing the variables to be used for partitioning.
dtype (Sequence[str] | None) – An optional sequence of strings representing the data type used to store variable values in a binary representation without data loss. Must be one of the following allowed data types:
int8
,int16
,int32
,int64
,uint8
,uint16
,uint32
,uint64
. If not provided, defaults toint64
for all variables.
- Raises:
ValueError – If the periodicity is not valid.
Example
>>> partitioning = Sequence(["a", "b", "c"], (None, 10, 10))
Attributes
Public Methods
decode
(values)Decode a partitioning scheme.
encode
(partition)Encode a partitioning scheme to the handled values.
Protected Methods
_split
(variables)Split the variables constituting the partitioning into partitioning schemes.
Inherited Methods
dtype
()Return the data type of the partitioning scheme.
from_config
(config)Create a partitioning scheme from a configuration.
Return the configuration of the partitioning scheme.
index_dataset
(zds)Yield the indexing scheme for the given dataset.
join
(partition_scheme, sep)Join a partitioning scheme.
list_partitions
(fs, path)List the partitions.
parse
(partition)Parse a partitioning scheme.
split_dataset
(zds, axis)Split the dataset into partitions.