Skip to content

Commit c6be882

Browse files
committed
DEPS: set min versions
closes pandas-dev#15206, numpy >= 1.9 closes pandas-dev#15543, matplotlib >= 1.4.3 scipy >= 0.14.0
1 parent 24b6349 commit c6be882

24 files changed

+86
-183
lines changed

ci/requirements-2.7_COMPAT.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python=2.7*
2-
numpy=1.7.1
2+
numpy=1.9.2
33
cython=0.23
44
dateutil=1.5
55
pytz=2013b

ci/requirements-2.7_COMPAT.run

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
numpy=1.7.1
1+
numpy=1.9.2
22
dateutil=1.5
33
pytz=2013b
4-
scipy=0.11.0
4+
scipy=0.14.0
55
xlwt=0.7.5
66
xlrd=0.9.2
7-
numexpr=2.2.2
8-
pytables=3.0.0
7+
bottleneck=1.0.0
8+
numexpr=2.4.4 # this is actually unsupported for non-pytables
9+
pytables=3.2.2
910
psycopg2
1011
pymysql=0.6.0
1112
sqlalchemy=0.7.8

ci/requirements-2.7_LOCALE.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python=2.7*
22
python-dateutil
33
pytz=2013b
4-
numpy=1.8.2
4+
numpy=1.9.2
55
cython=0.23

ci/requirements-2.7_LOCALE.run

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
python-dateutil
22
pytz=2013b
3-
numpy=1.8.2
3+
numpy=1.9.2
44
xlwt=0.7.5
55
openpyxl=1.6.2
66
xlsxwriter=0.5.2
77
xlrd=0.9.2
8-
matplotlib=1.3.1
8+
bottleneck=1.0.0
9+
matplotlib=1.4.3
910
sqlalchemy=0.8.1
1011
lxml=3.2.1
1112
scipy

ci/requirements-2.7_SLOW.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python=2.7*
22
python-dateutil
33
pytz
4-
numpy=1.8.2
4+
numpy=1.10*
55
cython

ci/requirements-2.7_SLOW.run

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
python-dateutil
22
pytz
3-
numpy=1.8.2
4-
matplotlib=1.3.1
3+
numpy=1.10*
4+
matplotlib=1.4.3
55
scipy
66
patsy
77
xlwt

doc/source/install.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Dependencies
203203
------------
204204

205205
* `setuptools <https://setuptools.readthedocs.io/en/latest/>`__
206-
* `NumPy <http://www.numpy.org>`__: 1.7.1 or higher
206+
* `NumPy <http://www.numpy.org>`__: 1.9.0 or higher
207207
* `python-dateutil <http://labix.org/python-dateutil>`__: 1.5 or higher
208208
* `pytz <http://pytz.sourceforge.net/>`__: Needed for time zone support
209209

@@ -233,7 +233,7 @@ Optional Dependencies
233233

234234
* `Cython <http://www.cython.org>`__: Only necessary to build development
235235
version. Version 0.23 or higher.
236-
* `SciPy <http://www.scipy.org>`__: miscellaneous statistical functions
236+
* `SciPy <http://www.scipy.org>`__: miscellaneous statistical functions, Version 0.14.0 or higher
237237
* `xarray <http://xarray.pydata.org>`__: pandas like handling for > 2 dims, needed for converting Panels to xarray objects. Version 0.7.0 or higher is recommended.
238238
* `PyTables <http://www.pytables.org>`__: necessary for HDF5-based storage. Version 3.0.0 or higher required, Version 3.2.1 or higher highly recommended.
239239
* `Feather Format <https://github.com/wesm/feather>`__: necessary for feather-based storage, version 0.3.1 or higher.
@@ -244,7 +244,7 @@ Optional Dependencies
244244
* `pymysql <https://github.com/PyMySQL/PyMySQL>`__: for MySQL.
245245
* `SQLite <https://docs.python.org/3.5/library/sqlite3.html>`__: for SQLite, this is included in Python's standard library by default.
246246

