CADETProcess.dataStructure.parameter.NdArray#
- class CADETProcess.dataStructure.parameter.NdArray(*args: Any, ty: type | None = None, **kwargs: Any)[source]#
Bases:
TypedParameter descriptor constrained to np.ndarray values.
Notes
The cast_value method automatically converts lists to numpy arrays and wraps scalars (int or float) into single-element numpy arrays.
- cast_value(value: Any) Any | ndarray[source]#
Cast lists or scalars (int or float) to numpy arrays.
- Parameters:
- valueAny
The value to be casted.
- Returns:
- np.ndarray or Any
If the value is a list or scalar (int or float), it returns its numpy array equivalent. Otherwise, it returns the value unchanged.