Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.
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
12 changes: 6 additions & 6 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# configuration file used by run_coverage.py
[run]
branch = True
source = hpat
source = sdc
concurrency = multiprocessing
parallel = True

[report]

omit =
hpat/ml/*
hpat/xenon_ext.py
hpat/ros.py
hpat/cv_ext.py
hpat/tests/*
sdc/ml/*
sdc/xenon_ext.py
sdc/ros.py
sdc/cv_ext.py
sdc/tests/*
14 changes: 7 additions & 7 deletions buildscripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

def run_smoke_tests(sdc_src, test_env_activate):
sdc_pi_example = os.path.join(sdc_src, 'buildscripts', 'sdc_pi_example.py')
run_command(f'{test_env_activate} && python -c "import hpat"')
run_command(f'{test_env_activate} && python -c "import sdc"')
run_command(f'{test_env_activate} && python {sdc_pi_example}')


Expand Down Expand Up @@ -104,13 +104,13 @@ def run_smoke_tests(sdc_src, test_env_activate):
os.chdir(../sdc_src) is a workaround for the following error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "hpat/hpat/__init__.py", line 9, in <module>
import hpat.dict_ext
File "hpat/hpat/dict_ext.py", line 12, in <module>
from hpat.str_ext import string_type, gen_unicode_to_std_str, gen_std_str_to_unicode
File "hpat/hpat/str_ext.py", line 18, in <module>
File "sdc/sdc/__init__.py", line 9, in <module>
import sdc.dict_ext
File "sdc/sdc/dict_ext.py", line 12, in <module>
from sdc.str_ext import string_type, gen_unicode_to_std_str, gen_std_str_to_unicode
File "sdc/sdc/str_ext.py", line 18, in <module>
from . import hstr_ext
ImportError: cannot import name 'hstr_ext' from 'hpat' (hpat/hpat/__init__.py)
ImportError: cannot import name 'hstr_ext' from 'sdc' (sdc/sdc/__init__.py)
"""
os.chdir(os.path.dirname(sdc_src))

Expand Down
8 changes: 4 additions & 4 deletions buildscripts/sdc-conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% set ARROW_CPP_VERSION = "==0.15.0" %}

package:
name: hpat
name: sdc
version: {{ GIT_DESCRIBE_TAG }}

source:
Expand Down Expand Up @@ -58,13 +58,13 @@ test:
- h5py
- scipy
imports:
- hpat
- sdc

outputs:
- type: conda
name: hpat
name: sdc
- type: wheel
name: hpat
name: sdc
requirements:
build:
- {{ compiler('c') }}
Expand Down
6 changes: 3 additions & 3 deletions buildscripts/sdc-conda-recipe/run_test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ set NUMBA_DEVELOPER_MODE=1
set NUMBA_DISABLE_ERROR_MESSAGE_HIGHLIGHTING=1
set PYTHONFAULTHANDLER=1

python -m hpat.tests.gen_test_data
python -m sdc.tests.gen_test_data
if errorlevel 1 exit 1

@rem TODO investigate root cause of NumbaPerformanceWarning
@rem http://numba.pydata.org/numba-doc/latest/user/parallel.html#diagnostics
IF "%SDC_NP_MPI%" == "" (
python -W ignore -u -m hpat.runtests -v
python -W ignore -u -m sdc.runtests -v
) ELSE (
mpiexec -localonly -n %SDC_NP_MPI% python -W ignore -u -m hpat.runtests -v)
mpiexec -localonly -n %SDC_NP_MPI% python -W ignore -u -m sdc.runtests -v)
if errorlevel 1 exit 1

REM Link check for Documentation using Sphinx's in-built linkchecker
Expand Down
6 changes: 3 additions & 3 deletions buildscripts/sdc-conda-recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ export NUMBA_DEVELOPER_MODE=1
export NUMBA_DISABLE_ERROR_MESSAGE_HIGHLIGHTING=1
export PYTHONFAULTHANDLER=1

python -m hpat.tests.gen_test_data
python -m sdc.tests.gen_test_data

#Link check for Documentation using Sphinx's in-built linkchecker
#sphinx-build -b linkcheck -j1 usersource _build/html

# TODO investigate root cause of NumbaPerformanceWarning
# http://numba.pydata.org/numba-doc/latest/user/parallel.html#diagnostics
if [ -z "$SDC_NP_MPI" ]; then
python -W ignore -u -m hpat.runtests -v
python -W ignore -u -m sdc.runtests -v
else
mpiexec -n $SDC_NP_MPI python -W ignore -u -m hpat.runtests -v
mpiexec -n $SDC_NP_MPI python -W ignore -u -m sdc.runtests -v
fi
4 changes: 2 additions & 2 deletions buildscripts/sdc_pi_example.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import hpat
import sdc
import numpy as np
import time


@hpat.jit
@sdc.jit
def calc_pi(n):
t1 = time.time()
x = 2 * np.random.ranf(n) - 1
Expand Down
26 changes: 13 additions & 13 deletions buildscripts/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
os.environ['PYTHONPATH'] = '.'
os.environ['HDF5_DIR'] = conda_prefix
try:
run_command(f'{develop_env_activate} && python -m hpat.tests.gen_test_data && coverage erase && coverage run -m hpat.runtests && coveralls -v')
run_command(f'{develop_env_activate} && python -m sdc.tests.gen_test_data && coverage erase && coverage run -m sdc.runtests && coveralls -v')
except:
format_print('Coverage fails')
print(traceback.format_exc())
Expand All @@ -85,13 +85,13 @@
os.chdir(../sdc_src) is a workaround for the following error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "hpat/hpat/__init__.py", line 9, in <module>
import hpat.dict_ext
File "hpat/hpat/dict_ext.py", line 12, in <module>
from hpat.str_ext import string_type, gen_unicode_to_std_str, gen_std_str_to_unicode
File "hpat/hpat/str_ext.py", line 18, in <module>
File "sdc/sdc/__init__.py", line 9, in <module>
import sdc.dict_ext
File "sdc/sdc/dict_ext.py", line 12, in <module>
from sdc.str_ext import string_type, gen_unicode_to_std_str, gen_std_str_to_unicode
File "sdc/sdc/str_ext.py", line 18, in <module>
from . import hstr_ext
ImportError: cannot import name 'hstr_ext' from 'hpat' (hpat/hpat/__init__.py)
ImportError: cannot import name 'hstr_ext' from 'sdc' (sdc/sdc/__init__.py)
"""
os.chdir(os.path.dirname(sdc_src))
run_command(f'{develop_env_activate} && {test_script}')
Expand Down Expand Up @@ -119,13 +119,13 @@
os.chdir(../sdc_src) is a workaround for the following error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "hpat/hpat/__init__.py", line 9, in <module>
import hpat.dict_ext
File "hpat/hpat/dict_ext.py", line 12, in <module>
from hpat.str_ext import string_type, gen_unicode_to_std_str, gen_std_str_to_unicode
File "hpat/hpat/str_ext.py", line 18, in <module>
File "sdc/sdc/__init__.py", line 9, in <module>
import sdc.dict_ext
File "sdc/sdc/dict_ext.py", line 12, in <module>
from sdc.str_ext import string_type, gen_unicode_to_std_str, gen_std_str_to_unicode
File "sdc/sdc/str_ext.py", line 18, in <module>
from . import hstr_ext
ImportError: cannot import name 'hstr_ext' from 'hpat' (hpat/hpat/__init__.py)
ImportError: cannot import name 'hstr_ext' from 'sdc' (sdc/sdc/__init__.py)
"""
os.chdir(os.path.dirname(sdc_src))
sdc_packages = get_sdc_build_packages(build_folder)
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def get_sdc_build_packages(build_output):
sdc_build_dir = os.path.join(build_output, os_dir)
for item in os.listdir(sdc_build_dir):
item_path = os.path.join(sdc_build_dir, item)
if os.path.isfile(item_path) and re.search(r'^hpat.*\.tar\.bz2$|^hpat.*\.whl$', item):
if os.path.isfile(item_path) and re.search(r'^sdc.*\.tar\.bz2$|^sdc.*\.whl$', item):
sdc_packages.append(item_path)

return sdc_packages
Expand Down
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@

if not sdc_doc_no_api_ref:
try:
import hpat # TODO: Rename hpat module name to sdc
import sdc # TODO: Rename hpat module name to sdc
except ImportError:
print('IMPORT EXCEPTION: Cannot import hpat. ')
print('IMPORT EXCEPTION: Cannot import sdc. ')
print('Documentation generator for API Reference for a given module expects that module '
'to be installed. Use conda/pip install hpat to install it prior to using API Reference generation')
print('If you want to disable API Reference generation, set the environment variable SDC_DOC_NO_API_REF=1')
Expand Down Expand Up @@ -214,7 +214,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'hpat', 'HPAT Documentation',
(master_doc, 'sdc', 'HPAT Documentation',
[author], 1)
]

Expand Down
4 changes: 2 additions & 2 deletions docs/source/sdc2pd_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import os
import glob
import hpat # TODO: Rename hpat module name to sdc
import sdc # TODO: Rename hpat module name to sdc

# *****************************************************************************************************
# *** PARSER CONFIGURATION ***
Expand Down Expand Up @@ -139,7 +139,7 @@ def parse_file(fname):


# Get path to SDC module installed
sdc_path = os.path.dirname(hpat.__file__) # TODO: Change hpat to sdc
sdc_path = os.path.dirname(sdc.__file__) # TODO: Change hpat to sdc
sdc_datatypes_path = os.path.join(sdc_path, "datatypes")
sdc_datatypes_pathname_mask = os.path.join(sdc_datatypes_path, "*.py")

Expand Down
6 changes: 3 additions & 3 deletions examples/Basic_DataFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@

import pandas as pd
import numpy as np
import hpat
import sdc


@hpat.jit
@sdc.jit
def merge_df(n):
df1 = pd.DataFrame({'key1': np.arange(n), 'A': np.arange(n) + 1.0})
df2 = pd.DataFrame({'key2': n - np.arange(n), 'B': n + np.arange(n) + 1.0})
df3 = pd.merge(df1, df2, left_on='key1', right_on='key2')
return df3


@hpat.jit
@sdc.jit
def concat_df(n):
df1 = pd.DataFrame({'key1': np.arange(n), 'A': np.arange(n) + 1.0})
df2 = pd.DataFrame({'key2': n - np.arange(n), 'A': n + np.arange(n) + 2.0})
Expand Down
4 changes: 2 additions & 2 deletions examples/accel_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
import numpy as np
import time
import pandas as pd
import hpat
import sdc


@hpat.jit
@sdc.jit
def accel_infer(n):

t1 = time.time()
Expand Down
6 changes: 3 additions & 3 deletions examples/d4p_kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@

import daal4py
import daal4py.hpat
import hpat
import sdc
import numpy as np


@hpat.jit(nopython=True)
@sdc.jit(nopython=True)
def kmeans(N, D, nClusters, maxit):
a = np.random.ranf((N, D)) # doesn't make much sense, but ok for now
kmi = daal4py.kmeans_init(nClusters, method='plusPlusDense')
Expand All @@ -42,4 +42,4 @@ def kmeans(N, D, nClusters, maxit):

print(kmeans(10000, 20, 2, 30))

hpat.distribution_report()
sdc.distribution_report()
8 changes: 4 additions & 4 deletions examples/d4p_linreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@

import daal4py
import daal4py.hpat
import hpat
import sdc
import numpy as np


@hpat.jit
@sdc.jit
def lr_predict(N, D, model):
data = np.random.ranf((N / 2, D))
return daal4py.linear_regression_prediction().compute(data, model)


@hpat.jit
@sdc.jit
def lr_train(N, D):
data = np.random.ranf((N, D))
gt = np.random.ranf((N, 2))
Expand All @@ -49,4 +49,4 @@ def lr_train(N, D):

print(p_res.prediction[0], t_res.model.NumberOfBetas)

hpat.distribution_report()
sdc.distribution_report()
6 changes: 3 additions & 3 deletions examples/hiframes_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

import pandas as pd
import numpy as np
import hpat
import sdc


@hpat.jit
@sdc.jit
def concat_df(n):
df1 = pd.DataFrame({'key1': np.arange(n), 'A': np.arange(n) + 1.0})
df2 = pd.DataFrame({'key2': n - np.arange(n), 'A': n + np.arange(n) + 1.0})
Expand All @@ -40,4 +40,4 @@ def concat_df(n):

n = 10
print(concat_df(n))
# hpat.distribution_report()
# sdc.distribution_report()
6 changes: 3 additions & 3 deletions examples/hiframes_cumsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

import pandas as pd
import numpy as np
import hpat
import sdc


@hpat.jit
@sdc.jit
def cumsum_df(n):
df = pd.DataFrame({'A': np.arange(n) + 1.0, 'B': np.random.ranf(n)})
Ac = df.A.cumsum()
Expand All @@ -39,4 +39,4 @@ def cumsum_df(n):

n = 10
print(cumsum_df(n))
hpat.distribution_report()
sdc.distribution_report()
4 changes: 2 additions & 2 deletions examples/hiframes_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

import pandas as pd
import numpy as np
import hpat
import sdc


@hpat.jit
@sdc.jit
def filter_df(n):
df = pd.DataFrame({'A': np.random.ranf(n), 'B': np.random.ranf(n)})
df1 = df[df.A > .5]
Expand Down
4 changes: 2 additions & 2 deletions examples/hiframes_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

import pandas as pd
import numpy as np
import hpat
import sdc


@hpat.jit
@sdc.jit
def merge_df(n):
df1 = pd.DataFrame({'key1': np.arange(n), 'A': np.arange(n) + 1.0})
df2 = pd.DataFrame({'key2': n - np.arange(n), 'B': n + np.arange(n) + 1.0})
Expand Down
4 changes: 2 additions & 2 deletions examples/hiframes_pivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

import pandas as pd
import numpy as np
import hpat
import sdc


@hpat.jit(pivots={'pt': ['small', 'large']})
@sdc.jit(pivots={'pt': ['small', 'large']})
def df_pivot(df):
pt = df.pivot_table(index='A', columns='C', values='D', aggfunc='sum')
print(pt.small.values)
Expand Down
Loading