zcollection.variable.delayed_array.DelayedArray#

class zcollection.variable.delayed_array.DelayedArray(name, data, dimensions, *, attrs=None, compressor=None, fill_value=None, filters=None)[source]#

Bases: Variable

Access to the chunked data using Dask arrays.

Parameters:
  • name (str) – Name of the variable

  • data (ArrayLike[Any]) – Variable data

  • dimensions (Sequence[str]) – Variable dimensions

  • attrs (Sequence[Attribute] | None) – Variable attributes

  • compressor (Codec | None) – Compression codec

  • fill_value (Any | None) – Value to use for uninitialized values

  • filters (Sequence[numcodecs.abc.Codec] | None) – Filters to apply before writing data to disk

Attributes

array

Variable data as a dask array.

attrs

Variable attributes

compressor

Compressor used to compress the data during writing data to disk

dimensions

Variable dimensions

fill_value

Value to use for uninitialized values

filters

Filters to apply before writing data to disk

name

Variable name

data

Return the underlying dask array where values equal to the fill value are masked.

dtype

Return the dtype of the underlying array.

nbytes

Return the number of bytes used by the variable.

ndim

Return the number of dimensions of the variable.

shape

Return the shape of the variable.

size

Return the size of the variable.

values

Return the variable data as a numpy array.

Public Methods

compute(**kwargs)

Return the variable data as a numpy array.

concat(other, dim)

Concatenate this variable with another variable or a list of variables along a dimension.

fill()

Fill the variable with the fill value.

from_zarr(array, name, dimension, **kwargs)

Create a new variable from a zarr array.

persist(**kwargs)

Persist the variable data into memory.

rechunk(**kwargs)

Rechunk the variable.

to_dask_array()

Return the underlying dask array.

Protected Methods

_abc_impl

_dask_finalize(results, array_func, *args, ...)

Finalize the computation of the variable.

Special Methods

__dask_graph__()

Return the dask Graph.

__dask_keys__()

Return the output keys for the Dask graph.

__dask_layers__()

Return the layers for the Dask graph.

__dask_optimize__(dsk, keys, **kwargs)

Returns whether the Dask graph can be optimized.

__dask_postcompute__()

Return the finalizer and extra arguments to convert the computed results into their in-memory representation.

__dask_postpersist__()

Return the rebuilder and extra arguments to rebuild an equivalent Dask collection from a persisted or rebuilt graph.

__dask_scheduler__(dsk, keys[, cache, ...])

Threaded cached implementation of dask.get

__dask_tokenize__()

Return the token for the Dask graph.

__getitem__(key)

Get a slice of the variable.

Inherited Methods

dimension_index()

Return an iterator over the variable dimensions and their index.

duplicate(data)

Create a new variable from the properties of this instance and the data provided.

fill_attrs(var)

Fill the variable attributes using the provided metadata.

have_same_properties(other)

Return true if this instance and the other variable have the same properties.

isel(key)

Return a new variable with data selected along the given dimension indices.

metadata()

Get the variable metadata.

rename(name)

Rename the variable.

set_for_insertion()

Create a new variable without any attribute.

to_xarray()

Convert the variable to an xarray.Variable.