247-
* `matplotlib <http://matplotlib.org/>`__: for plotting
247+
* `matplotlib <http://matplotlib.org/>`__: for plotting, Version 1.4.3 or higher.
248248
* For Excel I/O:
249249

250250
* `xlrd/xlwt <http://www.python-excel.org/>`__: Excel reading (xlrd) and writing (xlwt)

doc/source/whatsnew/v0.21.0.txt

+20
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,26 @@ Other Enhancements
134134
Backwards incompatible API changes
135135
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136136

137+
138+
.. _whatsnew_0210.api_breaking.deps:
139+
140+
Dependencies have increased minimum versions
141+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142+
143+
We have updated our minimum supported versions of dependencies (:issue:`15206`, :issue:`15543`, :issue:`15214`). We now require:
144+
145+
+--------------+-----------------+
146+
| Package | Minimum Version |
147+
+======================+=========+
148+
| Numpy | 1.9.0 |
149+
+--------------+-----------------+
150+
| Matplotlib | 1.4.3 |
151+
+--------------+-----------------+
152+
| Scipy | 0.14.0 |
153+
+--------------+-----------------+
154+
| Bottleneck | 1.0.0 |
155+
+--------------+-----------------+
156+
137157
.. _whatsnew_0210.api_breaking.pandas_eval:
138158

139159
Improved error handling during item assignment in pd.eval

pandas/_libs/sparse.pyx

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ from distutils.version import LooseVersion
1212

1313
# numpy versioning
1414
_np_version = np.version.short_version
15-
_np_version_under1p8 = LooseVersion(_np_version) < '1.8'
16-
_np_version_under1p9 = LooseVersion(_np_version) < '1.9'
1715
_np_version_under1p10 = LooseVersion(_np_version) < '1.10'
1816
_np_version_under1p11 = LooseVersion(_np_version) < '1.11'
1917

pandas/compat/numpy/__init__.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,18 @@
99
# numpy versioning
1010
_np_version = np.__version__
1111
_nlv = LooseVersion(_np_version)
12-
_np_version_under1p8 = _nlv < '1.8'
13-
_np_version_under1p9 = _nlv < '1.9'
1412
_np_version_under1p10 = _nlv < '1.10'
1513
_np_version_under1p11 = _nlv < '1.11'
1614
_np_version_under1p12 = _nlv < '1.12'
1715
_np_version_under1p13 = _nlv < '1.13'
1816
_np_version_under1p14 = _nlv < '1.14'
17+
_np_version_under1p15 = _nlv < '1.15'
1918

20-
if _nlv < '1.7.0':
19+
if _nlv < '1.9':
2120
raise ImportError('this version of pandas is incompatible with '
22-
'numpy < 1.7.0\n'
21+
'numpy < 1.9.0\n'
2322
'your numpy version is {0}.\n'
24-
'Please upgrade numpy to >= 1.7.0 to use '
23+
'Please upgrade numpy to >= 1.9.0 to use '
2524
'this pandas version'.format(_np_version))
2625

2726

@@ -70,11 +69,10 @@ def np_array_datetime64_compat(arr, *args, **kwargs):
7069

7170

7271
__all__ = ['np',
73-
'_np_version_under1p8',
74-
'_np_version_under1p9',
7572
'_np_version_under1p10',
7673
'_np_version_under1p11',
7774
'_np_version_under1p12',
7875
'_np_version_under1p13',
79-
'_np_version_under1p14'
76+
'_np_version_under1p14',
77+
'_np_version_under1p15'
8078
]

pandas/core/algorithms.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from warnings import warn, catch_warnings
77
import numpy as np
88

