Skip to content

TST: xfail some bottleneck on windows #16240

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

Merged
merged 2 commits into from
May 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/requirements-3.6_WIN.run
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
python-dateutil
pytz
numpy=1.12*
bottleneck
openpyxl
xlsxwriter
xlrd
Expand Down
39 changes: 30 additions & 9 deletions pandas/tests/series/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import pandas.core.nanops as nanops

from pandas.compat import lrange, range
from pandas.compat import lrange, range, is_platform_windows
from pandas import compat
from pandas.util.testing import (assert_series_equal, assert_almost_equal,
assert_frame_equal, assert_index_equal)
Expand All @@ -28,6 +28,10 @@
from .common import TestData


skip_if_bottleneck_on_windows = (is_platform_windows() and
nanops._USE_BOTTLENECK)


class TestSeriesAnalytics(TestData):

def test_sum_zero(self):
Expand Down Expand Up @@ -64,14 +68,6 @@ def test_overflow(self):
result = s.max(skipna=False)
assert int(result) == v[-1]

# use bottleneck if available
result = s.sum()
assert int(result) == v.sum(dtype='int64')
result = s.min()
assert int(result) == 0
result = s.max()
assert int(result) == v[-1]

for dtype in ['float32', 'float64']:
v = np.arange(5000000, dtype=dtype)
s = Series(v)
Expand All @@ -84,6 +80,28 @@ def test_overflow(self):
result = s.max(skipna=False)
assert np.allclose(float(result), v[-1])

@pytest.mark.xfail(
skip_if_bottleneck_on_windows,
reason="buggy bottleneck with sum overflow on windows")
def test_overflow_with_bottleneck(self):
# GH 6915
# overflowing on the smaller int dtypes
for dtype in ['int32', 'int64']:
v = np.arange(5000000, dtype=dtype)
s = Series(v)

# use bottleneck if available
result = s.sum()
assert int(result) == v.sum(dtype='int64')
result = s.min()
assert int(result) == 0
result = s.max()
assert int(result) == v[-1]

for dtype in ['float32', 'float64']:
v = np.arange(5000000, dtype=dtype)
s = Series(v)

# use bottleneck if available
result = s.sum()
assert result == v.sum(dtype=dtype)
Expand All @@ -92,6 +110,9 @@ def test_overflow(self):
result = s.max()
assert np.allclose(float(result), v[-1])

@pytest.mark.xfail(
skip_if_bottleneck_on_windows,
reason="buggy bottleneck with sum overflow on windows")
def test_sum(self):
self._check_stat_op('sum', np.sum, check_allna=True)

Expand Down