Skip to content

Commit

Permalink
Import hdbscan when needed and add ros3 to pytest.markers
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Oct 27, 2023
1 parent c15d6d3 commit 59a7588
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ markers = [
"widgets",
"sortingcomponents",
"streaming_extractors: extractors that require streaming such as ross and fsspec",
"ros3_test"
]
filterwarnings =[
'ignore:.*distutils Version classes are deprecated.*:DeprecationWarning',
Expand Down
1 change: 0 additions & 1 deletion src/spikeinterface/sortingcomponents/clustering/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import scipy.spatial
from sklearn.decomposition import PCA
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from hdbscan import HDBSCAN

import numpy as np
import networkx as nx
Expand Down
3 changes: 2 additions & 1 deletion src/spikeinterface/sortingcomponents/clustering/split.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from tqdm.auto import tqdm

from sklearn.decomposition import TruncatedSVD
from hdbscan import HDBSCAN

import numpy as np

Expand Down Expand Up @@ -218,6 +217,8 @@ def split(
final_features = TruncatedSVD(n_pca_features).fit_transform(flatten_features)

if clusterer == "hdbscan":
from hdbscan import HDBSCAN

clust = HDBSCAN(
min_cluster_size=min_cluster_size,
min_samples=min_samples,
Expand Down

0 comments on commit 59a7588

Please sign in to comment.