Skip to content

Commit 81093ba

Browse files
authored
BLD: bump numpy min version to 1.15.4 (#33729)
1 parent b62a3a4 commit 81093ba

File tree

16 files changed

+36
-44
lines changed

16 files changed

+36
-44
lines changed

ci/deps/azure-36-minimum_versions.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: pandas-dev
22
channels:
3-
- defaults
43
- conda-forge
54
dependencies:
65
- python=3.6.1
@@ -19,12 +18,12 @@ dependencies:
1918
- jinja2=2.8
2019
- numba=0.46.0
2120
- numexpr=2.6.2
22-
- numpy=1.13.3
21+
- numpy=1.15.4
2322
- openpyxl=2.5.7
2423
- pytables=3.4.3
2524
- python-dateutil=2.7.3
2625
- pytz=2017.2
27-
- scipy=0.19.0
26+
- scipy=1.2
2827
- xlrd=1.1.0
2928
- xlsxwriter=0.9.8
3029
- xlwt=1.2.0

ci/deps/azure-macos-36.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- matplotlib=2.2.3
2020
- nomkl
2121
- numexpr
22-
- numpy=1.14
22+
- numpy=1.15.4
2323
- openpyxl
2424
- pyarrow>=0.13.0
2525
- pytables

conda.recipe/meta.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ requirements:
2020
- cython
2121
- numpy
2222
- setuptools >=3.3
23-
- python-dateutil >=2.5.0
23+
- python-dateutil >=2.7.3
2424
- pytz
2525
run:
2626
- python {{ python }}
2727
- {{ pin_compatible('numpy') }}
28-
- python-dateutil >=2.5.0
28+
- python-dateutil >=2.7.3
2929
- pytz
3030

3131
test:

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Dependencies
220220
Package Minimum supported version
221221
================================================================ ==========================
222222
`setuptools <https://setuptools.readthedocs.io/en/latest/>`__ 24.2.0
223-
`NumPy <https://www.numpy.org>`__ 1.13.3
223+
`NumPy <https://www.numpy.org>`__ 1.15.4
224224
`python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ 2.7.3
225225
`pytz <https://pypi.org/project/pytz/>`__ 2017.2
226226
================================================================ ==========================

doc/source/whatsnew/v1.1.0.rst

+13-3
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,23 @@ Other enhancements
157157
Increased minimum versions for dependencies
158158
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
159159

160-
Some minimum supported versions of dependencies were updated (:issue:`29766`, :issue:`29723`, pytables >= 3.4.3).
160+
Some minimum supported versions of dependencies were updated (:issue:`33718`, :issue:`29766`, :issue:`29723`, pytables >= 3.4.3).
161161
If installed, we now require:
162162

163163
+-----------------+-----------------+----------+---------+
164164
| Package | Minimum Version | Required | Changed |
165165
+=================+=================+==========+=========+
166-
| python-dateutil | 2.7.3 | X | |
166+
| numpy | 1.15.4 | X | X |
167+
+-----------------+-----------------+----------+---------+
168+
| pytz | 2015.4 | X | |
169+
+-----------------+-----------------+----------+---------+
170+
| python-dateutil | 2.7.3 | X | X |
171+
+-----------------+-----------------+----------+---------+
172+
| bottleneck | 1.2.1 | | |
173+
+-----------------+-----------------+----------+---------+
174+
| numexpr | 2.6.2 | | |
175+
+-----------------+-----------------+----------+---------+
176+
| pytest (dev) | 4.0.2 | | |
167177
+-----------------+-----------------+----------+---------+
168178

169179
For `optional libraries <https://dev.pandas.io/docs/install.html#dependencies>`_ the general recommendation is to use the latest version.
@@ -195,7 +205,7 @@ Optional libraries below the lowest tested version may still work, but are not c
195205
+-----------------+-----------------+---------+
196206
| s3fs | 0.3.0 | |
197207
+-----------------+-----------------+---------+
198-
| scipy | 0.19.0 | |
208+
| scipy | 1.2.0 | X |
199209
+-----------------+-----------------+---------+
200210
| sqlalchemy | 1.1.4 | |
201211
+-----------------+-----------------+---------+

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ dependencies:
7575
- jinja2 # pandas.Styler
7676
- matplotlib>=2.2.2 # pandas.plotting, Series.plot, DataFrame.plot
7777
- numexpr>=2.6.8
78-
- scipy>=1.1
78+
- scipy>=1.2
7979
- numba>=0.46.0
8080

8181
# optional for io

pandas/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
# numpy compat
2222
from pandas.compat.numpy import (
23-
_np_version_under1p14,
24-
_np_version_under1p15,
2523
_np_version_under1p16,
2624
_np_version_under1p17,
2725
_np_version_under1p18,

pandas/compat/_optional.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"pytest": "5.0.1",
2222
"pyxlsb": "1.0.6",
2323
"s3fs": "0.3.0",
24-
"scipy": "0.19.0",
24+
"scipy": "1.2.0",
2525
"sqlalchemy": "1.1.4",
2626
"tables": "3.4.3",
2727
"tabulate": "0.8.3",

pandas/compat/numpy/__init__.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@
88
# numpy versioning
99
_np_version = np.__version__
1010
_nlv = LooseVersion(_np_version)
11-
_np_version_under1p14 = _nlv < LooseVersion("1.14")
12-
_np_version_under1p15 = _nlv < LooseVersion("1.15")
1311
_np_version_under1p16 = _nlv < LooseVersion("1.16")
1412
_np_version_under1p17 = _nlv < LooseVersion("1.17")
1513
_np_version_under1p18 = _nlv < LooseVersion("1.18")
1614
_is_numpy_dev = ".dev" in str(_nlv)
1715

1816

19-
if _nlv < "1.13.3":
17+
if _nlv < "1.15.4":
2018
raise ImportError(
21-
"this version of pandas is incompatible with numpy < 1.13.3\n"
19+
"this version of pandas is incompatible with numpy < 1.15.4\n"
2220
f"your numpy version is {_np_version}.\n"
23-
"Please upgrade numpy to >= 1.13.3 to use this pandas version"
21+
"Please upgrade numpy to >= 1.15.4 to use this pandas version"
2422
)
2523

2624

@@ -65,8 +63,6 @@ def np_array_datetime64_compat(arr, *args, **kwargs):
6563
__all__ = [
6664
"np",
6765
"_np_version",
68-
"_np_version_under1p14",
69-
"_np_version_under1p15",
7066
"_np_version_under1p16",
7167
"_np_version_under1p17",
7268
"_is_numpy_dev",

pandas/tests/api/test_api.py

-2
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ class TestPDApi(Base):
193193
"_hashtable",
194194
"_lib",
195195
"_libs",
196-
"_np_version_under1p14",
197-
"_np_version_under1p15",
198196
"_np_version_under1p16",
199197
"_np_version_under1p17",
200198
"_np_version_under1p18",

pandas/tests/dtypes/cast/test_promote.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,13 @@ def _assert_match(result_fill_value, expected_fill_value):
9898
# GH#23982/25425 require the same type in addition to equality/NA-ness
9999
res_type = type(result_fill_value)
100100
ex_type = type(expected_fill_value)
101-
if res_type.__name__ == "uint64":
102-
# No idea why, but these (sometimes) do not compare as equal
103-
assert ex_type.__name__ == "uint64"
104-
elif res_type.__name__ == "ulonglong":
105-
# On some builds we get this instead of np.uint64
106-
# Note: cant check res_type.dtype.itemsize directly on numpy 1.18
107-
assert res_type(0).itemsize == 8
108-
assert ex_type == res_type or ex_type == np.uint64
101+
102+
if hasattr(result_fill_value, "dtype"):
103+
# Compare types in a way that is robust to platform-specific
104+
# idiosyncracies where e.g. sometimes we get "ulonglong" as an alias
105+
# for "uint64" or "intc" as an alias for "int32"
106+
assert result_fill_value.dtype.kind == expected_fill_value.dtype.kind
107+
assert result_fill_value.dtype.itemsize == expected_fill_value.dtype.itemsize
109108
else:
110109
# On some builds, type comparison fails, e.g. np.int32 != np.int32
111110
assert res_type == ex_type or res_type.__name__ == ex_type.__name__

pandas/tests/extension/test_boolean.py

-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import numpy as np
1717
import pytest
1818

19-
from pandas.compat.numpy import _np_version_under1p14
20-
2119
import pandas as pd
2220
import pandas._testing as tm
2321
from pandas.core.arrays.boolean import BooleanDtype
@@ -111,9 +109,6 @@ def check_opname(self, s, op_name, other, exc=None):
111109
def _check_op(self, s, op, other, op_name, exc=NotImplementedError):
112110
if exc is None:
113111
if op_name in self.implements:
114-
# subtraction for bools raises TypeError (but not yet in 1.13)
115-
if _np_version_under1p14:
116-
pytest.skip("__sub__ does not yet raise in numpy 1.13")
117112
msg = r"numpy boolean subtract"
118113
with pytest.raises(TypeError, match=msg):
119114
op(s, other)

pandas/tests/frame/methods/test_astype.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
Timedelta,
1515
Timestamp,
1616
UInt64Index,
17-
_np_version_under1p14,
1817
concat,
1918
date_range,
2019
option_context,
@@ -169,9 +168,7 @@ def test_astype_str_float(self):
169168
tm.assert_frame_equal(result, expected)
170169
result = DataFrame([1.12345678901234567890]).astype(str)
171170

172-
# < 1.14 truncates
173-
# >= 1.14 preserves the full repr
174-
val = "1.12345678901" if _np_version_under1p14 else "1.1234567890123457"
171+
val = "1.1234567890123457"
175172
expected = DataFrame([val])
176173
tm.assert_frame_equal(result, expected)
177174

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ requires = [
55
"setuptools",
66
"wheel",
77
"Cython>=0.29.16", # Note: sync with setup.py
8-
"numpy==1.13.3; python_version=='3.6' and platform_system!='AIX'",
9-
"numpy==1.14.5; python_version>='3.7' and platform_system!='AIX'",
8+
"numpy==1.15.4; python_version=='3.6' and platform_system!='AIX'",
9+
"numpy==1.15.4; python_version>='3.7' and platform_system!='AIX'",
1010
"numpy==1.16.0; python_version=='3.6' and platform_system=='AIX'",
1111
"numpy==1.16.0; python_version>='3.7' and platform_system=='AIX'",
1212
]

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ipython>=7.11.1
5050
jinja2
5151
matplotlib>=2.2.2
5252
numexpr>=2.6.8
53-
scipy>=1.1
53+
scipy>=1.2
5454
numba>=0.46.0
5555
beautifulsoup4>=4.6.0
5656
html5lib

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def is_platform_mac():
3333
return sys.platform == "darwin"
3434

3535

36-
min_numpy_ver = "1.13.3"
36+
min_numpy_ver = "1.15.4"
3737
min_cython_ver = "0.29.16" # note: sync with pyproject.toml
3838

3939
try:

0 commit comments

Comments
 (0)