gustaf.utils.arr.enforce_len#

gustaf.utils.arr.enforce_len(value, n_len)[source]#

Given int, float, np.ndarray, tuple, list, returns an array with n_len len(). In case of iterable, it asserts n_len, else, repeats.

Parameters:
  • value (int, float or iterable)

  • n_len (int) – Size of desired array

Returns:

len_n_array

Return type:

(n_len,) np.ndarray