-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPS: drop numpy < 1.12 #23062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEPS: drop numpy < 1.12 #23062
Changes from 1 commit
22dab2d
a495db9
124d511
12b9a79
c8bfe66
b2cffb4
e9c407e
aac634d
f18880d
f81ad9f
c29b478
7ecc5f2
6e533e7
2ab7f55
7ca1753
9b85061
5b54612
708b2f6
a41ed9f
1e0c553
317e042
31dc4fa
ec93bdb
d20077a
925b555
b971bfb
93eabad
d72b547
e075eff
305f12b
752b5d7
9dc846a
e7f5bf2
169974b
5b45639
308e943
9be3d10
61763f6
ededd73
079bdaf
162458b
cdd497d
d8587a8
8e37179
d097b43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ dependencies: | |
- cython=0.28.2 | ||
- jinja2=2.8 | ||
- numexpr=2.4.4 # we test that we correctly don't use an unsupported numexpr | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did you remove code related this this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure where code related to this would be hiding? There was nothing in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
- numpy=1.9.3 | ||
- numpy=1.12.1 | ||
- openpyxl=2.5.5 | ||
- psycopg2 | ||
- pytables=3.2.2 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,8 +199,22 @@ Other Enhancements | |
|
||
Backwards incompatible API changes | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- A newly constructed empty :class:`DataFrame` with integer as the ``dtype`` will now only be cast to ``float64`` if ``index`` is specified (:issue:`22858`) | ||
|
||
.. _whatsnew_0240.api_breaking.deps: | ||
|
||
Dependencies have increased minimum versions | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
We have updated our minimum supported versions of dependencies (:issue:`21242`). | ||
We now require: | ||
|
||
+-----------------+-----------------+----------+---------------+ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove the issue part here it is not necessary |
||
| Package | Minimum Version | Required | Issue | | ||
+=================+=================+==========+===============+ | ||
| numpy | 1.12.0 | X | :issue:`21242`| | ||
+-----------------+-----------------+----------+---------------+ | ||
|
||
.. _whatsnew_0240.api_breaking.interval_values: | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,19 +9,16 @@ | |
# numpy versioning | ||
_np_version = np.__version__ | ||
_nlv = LooseVersion(_np_version) | ||
_np_version_under1p10 = _nlv < LooseVersion('1.10') | ||
_np_version_under1p11 = _nlv < LooseVersion('1.11') | ||
_np_version_under1p12 = _nlv < LooseVersion('1.12') | ||
_np_version_under1p13 = _nlv < LooseVersion('1.13') | ||
_np_version_under1p14 = _nlv < LooseVersion('1.14') | ||
_np_version_under1p15 = _nlv < LooseVersion('1.15') | ||
|
||
|
||
if _nlv < '1.9': | ||
if _nlv < '1.12': | ||
raise ImportError('this version of pandas is incompatible with ' | ||
'numpy < 1.9.0\n' | ||
'numpy < 1.12.0\n' | ||
'your numpy version is {0}.\n' | ||
'Please upgrade numpy to >= 1.9.0 to use ' | ||
'Please upgrade numpy to >= 1.12.0 to use ' | ||
'this pandas version'.format(_np_version)) | ||
|
||
|
||
|
@@ -43,9 +40,7 @@ def np_datetime64_compat(s, *args, **kwargs): | |
tz-changes in 1.11 that make '2015-01-01 09:00:00Z' show a deprecation | ||
warning, when need to pass '2015-01-01 09:00:00' | ||
""" | ||
|
||
if not _np_version_under1p11: | ||
s = tz_replacer(s) | ||
s = tz_replacer(s) | ||
return np.datetime64(s, *args, **kwargs) | ||
|
||
|
||
|
@@ -56,23 +51,17 @@ def np_array_datetime64_compat(arr, *args, **kwargs): | |
tz-changes in 1.11 that make '2015-01-01 09:00:00Z' show a deprecation | ||
warning, when need to pass '2015-01-01 09:00:00' | ||
""" | ||
|
||
if not _np_version_under1p11: | ||
|
||
# is_list_like | ||
if hasattr(arr, '__iter__') and not \ | ||
isinstance(arr, string_and_binary_types): | ||
arr = [tz_replacer(s) for s in arr] | ||
else: | ||
arr = tz_replacer(arr) | ||
# is_list_like | ||
if hasattr(arr, '__iter__') and not \ | ||
isinstance(arr, string_and_binary_types): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you do this without the backslash? |
||
arr = [tz_replacer(s) for s in arr] | ||
else: | ||
arr = tz_replacer(arr) | ||
|
||
return np.array(arr, *args, **kwargs) | ||
|
||
|
||
__all__ = ['np', | ||
'_np_version_under1p10', | ||
'_np_version_under1p11', | ||
'_np_version_under1p12', | ||
'_np_version_under1p13', | ||
'_np_version_under1p14', | ||
'_np_version_under1p15' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
import pandas as pd | ||
from pandas.util import testing as tm | ||
from pandas import (Series, period_range, DatetimeIndex, PeriodIndex, | ||
DataFrame, _np_version_under1p12, Period) | ||
DataFrame, Period) | ||
|
||
|
||
class TestPeriodIndex(object): | ||
|
@@ -68,16 +68,15 @@ def test_range_slice_day(self): | |
didx = DatetimeIndex(start='2013/01/01', freq='D', periods=400) | ||
pidx = PeriodIndex(start='2013/01/01', freq='D', periods=400) | ||
|
||
# changed to TypeError in 1.12 | ||
# exception changed to TypeError in 1.12 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can remove this comment and the issue refernce |
||
# https://github.com/numpy/numpy/pull/6271 | ||
exc = IndexError if _np_version_under1p12 else TypeError | ||
|
||
for idx in [didx, pidx]: | ||
# slices against index should raise IndexError | ||
values = ['2014', '2013/02', '2013/01/02', '2013/02/01 9H', | ||
'2013/02/01 09:00'] | ||
for v in values: | ||
with pytest.raises(exc): | ||
with pytest.raises(TypeError): | ||
idx[v:] | ||
|
||
s = Series(np.random.rand(len(idx)), index=idx) | ||
|
@@ -89,7 +88,7 @@ def test_range_slice_day(self): | |
|
||
invalid = ['2013/02/01 9H', '2013/02/01 09:00'] | ||
for v in invalid: | ||
with pytest.raises(exc): | ||
with pytest.raises(TypeError): | ||
idx[v:] | ||
|
||
def test_range_slice_seconds(self): | ||
|
@@ -98,16 +97,15 @@ def test_range_slice_seconds(self): | |
periods=4000) | ||
pidx = PeriodIndex(start='2013/01/01 09:00:00', freq='S', periods=4000) | ||
|
||
# changed to TypeError in 1.12 | ||
# exception changed to TypeError in 1.12 | ||
# https://github.com/numpy/numpy/pull/6271 | ||
exc = IndexError if _np_version_under1p12 else TypeError | ||
|
||
for idx in [didx, pidx]: | ||
# slices against index should raise IndexError | ||
values = ['2014', '2013/02', '2013/01/02', '2013/02/01 9H', | ||
'2013/02/01 09:00'] | ||
for v in values: | ||
with pytest.raises(exc): | ||
with pytest.raises(TypeError): | ||
idx[v:] | ||
|
||
s = Series(np.random.rand(len(idx)), index=idx) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the code / docs point to 1.12.0 but this is 1.12.1 - any reason for the minor version bump here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, that was an oversight...