@@ -96,6 +96,17 @@ def test_matching_to_self(self):
96
96
dist = bottleneck (pd , pd )
97
97
assert dist == 0
98
98
99
+ def test_single_point_same (self ):
100
+ dgm = np .array ([[0.11371516 , 4.45734882 ]])
101
+ dist = bottleneck (dgm , dgm )
102
+ assert dist == 0
103
+
104
+ def test_2x2_bisect_bug (self ):
105
+ dgm1 = np .array ([[6 , 9 ], [6 , 8 ]])
106
+ dgm2 = np .array ([[4 , 10 ], [9 , 10 ]])
107
+ dist = bottleneck (dgm1 , dgm2 )
108
+ assert dist == 2
109
+
99
110
class TestWasserstein :
100
111
def test_single (self ):
101
112
d = wasserstein (
@@ -130,6 +141,11 @@ def test_matching_to_self(self):
130
141
dist = wasserstein (pd , pd )
131
142
assert dist == 0
132
143
144
+ def test_single_point_same (self ):
145
+ dgm = np .array ([[0.11371516 , 4.45734882 ]])
146
+ dist = wasserstein (dgm , dgm )
147
+ assert dist == 0
148
+
133
149
134
150
class TestSliced :
135
151
def test_single (self ):
@@ -170,6 +186,10 @@ def test_different_size(self):
170
186
# These are very loose bounds
171
187
assert d == pytest .approx (0.314 , 0.1 )
172
188
189
+ def test_single_point_same (self ):
190
+ dgm = np .array ([[0.11371516 , 4.45734882 ]])
191
+ dist = sliced_wasserstein (dgm , dgm )
192
+ assert dist == 0
173
193
174
194
class TestHeat :
175
195
def test_compare (self ):
@@ -186,6 +206,11 @@ def test_compare(self):
186
206
# These are very loose bounds
187
207
assert d1 < d2
188
208
209
+ def test_single_point_same (self ):
210
+ dgm = np .array ([[0.11371516 , 4.45734882 ]])
211
+ dist = heat (dgm , dgm )
212
+ assert dist == 0
213
+
189
214
190
215
class TestModifiedGromovHausdorff :
191
216
def test_single_point (self ):
0 commit comments