Skip to content

Commit d9fb01c

Browse files
committed
DEPS: set min versions
closes #15206, numpy >= 1.9 closes #15543, matplotlib >= 1.4.3 scipy >= 0.14.0
1 parent d0d28fe commit d9fb01c

36 files changed

+221
-320
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ matrix:
3737
- JOB="3.5_OSX" TEST_ARGS="--skip-slow --skip-network"
3838
- dist: trusty
3939
env:
40-
- JOB="2.7_LOCALE" TEST_ARGS="--only-slow --skip-network" LOCALE_OVERRIDE="zh_CN.UTF-8"
40+
- JOB="2.7_LOCALE" LOCALE_OVERRIDE="zh_CN.UTF-8" SLOW=true
4141
addons:
4242
apt:
4343
packages:
@@ -62,7 +62,7 @@ matrix:
6262
# In allow_failures
6363
- dist: trusty
6464
env:
65-
- JOB="2.7_SLOW" TEST_ARGS="--only-slow --skip-network"
65+
- JOB="2.7_SLOW" SLOW=true
6666
# In allow_failures
6767
- dist: trusty
6868
env:
@@ -82,7 +82,7 @@ matrix:
8282
allow_failures:
8383
- dist: trusty
8484
env:
85-
- JOB="2.7_SLOW" TEST_ARGS="--only-slow --skip-network"
85+
- JOB="2.7_SLOW" SLOW=true
8686
- dist: trusty
8787
env:
8888
- JOB="2.7_BUILD_TEST" TEST_ARGS="--skip-slow" BUILD_TEST=true

ci/install_travis.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ which conda
4747
echo
4848
echo "[update conda]"
4949
conda config --set ssl_verify false || exit 1
50-
conda config --set always_yes true --set changeps1 false || exit 1
50+
conda config --set quiet true --set always_yes true --set changeps1 false || exit 1
5151
conda update -q conda
5252

5353
echo

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 # we test that we correctly don't use an unsupported numexpr
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

ci/script_multi.sh

+6
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,15 @@ elif [ "$COVERAGE" ]; then
3636
echo pytest -s -n 2 -m "not single" --cov=pandas --cov-report xml:/tmp/cov-multiple.xml --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
3737
pytest -s -n 2 -m "not single" --cov=pandas --cov-report xml:/tmp/cov-multiple.xml --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
3838

39+
elif [ "$SLOW" ]; then
40+
TEST_ARGS="--only-slow --skip-network"
41+
echo pytest -r xX -m "not single and slow" -v --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
42+
pytest -r xX -m "not single and slow" -v --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
43+
3944
else
4045
echo pytest -n 2 -r xX -m "not single" --junitxml=/tmp/multiple.xml $TEST_ARGS pandas
4146
pytest -n 2 -r xX -m "not single" --junitxml=/tmp/multiple.xml $TEST_ARGS pandas # TODO: doctest
47+
4248
fi
4349

4450
RET="$?"

ci/script_single.sh

+8
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,24 @@ if [ -n "$LOCALE_OVERRIDE" ]; then
1212
python -c "$pycmd"
1313
fi
1414

15+
if [ "$SLOW" ]; then
16+
TEST_ARGS="--only-slow --skip-network"
17+
fi
18+
1519
if [ "$BUILD_TEST" ]; then
1620
echo "We are not running pytest as this is a build test."
21+
1722
elif [ "$DOC" ]; then
1823
echo "We are not running pytest as this is a doc-build"
24+
1925
elif [ "$COVERAGE" ]; then
2026
echo pytest -s -m "single" --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml $TEST_ARGS pandas
2127
pytest -s -m "single" --cov=pandas --cov-report xml:/tmp/cov-single.xml --junitxml=/tmp/single.xml $TEST_ARGS pandas
28+
2229
else
2330
echo pytest -m "single" -r xX --junitxml=/tmp/single.xml $TEST_ARGS pandas
2431
pytest -m "single" -r xX --junitxml=/tmp/single.xml $TEST_ARGS pandas # TODO: doctest
32+
2533
fi
2634

2735
RET="$?"

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

+21-1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,27 @@ Other Enhancements
138138
Backwards incompatible API changes
139139
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140140

141+
142+
.. _whatsnew_0210.api_breaking.deps:
143+
144+
Dependencies have increased minimum versions
145+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146+
147+
We have updated our minimum supported versions of dependencies (:issue:`15206`, :issue:`15543`, :issue:`15214`)
148+
). If installed, we now require:
149+
150+
+--------------+-----------------+----------+
151+
| Package | Minimum Version | Required |
152+
+======================+=========+==========+
153+
| Numpy | 1.9.0 | X |
154+
+--------------+-----------------+----------+
155+
| Matplotlib | 1.4.3 | |
156+
+--------------+-----------------+----------+
157+
| Scipy | 0.14.0 | |
158+
+--------------+-----------------+----------+
159+
| Bottleneck | 1.0.0 | |
160+
+--------------+-----------------+----------+
161+
141162
.. _whatsnew_0210.api_breaking.pandas_eval:
142163

143164
Improved error handling during item assignment in pd.eval
@@ -259,7 +280,6 @@ Other API Changes
259280
^^^^^^^^^^^^^^^^^
260281

261282
- Support has been dropped for Python 3.4 (:issue:`15251`)
262-
- Support has been dropped for bottleneck < 1.0.0 (:issue:`15214`)
263283
- The Categorical constructor no longer accepts a scalar for the ``categories`` keyword. (:issue:`16022`)
264284
- Accessing a non-existent attribute on a closed :class:`~pandas.HDFStore` will now
265285
raise an ``AttributeError`` rather than a ``ClosedFileError`` (:issue:`16301`)

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

0 commit comments

Comments
 (0)