Skip to content

Commit

Permalink
BLD: bump numpy min version to 1.15.4 (#33729)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel authored May 1, 2020
1 parent b62a3a4 commit 81093ba
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 44 deletions.
5 changes: 2 additions & 3 deletions ci/deps/azure-36-minimum_versions.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: pandas-dev
channels:
- defaults
- conda-forge
dependencies:
- python=3.6.1
Expand All @@ -19,12 +18,12 @@ dependencies:
- jinja2=2.8
- numba=0.46.0
- numexpr=2.6.2
- numpy=1.13.3
- numpy=1.15.4
- openpyxl=2.5.7
- pytables=3.4.3
- python-dateutil=2.7.3
- pytz=2017.2
- scipy=0.19.0
- scipy=1.2
- xlrd=1.1.0
- xlsxwriter=0.9.8
- xlwt=1.2.0
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-macos-36.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
- matplotlib=2.2.3
- nomkl
- numexpr
- numpy=1.14
- numpy=1.15.4
- openpyxl
- pyarrow>=0.13.0
- pytables
Expand Down
4 changes: 2 additions & 2 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ requirements:
- cython
- numpy
- setuptools >=3.3
- python-dateutil >=2.5.0
- python-dateutil >=2.7.3
- pytz
run:
- python {{ python }}
- {{ pin_compatible('numpy') }}
- python-dateutil >=2.5.0
- python-dateutil >=2.7.3
- pytz

test:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Dependencies
Package Minimum supported version
================================================================ ==========================
`setuptools <https://setuptools.readthedocs.io/en/latest/>`__ 24.2.0
`NumPy <https://www.numpy.org>`__ 1.13.3
`NumPy <https://www.numpy.org>`__ 1.15.4
`python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ 2.7.3
`pytz <https://pypi.org/project/pytz/>`__ 2017.2
================================================================ ==========================
Expand Down
16 changes: 13 additions & 3 deletions doc/source/whatsnew/v1.1.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,23 @@ Other enhancements
Increased minimum versions for dependencies
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

+-----------------+-----------------+----------+---------+
| Package | Minimum Version | Required | Changed |
+=================+=================+==========+=========+
| python-dateutil | 2.7.3 | X | |
| numpy | 1.15.4 | X | X |
+-----------------+-----------------+----------+---------+
| pytz | 2015.4 | X | |
+-----------------+-----------------+----------+---------+
| python-dateutil | 2.7.3 | X | X |
+-----------------+-----------------+----------+---------+
| bottleneck | 1.2.1 | | |
+-----------------+-----------------+----------+---------+
| numexpr | 2.6.2 | | |
+-----------------+-----------------+----------+---------+
| pytest (dev) | 4.0.2 | | |
+-----------------+-----------------+----------+---------+

For `optional libraries <https://dev.pandas.io/docs/install.html#dependencies>`_ the general recommendation is to use the latest version.
Expand Down Expand Up @@ -195,7 +205,7 @@ Optional libraries below the lowest tested version may still work, but are not c
+-----------------+-----------------+---------+
| s3fs | 0.3.0 | |
+-----------------+-----------------+---------+
| scipy | 0.19.0 | |
| scipy | 1.2.0 | X |
+-----------------+-----------------+---------+
| sqlalchemy | 1.1.4 | |
+-----------------+-----------------+---------+
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ dependencies:
- jinja2 # pandas.Styler
- matplotlib>=2.2.2 # pandas.plotting, Series.plot, DataFrame.plot
- numexpr>=2.6.8
- scipy>=1.1
- scipy>=1.2
- numba>=0.46.0

# optional for io
Expand Down
2 changes: 0 additions & 2 deletions pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

# numpy compat
from pandas.compat.numpy import (
_np_version_under1p14,
_np_version_under1p15,
_np_version_under1p16,
_np_version_under1p17,
_np_version_under1p18,
Expand Down
2 changes: 1 addition & 1 deletion pandas/compat/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"pytest": "5.0.1",
"pyxlsb": "1.0.6",
"s3fs": "0.3.0",
"scipy": "0.19.0",
"scipy": "1.2.0",
"sqlalchemy": "1.1.4",
"tables": "3.4.3",
"tabulate": "0.8.3",
Expand Down
10 changes: 3 additions & 7 deletions pandas/compat/numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@
# numpy versioning
_np_version = np.__version__
_nlv = LooseVersion(_np_version)
_np_version_under1p14 = _nlv < LooseVersion("1.14")
_np_version_under1p15 = _nlv < LooseVersion("1.15")
_np_version_under1p16 = _nlv < LooseVersion("1.16")
_np_version_under1p17 = _nlv < LooseVersion("1.17")
_np_version_under1p18 = _nlv < LooseVersion("1.18")
_is_numpy_dev = ".dev" in str(_nlv)


if _nlv < "1.13.3":
if _nlv < "1.15.4":
raise ImportError(
"this version of pandas is incompatible with numpy < 1.13.3\n"
"this version of pandas is incompatible with numpy < 1.15.4\n"
f"your numpy version is {_np_version}.\n"
"Please upgrade numpy to >= 1.13.3 to use this pandas version"
"Please upgrade numpy to >= 1.15.4 to use this pandas version"
)


Expand Down Expand Up @@ -65,8 +63,6 @@ def np_array_datetime64_compat(arr, *args, **kwargs):
__all__ = [
"np",
"_np_version",
"_np_version_under1p14",
"_np_version_under1p15",
"_np_version_under1p16",
"_np_version_under1p17",
"_is_numpy_dev",
Expand Down
2 changes: 0 additions & 2 deletions pandas/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ class TestPDApi(Base):
"_hashtable",
"_lib",
"_libs",
"_np_version_under1p14",
"_np_version_under1p15",
"_np_version_under1p16",
"_np_version_under1p17",
"_np_version_under1p18",
Expand Down
15 changes: 7 additions & 8 deletions pandas/tests/dtypes/cast/test_promote.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,13 @@ def _assert_match(result_fill_value, expected_fill_value):
# GH#23982/25425 require the same type in addition to equality/NA-ness
res_type = type(result_fill_value)
ex_type = type(expected_fill_value)
if res_type.__name__ == "uint64":
# No idea why, but these (sometimes) do not compare as equal
assert ex_type.__name__ == "uint64"
elif res_type.__name__ == "ulonglong":
# On some builds we get this instead of np.uint64
# Note: cant check res_type.dtype.itemsize directly on numpy 1.18
assert res_type(0).itemsize == 8
assert ex_type == res_type or ex_type == np.uint64

if hasattr(result_fill_value, "dtype"):
# Compare types in a way that is robust to platform-specific
# idiosyncracies where e.g. sometimes we get "ulonglong" as an alias
# for "uint64" or "intc" as an alias for "int32"
assert result_fill_value.dtype.kind == expected_fill_value.dtype.kind
assert result_fill_value.dtype.itemsize == expected_fill_value.dtype.itemsize
else:
# On some builds, type comparison fails, e.g. np.int32 != np.int32
assert res_type == ex_type or res_type.__name__ == ex_type.__name__
Expand Down
5 changes: 0 additions & 5 deletions pandas/tests/extension/test_boolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import numpy as np
import pytest

from pandas.compat.numpy import _np_version_under1p14

import pandas as pd
import pandas._testing as tm
from pandas.core.arrays.boolean import BooleanDtype
Expand Down Expand Up @@ -111,9 +109,6 @@ def check_opname(self, s, op_name, other, exc=None):
def _check_op(self, s, op, other, op_name, exc=NotImplementedError):
if exc is None:
if op_name in self.implements:
# subtraction for bools raises TypeError (but not yet in 1.13)
if _np_version_under1p14:
pytest.skip("__sub__ does not yet raise in numpy 1.13")
msg = r"numpy boolean subtract"
with pytest.raises(TypeError, match=msg):
op(s, other)
Expand Down
5 changes: 1 addition & 4 deletions pandas/tests/frame/methods/test_astype.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
Timedelta,
Timestamp,
UInt64Index,
_np_version_under1p14,
concat,
date_range,
option_context,
Expand Down Expand Up @@ -169,9 +168,7 @@ def test_astype_str_float(self):
tm.assert_frame_equal(result, expected)
result = DataFrame([1.12345678901234567890]).astype(str)

# < 1.14 truncates
# >= 1.14 preserves the full repr
val = "1.12345678901" if _np_version_under1p14 else "1.1234567890123457"
val = "1.1234567890123457"
expected = DataFrame([val])
tm.assert_frame_equal(result, expected)

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ requires = [
"setuptools",
"wheel",
"Cython>=0.29.16", # Note: sync with setup.py
"numpy==1.13.3; python_version=='3.6' and platform_system!='AIX'",
"numpy==1.14.5; python_version>='3.7' and platform_system!='AIX'",
"numpy==1.15.4; python_version=='3.6' and platform_system!='AIX'",
"numpy==1.15.4; python_version>='3.7' and platform_system!='AIX'",
"numpy==1.16.0; python_version=='3.6' and platform_system=='AIX'",
"numpy==1.16.0; python_version>='3.7' and platform_system=='AIX'",
]
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ipython>=7.11.1
jinja2
matplotlib>=2.2.2
numexpr>=2.6.8
scipy>=1.1
scipy>=1.2
numba>=0.46.0
beautifulsoup4>=4.6.0
html5lib
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def is_platform_mac():
return sys.platform == "darwin"


min_numpy_ver = "1.13.3"
min_numpy_ver = "1.15.4"
min_cython_ver = "0.29.16" # note: sync with pyproject.toml

try:
Expand Down

0 comments on commit 81093ba

Please sign in to comment.