Open-EO / openeo-python-client

Python client API for OpenEO
https://open-eo.github.io/openeo-python-client/
Apache License 2.0
149 stars 38 forks source link

xarray loading issue in conda recipe build #359

Closed soxofaan closed 1 year ago

soxofaan commented 1 year ago

from https://github.com/conda-forge/staged-recipes/pull/15717#issuecomment-1375224655:


=========================== short test summary info ============================
FAILED tests/udf/test_xarraydatacube.py::test_save_load_dtype_int64[netcdf] - AssertionError: assert dtype('int32') == <class 'numpy.int64'>
 +  where dtype('int32') = <xarray.DataArray (t: 3, bands: 2, x: 4, y: 5)>\narray([[[[   0,    1,    2,    3,    4],\n         [  10,   11,   12,  ...nt32 5 6 7 8 9\n  * x        (x) int32 2 3 4 5\n  * t        (t) int32 2019 2020 2021\n  * bands    (bands) object 'a' 'b'.dtype
 +    where <xarray.DataArray (t: 3, bands: 2, x: 4, y: 5)>\narray([[[[   0,    1,    2,    3,    4],\n         [  10,   11,   12,  ...nt32 5 6 7 8 9\n  * x        (x) int32 2 3 4 5\n  * t        (t) int32 2019 2020 2021\n  * bands    (bands) object 'a' 'b' = <XarrayDataCube shape:(3, 2, 4, 5)>.array
 +  and   <class 'numpy.int64'> = numpy.int64
========== 1 failed, 1262 passed, 17 skipped, 190 warnings in 14.68s ===========
Tests failed for openeo-0.13.0-py310hff52083_0.conda - moving package to /home/conda/staged-recipes/build_artifacts/broken
WARNING:conda_build.build:Tests failed for openeo-0.13.0-py310hff52083_0.conda - moving package to /home/conda/staged-recipes/build_artifacts/broken
TESTS FAILED: openeo-0.13.0-py310hff52083_0.conda

I currently can not reproduce this, but I guess it is related to some additional optional dependencies for xarray that trigger a different behavior

soxofaan commented 1 year ago

(related to #176 )

soxofaan commented 1 year ago

In commits above I tried to play with combining different netcdf engines in xarray in the XarratDataCube test, using xarray.backends.list_engines, introduced in xarray 0.17. Turns out unfortunately that xarray 0.17 dropped support for python 3.6, which we still want to support for now

soxofaan commented 1 year ago

merged this additional test coverage already in 506c7a782859cb1d9487dfc40c9c18909060ef2d