TypeError: argument 'input': 'ndarray' object is not an instance of 'ndarray'
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Domain
- backend-api-design
Research direction
Start with the _set_node_vector signature shown in the issue and reproduce the three inputs: object-dtype 1D, default-dtype 1D, and object-dtype 2D arrays. Compare the resulting errors and make the invalid dtype and shape cases provide more useful guidance than the current generic TypeError.
Written by the indexing model from the issue text.
Description
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...
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 141
- Avg merge
- 16m
- Merged PRs (30d)
- 3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PyO3/rust-numpy
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
PyO3/rust-numpy#565 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
PyO3/rust-numpy#563 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 56/100
PyO3/rust-numpy#557 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 20/100
PyO3/rust-numpy#535 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
PyO3/rust-numpy#527 · 1 comment ·
Similar issues
-
bug CLI custom-model
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
fulcrumgenomics/ferro-hgvs#2251 ·
-
A-allocators A-docs C-enhancement T-libs
Difficulty 2/5 1-3 hours Newbie friendliness 75/100