Skip to content

Commit

Permalink
fix numpy deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
zm711 committed Dec 6, 2023
1 parent 6d69f3e commit 864163d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/spikeanalysis/spike_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,8 @@ def _isolation_distance(self, pc_feat: np.array, labels: np.array, this_id: int)
md_other = np.sort(cdist(pc_other_clusters, mean_this_cluster, "mahalanobis", VI=cov_matrix))

# md_self = cdist(pc_this_cluster,mean_this_cluster,"mahalanobis", VI=cov_matrix)
if len(md_other.shape) > 1:
md_other = np.squeeze(md_other)

isolation_dist = (md_other[n_spikes - 1]) ** 2
else:
Expand Down
1 change: 0 additions & 1 deletion test/test_spike_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ def test_generate_qcmetrics(spikes, tmp_path):
spikes.pc_feat = pc_feat
spikes.CACHING = True
spikes.generate_qcmetrics()

assert isinstance(spikes.isolation_distances, np.ndarray)
assert len(spikes.isolation_distances) == 2
assert isinstance(spikes.silhouette_scores, np.ndarray)
Expand Down

0 comments on commit 864163d

Please sign in to comment.