Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Type checking of input/output when initializing#852

codeFighter2022 started this conversation inGeneral
Discussion options

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

You must be logged in to vote

Replies: 1 comment

Comment options

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.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@codeFighter2022@bnavigator

[8]ページ先頭

©2009-2025 Movatter.jp