-
Notifications
You must be signed in to change notification settings - Fork 421
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
Make matplotlib an optional dependency #2163
Comments
I've had some thoughts like this before, it would be nice to streamline. I think everything should work just fine as long as Are you building your containers using |
I'm using |
I think you can achieve what you want today with:
Depending on what you're using, you may be able to drop even more of the first line. I'd love to hear feedback on if that works or something breaks unexpectedly. |
Good tip. Thanks! I'll give it a shot. |
I think I got this working with
But I discovered something else also depends on Matplotlib (I think Cartopy is the culprit). 🤦🏻♂️ 😁 |
I'm surprised Not sure what's prompting you to install CartoPy--there's not a lot useful about it if you're not using Matplotlib... |
The origins of Cartopy in the image are silly and uninteresting, so I won't bore you with the details. I was using it for something I could do with pyproj directly, so it's been removed from the image. I can run another test to see if I'm able to eliminate |
That would be helpful, thanks! |
Alright, I must've messed something up with Docker yesterday because now I'm getting an import error because it can't import |
Can you share the full traceback? It'd be good to see because I actually expected that to work. |
Looks like it's because I'm using
|
That's good to know. We can consider moving that inside |
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)
I'd like to bump this issue, as package management/build systems such as poetry and uv don't have support for excluding nested upstream dependencies, it would be really helpful if the plotting functions were an extra. My use case doesn't seem to have any problem just removing the doc builds on my PR seem to be failing due to a problem with pandas doc server? I'm not sure how to trigger them to re-run |
We're using metpy for some of its interpolate functions in an AWS Lambda function to process some data and send it to a web frontend for visualization. Requiring matplotlib is just increasing the size of our container image and, I think, introducing some security vulnerabilities via ImageMagick (according to the container security scan). It would be really nice if there were a way to disable the visualization tools in metpy so we can use it just for its analytical tools.
The text was updated successfully, but these errors were encountered: