EnergySystemsModellingLab / EnergySystemsModellingLab/MUSE_OS

New(?) `xarray` warnings found in tests

Open
#347 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
29
Forks
12
PR merge metrics
No merged PRs in 30d

Description

When running the test suite locally I see the following warnings which I haven't noticed
before:

```
tests/test_filters.py: 1 warning
tests/test_trade.py: 14 warnings
tests/test_subsector.py: 1 warning
/home/alex/code/MUSE_OS/src/muse/filters.py:482: UserWarning: rename 'technology' to 'asset' does not create an index anymore. Try using swap_dims instead or use set_index after rename to create an indexed coordinate.
.rename(technology="asset")

tests/test_trade.py::test_power_sector_some_investment
tests/test_subsector.py::test_subsector_noninvesting_aggregation
/home/alex/code/MUSE_OS/.venv/lib/python3.12/site-packages/xarray/core/dataset.py:4744: UserWarning: No index created for dimension agent because variable agent is not a coordinate. To create an index for agent, please first call `.set_coords('agent')` on this object.
warnings.warn(
```

The first one seems to be from within the "actual" code, rather than just the test, and
I'm not sure about the second.

I'm using Python 3.12 with `xarray` 2024.6.0.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.