rampedpyrox.assert_len

rampedpyrox.assert_len(data, n)[source]

Asserts that an array has length n and float datatypes.

Parameters:
  • data (scalar or array-like) – Array to assert has length n. If scalar, generates an np.ndarray with length n.
  • n (int) – Length to assert
Returns:

array – Updated array, now of class np.ndarray and with length n.

Return type:

np.ndarray

Raises:
  • ArrayError – If inputted data not int or array-like (excluding string).
  • LengthError – If length of the array is not n.