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

MNT: make matplotlib an optional dependency #3755

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

samthurston
Copy link

Applications that make use of the metpy analytical tools without the need for visualization may avoid importing matplotlib due to large import size.

In response to MetPy#2163

Description Of Changes

  • matplotlib removed from base dependencies
  • matplotlib added to "plot" optional group
  • "plot" optional group added to "extras" optional group
  • ci requirements files updated
  • installation guide updated

Checklist

Applications that make use of the metpy analytical tools without
the need for visualization may avoid importing matplotlib due to
large import size.

resolves [MetPy#2163](Unidata#2163)
@samthurston samthurston requested a review from a team as a code owner February 11, 2025 15:05
@samthurston samthurston requested review from dcamron and removed request for a team February 11, 2025 15:05
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Samuel Thurston seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dopplershift
Copy link
Member

Looks like re-running has fixed the doc errors. One thing to fix up is that the email on the commits doesn't appear to be associated with your GitHub account, which is why the CLA check isn't passing.

Right now, everything is passing because pytest-mpl is a fixed test requirement, which pulls in matplotlib. So for this to go forward we need a few things to be worked out on the test/CI system:

  • Version ranges for testing with matplotlib as an optional dependency
  • Only pulling in pytest-mpl when we need it
  • Marking plotting tests (or perhaps whole test plotting files) to skip when matplotlib isn't available

@samthurston
Copy link
Author

whoops. when you forget to reset the local user.email on your work machine :)

great points. I will take a look at the tests and see what I can do there.

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.

Make matplotlib an optional dependency
3 participants