Skip to content

Commit a9b4d40

Browse files
committed
DEPS: set min versions
closes pandas-dev#15206, numpy >= 1.9 closes pandas-dev#15543, matplotlib >= 1.4.3 closes pandas-dev#15214, bottleneck >= 1.0.0 scipy >= 0.14.0
1 parent 7b9a57f commit a9b4d40

24 files changed

+88
-180
lines changed

ci/requirements-2.7_COMPAT.build

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
python=2.7*
2-
numpy=1.7.1
2+
numpy=1.9.1
3+
libgfortran=3.0.0
34
cython=0.23
45
dateutil=1.5
56
pytz=2013b

ci/requirements-2.7_COMPAT.run

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
numpy=1.7.1
1+
numpy=1.9.1
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-
bottleneck=0.8.0
7+
bottleneck=1.0.0
88
numexpr=2.2.2
99
pytables=3.0.0
1010
html5lib=1.0b2

ci/requirements-2.7_LOCALE.build

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
python=2.7*
22
python-dateutil
33
pytz=2013b
4-
numpy=1.8.2
4+
numpy=1.9.1
5+
libgfortran=3.0.0
56
cython=0.23

ci/requirements-2.7_LOCALE.run

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
python-dateutil
22
pytz=2013b
3-
numpy=1.8.2
3+
numpy=1.9.1
44
xlwt=0.7.5
55
openpyxl=1.6.2
66
xlsxwriter=0.4.6
77
xlrd=0.9.2
8-
bottleneck=0.8.0
9-
matplotlib=1.3.1
8+
bottleneck=1.0.0
9+
matplotlib=1.4.3
1010
sqlalchemy=0.8.1
1111
html5lib=1.0b2
1212
lxml=3.2.1

ci/requirements-2.7_SLOW.build

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
python=2.7*
22
python-dateutil
33
pytz
4-
numpy=1.8.2
4+
numpy=1.9.1
5+
libgfortran=3.0.0
56
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.9.1
4+
matplotlib=1.4.3
55
scipy
66
patsy
77
xlwt

doc/source/install.rst

+4-4
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

@@ -217,7 +217,7 @@ Recommended Dependencies
217217
If installed, must be Version 2.4.6 or higher.
218218

219219
* `bottleneck <http://berkeleyanalytics.com/bottleneck>`__: for accelerating certain types of ``nan``
220-
evaluations. ``bottleneck`` uses specialized cython routines to achieve large speedups.
220+
evaluations. ``bottleneck`` uses specialized cython routines to achieve large speedups, Version 1.0.0 or higher.
221221

222222
.. note::
223223

@@ -232,7 +232,7 @@ Optional Dependencies
232232

233233
* `Cython <http://www.cython.org>`__: Only necessary to build development
234234
version. Version 0.23 or higher.
235-
* `SciPy <http://www.scipy.org>`__: miscellaneous statistical functions
235+
* `SciPy <http://www.scipy.org>`__: miscellaneous statistical functions, Version 0.14.0 or higher
236236
* `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.
237237
* `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.
238238
* `Feather Format <https://github.com/wesm/feather>`__: necessary for feather-based storage, version 0.3.1 or higher.
@@ -242,7 +242,7 @@ Optional Dependencies
242242
* `pymysql <https://github.com/PyMySQL/PyMySQL>`__: for MySQL.
243243
* `SQLite <https://docs.python.org/3.5/library/sqlite3.html>`__: for SQLite, this is included in Python's standard library by default.
244244

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

248248
* `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
@@ -46,6 +46,26 @@ Other Enhancements
4646
Backwards incompatible API changes
4747
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4848

49+
50+
.. _whatsnew_0210.api_breaking.deps:
51+
52+
Dependencies have increased minimum versions
53+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54+
55+
We have updated our minimum supported versions of dependencies (:issue:`15206`, :issue:`15543`, :issue:`15214`). We now require:
56+
57+
+--------------+-----------------+
58+
| Package | Minimum Version |
59+
+======================+=========+
60+
| Numpy | 1.9.1 |
61+
+--------------+-----------------+
62+
| Matplotlib | 1.4.3 |
63+
+--------------+-----------------+
64+
| Scipy | 0.14.0 |
65+
+--------------+-----------------+
66+
| Bottleneck | 1.0.0 |
67+
+--------------+-----------------+
68+
4969
.. _whatsnew_0210.api_breaking.pandas_eval:
5070

5171
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-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from warnings import warn, catch_warnings
77
import numpy as np
88

9-
from pandas import compat, _np_version_under1p8
9+
from pandas import compat
1010
from pandas.core.dtypes.cast import maybe_promote
1111
from pandas.core.dtypes.generic import (
1212
ABCSeries, ABCIndex,
@@ -398,11 +398,9 @@ def isin(comps, values):
398398
comps, dtype, _ = _ensure_data(comps)
399399
values, _, _ = _ensure_data(values, dtype=dtype)
400400

401-
# GH11232
402-
# work-around for numpy < 1.8 and comparisions on py3
403401
# faster for larger cases to use np.in1d
404402
f = lambda x, y: htable.ismember_object(x, values)
405-
if (_np_version_under1p8 and compat.PY3) or len(comps) > 1000000:
403+
if len(comps) > 1000000:
406404
f = lambda x, y: np.in1d(x, y)
407405
elif is_integer_dtype(comps):
408406
try:

pandas/core/generic.py

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

17451745
def _maybe_cache_changed(self, item, value):
17461746
"""The object has called back to us saying maybe it has changed.
1747-
1748-
numpy < 1.8 has an issue with object arrays and aliasing
1749-
GH6026
17501747
"""
1751-
self._data.set(item, value, check=pd._np_version_under1p8)
1748+
self._data.set(item, value, check=False)
17521749

17531750
@property
17541751
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 (
@@ -3256,11 +3256,7 @@ def value_counts(self, normalize=False, sort=True, ascending=False,
32563256
d = np.diff(np.r_[idx, len(ids)])
32573257
if dropna:
32583258
m = ids[lab == -1]
3259-
if _np_version_under1p8:
3260-
mi, ml = algorithms.factorize(m)
3261-
d[ml] = d[ml] - np.bincount(mi)
3262-
else:
3263-
np.add.at(d, m, -1)
3259+
np.add.at(d, m, -1)
32643260
acc = rep(d)[mask]
32653261
else:
32663262
acc = rep(d)

pandas/core/internals.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
import pandas.core.computation.expressions as expressions
6767
from pandas.util._decorators import cache_readonly
6868
from pandas.util._validators import validate_bool_kwarg
69-
70-
from pandas import compat, _np_version_under1p9
69+
from pandas import compat
7170
from pandas.compat import range, map, zip, u
7271

7372

@@ -1327,15 +1326,7 @@ def quantile(self, qs, interpolation='linear', axis=0, mgr=None):
13271326
tuple of (axis, block)
13281327
13291328
"""
1330-
if _np_version_under1p9:
1331-
if interpolation != 'linear':
1332-
raise ValueError("Interpolation methods other than linear "
1333-
"are not supported in numpy < 1.9.")
1334-
1335-
kw = {}
1336-
if not _np_version_under1p9:
1337-
kw.update({'interpolation': interpolation})
1338-
1329+
kw = {'interpolation': interpolation}
13391330
values = self.get_values()
13401331
values, _, _, _ = self._try_coerce_args(values, values)
13411332

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):

pandas/tests/indexes/period/test_indexing.py

+13-21
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pandas.compat import lrange
99
from pandas._libs import tslib
1010
from pandas import (PeriodIndex, Series, DatetimeIndex,
11-
period_range, Period, _np_version_under1p9)
11+
period_range, Period)
1212

1313

1414
class TestGetItem(object):
@@ -149,16 +149,12 @@ def test_getitem_seconds(self):
149149
values = ['2014', '2013/02', '2013/01/02', '2013/02/01 9H',
150150
'2013/02/01 09:00']
151151
for v in values:
152-
if _np_version_under1p9:
153-
with pytest.raises(ValueError):
154-
idx[v]
155-
else:
156-
# GH7116
157-
# these show deprecations as we are trying
158-
# to slice with non-integer indexers
159-
# with pytest.raises(IndexError):
160-
# idx[v]
161-
continue
152+
# GH7116
153+
# these show deprecations as we are trying
154+
# to slice with non-integer indexers
155+
# with pytest.raises(IndexError):
156+
# idx[v]
157+
continue
162158

163159
s = Series(np.random.rand(len(idx)), index=idx)
164160
tm.assert_series_equal(s['2013/01/01 10:00'], s[3600:3660])
@@ -178,16 +174,12 @@ def test_getitem_day(self):
178174
'2013/02/01 09:00']
179175
for v in values:
180176

181-
if _np_version_under1p9:
182-
with pytest.raises(ValueError):
183-
idx[v]
184-
else:
185-
# GH7116
186-
# these show deprecations as we are trying
187-
# to slice with non-integer indexers
188-
# with pytest.raises(IndexError):
189-
# idx[v]
190-
continue
177+
# GH7116
178+
# these show deprecations as we are trying
179+
# to slice with non-integer indexers
180+
# with pytest.raises(IndexError):
181+
# idx[v]
182+
continue
191183

192184
s = Series(np.random.rand(len(idx)), index=idx)
193185
tm.assert_series_equal(s['2013/01'], s[0:31])

0 commit comments

Comments
 (0)