is_ragged

(function from pyomo.contrib.pyros.uncertainty_sets)

pyomo.contrib.pyros.uncertainty_sets.is_ragged(arr, arr_types=None)[source]

Return True if the array-like arr is ragged, False otherwise.

NOTE: if Numpy ndarrays are considered to be arr types, then zero-dimensional arrays are not considered to be as such.

Parameters:
  • arr (array_like) – Array to check.

  • arr_types (None or iterable of type) – Types of entries of arr to be considered subarrays. If None is specified, then this is set to (list, numpy.ndarray, tuple).

Returns:

True if ragged, False otherwise.

Return type:

bool