quaternionic.utilities
attach_typelist_and_signature
attach_typelist_and_signature(ftylist, signature)
Source: quaternionic/utilities.py
convert_numpy_ufunc_type_to_numba_ftylist
convert_numpy_ufunc_type_to_numba_ftylist(typelist)
Source: quaternionic/utilities.py
guvectorize_module_functions
guvectorize_module_functions(module, obj)
Source: quaternionic/utilities.py
Compile all functions in module to ufuncs and attach to obj.
Note that the functions in module must have attributes types
and signature
, providing the necessary arguments to numba's guvectorize decorator; any function that does not have those attributes will be skipped silently.
ndarray_args
ndarray_args(f)
Source: quaternionic/utilities.py
Decorate jitted functions to accept quaternionic arrays
ndarray_args_and_return
ndarray_args_and_return(f)
Source: quaternionic/utilities.py
Decorate jitted functions to accept and return quaternionic arrays
pyguvectorize
pyguvectorize(types, signature)
Source: quaternionic/utilities.py
Test function to convert functions to general universal functions.
Note that this is almost certainly only useful for functions defined in quaternionic.algebra — and specifically only if they have type
and signature
attributes. Moreover, the result is a slow python function, meant only for testing. Nonetheless, the output of this decorator should be callable with the same signature as a gufunc. In this way, tests designed for the compiled gufuncs can also be used to test the python-mode code and obtain coverage results.
pyguvectorize_module_functions
pyguvectorize_module_functions(module, obj)
Source: quaternionic/utilities.py
Wrap all functions in module to ufunc-like python funcs and attach to obj. This function is almost exclusively useful for testing purposes. See docstring of pyguvectorize function for details.
type_self_return
type_self_return(f)
Source: quaternionic/utilities.py
Decorate jitted functions to return with type of first argument