Skip to content

test_reproject fails on Debian sid #924

@avalentino

Description

@avalentino

Code Sample, a copy-pastable example if possible

$ python3 -m pytest -k "not test_clip_geojson__no_drop"

[CUT]
=========================== short test summary info ============================
FAILED test/integration/test_integration_rioxarray.py::test_clip_box__auto_expand[open_rasterio]
FAILED test/integration/test_integration_rioxarray.py::test_clip_box__auto_expand[modis_clip3]
FAILED test/integration/test_integration_rioxarray.py::test_clip_box__auto_expand[modis_clip4]
FAILED test/integration/test_integration_rioxarray.py::test_reproject[modis_reproject2]
FAILED test/integration/test_integration_rioxarray.py::test_reproject__grid_mapping[modis_reproject2]
FAILED test/integration/test_integration_rioxarray.py::test_reproject__masked[modis_reproject2]
FAILED test/integration/test_integration_rioxarray.py::test_reproject__str_resample[modis_reproject2]
FAILED test/integration/test_integration_rioxarray.py::test_reproject__no_transform[modis_reproject2]
FAILED test/integration/test_integration_rioxarray.py::test_reproject__no_nodata[modis_reproject2-None]

[CUT]

FAILED test/integration/test_integration_rioxarray.py::test_reproject__no_nodata[modis_reproject2--9999]
FAILED test/integration/test_integration_rioxarray.py::test_reproject__no_nodata_masked[modis_reproject2]
FAILED test/integration/test_integration_rioxarray.py::test_reproject_match[open_rasterio]
FAILED test/integration/test_integration_rioxarray.py::test_reproject_match[modis_reproject_match3]
FAILED test/integration/test_integration_rioxarray.py::test_reproject_match[modis_reproject_match4]
FAILED test/integration/test_integration_rioxarray.py::test_reproject_match__masked[open_rasterio]
FAILED test/integration/test_integration_rioxarray.py::test_reproject_match__masked[modis_reproject_match3]
FAILED test/integration/test_integration_rioxarray.py::test_reproject_match__masked[modis_reproject_match4]
FAILED test/integration/test_integration_rioxarray.py::test_reproject_match__no_transform_nodata[open_rasterio]
FAILED test/integration/test_integration_rioxarray.py::test_reproject_match__no_transform_nodata[modis_reproject_match_coords3]
FAILED test/integration/test_integration_rioxarray.py::test_reproject_match__pass_nodata[open_rasterio]
FAILED test/integration/test_integration_rioxarray.py::test_reproject_match__pass_nodata[modis_reproject_match__passed_nodata3]
FAILED test/integration/test_integration_rioxarray.py::test_reproject_match__pass_nodata[modis_reproject_match__passed_nodata4]
= 22 failed, 512 passed, 4 skipped, 8 deselected, 2 xfailed, 4 xpassed, 173 warnings in 12.18s =

Problem description

Some tests fail on Debian Sid but not with a clean installation from pip.
The list of failing tests are reported above.
I tried to investigate a bit

test/integration/test_integration_rioxarray.py::test_reproject[modis_reproject2] 

and compared intermediate variables with the clean pip installation.

def test_reproject(modis_reproject):
    mask_args = (
        dict(masked=False, mask_and_scale=False)
        if "rasterio" in str(modis_reproject["open"])
        else dict(mask_and_scale=False)
    )
    print("mask_args:", mask_args)
    print('modis_reproject["open"]:', modis_reproject["open"])
    with (
        modis_reproject["open"](modis_reproject["input"], **mask_args) as mda,
        modis_reproject["open"](modis_reproject["compare"], **mask_args) as mdc,
    ):
        print('modis_reproject["to_proj"]:', modis_reproject["to_proj"])
        mds_repr = mda.rio.reproject(modis_reproject["to_proj"])

        # overwrite test dataset
        # if isinstance(mds_repr, xarray.DataArray):
        #    mds_repr.to_netcdf(modis_reproject["compare"])

        # test
        _assert_xarrays_equal(mds_repr, mdc)
        assert mds_repr.coords[mds_repr.rio.x_dim].attrs == {
            "axis": "X",
            "long_name": "x coordinate of projection",
            "standard_name": "projection_x_coordinate",
            "units": "metre",
        }
        assert mds_repr.coords[mds_repr.rio.y_dim].attrs == {
            "axis": "Y",
            "long_name": "y coordinate of projection",
            "standard_name": "projection_y_coordinate",
            "units": "metre",
        }

Apparently the mdc variable seems to be flipped vertically in the case of the Debian installation (which seems to suggest some link with #650) but for the pip installation everything looks fine.

I collected the following information that could be relevant in this case:

* Debian installation

SCIPY_LT_17: False
SCIPY_INSTALLED: True
scipy.__version__: 1.16.3
GDAL_GE_361: True
rasterio.__gdal_version__: 3.12.3
rasterio.__version__: 1.5.0
MODIS_ARRAY_UTM: /home/antonio/debian/git/python-rioxarray/test/test_data/compare/MODIS_ARRAY_UTM_GDAL361.nc
mask_args: {'masked': False, 'mask_and_scale': False}
modis_reproject["open"]: functools.partial(<function open_dataset at 0x7b8953fa85e0>, engine='rasterio')
modis_reproject["to_proj"]: +datum=WGS84 +no_defs +proj=utm +units=m +zone=15

* pip installation

SCIPY_LT_17: False
SCIPY_INSTALLED: True
scipy.__version__: 1.17.1
GDAL_GE_361: True
rasterio.__gdal_version__: 3.12.1
rasterio.__version__: 1.5.0
MODIS_ARRAY_UTM: /home/antonio/debian/git/python-rioxarray/test/test_data/compare/MODIS_ARRAY_UTM_GDAL361.nc
mask_args: {'masked': False, 'mask_and_scale': False}
modis_reproject["open"]: functools.partial(<function open_dataset at 0x7d575a6713a0>, engine='rasterio')
modis_reproject["to_proj"]: +datum=WGS84 +no_defs +proj=utm +units=m +zone=15

Expected Output

All unittests pass.

Environment Information

Debian installation

rioxarray (0.22.0) deps:
  rasterio: 1.5.0
    xarray: 2026.1.0
      GDAL: 3.12.3
      GEOS: 3.14.1
      PROJ: 9.8.1
 PROJ DATA: ~/.local/share/proj:/usr/share/proj
 GDAL DATA: None

Other python deps:
     scipy: 1.16.3
    pyproj: 3.7.2

System:
    python: 3.13.12 (main, Feb  4 2026, 15:06:39) [GCC 15.2.0]
executable: /usr/bin/python3
   machine: Linux-6.17.0-22-generic-x86_64-with-glibc2.42

Pip installation

rioxarray (0.22.0) deps:
  rasterio: 1.5.0
    xarray: 2026.4.0
      GDAL: 3.12.1
      GEOS: 3.14.1
      PROJ: 9.7.1
 PROJ DATA: ~/debian/git/python-rioxarray/venv/lib/python3.13/site-packages/rasterio/proj_data
 GDAL DATA: ~/debian/git/python-rioxarray/venv/lib/python3.13/site-packages/rasterio/gdal_data

Other python deps:
     scipy: 1.17.1
    pyproj: 3.7.2

System:
    python: 3.13.12 (main, Feb  4 2026, 15:06:39) [GCC 15.2.0]
executable: ~/debian/git/python-rioxarray/venv/bin/python3
   machine: Linux-6.17.0-22-generic-x86_64-with-glibc2.42

Installation method

  • installation form debian packages on Debian sid

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions