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

introduce openeo.testing.results with reusable result comparison utilities for test suites #594

Closed
soxofaan opened this issue Jul 19, 2024 · 2 comments
Assignees

Comments

@soxofaan
Copy link
Member

This is a tracking ticket about new submodule openeo.testing.results, which I already added earlier (starting with feature branch merge 95e00f9 ).
There wasn't a dedicated ticket in this repo for it (it was mainly targetting ESA-APEx/apex_algorithms#5), but to better track further follow up I decided to create one here anyway

@soxofaan soxofaan self-assigned this Jul 19, 2024
@soxofaan
Copy link
Member Author

tests on python 3.11 are currently failing with

__ TestAssertXarray.test_assert_xarray_dataset_allclose_empty_coords_handling __
...
openeo/testing/results.py:132: in _compare_xarray_dataarray
    xarray.testing.assert_allclose(a=actual, b=expected, rtol=rtol, atol=atol)
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/xarray/testing/assertions.py:274: in compat_variable
    return a.dims == b.dims and (a._data is b._data or equiv(a.data, b.data))
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/xarray/testing/assertions.py:45: in _data_allclose_or_equiv
    arr1 = _decode_string_data(arr1)
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/xarray/testing/assertions.py:39: in _decode_string_data
    return np.core.defchararray.decode(data, "utf-8", "replace")
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/numpy/core/__init__.py:30: in __getattr__
    attr = getattr(_core, attr_name)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'defchararray'

    def __getattr__(name):
        # Deprecated 2022-11-22, NumPy 1.25.
        if name == "MachAr":
            import warnings
            warnings.warn(
                "The `np._core.MachAr` is considered private API (NumPy 1.24)",
                DeprecationWarning, stacklevel=2,
            )
            return _machar.MachAr
>       raise AttributeError(f"Module {__name__!r} has no attribute {name!r}")
E       AttributeError: Module 'numpy._core' has no attribute 'defchararray'

which looks like this issue pydata/xarray#9165 (numpy2 compatibility problem)

soxofaan added a commit that referenced this issue Jul 19, 2024
Improve compatibility of `openeo.testing.results` tests with multiple xarray/numpy versions
soxofaan added a commit that referenced this issue Jul 19, 2024
Improve compatibility of `openeo.testing.results` tests with multiple xarray/numpy versions
@soxofaan
Copy link
Member Author

I think it's fine to close this ticket for now. The initial implementation is there, used e.g. in ESA-APEx/apex_algorithms#5 and available in recently released 0.31.0

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