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

Commit 5c87986

Browse files
Merge pull request #35 from IntelPython/master
Merge changes from SDC master
2 parents ea0ffed + e5ea29c commit 5c87986

20 files changed

Lines changed: 533 additions & 324 deletions

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ env:
1010
- NUMPY_VER=1.16
1111
- CONDA_PREFIX_PATH=$HOME/miniconda3
1212
matrix:
13-
- BUILD_MODE=package TEST_MODE=conda RUN_COVERAGE=False SDC_NP_MPI=1
14-
- BUILD_MODE=develop TEST_MODE=develop RUN_COVERAGE=True
13+
- BUILD_MODE=package TEST_MODE=conda RUN_COVERAGE=False SDC_CONFIG_PIPELINE_SDC=True
14+
- BUILD_MODE=package TEST_MODE=conda RUN_COVERAGE=False SDC_CONFIG_PIPELINE_SDC=True SDC_NP_MPI=1
15+
- BUILD_MODE=develop TEST_MODE=develop RUN_COVERAGE=True SDC_CONFIG_PIPELINE_SDC=True
1516

1617
before_install:
1718
- chmod 777 buildscripts/install_conda.sh

azure-pipelines.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
PYTHON_VER: '3.7'
1010
NUMPY_VER: '1.16'
1111
USE_NUMBA_MASTER: 'False'
12+
SDC_CONFIG_PIPELINE_SDC: 'False'
1213

1314
- template: buildscripts/azure/template-linux-macos.yml
1415
parameters:
@@ -20,6 +21,7 @@ jobs:
2021
PYTHON_VER: '3.7'
2122
NUMPY_VER: '1.16'
2223
USE_NUMBA_MASTER: 'False'
24+
SDC_CONFIG_PIPELINE_SDC: 'False'
2325

2426
- template: buildscripts/azure/template-linux-macos.yml
2527
parameters:
@@ -31,6 +33,7 @@ jobs:
3133
PYTHON_VER: '3.7'
3234
NUMPY_VER: '1.16'
3335
USE_NUMBA_MASTER: 'False'
36+
SDC_CONFIG_PIPELINE_SDC: 'False'
3437

3538
- template: buildscripts/azure/template-windows.yml
3639
parameters:
@@ -42,6 +45,7 @@ jobs:
4245
PYTHON_VER: '3.7'
4346
NUMPY_VER: '1.16'
4447
USE_NUMBA_MASTER: 'True'
48+
SDC_CONFIG_PIPELINE_SDC: 'False'
4549

4650
- template: buildscripts/azure/template-linux-macos.yml
4751
parameters:
@@ -53,6 +57,7 @@ jobs:
5357
PYTHON_VER: '3.7'
5458
NUMPY_VER: '1.16'
5559
USE_NUMBA_MASTER: 'True'
60+
SDC_CONFIG_PIPELINE_SDC: 'False'
5661

5762
- template: buildscripts/azure/template-linux-macos.yml
5863
parameters:
@@ -63,4 +68,5 @@ jobs:
6368
py3.7_numpy1.16:
6469
PYTHON_VER: '3.7'
6570
NUMPY_VER: '1.16'
66-
USE_NUMBA_MASTER: 'True'
71+
USE_NUMBA_MASTER: 'True'
72+
SDC_CONFIG_PIPELINE_SDC: 'False'

buildscripts/azure/template-linux-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
2323
- script: |
2424
if [ "$USE_NUMBA_MASTER" == "False" ]; then
25-
$HOME/miniconda3/bin/python buildscripts/build.py --build-mode=package --python=$PYTHON_VER --numpy=$NUMPY_VER --conda-prefix=$HOME/miniconda3;
25+
$HOME/miniconda3/bin/python buildscripts/build.py --build-mode=package --python=$PYTHON_VER --numpy=$NUMPY_VER --skip-smoke-tests --conda-prefix=$HOME/miniconda3;
2626
else
2727
$HOME/miniconda3/bin/python buildscripts/build.py --build-mode=package --python=$PYTHON_VER --numpy=$NUMPY_VER --use-numba-master --conda-prefix=$HOME/miniconda3;
2828
fi

buildscripts/azure/template-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- script: |
2323
IF "%USE_NUMBA_MASTER%" == "False" (
24-
"C:\\Miniconda\\python.exe" buildscripts\\build.py --build-mode=package --python=%PYTHON_VER% --numpy=%NUMPY_VER% --conda-prefix="C:\\Miniconda"
24+
"C:\\Miniconda\\python.exe" buildscripts\\build.py --build-mode=package --python=%PYTHON_VER% --numpy=%NUMPY_VER% --skip-smoke-tests --conda-prefix="C:\\Miniconda"
2525
) ELSE (
2626
"C:\\Miniconda\\python.exe" buildscripts\\build.py --build-mode=package --python=%PYTHON_VER% --numpy=%NUMPY_VER% --use-numba-master --conda-prefix="C:\\Miniconda")
2727
displayName: 'Build conda and wheel packages'

