Skip to content

check_asarray API Reference

geoloop.axisym.AxisymetricEL.check_asarray

check_asarray(rmin: float | ndarray, nr: int) -> np.ndarray

Ensure the input is a NumPy array.

If rmin is already a NumPy array, it is returned as is. Otherwise, a NumPy array of length nr filled with rmin is created.

Parameters:

Name Type Description Default
rmin float or ndarray

Input value or array to be converted/checked.

required
nr int

Length of the array to create if rmin is not an array.

required

Returns:

Type Description
ndarray

NumPy array with values from rmin or filled with rmin.