blosc2.lazyudf#

blosc2.lazyudf(func, inputs, dtype, chunked_eval=True, **kwargs)#

Get a LazyUDF from a python user-defined function.

Parameters:
  • func (Python function) – User defined function to apply to each block. This function will always receive the same parameters: inputs_tuple, output and offset. The first one will contain the corresponding slice for the block of each input in inputs. The second, the buffer to be filled as a multidimensional numpy.ndarray. And the third one, the multidimensional offset corresponding to the start of the block that it is being computed.

  • inputs (tuple or list) – The sequence of inputs. The supported inputs are NumPy.ndarray, Python scalars, NDArray, NDField or C2Array.

  • dtype (np.dtype) – The resulting ndarray dtype in NumPy format.

  • chunked_eval (bool, optional) – Whether to evaluate the expression in chunks or not (blocks).

  • kwargs (dict, optional) – Keyword arguments that are supported by the empty() constructor. These arguments will be used by the LazyArray.__getitem__() and LazyArray.eval() methods. The last one will ignore the urlpath parameter passed in this function.

Returns:

out – A LazyUDF is returned.

Return type:

LazyUDF