Skip to content

Commit

Permalink
Cleaner check for existence of modules
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaldu committed Feb 5, 2024
1 parent 0f38c8b commit d77bead
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions CLUEstering/CLUEstering.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,21 @@
import pandas as pd
from sklearn.datasets import make_blobs
from sklearn.preprocessing import StandardScaler
from os.path import dirname, join
from os.path import dirname, exists, join
path = dirname(__file__)
import sys
sys.path.insert(1, join(path, 'lib'))
import CLUE_Convolutional_Kernels as clue_kernels
import CLUE_CPU_Serial as cpu_serial
tbb_found = False
if len(glob(join(path, 'lib/CLUE_CPU_TBB*.so'))) != 0:
tbb_found = exists(*glob(join(path, 'lib/CLUE_CPU_TBB*.so')))
if tbb_found:
import CLUE_CPU_TBB as cpu_tbb
tbb_found = True
cuda_found = False
if len(glob(join(path, 'lib/CLUE_GPU_CUDA*.so'))) != 0:
cuda_found = exists(*glob(join(path, 'lib/CLUE_CPU_TBB*.so')))
if cuda_found:
import CLUE_GPU_CUDA as gpu_cuda
cuda_found = True
hip_found = False
if len(glob(join(path, 'lib/CLUE_GPU_HIP*.so'))) != 0:
hip_found = exists(*glob(join(path, 'lib/CLUE_CPU_TBB*.so')))
if hip_found:
import CLUE_GPU_HIP as gpu_hip
hip_found = True

def test_blobs(n_samples: int, n_dim: int , n_blobs: int = 4, mean: float = 0,
sigma: float = 0.5, x_max: float = 30, y_max: float = 30) -> pd.DataFrame:
Expand Down

0 comments on commit d77bead

Please sign in to comment.