Skip to content

Commit

Permalink
A more sensible shape comparison threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyh committed Aug 19, 2022
1 parent acc3e1b commit 779e62f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def assert_expected_eo3_path(
)
else:
assert_shapes_mostly_equal(
produced_dataset.geometry, expected_dataset.geometry, 0.00000001
produced_dataset.geometry,
expected_dataset.geometry,
# Typically meters -- this is easily good enough accuracy.
0.0001,
)


Expand Down Expand Up @@ -103,7 +106,7 @@ def assert_shapes_mostly_equal(
# Check area first, as it's a nicer error message when they're wildly different.
assert shape1.area == pytest.approx(
shape2.area, abs=threshold
), "Shapes have different areas"
), f"Shapes have different areas: {shape1.area} != {shape2.area}"

s1 = shape1.simplify(tolerance=threshold)
s2 = shape2.simplify(tolerance=threshold)
Expand Down

0 comments on commit 779e62f

Please sign in to comment.