Skip to content

Commit ae2bf1c

Browse files
author
Joao Felipe Rocha
committed
Better landmarking debugging printing
1 parent 1a3a0c3 commit ae2bf1c

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

test/test_landmark.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ def test_landmark_exact_pygsp_graph():
129129
def test_landmark_knn_pygsp_graph():
130130
n_landmark = 150
131131
# knn graph
132+
print(f"Data shape: {data.shape}")
133+
print(f"n_landmark requested: {n_landmark}")
134+
132135
G = build_graph(
133136
data,
134137
n_landmark=n_landmark,
@@ -138,6 +141,17 @@ def test_landmark_knn_pygsp_graph():
138141
random_state=42,
139142
use_pygsp=True,
140143
)
144+
print(f"Graph type: {type(G)}")
145+
print(f"Has landmark_op: {hasattr(G, 'landmark_op')}")
146+
if hasattr(G, "landmark_op"):
147+
print(f"landmark_op shape: {G.landmark_op.shape}")
148+
149+
# Check if landmarks were actually created
150+
if hasattr(G, "n_landmark"):
151+
print(f"G.n_landmark: {G.n_landmark}")
152+
if hasattr(G, "landmark_indices"):
153+
print(f"Number of landmark indices: {len(G.landmark_indices)}")
154+
141155
assert G.landmark_op.shape == (n_landmark, n_landmark)
142156
assert isinstance(G, graphtools.graphs.kNNGraph)
143157
assert isinstance(G, graphtools.graphs.LandmarkGraph)
@@ -163,17 +177,6 @@ def test_landmark_mnn_pygsp_graph():
163177
use_pygsp=True,
164178
)
165179

166-
print(f"Graph type: {type(G)}")
167-
print(f"Has landmark_op: {hasattr(G, 'landmark_op')}")
168-
if hasattr(G, "landmark_op"):
169-
print(f"landmark_op shape: {G.landmark_op.shape}")
170-
171-
# Check if landmarks were actually created
172-
if hasattr(G, "n_landmark"):
173-
print(f"G.n_landmark: {G.n_landmark}")
174-
if hasattr(G, "landmark_indices"):
175-
print(f"Number of landmark indices: {len(G.landmark_indices)}")
176-
177180
assert G.landmark_op.shape == (n_landmark, n_landmark)
178181

179182

0 commit comments

Comments
 (0)