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

Some tests started to fail with rasterio 1.4.3 #836

Closed
imincik opened this issue Dec 9, 2024 · 1 comment · Fixed by #838
Closed

Some tests started to fail with rasterio 1.4.3 #836

imincik opened this issue Dec 9, 2024 · 1 comment · Fixed by #838
Labels
bug Something isn't working

Comments

@imincik
Copy link

imincik commented Dec 9, 2024

Problem description

In nixpkgs, Some tests started to fail with rasterio 1.4.3 (see: NixOS/nixpkgs#362893 (comment)).

$ nix-build -A python3Packages.rioxarray

...

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED test/integration/test_integration__io.py::test_rasterio_environment - Failed: DID NOT RAISE <class 'Exception'>
FAILED test/integration/test_integration_merge.py::test_merge__different_crs[True] - AssertionError:
FAILED test/integration/test_integration_merge.py::test_merge__different_crs[False] - AssertionError:
= 3 failed, 459 passed, 17 skipped, 8 deselected, 2 xfailed, 2 xpassed, 419 warnings in 7.45s =
error: build of '/nix/store/5q8bxayw0qlli4h20i2pvy9b6f6pksxn-python3.12-rioxarray-0.18.1.drv' on 'ssh-ng://im-builder.tail6adb8.ts.net' failed: builder for '/nix/store/5q8bxayw0qlli4h20i2pvy9b6f6pksxn-python3.12-rioxarray-0.18.1.drv' failed with exit code 1;
       last 10 log lines:
       >
       > test/integration/test_integration_xarray_plugin.py::test_open_multiple_resolution
       >   <frozen _collections_abc>:868: RuntimeWarning: deallocating CachingFileManager(<function open at 0x7ffee13b0040>, 'HDF4_EOS:EOS_GRID:/build/source/test/test_data/input/MOD09GA.A2008296.h14v17.006.2015181011753.hdf:MODIS_Grid_500m_2D:num_observations_500m', mode='r', kwargs={'sharing': False}, manager_id='9b01d24c-019c-4c4e-976a-29a7be5fff32'), but file is not already closed. This may indicate a bug.
       >
       > -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
       > =========================== short test summary info ============================
       > FAILED test/integration/test_integration__io.py::test_rasterio_environment - Failed: DID NOT RAISE <class 'Exception'>
       > FAILED test/integration/test_integration_merge.py::test_merge__different_crs[True] - AssertionError:
       > FAILED test/integration/test_integration_merge.py::test_merge__different_crs[False] - AssertionError:
       > = 3 failed, 459 passed, 17 skipped, 8 deselected, 2 xfailed, 2 xpassed, 419 warnings in 7.45s =
       For full logs, run 'nix log /nix/store/5q8bxayw0qlli4h20i2pvy9b6f6pksxn-python3.12-rioxarray-0.18.1.drv'.
error: builder for '/nix/store/5q8bxayw0qlli4h20i2pvy9b6f6pksxn-python3.12-rioxarray-0.18.1.drv' failed with exit code 1
__________________________ test_rasterio_environment ___________________________

    def test_rasterio_environment():
        with create_tmp_geotiff() as (tmp_file, expected):
            # Should fail with error since suffix not allowed
>           with pytest.raises(Exception):
E           Failed: DID NOT RAISE <class 'Exception'>

test/integration/test_integration__io.py:869: Failed

test/integration/test_integration_merge.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = (<xarray.DataArray '__xarray_dataarray_variable__' ()> Size: 8B
array(-131734881)
Coordinates:
    spatial_ref  int64 8B 0, -126821853)
kwds = {}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError:
E           Arrays are not almost equal to 7 decimals
E            ACTUAL: <xarray.DataArray '__xarray_dataarray_variable__' ()> Size: 8B
E           array(-131734881)
E           Coordinates:
E               spatial_ref  int64 8B 0
E            DESIRED: -126821853

/nix/store/zv1kaq7f1q20x62kbjv6pfjygw5jmwl6-python3-3.12.7/lib/python3.12/contextlib.py:81: AssertionError

test/integration/test_integration_merge.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = (<xarray.DataArray ()> Size: 8B
array(-131734881)
Coordinates:
    spatial_ref  int64 8B 0, -126821853)
kwds = {}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError:
E           Arrays are not almost equal to 7 decimals
E            ACTUAL: <xarray.DataArray ()> Size: 8B
E           array(-131734881)
E           Coordinates:
E               spatial_ref  int64 8B 0
E            DESIRED: -126821853

/nix/store/zv1kaq7f1q20x62kbjv6pfjygw5jmwl6-python3-3.12.7/lib/python3.12/contextlib.py:81: AssertionError

[this should explain why the current behavior is a problem and why the expected output is a better solution.]

Expected Output

Tests should successfully pass.

Environment Information

  • python -c "import rioxarray; rioxarray.show_versions()"
  • rioxarray version (python -c "import rioxarray; print(rioxarray.__version__)")
  • rasterio version (rio --version)
  • GDAL version (rio --gdal-version)
  • Python version (python -c "import sys; print(sys.version.replace('\n', ' '))")
  • Operation System Information (python -c "import platform; print(platform.platform())")

Installation method

  • conda, pypi, from source, etc...

Conda environment information (if you installed with conda):


Environment (conda list):
$ conda list | grep -E "rasterio|xarray|gdal"


Details about conda and system ( conda info ):
$ conda info

@imincik imincik added the bug Something isn't working label Dec 9, 2024
@imincik
Copy link
Author

imincik commented Dec 19, 2024

@snowman2 , thanks for fix,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant