Ejemplo n.º 1
0
def distance_test():
    def test_func(pl1, pl2, distance):
        assert_almost_equal(F.frechet_distance(pl1, pl2), distance)

    assert_almost_equal(
        F.frechet_distance([(0, 0), (10, 0), (20, 0)], [(0, 0), (10, 0),
                                                        (20, 0)]), 0)
    assert_almost_equal(
        F.frechet_distance([(0, 0), (20, 0)], [(0, 0), (10, 0), (20, 0)]), 0)

    for pl1, pl2, distance in test_data:
        yield (test_func, pl1, pl2, distance)
Ejemplo n.º 2
0
def distance_test():
    def test_func(pl1, pl2, distance):
        assert_almost_equal(F.frechet_distance(pl1, pl2), distance)

    assert_almost_equal(F.frechet_distance([(0, 0), (10, 0), (20, 0)],
                                           [(0, 0), (10, 0), (20, 0)]),
                        0)
    assert_almost_equal(F.frechet_distance([(0, 0), (20, 0)],
                                           [(0, 0), (10, 0), (20, 0)]),
                        0)

    for pl1, pl2, distance in test_data:
        yield (test_func, pl1, pl2, distance)
Ejemplo n.º 3
0
 def test_func(pl1, pl2, distance):
     assert_almost_equal(F.frechet_distance(pl1, pl2), distance)
Ejemplo n.º 4
0
 def test_func(pl1, pl2, distance):
     assert_almost_equal(F.frechet_distance(pl1, pl2), distance)