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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean warnings in examples #6239
Clean warnings in examples #6239
Conversation
Fixes a numpy warning. The old matrix was positive-semidefinite according to the old check in numpy but it seems this has changed a bit
@@ -45,6 +45,6 @@ | |||
tick.tick2line.set_markersize(0) | |||
tick.label1.set_horizontalalignment('center') | |||
|
|||
imid = len(r)/2 | |||
imid = int(len(r)/2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just len(r) // 2
(and the same in many other cases)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I dont have any strong preference for one over the other
@@ -75,8 +75,13 @@ | |||
# 6 | |||
plt.figure() | |||
M = np.zeros(U.shape, dtype='bool') | |||
M[U.shape[0]/3:2*U.shape[0]/3, | |||
U.shape[1]/3:2*U.shape[1]/3] = True | |||
XMaskStart = U.shape[0]//3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is a bit un-Pythonic, but otherwise the PR is fine.
how far back do we want to backport this? |
I probably made a bit of a mess of this 58a27bf does not make sense to backport further than 2.0 (since it relates to a arg deprecated in 2.0) Thes rest could be back ported to 1.5.x, The numpy related changes are probably the most serious ones. They will brake code with some future version of numpy. |
Lets just do back to 2.0 then. |
backported to v2.x as c455e52 |
These are mostly numpy warnings