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

Commit 5eb69c8

Browse files
author
Ehsan Totoni
committed
fix C extension namespace and use relative import to fix setup.py install
1 parent 90a524c commit 5eb69c8

20 files changed

Lines changed: 43 additions & 43 deletions

hpat/config.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
try:
2-
import hpat.io
3-
import hpat.io._hdf5
2+
from .io import _hdf5
43
except ImportError:
54
_has_h5py = False
65
else:
@@ -14,22 +13,22 @@
1413
_has_pyarrow = True
1514

1615
try:
17-
import ros_cpp
16+
from . import ros_cpp
1817
except ImportError:
1918
_has_ros = False
2019
else:
2120
_has_ros = True
2221

2322
try:
24-
import cv_wrapper
23+
from . import cv_wrapper
2524
except ImportError:
2625
_has_opencv = False
2726
else:
2827
_has_opencv = True
2928
import hpat.cv_ext
3029

3130
try:
32-
import hxe_ext
31+
from . import hxe_ext
3332
except ImportError:
3433
_has_xenon = False
3534
else:

hpat/cv_ext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from llvmlite import ir as lir
1515
import llvmlite.binding as ll
16-
import cv_wrapper
16+
from . import cv_wrapper
1717
ll.add_symbol('cv_imread', cv_wrapper.cv_imread)
1818
ll.add_symbol('cv_resize', cv_wrapper.cv_resize)
1919
ll.add_symbol('cv_imdecode', cv_wrapper.cv_imdecode)

hpat/dict_ext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from numba import cgutils
1414
from llvmlite import ir as lir
1515
import llvmlite.binding as ll
16-
import hdict_ext
16+
from . import hdict_ext
1717
from hpat.utils import unliteral_all
1818

1919
ll_voidp = lir.IntType(8).as_pointer()

hpat/distributed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ def _run_call_df(self, lhs, df, func_name, assign, args):
958958
# nodes.append(print_node)
959959

960960
# TODO: fix lazy IO load
961-
import hio
961+
from . import hio
962962
import llvmlite.binding as ll
963963
ll.add_symbol('file_write_parallel', hio.file_write_parallel)
964964
# HACK use the string in a dummy function to avoid refcount issues

hpat/distributed_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
unliteral_all)
1414
import time
1515
from llvmlite import ir as lir
16-
import hdist
16+
from . import hdist
1717
import llvmlite.binding as ll
1818
ll.add_symbol('c_alltoall', hdist.c_alltoall)
1919
ll.add_symbol('c_gather_scalar', hdist.c_gather_scalar)
@@ -25,7 +25,7 @@
2525
from enum import Enum
2626

2727
# get size dynamically from C code (mpich 3.2 is 4 bytes but openmpi 1.6 is 8)
28-
import hdist
28+
from . import hdist
2929
mpi_req_numba_type = getattr(types, "int"+str(8 * hdist.mpi_req_num_bytes))
3030

3131
MPI_ROOT = 0

hpat/distributed_lower.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from hpat.distributed_api import mpi_req_numba_type, ReqArrayType, req_array_type
1414
import time
1515
from llvmlite import ir as lir
16-
import hdist
16+
from . import hdist
1717
import llvmlite.binding as ll
1818
ll.add_symbol('hpat_dist_get_rank', hdist.hpat_dist_get_rank)
1919
ll.add_symbol('hpat_dist_get_size', hdist.hpat_dist_get_size)

hpat/hiframes/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# quantile imports?
4545
import llvmlite.llvmpy.core as lc
4646
from llvmlite import ir as lir
47-
import quantile_alg
47+
from .. import quantile_alg
4848
import llvmlite.binding as ll
4949
ll.add_symbol('quantile_parallel', quantile_alg.quantile_parallel)
5050
ll.add_symbol('nth_sequential', quantile_alg.nth_sequential)

hpat/hiframes/boxing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
box_categorical_array, unbox_categorical_array)
2424
from hpat.hiframes.pd_series_ext import SeriesType, arr_to_series_type
2525

26-
import hstr_ext
26+
from .. import hstr_ext
2727
import llvmlite.binding as ll
2828
from llvmlite import ir as lir
2929
import llvmlite.llvmpy.core as lc

hpat/hiframes/join.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,10 +667,10 @@ def write_data_send_buff_overload(meta_tup, node_id, ind, data, key_meta):
667667
import llvmlite.binding as ll
668668
from numba.targets.arrayobj import make_array
669669
from hpat.utils import _numba_to_c_type_map
670-
import chiframes
670+
from .. import chiframes
671671
ll.add_symbol('get_join_sendrecv_counts', chiframes.get_join_sendrecv_counts)
672672
ll.add_symbol('timsort', chiframes.timsort)
673-
import hdist
673+
from .. import hdist
674674
ll.add_symbol('c_alltoallv', hdist.c_alltoallv)
675675

676676

hpat/hiframes/pd_timestamp_ext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# pandas_present = False
2929

3030
import datetime
31-
import hdatetime_ext
31+
from .. import hdatetime_ext
3232
import llvmlite.binding as ll
3333
ll.add_symbol('parse_iso_8601_datetime', hdatetime_ext.parse_iso_8601_datetime)
3434
ll.add_symbol('convert_datetimestruct_to_datetime', hdatetime_ext.convert_datetimestruct_to_datetime)
@@ -881,7 +881,7 @@ def parse_datetime_str(str):
881881
# from numba.targets.listobj import ListInstance
882882
# from llvmlite import ir as lir
883883
# import llvmlite.binding as ll
884-
# #import hdatetime_ext
884+
# #from .. import hdatetime_ext
885885
# #ll.add_symbol('dt_to_timestamp', hdatetime_ext.dt_to_timestamp)
886886
#
887887
# @lower_builtin(operator.getitem, TimestampSeriesType, types.Integer)

0 commit comments

Comments
 (0)