Description
Linopy throws a xarray
DeprecationWarning quite a few times. If raised as exceptions, 89 tests fail. Mainly in test/test_linear_expression.py
.
../site-packages/xarray/core/dataarray.py:3146: DeprecationWarning: Deleting a single level of a MultiIndex is deprecated. Previously, this deleted all levels of a MultiIndex. Please also drop the following variables: {'z'} to avoid an error in the future.
Needs a deeper dive, but here are some thoughts:
Only happens with multi index actions and when arrays are assigned to a dataset with a new reference. See some examples below. During the merge of two objects, xarray is dropping conflicting coords. But deleting them leads to further problems. I'm also not sure whether this is an xarray issue, because the code can only be adapted in a rather unpleasant way.
Links:
Dropping a MultiIndex variable raises an error after explicit indexes refactor · Issue #6505 · pydata/xarray
Explicit indexes by benbovy · Pull Request #5692 · pydata/xarray
python - Why cannot I add a DataArray to an existing Dataset with a MultiIndex? - Stack Overflow
Occurs in:
Line 153 in 8294530
Lines 457 to 476 in 8294530