respy._numba#

Special functions for using numba.

Module Contents#

Functions#

array_to_tuple(tyctx, array_or_dict, indexer_array)

Convert an array to a tuple for indexing.

sum_over_numba_boolean_unituple(tuple_)

Compute the sum over a boolean numba.types.UniTuple.

respy._numba.array_to_tuple(tyctx, array_or_dict, indexer_array)[source]#

Convert an array to a tuple for indexing.

This function is taken from https://gist.github.com/sklam/830fe01343ba95828c3b24c391855c86 to create tuple from an array for indexing which is not possible within a Numba function.

Parameters:
array_or_dictnumpy.ndarray or numba.typed.Dict

Array for which the indexer is used.

indexer_arraynumpy.ndarray

Array which should be converted to a tuple.

respy._numba.sum_over_numba_boolean_unituple(tuple_)[source]#

Compute the sum over a boolean numba.types.UniTuple.

Parameters:
tuple_numba.types.UniTuple[bool]
Returns:
sum_Union[float, int]