-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fixing the issue where right column and top row generate wrong stream… #11455
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
Conversation
xref: This supposedly fixes #11452 |
Thanks a lot @pmackenz ! You were right, it was an indexing issue. Thats great! This fails all the image tests that used streamplot because now the streamplots are corrected. Someone will have to generate the new image comparison files and commit them as part of this PR before it can go in. Are you up to try? If not, I'm happy to help by pushing to your commit. |
@jklymak , I am glad it was such a small issue to fix. However, I am really busy with work and don't have more time to donate for a few weeks. I'd appreciate if somebody else could update the test images. |
Ooookay, I think I did that right. Note I pushed onto yout matplotlib/master branch which is what you made this commit on. In the future, better to create a new branch in your repo rather than use "master" |
Reviewers, note that I updated the style and removed the text from all the tests... |
Anyone else not getting the option to view image diffs? |
I swear that wasn't there earlier. 🐑 |
Grrrr, I can't reproduce the |
Can anyone closer to the Travis build reproduce the error in |
We may want to investigate what was meant here... |
OK think I fixed it. A bit annoying. Running
gives a warning:
and I couldn't get the images to match. Calling as
I don't get that warning and the images come out different.
Full warning stack
|
Milestoning for 3.0 - not a reversion, but certainly a bug that should be fixed sooner than later. I can't review because I pushed the images... |
Wow, never expected to cause that much trouble with by two-character bug fix (really, just 2 characters). I very much appreciate how everybody is helping out here. This was my first micro-contribution aside from bug reports and I feel I owe everyone here! THANKS. |
I guess the open question is (as mentionned above) still why that |
Might have been a workaround for a different (now historic) bug. Workaround turned bug once the original issue was resolved ... ? OR: never been scrutinized by a picky user before. Wouldn't have noticed if I hadn't used streamplot to check a boundary condition on the right edge and after a few days of debugging concluded it wasn't my code doing this mistake. |
The code was introduced in 5632418 as part of #664. That was quite a large merge and might really have got in without thoroughly thinking about the index. The proposed change
Basically, what this does is for
As far as I can see, the else clause is only relevant for single numbers.
I propose to replace the whole if-else block by
|
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.
Thanks for the fix! This is going to need a changelog entry in doc/users/next_whats_new
, since it is technically an API breaking change. Let us know if you have any questions about adding one.
Does anyone have any thoughts on backporting to |
@meeseekesbot backport to v2.2.x |
This is due to an indexing error in previous versions, cf. matplotlib/matplotlib#11455.
It is a sort of bugfix, but it does cause downstream effects, e.g., SciTools/cartopy@1bf2c97 So if we do backport, it'd be good to know to get that condition right. |
@meeseeksdev backport to v2.2.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
… top row generate wrong stream…
This is due to an indexing error in previous versions, cf. matplotlib/matplotlib#11455.
This is due to an indexing error in previous versions, cf. matplotlib/matplotlib#11455.
The interpolation function in streamplot was duplicating the second to last right data column instead of using the rightmost column. Same issue for topmost row being replaced by the row just below the top.
PR Summary
This was indeed an indexing error. Fixing the index solved the issue.
Here the corrected images (same code as in the bug report, but now generating correct figures with streamlines as tangent to velocity vectors):

PR Checklist