Skip to content

Uses xarray.core.ops which is not part of the public xarray API and will vanish #320

@mikapfl

Description

@mikapfl

Describe the bug

Using the latest upstream (not yet released) version of xarray, we get the error AttributeError: module 'xarray.core' has no attribute 'ops' from various parts of primap2.

Failing Test

 FAILED primap2/tests/csg/test_compose.py::test_compose_simple - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_compose.py::test_compose_exclude_result - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_compose.py::test_compose_invalid_strategy_definition - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_compose.py::test_compose_strategy_skipping - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_compose.py::test_compose_strategy_all_error - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_compose.py::test_compose_skip_source - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_compose.py::test_compose_skip_variable - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_compose.py::test_compose_skip_entity - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_compose.py::test_compose_pbar - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_compose.py::test_compose_sec_cats_missing - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_compose.py::test_compose_timeseries_trivial - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_compose.py::test_compose_timeseries_no_match - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_compose.py::test_compose_timeseries_all_null - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_strategies.py::test_strategies_conform[substitution] - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_strategies.py::test_strategies_conform[globalLS] - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_strategies.py::test_substitution_strategy - AttributeError: module 'xarray.core' has no attribute 'ops'
FAILED primap2/tests/csg/test_strategies.py::test_globalLS_strategy - AttributeError: module 'xarray.core' has no attribute 'ops'

see also https://github.com/primap-community/primap2/actions/runs/13914435902/job/38934794569#step:6:1728

You can see it for yourself locally by running

uv pip install --upgrade --resolution highest --prerelease allow --requirements requirements_upstream_dev.txt
make test

Expected behavior

All tests pass with the upcoming version of xarray.

System (please complete the following information):

  • OS: Debian Testing
  • Python version 3.12, using xarray main at bb539d8e89fa7601e69fb9dbf849b051c61a3a31

Additional context

The PR in xarray which removed xarray.core.ops: pydata/xarray#10132
The documentation about xarray's public API: https://docs.xarray.dev/en/stable/getting-started-guide/faq.html#what-parts-of-xarray-are-considered-public-api

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions