Skip to content

Commit

Permalink
[Cylon] Fix Python test error
Browse files Browse the repository at this point in the history
Signed-off-by: Arup Sarker <[email protected]>
  • Loading branch information
arupcsedu committed May 19, 2024
1 parent ddf79c6 commit 2984a56
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 31 deletions.
34 changes: 12 additions & 22 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,36 +220,26 @@ def build_cpp():

pyarrow_location = os.path.dirname(pa.__file__)
conda_prefix = check_conda_prefix()
sym_generator = f"ln -s {pyarrow_location}/libarrow_python.so {conda_prefix}/lib/libarrow_python.so"
logger.info(f"Generate Symbolic link: {sym_generator}")
res = subprocess.call(sym_generator, cwd=BUILD_DIR, shell=True)
check_status(res, "Generate Symbolic link")
if not os.path.exists(f"{conda_prefix}/lib/libarrow_python.so"):
sym_generator = f"ln -s {pyarrow_location}/libarrow_python.so {conda_prefix}/lib/libarrow_python.so"
logger.info(f"Generate Symbolic link: {sym_generator}")
res = subprocess.call(sym_generator, cwd=BUILD_DIR, shell=True)
check_status(res, "Generate Symbolic link")


export_cc = f'export CC=which mpicc'
logger.info(f"export cc: {export_cc}")
res = subprocess.call(export_cc, cwd=BUILD_DIR, shell=True)
check_status(res, "Export CC")
os.environ['CC']=f"{conda_prefix}/bin/mpicc"
logger.info(f"export cc: : {os.getenv('CC')}")

export_cxx = f'export CXX=which mpicxx'
logger.info(f"export cxx: {export_cxx}")
res = subprocess.call(export_cxx, cwd=BUILD_DIR, shell=True)
check_status(res, "Export CXX")

os.environ['CXX']=f"{conda_prefix}/bin/mpicxx"
logger.info(f"export cxx: : {os.getenv('CXX')}")

export_mpicc = f'export MPI_CC=which mpicc'
logger.info(f"export mpicc: {export_mpicc}")
res = subprocess.call(export_mpicc, cwd=BUILD_DIR, shell=True)
check_status(res, "Export MPI_CC")
os.environ['MPI_CC']=f"{conda_prefix}/bin/mpicc"
logger.info(f"export mpicc: : {os.getenv('MPI_CC')}")

export_mpicxx = f'export MPI_CXX=which mpicxx'
logger.info(f"export mpicxx: {export_mpicxx}")
res = subprocess.call(export_mpicxx, cwd=BUILD_DIR, shell=True)
check_status(res, "Export MPI_CXX")

os.environ['MPI_CXX']=f"{conda_prefix}/bin/mpicxx"
logger.info(f"export mpicxx: : {os.getenv('MPI_CXX')}")


cmake_command = f"cmake -DPYCYLON_BUILD={on_off(BUILD_PYTHON)} {win_cmake_args} " \
f"-DCMAKE_BUILD_TYPE={CPP_BUILD_MODE} " \
f"-DCYLON_WITH_TEST={on_off(RUN_CPP_TESTS)} " \
Expand Down
18 changes: 9 additions & 9 deletions python/pycylon/test/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def test_cylon_set_index_from_column():
from pycylon.indexing.cyindex import IndexingType
from pycylon.indexing.index_utils import IndexUtil

pdf_float = pd.DataFrame({'a': pd.Series([1, 4, 7, 10, 20, 23, 10], dtype=np.int64()),
'b': pd.Series([2, 5, 8, 11, 22, 25, 12], dtype='int')})
pdf_float = pd.DataFrame({'a': pd.Series([1, 4, 7, 10, 20, 23, 10], dtype=np.int32),
'b': pd.Series([2, 5, 8, 11, 22, 25, 12], dtype=np.int32)})
pdf = pd.DataFrame([[1, 2], [4, 5], [7, 8], [10, 11], [20, 22], [23, 25], [10, 12]])
ctx: CylonContext = CylonContext(config=None, distributed=False)
cn_tb: Table = Table.from_pandas(ctx, pdf_float)
Expand All @@ -105,8 +105,8 @@ def test_reset_index():
from pycylon.indexing.cyindex import IndexingType
from pycylon.indexing.index_utils import IndexUtil

pdf_float = pd.DataFrame({'a': pd.Series([1, 4, 7, 10, 20, 23, 10], dtype=np.int64()),
'b': pd.Series([2, 5, 8, 11, 22, 25, 12], dtype='int')})
pdf_float = pd.DataFrame({'a': pd.Series([1, 4, 7, 10, 20, 23, 10], dtype=np.int32),
'b': pd.Series([2, 5, 8, 11, 22, 25, 12], dtype=np.int32)})
pdf = pd.DataFrame([[1, 2], [4, 5], [7, 8], [10, 11], [20, 22], [23, 25], [10, 12]])
ctx: CylonContext = CylonContext(config=None, distributed=False)
cn_tb: Table = Table.from_pandas(ctx, pdf_float)
Expand Down Expand Up @@ -467,12 +467,12 @@ def test_cylon_cpp_str_range_column_indexing():
def test_loc_op_mode_1():
from pycylon.indexing.cyindex import IndexingType

pdf_float = pd.DataFrame({'a': pd.Series([1, 4, 7, 10, 20, 23, 11], dtype=np.int64()),
'b': pd.Series([2, 5, 8, 11, 22, 25, 12], dtype='int'),
'c': pd.Series([12, 15, 18, 111, 122, 125, 112], dtype='int'),
'd': pd.Series([212, 215, 218, 211, 222, 225, 312], dtype='int'),
pdf_float = pd.DataFrame({'a': pd.Series([1, 4, 7, 10, 20, 23, 11], dtype=np.int32),
'b': pd.Series([2, 5, 8, 11, 22, 25, 12], dtype=np.int32),
'c': pd.Series([12, 15, 18, 111, 122, 125, 112], dtype=np.int32),
'd': pd.Series([212, 215, 218, 211, 222, 225, 312], dtype=np.int32),
'e': pd.Series([1121, 12151, 12181, 12111, 12221, 12251, 13121],
dtype='int')})
dtype=np.int32)})
ctx: CylonContext = CylonContext(config=None, distributed=False)
cn_tb: Table = Table.from_pandas(ctx, pdf_float)
indexing_type = IndexingType.LINEAR
Expand Down

0 comments on commit 2984a56

Please sign in to comment.