diff --git a/pyproject.toml b/pyproject.toml index 27eeee01f5..7ded8bc460 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,11 +22,12 @@ classifiers = [ ] dependencies = [ "scikit-learn", - "numpy<2", # https://github.com/TutteInstitute/fast_hdbscan/issues/17#issuecomment-2380859314 + "numpy!=2.0.0", # https://github.com/lmcinnes/umap/issues/1138 "pandas>=1.0", "jinja2", "umap-learn", - "fast-hdbscan", + "hdbscan>=0.8.38", + "numba>=0.60.0", # https://github.com/astral-sh/uv/issues/6281 "starlette", "uvicorn", "psutil", @@ -385,7 +386,7 @@ exclude = [ [[tool.mypy.overrides]] module = [ - "fast_hdbscan", + "hdbscan", "umap", "numba.*", "scipy.*", diff --git a/src/phoenix/pointcloud/clustering.py b/src/phoenix/pointcloud/clustering.py index 6ed4b23ae4..afdc8bbc3f 100644 --- a/src/phoenix/pointcloud/clustering.py +++ b/src/phoenix/pointcloud/clustering.py @@ -17,7 +17,7 @@ class Hdbscan: cluster_selection_epsilon: float = 0.0 def find_clusters(self, mat: Matrix) -> List[RawCluster]: - from fast_hdbscan import HDBSCAN + from hdbscan import HDBSCAN cluster_ids: npt.NDArray[np.int_] = HDBSCAN(**asdict(self)).fit_predict(mat) ans: List[RawCluster] = [set() for _ in range(np.max(cluster_ids) + 1)] diff --git a/src/phoenix/pointcloud/projectors.py b/src/phoenix/pointcloud/projectors.py index 4ebbbbdb6a..39316e50da 100644 --- a/src/phoenix/pointcloud/projectors.py +++ b/src/phoenix/pointcloud/projectors.py @@ -6,12 +6,6 @@ import numpy.typing as npt from typing_extensions import TypeAlias -with warnings.catch_warnings(): - from numba.core.errors import NumbaWarning - - warnings.simplefilter("ignore", category=NumbaWarning) - from umap import UMAP - Matrix: TypeAlias = npt.NDArray[np.float64] @@ -25,6 +19,11 @@ class Umap: min_dist: float = 0.1 def project(self, mat: Matrix, n_components: int) -> Matrix: + with warnings.catch_warnings(): + from numba.core.errors import NumbaWarning + + warnings.simplefilter("ignore", category=NumbaWarning) + from umap import UMAP config = asdict(self) config["n_components"] = n_components if len(mat) <= n_components: