-
Notifications
You must be signed in to change notification settings - Fork 283
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
Image tests: set agg backend after rcdefaults #3846
Image tests: set agg backend after rcdefaults #3846
Conversation
This is being investigated in #3821 🙂 |
Sorry shouldn't have closed it, read it as an issue! @stephenworsley does this help fix #3821? |
Thanks @trexfeathers, if I'd noticed that issue I might have got here quicker...! |
matplotlib.rcdefaults() | ||
matplotlib.use("agg") |
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.
@rcomer Awesome spot 👀
Works for me, tested it locally 👍
Would you mind just adding a comment above matplotlib.use("agg")
to ensure that a future developer doesn't move this statement back to being before matplotlib.rcdefaults()
, thanks 😀
You could even quote this PR, just to add some connective tissue...
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.
Otherwise LGTM 🥳
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.
closes #3821
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 @bjlittle, I've added that comment. Also a comment about why the rcdefaults
is there for good measure.
@rcomer Awesome, thanks 👍 |
* master: Whatsnew for effects on aux factories of units defaulting to 'unknown'. (SciTools#3870) Whatsnew entry for SciTools#3867. (SciTools#3868) Developer guide overhaul (SciTools#3852) Update CF standard name table to v75 (SciTools#3867) Link to new classes and methods in the Ancillary variables whatsnew. (SciTools#3865) update black version (SciTools#3866) Fix whatsnew api links. (SciTools#3856) Add additional pre-commit hooks (SciTools#3862) update pre-commit flake8 version (SciTools#3863) whatsnew - update announcement (SciTools#3861) whatsnew - remove contents directive (SciTools#3859) whatsnew - links and versions (SciTools#3853) Replace deprecated IndexFormatter (SciTools#3857) whatsnew for SciTools#3681 (SciTools#3858) Whatsnew entry for SciTools#3846. (SciTools#3855) Image tests: set agg backend after rcdefaults (SciTools#3846) whatnew - announcements (SciTools#3850)
I was following @tkknight's nice new instructions for installing and running tests, but got a bunch of errors and failures from
assertBoundsTickLabels
andassertPointsTickLabels
on the TestGraphicStringCoord class. The errors look like this:so it seemed the test was attempting to use TkAgg, even though the intent in
tests/__init__.py
is clearly to use Agg. Switching the order of the backend setting andrcdefaults
call fixed the problem.I'm not clear why this hasn't come up for anyone else. I do have a
matplotlibrc
file, which probably most devs don't - this file was the reason thercdefaults
call was originally added (#2746).