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 to int64 for all variables.

Raises:

ValueError – If the periodicity is not valid.

Example

>>> partitioning = Sequence(["a", "b", "c"], (None, 10, 10))

Attributes

variables

Variables to be used for the partitioning.

ID

The ID of the partitioning scheme.

Public Methods

decode(values)

Decode a partitioning scheme.

encode(partition)

Encode a partitioning scheme to the handled values.

Protected Methods

_abc_impl

_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.

get_config()

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.