Image tests: set agg backend after rcdefaults#3846
Merged
bjlittle merged 2 commits intoSciTools:masterfrom Sep 16, 2020
Merged
Conversation
Contributor
|
This is being investigated in #3821 🙂 |
Contributor
|
Sorry shouldn't have closed it, read it as an issue! @stephenworsley does this help fix #3821? |
Member
Author
|
Thanks @trexfeathers, if I'd noticed that issue I might have got here quicker...! |
Contributor
bjlittle
reviewed
Sep 15, 2020
|
|
||
| matplotlib.use("agg") | ||
| matplotlib.rcdefaults() | ||
| matplotlib.use("agg") |
Member
There was a problem hiding this comment.
@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...
Member
Author
There was a problem hiding this comment.
Thanks @bjlittle, I've added that comment. Also a comment about why the rcdefaults is there for good measure.
Member
|
@rcomer Awesome, thanks 👍 |
trexfeathers
added a commit
to trexfeathers/iris
that referenced
this pull request
Sep 16, 2020
rcomer
pushed a commit
that referenced
this pull request
Sep 16, 2020
tkknight
added a commit
to tkknight/iris
that referenced
this pull request
Sep 20, 2020
* 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was following @tkknight's nice new instructions for installing and running tests, but got a bunch of errors and failures from
assertBoundsTickLabelsandassertPointsTickLabelson 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__.pyis clearly to use Agg. Switching the order of the backend setting andrcdefaultscall fixed the problem.I'm not clear why this hasn't come up for anyone else. I do have a
matplotlibrcfile, which probably most devs don't - this file was the reason thercdefaultscall was originally added (#2746).