Skip to content

Fix matplotlib and other deprecations #2329

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

Merged
merged 5 commits into from
Oct 11, 2022

Conversation

dhomeier
Copy link
Collaborator

Description

Fixing a failing test due to changed matplotlib.cm API and various deprecation warnings.
The external.echo warning filter is a bit problematic in that it depends on glue.viewers being tested after glue.plugins if at all, otherwise (if glue.external.echo has not been already imported)
glue/viewers/histogram/qt/tests/test_data_viewer.py::TestHistogramViewer::test_session_back_compat[1]
will raise a warning as well.
The last commit replaces deprecated matplotlib canvas.*_event centrally in viewers/matplotlib/qt/widget as a quicker (and dirtier?) fix to changing all calls in the tests individually; may need discussion. The reasons for the upstream change are discussed in matplotlib/matplotlib#16931.

@astrofrog
Copy link
Member

I think adding the methods to the central Matplotlib widget is fine - thanks!

@dhomeier
Copy link
Collaborator Author

Might consider using more exact copies of the versions in matplotlib.backend_bases, but as they are only used in the tests, those should suffice.
There's 24 calls in 3 test files in total; could perhaps be changed in place once we drop mpl < 3.6.

@dhomeier dhomeier marked this pull request as ready for review October 11, 2022 13:53
@dhomeier
Copy link
Collaborator Author

dhomeier commented Oct 11, 2022

I've added lts envs with matplotlib 3.5.* to isolate the errors in the py310 jobs; otherwise no idea what more to make of the 6 recurring negative xerr "Exceptions caught in Qt event loop" for each test...
While it's failing here for Linux and macOS, but not Windows, the same tests all pass with mpl 3.6.0 for both my Mac systems, arm64 and x86_64 alike.
Can only speculate that some of the NaN magic in matplotlib/matplotlib#22929 broke this, but probably not at the Python level.

@dhomeier dhomeier merged commit 460fcc7 into glue-viz:main Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy