Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit 287d783

Browse files
Move to pandas=1.2.0 (#959)
* Move to pandas=1.2.0 Motivation: use latest versions of dependencies. * More failed tests are fixed * Fixing doc build
1 parent 7524c59 commit 287d783

9 files changed

Lines changed: 46 additions & 31 deletions

File tree

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ Distribution includes Intel® SDC for Python 3.6 and Python 3.7 for Windows and
3434

3535
Intel® SDC conda package can be installed using the steps below::
3636

37-
> conda create -n sdc-env python=<3.7 or 3.6> pyarrow=0.17.0 pandas=1.0.5 -c anaconda -c conda-forge
37+
> conda create -n sdc-env python=<3.7 or 3.6> pyarrow=0.17.0 pandas=1.2.0 -c anaconda -c conda-forge
3838
> conda activate sdc-env
3939
> conda install sdc -c intel/label/beta -c intel -c defaults -c conda-forge --override-channels
4040

4141
Intel® SDC wheel package can be installed using the steps below::
4242

43-
> conda create -n sdc-env python=<3.7 or 3.6> pip pyarrow=0.17.0 pandas=1.0.5 -c anaconda -c conda-forge
43+
> conda create -n sdc-env python=<3.7 or 3.6> pip pyarrow=0.17.0 pandas=1.2.0 -c anaconda -c conda-forge
4444
> conda activate sdc-env
4545
> pip install --index-url https://pypi.anaconda.org/intel/label/beta/simple --extra-index-url https://pypi.anaconda.org/intel/simple --extra-index-url https://pypi.org/simple sdc
4646

@@ -82,7 +82,7 @@ Building on Linux with setuptools
8282

8383
export PYVER=<3.6 or 3.7>
8484
export NUMPYVER=<1.16 or 1.17>
85-
conda create -n sdc-env -q -y -c intel/label/beta -c defaults -c intel -c conda-forge python=$PYVER numpy=$NUMPYVER tbb-devel tbb4py numba=0.52 pandas=1.0.5 pyarrow=0.17.0 gcc_linux-64 gxx_linux-64
85+
conda create -n sdc-env -q -y -c intel/label/beta -c defaults -c intel -c conda-forge python=$PYVER numpy=$NUMPYVER tbb-devel tbb4py numba=0.52 pandas=1.2.0 pyarrow=0.17.0 gcc_linux-64 gxx_linux-64
8686
source activate sdc-env
8787
git clone https://github.com/IntelPython/sdc.git
8888
cd sdc
@@ -120,7 +120,7 @@ Building on Windows with setuptools
120120

121121
set PYVER=<3.6 or 3.7>
122122
set NUMPYVER=<1.16 or 1.17>
123-
conda create -n sdc-env -c intel/label/beta -c defaults -c intel -c conda-forge python=%PYVER% numpy=%NUMPYVER% tbb-devel tbb4py numba=0.52 pandas=1.0.5 pyarrow=0.17.0
123+
conda create -n sdc-env -c intel/label/beta -c defaults -c intel -c conda-forge python=%PYVER% numpy=%NUMPYVER% tbb-devel tbb4py numba=0.52 pandas=1.2.0 pyarrow=0.17.0
124124
conda activate sdc-env
125125
set INCLUDE=%INCLUDE%;%CONDA_PREFIX%\Library\include
126126
set LIB=%LIB%;%CONDA_PREFIX%\Library\lib

conda-recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set NUMBA_VERSION = "==0.52.0" %}
2-
{% set PANDAS_VERSION = "==1.0.5" %}
2+
{% set PANDAS_VERSION = "==1.2.0" %}
33
{% set PYARROW_VERSION = "==0.17.0" %}
44

55
package:

docs/source/_templates/_api_ref.pandas.window_templ.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ Exponentially-weighted moving window functions
5151
----------------------------------------------
5252

5353
.. sdc_toctree
54-
EWM.mean
55-
EWM.std
56-
EWM.var
57-
EWM.corr
58-
EWM.cov
54+
ewm.ExponentialMovingWindow.mean
55+
ewm.ExponentialMovingWindow.std
56+
ewm.ExponentialMovingWindow.var
57+
ewm.ExponentialMovingWindow.corr
58+
ewm.ExponentialMovingWindow.cov

