kalmankit.utils module

Convenience and utility functions for the library

kalmankit.utils.check_none_and_broadcast(arr: ndarray | None, broad_to: ndarray) ndarray[source]

Helper function.

Check wether “arr” is None and generate a new array with shape equal to “broad_to” shape of np.nan values.

Parameters:
  • arr (numpy.ndarray) – Array to check if is None.

  • broad_to (numpy.ndarry) – Array whose shape will be mimicked if “arr” is None.

Returns:

arr (np.ndarray) – Array with np.nan values or original array if is not None.

kalmankit.utils.is_nan_all(arr: ndarray) bool[source]

Check if all elements of the given array are nan.

Parameters:

arr (numpy.ndarray) – NumPy array to check.

Returns:

bool – Whether all elements are nan (True) or not (False).