From 8df8985af13fdce659e769a439676b0494d5ef83 Mon Sep 17 00:00:00 2001 From: vferat Date: Sun, 12 May 2024 20:28:03 +0200 Subject: [PATCH] Change distance computation --- pycrostates/utils/utils.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pycrostates/utils/utils.py b/pycrostates/utils/utils.py index 1ffac1a3..aefa6ad0 100644 --- a/pycrostates/utils/utils.py +++ b/pycrostates/utils/utils.py @@ -48,16 +48,11 @@ def _corr_vectors(A, B, axis=0): np.seterr(divide="warn", invalid="warn") return corr - def _distance_matrix(X, Y=None): """Distance matrix used in metrics.""" - distances = np.abs(1 / np.corrcoef(X, Y)) - 1 - distances = np.nan_to_num( - distances, copy=False, nan=10e300, posinf=1e300, neginf=-1e300 - ) + distances = 1 - np.abs(1 / np.corrcoef(X, Y)) return distances - def _compare_infos(cluster_info, inst_info): """Check that channels in cluster_info are all present in inst_info.""" for ch in cluster_info["ch_names"]: