Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhixiong-tang committed Oct 3, 2024
1 parent 80a3b5d commit 26ec13c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
douglas_simplify_indexes,
douglas_simplify_mask,
intersect_segments,
snap_onto_2d,
tf,
)
from polyline_ruler.tf import cheap_ruler_k


def test_segment():
Expand Down Expand Up @@ -267,6 +267,8 @@ def test_intersections_duplicates():


def test_cheap_ruler_k():
from polyline_ruler.tf import cheap_ruler_k

k = cheap_ruler_k(50.0)
eps = np.abs(k - [71695.753616003, 111229.06398856241, 1.0]).sum()
assert eps < 1e-15
Expand Down Expand Up @@ -440,4 +442,8 @@ def test_cheap_ruler():
assert dist == ruler.k()[1]


print()
def test_snap_onto():
P, dist, t = snap_onto_2d([13, 4], [0, 0], [10, 0])
assert P.tolist() == [10, 0]
assert dist == 5.0
assert t == 1.0

0 comments on commit 26ec13c

Please sign in to comment.