riptable.numba.invalid_values

Functions for working with numba.

Functionality includes:

  • Functions for numba <-> riptable interop

  • Convenience functions and decorators used when implementing numba-accelerated functions.

Notes

Many functions in this module implement both a standard Python version and an overload using numba.extending.overload. This is done to allow the code to work when NUMBA_DISABLE_JIT=1 is specified on the command line, e.g. to allow functions to be debugged.

Functions

get_invalid(x)

A function for getting the invalid for a type of element.

get_max_valid(x)

Get the maximum valid value for the dtype of an array or scalar.

get_min_valid(x)

Get the minimum valid value for the dtype of an array or scalar.

is_valid(x)

A function for checking if data is valid. This works for both floats and integers.

riptable.numba.invalid_values.get_invalid(x)

A function for getting the invalid for a type of element.

This works for both floats and integers.

  • For floats, the invalid is NaN.

  • For signed integers, the invalid is the most NEGATIVE value of the type.

  • For unsigned integers, the invalid is the most POSITIVE value of the type.

For arrays, the invalid of the dtype of the array is returned.

Parameters:

x – An element of the type you want the invalid for

Return type:

The invalid value for x’s type/dtype.

riptable.numba.invalid_values.get_max_valid(x)

Get the maximum valid value for the dtype of an array or scalar.

This function supports integer and floating-point values.

Parameters:

x – An array or scalar value of the type you want the maximum valid value for.

Returns:

The maximum valid value for x’s dtype.

Return type:

max_valid

riptable.numba.invalid_values.get_min_valid(x)

Get the minimum valid value for the dtype of an array or scalar.

Parameters:

x – An array or scalar value of the type you want the minimum valid value for.

Returns:

The minimum valid value for x’s dtype.

Return type:

min_valid

riptable.numba.invalid_values.is_valid(x)

A function for checking if data is valid. This works for both floats and integers.

  • For floats, the invalid is NaN.

  • For signed integers, the invalid is the most NEGATIVE value of the type.

  • For unsigned integers, the invalid is the most POSITIVE value of the type.

Parameters:

x – The value to check

Return type:

A bool for whether the data is valid.