caterva2.Dataset.fetch#

Dataset.fetch(slice_=None, prefer_schunk=True)#

Fetch a slice of a dataset. Can specify transport serialization.

Similar to __getitem__() but this one lets specify whether to prefer using Blosc2 schunk serialization or pickle during data transport between the subscriber and the client. See below.

Parameters:
  • slice_ (int, slice, tuple of ints and slices, or None) – The slice to fetch.

  • prefer_schunk (bool) – Whether to prefer using Blosc2 schunk serialization during data transport. If False, pickle will always be used instead. Default is True, so Blosc2 serialization will be used if Blosc2 is installed (and data payload is large enough).

Returns:

The slice of the dataset.

Return type:

numpy.ndarray