fletcher.algorithms.utils.chunking module

Utility functions to deal with chunked arrays.

fletcher.algorithms.utils.chunking.apply_per_chunk(func)

Apply a function to each chunk if the input is chunked.

fletcher.algorithms.utils.chunking.dispatch_chunked_binary_map(a: Any, b: Any, ops: Dict[str, Callable])
fletcher.algorithms.utils.chunking.dispatch_chunked_binary_map(a: pyarrow.lib.ChunkedArray, b: Any, ops: Dict[str, Callable])
fletcher.algorithms.utils.chunking.dispatch_chunked_binary_map(a: pyarrow.lib.Array, b: Any, ops: Dict[str, Callable])

Apply a map-like binary function where at least one of the arguments is an Arrow structure.

This will yield a pyarrow.Arrow or pyarrow.ChunkedArray as an output.

Parameters
a: scalar or np.ndarray or pa.Array or pa.ChunkedArray
b: scalar or np.ndarray or pa.Array or pa.ChunkedArray
op: dict

Dictionary with the keys (‘array_array’, ‘array_nparray’, ‘nparray_array’, ‘array_scalar’, ‘scalar_array’)