docs/source/getting_started.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ Distribution includes Intel SDC for Python 3.6 and 3.7 for Windows and Linux pla
4141
Intel SDC conda package can be installed using the steps below:
4242
::
4343

44-
> conda create -n sdc_env python=<3.7 or 3.6> pyarrow=0.17.0 pandas=0.25.3 -c anaconda -c conda-forge
44+
> conda create -n sdc_env python=<3.7 or 3.6> pyarrow=0.17.0 pandas=1.2.0 -c anaconda -c conda-forge
4545
> conda activate sdc_env
4646
> conda install sdc -c intel/label/beta -c intel -c defaults -c conda-forge --override-channels
4747

4848
Intel SDC wheel package can be installed using the steps below:
4949
::
5050

51-
> conda create -n sdc_env python=<3.7 or 3.6> pip pyarrow=0.17.0 pandas=0.25.3 -c anaconda -c conda-forge
51+
> conda create -n sdc_env python=<3.7 or 3.6> pip pyarrow=0.17.0 pandas=1.2.0 -c anaconda -c conda-forge
5252
> conda activate sdc_env
5353
> pip install --index-url https://pypi.anaconda.org/intel/label/beta/simple --extra-index-url https://pypi.anaconda.org/intel/simple --extra-index-url https://pypi.org/simple sdc
5454

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
numpy>=1.16
2-
pandas==1.0.5
2+
pandas==1.2.0
33
pyarrow==0.17.0
44
numba==0.52.0
55
tbb

sdc/datatypes/hpat_pandas_series_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ def sdc_pandas_series_setitem_idx_int_series_align_impl(self, idx, value):
776776
raise ValueError("Reindexing only valid with uniquely valued Index objects")
777777

778778
if len(valid_indices_masked) != idx_size:
779-
raise ValueError("Reindexing not possible: idx has index not found in Series")
779+
raise KeyError("Reindexing not possible: idx has index not found in Series")
780780

781781
if value_is_scalar == True: # noqa
782782
self._data[valid_indices_positions] = _value
@@ -810,7 +810,7 @@ def sdc_pandas_series_setitem_idx_str_series_align_impl(self, idx, value):
810810
set_positions[i] = map_index_to_position[index_value]
811811

812812
if number_of_found != idx_data_size:
813-
raise ValueError("Reindexing not possible: idx has index not found in Series")
813+
raise KeyError("Reindexing not possible: idx has index not found in Series")
814814

815815
if value_is_series == True: # noqa
816816
self._data[set_positions] = value._data

sdc/tests/test_rolling.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,6 @@ def test_impl(df, other, pairwise):
11491149
hpat_func(df, other, True)
11501150
self.assertIn(msg_tmpl.format('False, None'), str(raises.exception))
11511151

1152-
@unittest.expectedFailure
11531152
def test_df_rolling_cov_issue_floating_point_rounding(self):
11541153
"""
11551154
Cover issue of different float rounding in Python and SDC/Numba:

sdc/tests/test_series.py

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,16 +2138,26 @@ def test_series_value_counts_numeric_dropna_false(self):
21382138
def test_impl(S):
21392139
return S.value_counts(dropna=False)
21402140

2141-
data_to_test = [[1, 2, 3, 1, 1, 3],
2142-
[1, 2, 3, np.nan, 1, 3, np.nan, np.inf],
2143-
[0.1, 3., np.nan, 3., 0.1, 3., np.nan, np.inf, 0.1, 0.1]]
2141+
data_to_test = [
2142+
[1, 2, 3, 1, 1, 3],
2143+
[1, 2, 3, np.nan, 1, 3, np.nan, np.inf],
2144+
[0.1, 3., np.nan, 3., 0.1, 3., np.nan, np.inf, 0.1, 0.1]
2145+
]
21442146

21452147
hpat_func = self.jit(test_impl)
21462148

21472149
for data in data_to_test:
21482150
with self.subTest(series_data=data):
21492151
S = pd.Series(data)
2150-
pd.testing.assert_series_equal(hpat_func(S), test_impl(S))
2152+
result = hpat_func(S)
2153+
result_ref = test_impl(S)
2154+
2155+
# order within groups of same counts may be different since
2156+
# pandas impl uses sort_values() with default kind='quicksort'
2157+
pd.testing.assert_series_equal(
2158+
result.sort_index(),
2159+
result_ref.sort_index()
2160+
)
21512161

21522162
def test_series_value_counts_str_dropna_false(self):
21532163
def test_impl(S):
@@ -3933,7 +3943,10 @@ def test_impl_non_literal_kind(A, param_value):
39333943
np.unique(np.random.randint(0, 100, n)),
39343944
['ac', 'c', 'cb', 'ca', None, 'da', 'cc', 'ddd', 'd']
39353945
]
3936-
kind_values = ['quicksort', 'mergesort']
3946+
kind_values = [
3947+
'quicksort',
3948+
'mergesort'
3949+
]
39373950
for data in data_to_test:
39383951
S = pd.Series(data=data)
39393952
for kind in kind_values:
@@ -4013,6 +4026,7 @@ def test_impl(series, ascending, kind):
40134026
np.testing.assert_array_equal(ref_result.data, jit_result.data)
40144027
self.assertEqual(ref, jit)
40154028

4029+
@skip_numba_jit("BUG: sort with kind=mergesort, ascending=False not stable for string data (SAT-3828)")
40164030
def test_series_sort_values_full_unicode4(self):
40174031
def test_impl(series, ascending, kind):
40184032
return series.sort_values(axis=0, ascending=ascending, kind=literally(kind), na_position='last')
@@ -4023,17 +4037,17 @@ def test_impl(series, ascending, kind):
40234037

40244038
for data in all_data:
40254039
series = pd.Series(data * 3)
4026-
for ascending in [True, False]:
4027-
for kind in ['quicksort', 'mergesort']:
4028-
ref_result = test_impl(series, ascending, kind=kind)
4029-
jit_result = hpat_func(series, ascending, kind=kind)
4030-
ref = restore_series_sort_values(series, ref_result.index, ascending)
4031-
jit = restore_series_sort_values(series, jit_result.index, ascending)
4040+
for ascending, kind in product([True, False], ['quicksort', 'mergesort']):
4041+
with self.subTest(data=data, ascending=ascending, kind=kind):
4042+
result = hpat_func(series, ascending, kind=kind)
4043+
result_ref = test_impl(series, ascending, kind=kind)
40324044
if kind == 'mergesort':
4033-
pd.testing.assert_series_equal(ref_result, jit_result)
4045+
pd.testing.assert_series_equal(result, result_ref)
40344046
else:
4035-
np.testing.assert_array_equal(ref_result.values, jit_result.values)
4036-
self.assertEqual(ref, jit)
4047+
np.testing.assert_array_equal(result.values, result_ref.values)
4048+
jit = restore_series_sort_values(series, result.index, ascending)
4049+
ref = restore_series_sort_values(series, result_ref.index, ascending)
4050+
self.assertEqual(jit, ref)
40374051

40384052
@skip_parallel
40394053
def test_series_sort_values_full_idx(self):
@@ -5316,6 +5330,7 @@ def test_impl(A, i, value):
53165330
test_impl(S2, idx, value)
53175331
pd.testing.assert_series_equal(S1, S2)
53185332

5333+
@unittest.expectedFailure # FIXME_Pandas#37427 (since pandas=1.1 setitem does diff things for diff dtypes)
53195334
def test_series_setitem_idx_str_series(self):
53205335
""" Verifies Series.setitem for idx operand of type pandas.Series and string dtype called on
53215336
integer Series with index of matching dtype and scalar and non scalar assigned values """
@@ -5331,6 +5346,7 @@ def test_series_setitem_idx_str_series(self):
53315346
pd.Series(assigned_values)]
53325347
self._test_series_setitem([series_data], [series_index], [idx], values_to_test, np.intp)
53335348

5349+
@unittest.expectedFailure # FIXME_Pandas#37427 (since pandas=1.1 setitem does diff things for diff dtypes)
53345350
def test_series_setitem_idx_float_series(self):
53355351
""" Verifies Series.setitem for idx operand of type pandas.Series and float dtype called on
53365352
integer Series with index of matching dtype and scalar and non scalar assigned values """

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ def run(self):
375375
package_data={'sdc.tests': ['*.bz2'], },
376376
install_requires=[
377377
'numpy>=1.16',
378-
'pandas>=1.0',
378+
'pandas>=1.2.0',
379379
'pyarrow==0.17.0',
380380
'numba>=0.52.0,<0.53',
381381
'tbb'

0 commit comments

Comments
 (0)