Skip to content

Commit

Permalink
MNT: make matplotlib an optional dependency
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Samuel Thurston committed Feb 11, 2025
1 parent 489b87c commit 269a09e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions ci/extra_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
matplotlib==3.10.0
cartopy==0.24.0
dask==2025.1.0
shapely==2.0.7
1 change: 0 additions & 1 deletion ci/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
matplotlib==3.10.0
numpy==2.2.2
pandas==2.2.3
pooch==1.8.2
Expand Down
7 changes: 6 additions & 1 deletion docs/userguide/installguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ years. For Python itself, that generally means supporting the last two minor rel
currently supports Python >= 3.10.

.. literalinclude:: ../../pyproject.toml
:start-at: matplotlib
:start-at: numpy
:end-at: xarray

------------
Expand All @@ -37,6 +37,11 @@ the base of the source directory, run:
This will build and install MetPy into your current Python installation.

To include the plotting features run:

.. parsed-literal::
pip install .[plot]
------------------
Working With Conda
------------------
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ classifiers = [
]
requires-python = ">=3.10"
dependencies = [
"matplotlib>=3.5.0",
"numpy>=1.22.0",
"pandas>=1.4.0",
"pint>=0.17",
Expand Down Expand Up @@ -63,7 +62,11 @@ test = [
extras = [
"cartopy>=0.21.0",
"dask>=2020.12.0",
"shapely>=1.6.4"
"shapely>=1.6.4",
"metpy[plot]"
]
plot = [
"matplotlib>=3.5.0"
]

[project.urls]
Expand Down

0 comments on commit 269a09e

Please sign in to comment.