Skip to content
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

Address CI failures from upstream Matplotlib changes #621

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

kafitzgerald
Copy link
Collaborator

@kafitzgerald kafitzgerald commented Oct 16, 2024

Addresses several of the failures we're seeing while testing with a dev version of Matplotlib (3.10.0.dev).

These stem from deprecations following earlier Matplotlib changes with ContourSet and legend.

Relates to #620

There will be a lingering problem related to hatch color that this PR does not address so I'm leaving the associated issue open for now. There's also an open issue (confirmed bug) on Matplotlib.

@kafitzgerald
Copy link
Collaborator Author

This is proving trickier than I thought. In particular, the changes for NCL_coneff_11.py which attempt to adapt the code to update the hatch colors and linewidths after the Matplotlib changes aren't working

I tried a few other things and dug into the docs a bit, but am not having much luck. It seems like the hatching related code isn't the most straightforward or robust and we might be hitting on some related challenges with this.

I'll come back to this later (and likely log an issue over on Matplotlib), but if anyone else has ideas I'm open to suggestions here.

Some additional details...

The deprecation of ContourSet.collections and then removal in 3.10 is what's causing upstream CI (Matplotlib 3.10.dev) to fail. Relevant release notes:
https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.8.0.html#contourset-collections

We iterated over collections to help set colors for the hatching in NCL_coneff_11.py and customize several other examples. I've been able to successfully make changes to the other examples, but for whatever reason the hatch properties seem to be problematic.

@kafitzgerald kafitzgerald marked this pull request as ready for review October 21, 2024 16:37
Copy link
Collaborator

@jukent jukent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we were working around things in matplotlib that were changed upstream because these changes stop the failure and are more concise.

@kafitzgerald kafitzgerald changed the title Matplotlib fixes Address CI failures from upstream Matplotlib changes Oct 21, 2024
@kafitzgerald kafitzgerald merged commit 1431c48 into NCAR:main Oct 21, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants