Skip to content

Commit e93ca8c

Browse files
author
Jan Luca van den Busch
committed
tried to renable query tests
1 parent 4ee6bdb commit e93ca8c

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

tests/test_balltree.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,12 @@ def test_to_from_file(self, mock_data, mock_weight, tmp_path):
214214
assert orig.count_nodes() == restored.count_nodes()
215215
assert_array_equal(orig.data, restored.data)
216216

217-
@mark.skip
218217
def test_count_radius_no_radius(self, rand_data_weight):
219218
data, _ = rand_data_weight
220219
tree = BallTree(data)
221220
with raises(TypeError):
222221
tree.count_radius(data[0])
223222

224-
@mark.skip
225223
@mark.parametrize("radius", radius_testvalues)
226224
def test_count_radius_single(self, radius, rand_data_weight):
227225
data, _ = rand_data_weight
@@ -233,36 +231,34 @@ def test_count_radius_single(self, radius, rand_data_weight):
233231
count = brute_force((data, weight), (p, w), radius)
234232
assert_almost_equal(tree.count_radius(p, radius), count)
235233

236-
@mark.skip
237234
@mark.parametrize("radius", radius_testvalues)
238235
def test_count_radius_single_weight(self, radius, rand_data_weight):
239236
data, weight = rand_data_weight
240237
tree = BallTree(data, weight)
241238

242239
p = data[0]
243-
w = weight[0]
240+
w = float(weight[0])
244241
count = brute_force((data, weight), (p, w), radius)
245242
assert_almost_equal(tree.count_radius(p, radius, weight=w), count)
246243

247-
@mark.skip
248244
@mark.parametrize("radius", radius_testvalues)
249245
def test_count_radius_multi(self, radius, rand_data_weight):
250246
data, weight = rand_data_weight
251247
tree = BallTree(data, weight)
252248

253249
count = 0.0
254250
for p, w in zip(data, weight):
255-
count += brute_force((data, weight), (p, w), radius)
251+
count += brute_force((data, weight), (p, float(w)), radius)
256252
assert_almost_equal(tree.count_radius(data, radius, weight), count)
257253

258-
@mark.skip # xfail
254+
@mark.xfail
259255
@mark.parametrize("rmin,rmax", rminmax_testvalues)
260256
def test_count_range_single(self, rmin, rmax, rand_data_weight):
261257
data, weight = rand_data_weight
262258
tree = BallTree(data, weight)
263259

264260
p = data[0]
265-
w = weight[0]
261+
w = float(weight[0])
266262
count = brute_force((data, weight), (p, w), rmax) - brute_force(
267263
(data, weight), (p, w), rmin
268264
)
@@ -278,7 +274,7 @@ def test_dualcount_radius(self, radius, rand_data_weight):
278274
count += brute_force((data, weight), (p, w), radius)
279275
assert_almost_equal(tree.dualcount_radius(tree, radius), count)
280276

281-
@mark.skip # xfail
277+
@mark.xfail
282278
@mark.parametrize("rmin,rmax", rminmax_testvalues)
283279
def test_dualcount_range(self, rmin, rmax, rand_data_weight):
284280
data, weight = rand_data_weight
@@ -287,7 +283,7 @@ def test_dualcount_range(self, rmin, rmax, rand_data_weight):
287283

288284
count = 0.0
289285
for p, w in zip(data, weight):
290-
count += brute_force((data, weight), (p, w), rmax) - brute_force(
286+
count += brute_force((data, weight), (p, float(w)), rmax) - brute_force(
291287
(data, weight), (p, w), rmin
292288
)
293289
assert_almost_equal(tree.dualcount_range(tree, rmin, rmax), count)

0 commit comments

Comments
 (0)