|
16 | 16 |
|
17 | 17 | from linopy import LinearExpression, Variable |
18 | 18 | from linopy.common import ( |
| 19 | + CoordAlignWarning, |
19 | 20 | align, |
20 | 21 | as_dataarray, |
21 | 22 | assign_multiindex_safe, |
@@ -98,7 +99,7 @@ def test_as_dataarray_with_series_override_coords() -> None: |
98 | 99 | target_dim = "dim_0" |
99 | 100 | target_index = ["a", "b", "c"] |
100 | 101 | s = pd.Series([1, 2, 3], index=target_index) |
101 | | - with pytest.warns(UserWarning): |
| 102 | + with pytest.warns(CoordAlignWarning): |
102 | 103 | da = as_dataarray(s, coords=[[1, 2, 3]]) |
103 | 104 | assert isinstance(da, DataArray) |
104 | 105 | assert da.dims == (target_dim,) |
@@ -217,7 +218,7 @@ def test_as_dataarray_dataframe_override_coords() -> None: |
217 | 218 | target_index = ["a", "b"] |
218 | 219 | target_columns = ["A", "B"] |
219 | 220 | df = pd.DataFrame([[1, 2], [3, 4]], index=target_index, columns=target_columns) |
220 | | - with pytest.warns(UserWarning): |
| 221 | + with pytest.warns(CoordAlignWarning): |
221 | 222 | da = as_dataarray(df, coords=[[1, 2], [2, 3]]) |
222 | 223 | assert isinstance(da, DataArray) |
223 | 224 | assert da.dims == target_dims |
|
0 commit comments