zcollection.meta.Dataset#

class zcollection.meta.Dataset(dimensions, variables, *, attrs=None, chunks=None, block_size_limit=None)[source]#

Bases: object

Handle the metadata of a dataset.

Parameters:
  • dimensions (Sequence[str]) – A sequence of strings representing the dimensions of the dataset.

  • variables (Sequence[Variable]) – A sequence of Variable objects representing the variables of the dataset.

  • attrs (Sequence[Attribute] | None) – An optional sequence of Attribute objects representing the attributes of the dataset. Defaults to None.

  • chunks (Sequence[Dimension] | None) – An optional sequence of Dimension objects representing the chunk size for each dimension. Defaults to None.

  • block_size_limit (int | None) – An optional integer representing the maximum size (in bytes) of a block/chunk of variable’s data.

Attributes

dimensions

Dimensions of the dataset.

variables

Variables of the dataset.

attrs

Attributes of the dataset.

chunks

Chunk size for each dimension

block_size_limit

Maximum data chunk size

Public Methods

add_variable(variable)

Add a variable to the dataset.

from_config(data)

Create a new dataset from the given dataset configuration.

get_config()

Get the dataset metadata.

missing_variables(other)

Finds the variables in the provided dataset that are not in this instance.

search_same_dimensions_as(variable)

Searches for a variable in this dataset that has the same dimensions as the given variable.

select_variables([keep_variables, ...])

Select variables to keep or drop from the dataset.

select_variables_by_dims(dims[, predicate])

Select variables that have at least one dimension in the given dimensions depending on the predicate.

Special Methods

__eq__(other)

Return self==value.

__ne__(other)

Return self!=value.