scalarize#

caput.util.arraytools.scalarize(dtype: numpy.typing.DTypeLike = np.float64) collections.abc.Callable[source]#

Handle scalars and other iterables being passed to numpy requiring code.

Parameters:
dtypedtype

The output datatype. Used only to set the return type of zero-length arrays.

Returns:
scalarizedcallable()

Scalarized function.