Skip to content

Commit

Permalink
added fallback for macos if dadac not compiled properly
Browse files Browse the repository at this point in the history
  • Loading branch information
lykos98 committed Feb 23, 2024
1 parent b6e75b3 commit d065ae1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dadapy/clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"""

import multiprocessing
import platform
import time
import warnings

Expand Down Expand Up @@ -115,7 +116,10 @@ def compute_clustering_ADP(self, Z=1.65, halo=False, impl="c", v2=False):
dadac_handler = c_data(self.X, verbose=self.verb)
except NameError:
warnings.warn(
"""Cannot load dadac.Data, falling back to python/cython implementation""",
f"""Cannot load dadac.Data, falling back to python/cython implementation.
This is can be caused from the fact that you are running from a non Linux system.
Your platform, is {platform.platform()}, please refer to dadaC docs to manually install
the package""",
stacklevel=2,
)
impl = "py"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __str__(self):
sources=["dadapy/_cython/cython_differentiable_imbalance.c"],
include_dirs=[get_numpy_include()],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
)
),
]

extra_compile_args = (["-fopenmp"],)
Expand Down

0 comments on commit d065ae1

Please sign in to comment.