When trying to capture an Array from Python using the following input scheme:
fn _set_node_vector<'py>(
&mut self,
py: Python<'py>,
input: Bound<'py, numpy::PyArray1<Py<PyAny>>>,
) -> PyResult<()>
I have three cases:
a) Valid input: the array is correctly specified: v1 = np.array([1.0, 2.0], dtype=object)
b) Invalid i1 = np.array([1.0, 2.0]) (possibly because the dtype is float)
c) Invalid: i2 = np.array([[1.0, 2.0]], dtype=object) (shape is wrong)
In both invalid cases the error returned is:
TypeError: argument 'input': 'ndarray' object is not an instance of 'ndarray'
Bit more steering can be helpful...
When trying to capture an Array from Python using the following input scheme:
I have three cases:
a) Valid input: the array is correctly specified:
v1 = np.array([1.0, 2.0], dtype=object)b) Invalid
i1 = np.array([1.0, 2.0])(possibly because the dtype is float)c) Invalid:
i2 = np.array([[1.0, 2.0]], dtype=object)(shape is wrong)In both invalid cases the error returned is:
Bit more steering can be helpful...