ewoksdata.data.bliss.get_data#

ewoksdata.data.bliss.get_data(data, retry_timeout=None, retry_period=None, **hdf5_options)[source]#

Retrieve numerical data from a data source and return it as a NumPy array or scalar.

This function accepts various data representations, including data URLs, array-like objects, and scalar numbers. The data source may not be immediately available so a retry mechanism is used.

Parameters:
  • data (Union[str, DataUrl, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], bool, int, float, complex, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]], Number]) – The input data source. May be: - A string or DataUrl referencing a dataset (e.g., HDF5), - An array-like object convertible to a NumPy array, - A scalar numerical value.

  • retry_timeout (Optional[float]) – Maximum time in seconds to wait for the data to become available. If None (default), no timeout is applied.

  • retry_period (Optional[float]) – Interval in seconds between availability checks when retrying. If None (default), a period of 0.1 seconds is used.

  • hdf5_options (Any) – Additional keyword arguments forwarded to silx.io.h5py_utils.File when opening HDF5 resources.

Return type:

Union[ndarray, Number, Sequence]

Returns:

The resolved data. Array-like inputs are returned as NumPy arrays, while scalar inputs are returned as numbers.

Raises:
  • TimeoutError – If the data does not become available within retry_timeout.

  • ValueError – If the input type is unsupported or the data cannot be resolved.