Skip to content

Commit d9ba57c

Browse files
committed
Bump oldest supported numpy to 1.11.
1 parent f8b425d commit d9ba57c

File tree

8 files changed

+27
-37
lines changed

8 files changed

+27
-37
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
- run:
135135
<<: *deps-install
136136
environment:
137-
NUMPY_VERSION: "==1.10.0"
137+
NUMPY_VERSION: "==1.11.0"
138138
- run: *mpl-install
139139

140140
- run: *doc-build

INSTALL.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Matplotlib requires the following dependencies:
136136
* `Python <https://www.python.org/downloads/>`_ (>= 3.5)
137137
* `FreeType <https://www.freetype.org/>`_ (>= 2.3)
138138
* `libpng <http://www.libpng.org>`_ (>= 1.2)
139-
* `NumPy <http://www.numpy.org>`_ (>= 1.10.0)
139+
* `NumPy <http://www.numpy.org>`_ (>= 1.11)
140140
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`_
141141
* `cycler <http://matplotlib.org/cycler/>`_ (>= 0.10.0)
142142
* `dateutil <https://pypi.org/project/python-dateutil>`_ (>= 2.1)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Numpy minimum version bump
2+
``````````````````````````
3+
Matplotlib 3.1 requires numpy>=1.11.

lib/matplotlib/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def _check_versions():
191191
("cycler", "0.10"),
192192
("dateutil", "2.1"),
193193
("kiwisolver", "1.0.1"),
194-
("numpy", "1.10"),
194+
("numpy", "1.11"),
195195
("pyparsing", "2.0.1"),
196196
]:
197197
module = importlib.import_module(modname)

lib/matplotlib/dates.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,8 @@ def _dt64_to_ordinalf(d):
254254

255255
# the "extra" ensures that we at least allow the dynamic range out to
256256
# seconds. That should get out to +/-2e11 years.
257-
# NOTE: First cast truncates; second cast back is for NumPy 1.10.
258-
extra = d - d.astype('datetime64[s]').astype(d.dtype)
259-
extra = extra.astype('timedelta64[ns]')
260-
t0 = np.datetime64('0001-01-01T00:00:00').astype('datetime64[s]')
257+
extra = (d - d.astype('datetime64[s]')).astype('timedelta64[ns]')
258+
t0 = np.datetime64('0001-01-01T00:00:00', 's')
261259
dt = (d.astype('datetime64[s]') - t0).astype(np.float64)
262260
dt += extra.astype(np.float64) / 1.0e9
263261
dt = dt / SEC_PER_DAY + 1.0

lib/matplotlib/ticker.py

+7-16
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,6 @@
187187
'SymmetricalLogLocator', 'LogitLocator')
188188

189189

190-
# Work around numpy/numpy#6127.
191-
def _divmod(x, y):
192-
if isinstance(x, np.generic):
193-
x = x.item()
194-
if isinstance(y, np.generic):
195-
y = y.item()
196-
return divmod(x, y)
197-
198-
199190
def _mathdefault(s):
200191
return '\\mathdefault{%s}' % s
201192

@@ -1665,7 +1656,7 @@ def view_limits(self, vmin, vmax):
16651656
vmax += 1
16661657

16671658
if rcParams['axes.autolimit_mode'] == 'round_numbers':
1668-
exponent, remainder = _divmod(
1659+
exponent, remainder = divmod(
16691660
math.log10(vmax - vmin), math.log10(max(self.numticks - 1, 1)))
16701661
exponent -= (remainder < .5)
16711662
scale = max(self.numticks - 1, 1) ** (-exponent)
@@ -1690,30 +1681,30 @@ def __init__(self, base):
16901681

16911682
def lt(self, x):
16921683
'return the largest multiple of base < x'
1693-
d, m = _divmod(x, self._base)
1684+
d, m = divmod(x, self._base)
16941685
if closeto(m, 0) and not closeto(m / self._base, 1):
16951686
return (d - 1) * self._base
16961687
return d * self._base
16971688

16981689
def le(self, x):
16991690
'return the largest multiple of base <= x'
1700-
d, m = _divmod(x, self._base)
1691+
d, m = divmod(x, self._base)
17011692
if closeto(m / self._base, 1): # was closeto(m, self._base)
17021693
#looks like floating point error
17031694
return (d + 1) * self._base
17041695
return d * self._base
17051696

17061697
def gt(self, x):
17071698
'return the smallest multiple of base > x'
1708-
d, m = _divmod(x, self._base)
1699+
d, m = divmod(x, self._base)
17091700
if closeto(m / self._base, 1):
17101701
#looks like floating point error
17111702
return (d + 2) * self._base
17121703
return (d + 1) * self._base
17131704

17141705
def ge(self, x):
17151706
'return the smallest multiple of base >= x'
1716-
d, m = _divmod(x, self._base)
1707+
d, m = divmod(x, self._base)
17171708
if closeto(m, 0) and not closeto(m / self._base, 1):
17181709
return d * self._base
17191710
return (d + 1) * self._base
@@ -1808,14 +1799,14 @@ def closeto(self, ms, edge):
18081799

18091800
def le(self, x):
18101801
'Return the largest n: n*step <= x.'
1811-
d, m = _divmod(x, self.step)
1802+
d, m = divmod(x, self.step)
18121803
if self.closeto(m / self.step, 1):
18131804
return (d + 1)
18141805
return d
18151806

18161807
def ge(self, x):
18171808
'Return the smallest n: n*step >= x.'
1818-
d, m = _divmod(x, self.step)
1809+
d, m = divmod(x, self.step)
18191810
if self.closeto(m / self.step, 0):
18201811
return d
18211812
return (d + 1)

requirements/testing/travis35.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
cycler==0.10
44
python-dateutil==2.1
5-
numpy==1.10.0
5+
numpy==1.11
66
pandas<0.21.0
77
pyparsing==2.0.1
88
pytest==3.6

setupext.py

+11-13
Original file line numberDiff line numberDiff line change
@@ -774,24 +774,22 @@ def include_dirs_hook():
774774
return [numpy.get_include()]
775775

776776
def add_flags(self, ext):
777-
# Ensure that PY_ARRAY_UNIQUE_SYMBOL is uniquely defined for
778-
# each extension
779-
array_api_name = 'MPL_' + ext.name.replace('.', '_') + '_ARRAY_API'
780-
781-
ext.define_macros.append(('PY_ARRAY_UNIQUE_SYMBOL', array_api_name))
782777
ext.add_hook('include_dirs', self.include_dirs_hook)
783-
784-
ext.define_macros.append(('NPY_NO_DEPRECATED_API',
785-
'NPY_1_7_API_VERSION'))
786-
787-
# Allow NumPy's printf format specifiers in C++.
788-
ext.define_macros.append(('__STDC_FORMAT_MACROS', 1))
778+
ext.define_macros.extend([
779+
# Ensure that PY_ARRAY_UNIQUE_SYMBOL is uniquely defined for each
780+
# extension.
781+
('PY_ARRAY_UNIQUE_SYMBOL',
782+
'MPL_' + ext.name.replace('.', '_') + '_ARRAY_API'),
783+
('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION'),
784+
# Allow NumPy's printf format specifiers in C++.
785+
('__STDC_FORMAT_MACROS', 1),
786+
])
789787

790788
def get_setup_requires(self):
791-
return ['numpy>=1.10.0']
789+
return ['numpy>=1.11']
792790

793791
def get_install_requires(self):
794-
return ['numpy>=1.10.0']
792+
return ['numpy>=1.11']
795793

796794

797795
class LibAgg(SetupPackage):

0 commit comments

Comments
 (0)