Skip to content

Bump minimum NumPy to 1.19 #22205

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 2 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions doc/api/next_api_changes/development/22205-ES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Increase to minimum supported versions of Python and dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For Matplotlib 3.6, the :ref:`minimum supported versions <dependencies>` are
being bumped:

+------------+-----------------+---------------+
| Dependency | min in mpl3.5 | min in mpl3.6 |
+============+=================+===============+
| NumPy | 1.17 | 1.19 |
+------------+-----------------+---------------+

This is consistent with our :ref:`min_deps_policy` and `NEP29
<https://numpy.org/neps/nep-0029-deprecation_policy.html>`__

2 changes: 1 addition & 1 deletion doc/api/prev_api_changes/api_changes_3.2.0/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ is desired.

Packaging DLLs
~~~~~~~~~~~~~~
Previously, it was possible to package Windows DLLs into the Maptlotlib
Previously, it was possible to package Windows DLLs into the Matplotlib
wheel (or sdist) by copying them into the source tree and setting the
``package_data.dlls`` entry in ``setup.cfg``.

Expand Down
2 changes: 1 addition & 1 deletion doc/api/prev_api_changes/api_changes_3.4.0/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Development changes
Increase to minimum supported versions of Python and dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For Maptlotlib 3.4, the :ref:`minimum supported versions <dependencies>` are
For Matplotlib 3.4, the :ref:`minimum supported versions <dependencies>` are
being bumped:

+------------+-----------------+---------------+
Expand Down
2 changes: 1 addition & 1 deletion doc/devel/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mandatory dependencies are automatically installed. This list is mainly for
reference.

* `Python <https://www.python.org/downloads/>`_ (>= 3.7)
* `NumPy <https://numpy.org>`_ (>= 1.17)
* `NumPy <https://numpy.org>`_ (>= 1.19)
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`_
* `cycler <https://matplotlib.org/cycler/>`_ (>= 0.10.0)
* `dateutil <https://pypi.org/project/python-dateutil/>`_ (>= 2.7)
Expand Down
4 changes: 3 additions & 1 deletion doc/devel/min_dep_policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ We will support at least minor versions of the development
dependencies released in the 12 months prior to our planned release.

We will only bump these as needed or versions no longer support our
minimum Python and numpy.
minimum Python and NumPy.

System and C-dependencies
=========================
Expand All @@ -83,6 +83,7 @@ specification of the dependencies.
========== ======== ======
Matplotlib Python NumPy
========== ======== ======
`3.6`_ 3.7 1.19.0
`3.5`_ 3.7 1.17.0
`3.4`_ 3.7 1.16.0
`3.3`_ 3.6 1.15.0
Expand All @@ -100,6 +101,7 @@ Matplotlib Python NumPy
1.0 2.4 1.1
========== ======== ======

.. _`3.6`: https://matplotlib.org/3.6.0/devel/dependencies.html
.. _`3.5`: https://matplotlib.org/3.5.0/devel/dependencies.html
.. _`3.4`: https://matplotlib.org/3.4.0/devel/dependencies.html
.. _`3.3`: https://matplotlib.org/3.3.0/users/installing.html#dependencies
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- cycler>=0.10.0
- fonttools>=4.22.0
- kiwisolver>=1.0.1
- numpy>=1.17
- numpy>=1.19
- pillow>=6.2
- pygobject
- pyparsing
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _check_versions():
("cycler", "0.10"),
("dateutil", "2.7"),
("kiwisolver", "1.0.1"),
("numpy", "1.17"),
("numpy", "1.19"),
("pyparsing", "2.2.1"),
]:
module = importlib.import_module(modname)
Expand Down
10 changes: 2 additions & 8 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,19 +1025,13 @@ def test_fill_between_interpolate_nan():
y1 = np.asarray([8, 18, np.nan, 18, 8, 18, 24, 18, 8, 18])
y2 = np.asarray([18, 11, 8, 11, 18, 26, 32, 30, np.nan, np.nan])

# NumPy <1.19 issues warning 'invalid value encountered in greater_equal'
# for comparisons that include nan.
with np.errstate(invalid='ignore'):
greater2 = y2 >= y1
greater1 = y1 >= y2

fig, ax = plt.subplots()

ax.plot(x, y1, c='k')
ax.plot(x, y2, c='b')
ax.fill_between(x, y1, y2, where=greater2, facecolor="green",
ax.fill_between(x, y1, y2, where=y2 >= y1, facecolor="green",
interpolate=True, alpha=0.5)
ax.fill_between(x, y1, y2, where=greater1, facecolor="red",
ax.fill_between(x, y1, y2, where=y1 >= y2, facecolor="red",
interpolate=True, alpha=0.5)


Expand Down
2 changes: 1 addition & 1 deletion requirements/testing/minver.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cycler==0.10
kiwisolver==1.0.1
numpy==1.17.0
numpy==1.19.0
packaging==20.0
pillow==6.2.0
pyparsing==2.2.1
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,15 @@ def make_release_tree(self, base_dir, files):
python_requires='>={}'.format('.'.join(str(n) for n in py_min_version)),
setup_requires=[
"certifi>=2020.06.20",
"numpy>=1.17",
"numpy>=1.19",
"setuptools_scm>=4",
"setuptools_scm_git_archive",
],
install_requires=[
"cycler>=0.10",
"fonttools>=4.22.0",
"kiwisolver>=1.0.1",
"numpy>=1.17",
"numpy>=1.19",
"packaging>=20.0",
"pillow>=6.2.0",
"pyparsing>=2.2.1,<3.0.0",
Expand Down