EnergySystemsModellingLab / EnergySystemsModellingLab/MUSE_OS

New(?) `xarray` warnings found in tests

Aperta
#347 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
29
Fork
12
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.