Type checking of input/output when initializing #852
codeFighter2022
started this conversation in
General
Replies: 1 comment
-
Hi, thanks for the report! This is actually a bug/regression because NumPy 1.24 does not allow ragged arrays anymore. I have opened #853 for it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
First of all, thanks a lot for this amazing toolbox!
I think, I found a bug, or a suggestion for improvement, when running the prey example:
https://python-control.readthedocs.io/en/0.9.3.post2/iosys.html#example
When I run the code of the prey example, in particular the linearization,
lin_predprey = ct.linearize(io_predprey, xeq, 0)
I get the following error
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
After analyzing the code, I think the origin of the error is that in predprey_rhs() dH is of type numpy arrary, while dL is not.
I think others ones are much deeper in the code than me. That is why I post this topic instead of a pull request.
Maybe a type check with dummy input/output data already solves these kind of issues when initializing the constructor. I think such a feature could save people some time.
Best,
codeFighter2022
Python: 3.810
Control: 0.9.3.post2
I installed the toolbox via pip
Beta Was this translation helpful? Give feedback.
All reactions