9-
from pandas import compat, _np_version_under1p8
109
from pandas.core.dtypes.cast import maybe_promote
1110
from pandas.core.dtypes.generic import (
1211
ABCSeries, ABCIndex,
@@ -407,14 +406,12 @@ def isin(comps, values):
407406
comps, dtype, _ = _ensure_data(comps)
408407
values, _, _ = _ensure_data(values, dtype=dtype)
409408

410-
# GH11232
411-
# work-around for numpy < 1.8 and comparisions on py3
412409
# faster for larger cases to use np.in1d
413410
f = lambda x, y: htable.ismember_object(x, values)
411+
414412
# GH16012
415413
# Ensure np.in1d doesn't get object types or it *may* throw an exception
416-
if ((_np_version_under1p8 and compat.PY3) or len(comps) > 1000000 and
417-
not is_object_dtype(comps)):
414+
if len(comps) > 1000000 and not is_object_dtype(comps):
418415
f = lambda x, y: np.in1d(x, y)
419416
elif is_integer_dtype(comps):
420417
try:

pandas/core/generic.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1827,11 +1827,8 @@ def _box_item_values(self, key, values):
18271827

18281828
def _maybe_cache_changed(self, item, value):
18291829
"""The object has called back to us saying maybe it has changed.
1830-
1831-
numpy < 1.8 has an issue with object arrays and aliasing
1832-
GH6026
18331830
"""
1834-
self._data.set(item, value, check=pd._np_version_under1p8)
1831+
self._data.set(item, value, check=False)
18351832

18361833
@property
18371834
def _is_cached(self):

pandas/core/groupby.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
)
1414

1515
from pandas import compat
16-
from pandas.compat.numpy import function as nv, _np_version_under1p8
16+
from pandas.compat.numpy import function as nv
1717
from pandas.compat import set_function_name
1818

