Skip to content

Commit 98a5bb1

Browse files
committed
fix _check_symmetry
1 parent 1496eeb commit 98a5bb1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

radius_clustering/radius_clustering.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ def __init__(self, manner="approx", threshold=0.5):
5151
self.threshold = threshold
5252

5353
def _check_symmetric(self, a, tol=1e-8):
54+
if a.ndim != 2:
55+
raise ValueError("Input must be a 2D array.")
56+
if a.shape[0] != a.shape[1]:
57+
return False
5458
return np.allclose(a, a.T, atol=tol)
5559

5660
def fit(self, X, y=None):

0 commit comments

Comments
 (0)