sdc/datatypes/hpat_pandas_series_functions.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2896,11 +2896,12 @@ def hpat_pandas_series_nunique_str_impl(self, dropna=True):
28962896
It is better to merge with Numeric branch
28972897
"""
28982898

2899-
str_set = set(self._data)
2900-
if dropna == False:
2901-
return len(str_set) - 1
2902-
else:
2903-
return len(str_set)
2899+
data = self._data
2900+
if dropna:
2901+
nan_mask = self.isna()
2902+
data = self._data[~nan_mask._data]
2903+
unique_values = set(data)
2904+
return len(unique_values)
29042905

29052906
return hpat_pandas_series_nunique_str_impl
29062907

@@ -2954,7 +2955,8 @@ def hpat_pandas_series_count(self, level=None):
29542955
if isinstance(self.data, StringArrayType):
29552956
def hpat_pandas_series_count_str_impl(self, level=None):
29562957

2957-
return len(self._data)
2958+
nan_mask = self.isna()
2959+
return numpy.sum(nan_mask._data == 0)
29582960

29592961
return hpat_pandas_series_count_str_impl
29602962

sdc/tests/test_basic.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
import sdc
3838
from sdc.tests.test_utils import (count_array_REPs, count_parfor_REPs,
3939
count_parfor_OneDs, count_array_OneDs, count_array_OneD_Vars,
40-
dist_IR_contains, get_rank, get_start_end, check_numba_version)
40+
dist_IR_contains, get_rank, get_start_end, check_numba_version,
41+
skip_numba_jit, TestCase)
4142

4243

4344
def get_np_state_ptr():
@@ -54,7 +55,7 @@ def _copy_py_state(r, ptr):
5455
return ints, index
5556

5657

57-
class BaseTest(unittest.TestCase):
58+
class BaseTest(TestCase):
5859

5960
def __init__(self, *args, **kwargs):
6061
super().__init__(*args, **kwargs)
@@ -214,6 +215,7 @@ def f():
214215
hpat_f = sdc.jit(f)
215216
hpat_f()
216217

218+
@skip_numba_jit
217219
def test_inline_locals(self):
218220
# make sure locals in inlined function works
219221
@sdc.jit(locals={'B': types.float64[:]})
@@ -250,6 +252,7 @@ def test_reduce(self):
250252
self.assertEqual(count_array_REPs(), 0)
251253
self.assertEqual(count_parfor_REPs(), 0)
252254

255+
@skip_numba_jit
253256
def test_reduce2(self):
254257
import sys
255258
dtypes = ['float32', 'float64', 'int32', 'int64']
@@ -277,6 +280,7 @@ def test_reduce2(self):
277280
self.assertEqual(count_array_REPs(), 0)
278281
self.assertEqual(count_parfor_REPs(), 0)
279282

283+
@skip_numba_jit
280284
def test_reduce_filter1(self):
281285
import sys
282286
dtypes = ['float32', 'float64', 'int32', 'int64']
@@ -306,6 +310,7 @@ def test_reduce_filter1(self):
306310
self.assertEqual(count_array_REPs(), 0)
307311
self.assertEqual(count_parfor_REPs(), 0)
308312

313+
@skip_numba_jit
309314
def test_array_reduce(self):
310315
binops = ['+=', '*=', '+=', '*=', '|=', '|=']
311316
dtypes = ['np.float32', 'np.float32', 'np.float64', 'np.float64', 'np.int32', 'np.int64']
@@ -365,6 +370,7 @@ def test_impl(N):
365370
self.assertEqual(count_array_OneDs(), 2)
366371
self.assertEqual(count_parfor_OneDs(), 2)
367372

373+
@skip_numba_jit
368374
def test_dist_input(self):
369375
def test_impl(A):
370376
return len(A)

sdc/tests/test_d4p.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@
3939
from sdc.tests.test_utils import (count_array_REPs, count_parfor_REPs,
4040
count_parfor_OneDs, count_array_OneDs,
4141
count_parfor_OneD_Vars, count_array_OneD_Vars,
42-
dist_IR_contains)
42+
dist_IR_contains,
43+
TestCase)
4344

44-
class TestD4P(unittest.TestCase):
45+
class TestD4P(TestCase):
4546
def test_logistic_regression(self):
4647
'''
4748
Testing logistic regression including

0 commit comments

Comments
 (0)