CADETProcess.dataStructure.parameter.SizedNdArray

CADETProcess.dataStructure.parameter.SizedNdArray#

class CADETProcess.dataStructure.parameter.SizedNdArray(*args: Any, ty: type | None = None, **kwargs: Any)[source]#

Bases: NdArray, Sized

Descriptor for NumPy arrays whose size may depend on other instance attributes.

get_expected_size(instance: Any | None) tuple[source]#

Calculate the expected size of a numpy array based on the instance’s other attributes.

Returns:
tuple

The expected shape of the array.

get_size(value: ndarray) tuple[int, ...][source]#

Determine the size of the provided value.

Parameters:
valueAny

The value for which the size needs to be determined.

Returns:
tuple[int, …]

Size of the value.