def test_searchpairs(b, radius, result): b = np.array(b, dtype=np.float32) cutoff = 2.0 coords = transform_StoR(f_dataset, b) tree = PeriodicKDTree(box=b) tree.set_coords(coords, cutoff=cutoff) if cutoff < radius: with pytest.raises(RuntimeError, match=result): indices = tree.search_pairs(radius) else: indices = tree.search_pairs(radius) assert_equal(len(indices), len(result))
def test_ckd_searchpairs_nopbc(radius, result): coords = f_dataset.copy() tree = PeriodicKDTree() tree.set_coords(coords) indices = tree.search_pairs(radius) assert_equal(indices, result)