calculate_precisely

typhon.math.calculate_precisely(f)[source]

Raise all arguments to their highest numpy precision.

This decorator copies any floats to f8, ints to i8, preserving masked arrays and/or ureg units.

Currently only works for simple dtypes of float, int, or uint.

This makes a copy. Therefore, it is memory-intensive and it does not work if function has need to change values in-place.

Experimental function.

See also: https://github.com/numpy/numpy/issues/593