1919
from pandas.core.dtypes.common import (
@@ -3257,11 +3257,7 @@ def value_counts(self, normalize=False, sort=True, ascending=False,
32573257
d = np.diff(np.r_[idx, len(ids)])
32583258
if dropna:
32593259
m = ids[lab == -1]
3260-
if _np_version_under1p8:
3261-
mi, ml = algorithms.factorize(m)
3262-
d[ml] = d[ml] - np.bincount(mi)
3263-
else:
3264-
np.add.at(d, m, -1)
3260+
np.add.at(d, m, -1)
32653261
acc = rep(d)[mask]
32663262
else:
32673263
acc = rep(d)

pandas/core/internals.py

+2-14
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@
6969
import pandas.core.computation.expressions as expressions
7070
from pandas.util._decorators import cache_readonly
7171
from pandas.util._validators import validate_bool_kwarg
72-
73-
from pandas import compat, _np_version_under1p9
72+
from pandas import compat
7473
from pandas.compat import range, map, zip, u
7574

7675

@@ -857,9 +856,6 @@ def _is_empty_indexer(indexer):
857856

858857
# set
859858
else:
860-
if _np_version_under1p9:
861-
# Work around GH 6168 to support old numpy
862-
indexer = getattr(indexer, 'values', indexer)
863859
values[indexer] = value
864860

865861
# coerce and try to infer the dtypes of the result
@@ -1482,15 +1478,7 @@ def quantile(self, qs, interpolation='linear', axis=0, mgr=None):
14821478
tuple of (axis, block)
14831479
14841480
"""
1485-
if _np_version_under1p9:
1486-
if interpolation != 'linear':
1487-
raise ValueError("Interpolation methods other than linear "
1488-
"are not supported in numpy < 1.9.")
1489-
1490-
kw = {}
1491-
if not _np_version_under1p9:
1492-
kw.update({'interpolation': interpolation})
1493-
1481+
kw = {'interpolation': interpolation}
14941482
values = self.get_values()
14951483
values, _, _, _ = self._try_coerce_args(values, values)
14961484

pandas/tests/frame/test_quantile.py

-42
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from pandas.util.testing import assert_series_equal, assert_frame_equal
1313

1414
import pandas.util.testing as tm
15-
from pandas import _np_version_under1p9
1615

1716
from pandas.tests.frame.common import TestData
1817

@@ -103,9 +102,6 @@ def test_quantile_axis_parameter(self):
103102

104103
def test_quantile_interpolation(self):
105104
# see gh-10174
106-
if _np_version_under1p9:
107-
pytest.skip("Numpy version under 1.9")
108-
109105
from numpy import percentile
110106

111107
# interpolation = linear (default case)
@@ -166,44 +162,6 @@ def test_quantile_interpolation(self):
166162
index=[.25, .5], columns=['a', 'b', 'c'])
167163
assert_frame_equal(result, expected)
168164

169-
def test_quantile_interpolation_np_lt_1p9(self):
170-
# see gh-10174
171-
if not _np_version_under1p9:
172-
pytest.skip("Numpy version is greater than 1.9")
173-
174-
from numpy import percentile
175-
176-
# interpolation = linear (default case)
177-
q = self.tsframe.quantile(0.1, axis=0, interpolation='linear')
178-
assert q['A'] == percentile(self.tsframe['A'], 10)
179-
q = self.intframe.quantile(0.1)
180-
assert q['A'] == percentile(self.intframe['A'], 10)
181-
182-
# test with and without interpolation keyword
183-
q1 = self.intframe.quantile(0.1)
184-
assert q1['A'] == np.percentile(self.intframe['A'], 10)
185-
assert_series_equal(q, q1)
186-
187-
# interpolation method other than default linear
188-
msg = "Interpolation methods other than linear"
189-
df = DataFrame({"A": [1, 2, 3], "B": [2, 3, 4]}, index=[1, 2, 3])
190-
with tm.assert_raises_regex(ValueError, msg):
191-
df.quantile(.5, axis=1, interpolation='nearest')
192-
193-
with tm.assert_raises_regex(ValueError, msg):
194-
df.quantile([.5, .75], axis=1, interpolation='lower')
195-
196-
# test degenerate case
197-
df = DataFrame({'x': [], 'y': []})
198-
with tm.assert_raises_regex(ValueError, msg):
199-
q = df.quantile(0.1, axis=0, interpolation='higher')
200-
201-
# multi
202-
df = DataFrame([[1, 1, 1], [2, 2, 2], [3, 3, 3]],
203-
columns=['a', 'b', 'c'])
204-
with tm.assert_raises_regex(ValueError, msg):
205-
df.quantile([.25, .5], interpolation='midpoint')
206-
207165
def test_quantile_multi(self):
208166
df = DataFrame([[1, 1, 1], [2, 2, 2], [3, 3, 3]],
209167
columns=['a', 'b', 'c'])

pandas/tests/indexes/datetimes/test_datetime.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pandas.compat import lrange
1010
from pandas.compat.numpy import np_datetime64_compat
1111
from pandas import (DatetimeIndex, Index, date_range, Series, DataFrame,
12-
Timestamp, datetime, offsets, _np_version_under1p8)
12+
Timestamp, datetime, offsets)
1313

1414
from pandas.util.testing import assert_series_equal, assert_almost_equal
1515

@@ -276,11 +276,7 @@ def test_comparisons_nat(self):
276276
np_datetime64_compat('2014-06-01 00:00Z'),
277277
np_datetime64_compat('2014-07-01 00:00Z')])
278278

279-
if _np_version_under1p8:
280-
# cannot test array because np.datetime('nat') returns today's date
281-
cases = [(fidx1, fidx2), (didx1, didx2)]
282-
else:
283-
cases = [(fidx1, fidx2), (didx1, didx2), (didx1, darr)]
279+
cases = [(fidx1, fidx2), (didx1, didx2), (didx1, darr)]
284280

285281
# Check pd.NaT is handles as the same as np.nan
286282
with tm.assert_produces_warning(None):

0 commit comments

Comments
 (0)