-
Notifications
You must be signed in to change notification settings - Fork 280
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
BUG: fix orientation of colorbar in multiplanel plot #4981
Conversation
Hi! Welcome, and thanks for opening this pull request. We have some guidelines for new pull requests, and soon you'll hear back about the results of our tests and continuous integration checks. Thank you for your contribution! |
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.
Great !
Ideally we need an image test for this, here's the guide https://yt-project.org/docs/dev/developing/testing.html#creating-and-updating-image-baselines-for-pytest-mpl-tests
The minimal py3.9.2 test build is failing because it uses yt's minimally supported matplotlib (3.5.0), for which colorbar does not have a location kwarg. Looks like the location kwarg was introduced in matplotlib 3.7.0(release notes here). IMO it's OK for this bug to persist in yt with the minimally supported matplotlib, so the easiest thing to do is just add a check for matplotlib version before passing in a location kwarg. |
Agreed. Note that matplotlib natively supports runtime version checking as import maptlotlib as MPL
if mpl.__version_info__ >= (3, 7):
...
else:
... |
Maybe we could even emit a warning if we can detect that the colorbar is horizontal and matplotlib is too old. |
I have a question regarding writing a test. Since the bug persists for older versions of MPL and a warning is emitted, the same test will generate different baseline images in new and old versions of MPL, but they will have the same file name. This prevents me from updating the reference image into |
Yes, image tests are tricky an hardly portable; in fact we only run them on a specific runner image ( Good job on adding a |
That makes it easier! In fact, I added |
Doesn't hurt ! |
@neutrinoceros Passing an empty keyword dict Since for now, the workflow online for tests requires approval, I abandoned |
It's not obvious to me either (especially since I didn't get to see mypy's output), but it's not crucial, if mypy is happy with your current implementation that's good enough for me ! |
@xshaokun please revert commit ed399da : adding content to the submodule should be done as a separate pull request there (sorry the process isn't simpler ... it is documented though)) |
I have created the PR there and I thought something should also be done here. |
Sorry I missed that. For future reference, this is yt-project/yt_pytest_mpl_baseline#6 |
Great, the output looks good to me. I'll merge your companion PR on the submodule repo when it's up to date ! thank you for your patience ! |
Co-authored-by: Clément Robert <[email protected]>
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 a lot for your patience, I think this is almost ready for merge but here's a last round of review
Co-authored-by: Clément Robert <[email protected]>
Hooray! Congratulations on your first merged pull request! We hope we keep seeing you around! 🎆 |
PR Summary
fix #4382
PR Checklist