Skip to content

test_triangle_orientation fails intermittently #61

@brl0

Description

@brl0

The test below fails intermittently.

__________________________ test_triangle_orientation ___________________________

    @given(coord, coord, coord, coord, coord, coord)
>   @hyp_settings
    def test_triangle_orientation(ax, ay, bx, by, cx, cy):

spatialpandas/tests/geometry/algorithms/test_orientation.py:9: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

ax = 0.0, ay = -4.440892098500627e-13, bx = 6.661338147750941e-13
by = 2.2204460492503136e-13, cx = 4.440892098500627e-13, cy = 0.0

    @given(coord, coord, coord, coord, coord, coord)
    @hyp_settings
    def test_triangle_orientation(ax, ay, bx, by, cx, cy):
        result = triangle_orientation(ax, ay, bx, by, cx, cy)
    
        # Use shapely polygon to compute expected orientation
        sg_poly = sg.Polygon([(ax, ay), (bx, by), (cx, cy), (ax, ay)])
    
        if sg_poly.area == 0:
            expected = 0
        else:
            expected = 1 if sg_poly.exterior.is_ccw else -1
    
>       assert result == expected
E       assert 0 == 1
E         +0
E         -1

spatialpandas/tests/geometry/algorithms/test_orientation.py:21: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_triangle_orientation(
    ax=0.0,
    ay=-4.440892098500627e-13,
    bx=6.661338147750941e-13,
    by=2.2204460492503136e-13,
    cx=4.440892098500627e-13,
    cy=0.0,
)

You can reproduce this example by temporarily adding @reproduce_failure('6.1.1', b'AXicY2CAAEYIxQTlMqMKw8UZAAEIAAo=') as a decorator on your test case

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions