Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent pytest raster subsetting failures #358

Open
jpswinski opened this issue Dec 8, 2023 · 1 comment
Open

Intermittent pytest raster subsetting failures #358

jpswinski opened this issue Dec 8, 2023 · 1 comment

Comments

@jpswinski
Copy link
Member

Intermittently, the raster subsetting test will fail with one of the asserted values being close but not exact. It is unclear why there is non-determinism in the test execution.

    def test_rasterize(self, init):
        resource = "ATL03_20181017222812_02950102_005_01.h5"
        region = sliderule.toregion(os.path.join(TESTDIR, "data/grandmesa.geojson"))
        parms = {
            "poly": region['poly'],
            "raster": region['raster'],
            "srt": icesat2.SRT_LAND,
            "cnf": icesat2.CNF_SURFACE_LOW,
            "ats": 20.0,
            "cnt": 10,
            "len": 40.0,
            "res": 20.0 }
        gdf = icesat2.atl06p(parms, resources=[resource])
        assert init
        assert len(gdf) == 953
>       assert abs(gdf["h_mean"].describe()["mean"] - 1749.8443895024502) < 0.01
E       assert 0.015798150227510632 < 0.01
E        +  where 0.015798150227510632 = abs((1749.8601876526777 - 1749.8443895024502))


FAILED tests/test_subsetting.py::TestSubsetting::test_rasterize - assert 0.015798150227510632 < 0.01
@jpswinski
Copy link
Member Author

See above commit - pytest conditions are relaxed to allow tests to pass (and catch other issues). Once this issue is resolved, the test needs to be updated again to put back the stricter condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant