Skip to content

Bump numpy dependency to >=1.15. #15698

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 1 commit into from
Nov 15, 2019
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
2 changes: 1 addition & 1 deletion INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Dependencies
Matplotlib requires the following dependencies:

* `Python <https://www.python.org/downloads/>`_ (>= 3.6)
* `NumPy <http://www.numpy.org>`_ (>= 1.12)
* `NumPy <http://www.numpy.org>`_ (>= 1.15)
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`_
* `cycler <http://matplotlib.org/cycler/>`_ (>= 0.10.0)
* `dateutil <https://pypi.org/project/python-dateutil>`_ (>= 2.1)
Expand Down
2 changes: 1 addition & 1 deletion doc/api/next_api_changes/development.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Development changes
-------------------

Matplotlib now requires numpy>=1.12
Matplotlib now requires numpy>=1.15
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Matplotlib now uses Pillow to save and read pngs
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def _check_versions():
("cycler", "0.10"),
("dateutil", "2.1"),
("kiwisolver", "1.0.1"),
("numpy", "1.12"),
("numpy", "1.15"),
("pyparsing", "2.0.1"),
]:
module = importlib.import_module(modname)
Expand Down
28 changes: 2 additions & 26 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,6 @@
from matplotlib.axes._secondary_axes import SecondaryAxis
from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer

try:
from numpy.lib.histograms import (
histogram_bin_edges as _histogram_bin_edges)
except ImportError:
# this function is new in np 1.15
def _histogram_bin_edges(arr, bins, range=None, weights=None):
# this in True for 1D arrays, and False for None and str
if np.ndim(bins) == 1:
return bins

if isinstance(bins, str):
# rather than backporting the internals, just do the full
# computation. If this is too slow for users, they can
# update numpy, or pick a manual number of bins
return np.histogram(arr, bins, range, weights)[1]
else:
if bins is None:
# hard-code numpy's default
bins = 10
if range is None:
range = np.min(arr), np.max(arr)

return np.linspace(*range, bins + 1)


_log = logging.getLogger(__name__)

Expand Down Expand Up @@ -6698,8 +6674,8 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
_w = np.concatenate(w)
else:
_w = None

bins = _histogram_bin_edges(np.concatenate(x), bins, bin_range, _w)
bins = np.histogram_bin_edges(
np.concatenate(x), bins, bin_range, _w)
else:
hist_kwargs['range'] = bin_range

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

cycler==0.10
python-dateutil==2.1
numpy==1.12.0
numpy==1.15.0
pyparsing==2.0.1
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ def run(self):

python_requires='>={}'.format('.'.join(str(n) for n in min_version)),
setup_requires=[
"numpy>=1.12",
"numpy>=1.15",
],
install_requires=[
"cycler>=0.10",
"kiwisolver>=1.0.1",
"numpy>=1.12",
"numpy>=1.15",
"pillow>=6.2.0",
"pyparsing>=2.0.1,!=2.0.4,!=2.1.2,!=2.1.6",
"python-dateutil>=2.1",
Expand Down