From a81b1e0673d39f156b1c07b6a2c5b0b4d292393d Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Thu, 4 May 2017 17:03:12 -0400 Subject: [PATCH 1/2] CI: add bottleneck for 3.6 on windows --- ci/requirements-3.6_WIN.run | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/requirements-3.6_WIN.run b/ci/requirements-3.6_WIN.run index 840d2867e9297..899bfbc6b6b23 100644 --- a/ci/requirements-3.6_WIN.run +++ b/ci/requirements-3.6_WIN.run @@ -1,6 +1,7 @@ python-dateutil pytz numpy=1.12* +bottleneck openpyxl xlsxwriter xlrd From 6055a72bef8bf70b690ead11e6447f1a612171a4 Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Thu, 4 May 2017 17:26:38 -0400 Subject: [PATCH 2/2] TST: xfail some bottleneck tests on windows xref https://github.com/pandas-dev/pandas/issues/16049#issuecomment-299298192 --- pandas/tests/series/test_analytics.py | 39 ++++++++++++++++++++------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/pandas/tests/series/test_analytics.py b/pandas/tests/series/test_analytics.py index 257f992f57f6d..ec6a118ec3639 100644 --- a/pandas/tests/series/test_analytics.py +++ b/pandas/tests/series/test_analytics.py @@ -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) @@ -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): @@ -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) @@ -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) @@ -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)