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

Do not overwrite np = numpy with an array size.#98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ochurlaud wants to merge1 commit intopython-control:masterfromochurlaud:patch-1
Closed

Do not overwrite np = numpy with an array size.#98

ochurlaud wants to merge1 commit intopython-control:masterfromochurlaud:patch-1

Conversation

ochurlaud
Copy link

The function failed to be called with python3

The function failed to be called with python3
@coveralls
Copy link

coveralls commentedJun 23, 2016
edited
Loading

Coverage Status

Coverage decreased (-0.2%) to 75.764% when pulling8e6a853 on ochurlaud:patch-1 into7b07af3 on python-control:master.

@slivingstonslivingston self-assigned thisAug 10, 2016
@slivingston
Copy link
Member

I would not expect this to only affect Python 3.

@slivingston
Copy link
Member

Can you provide an example that demonstrates the error?

Sincenp as an identifier fornumpy is not used within the function scope after wherenp is assigned to an array size, it is not an error. I agree that changing the name would improve the style, but it is not a matter of correctness.

@ochurlaud
Copy link
Author

Hum, I don't remember: it was some time ago. Comparing to other modules, t should be call _np I think instead of what I wrote. Anyway: as it's a small fix, without huge repercussions, I think it should be somehow done.

Even if you don't use my PR, just do the correction somehow?

@roryyorke
Copy link
Contributor

I fixed this on#100. Itis a bug; if, on that branch, I revert from np_ to np, I get the error below. I'd have to read up on how Python handles globals and locals to explain this (did that change in Python 3?).

Test h2syn----------------------------------------------------------------------Traceback (most recent call last):  File "robust_test.py", line 34, in testH2syn    k = control.robust.h2syn(p, 1, 1)  File "/home/rory/src/python-control/control/robust.py", line 91, in h2syn    n = np.size(P.A,0)UnboundLocalError: local variable 'np' referenced before assignment

@ochurlaud
Copy link
Author

Ok, then maybe merging#100 would be better than mine.

@slivingston
Copy link
Member

Changes from pull request#100 were merged, which subsumes changes from here,as noted above. In particular, cf. lines93 and157 of control/robust.py as of commitd4e0155 (current tip ofmaster branch).

@ochurlaud Nonetheless, thanks for this pull request. I should have been faster to review it.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@slivingstonslivingston

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@ochurlaud@coveralls@slivingston@roryyorke

[8]ページ先頭

©2009-2025 Movatter.jp