def test_node_pairs_two_way(dataframes2): nodes, ways, waynodes = dataframes2 pairs = load.node_pairs(nodes, ways, waynodes) assert len(pairs) == 1 fn = 53063555 tn = 53099275 pair = pairs.loc[(fn, tn)] assert pair.from_id == fn assert pair.to_id == tn npt.assert_allclose(pair.distance, 101.48279182499789)
def test_node_pairs_one_way(dataframes2): nodes, ways, waynodes = dataframes2 pairs = load.node_pairs(nodes, ways, waynodes, two_way=False) assert len(pairs) == 2 n1 = 53063555 n2 = 53099275 for p1, p2 in [(n1, n2), (n2, n1)]: pair = pairs.loc[(p1, p2)] assert pair.from_id == p1 assert pair.to_id == p2 npt.assert_allclose(pair.distance, 101.48279182499789)