-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
New defaults for xarrays concat/merge/combine were set in pydata/xarray#10062. This gives some warnings:
FAILED tests/test_xarray_helpers.py::test_merge_meteofiles - FutureWarning: In a future version of xarray the default value for compat will change from compat='no_conflicts' to compat='override'. This is likely to lead to different results when combining overlapping variables with the same name. To opt in to new defaults and get rid of these warnings now use `set_options(use_new_combine_kwarg_defaults=True) or set compat explicitly.
FAILED tests/test_xarray_helpers.py::test_merge_meteofiles_number_coordinate - FutureWarning: In a future version of xarray the default value for compat will change from compat='no_conflicts' to compat='override'. This is likely to lead to different results when combining overlapping variables with the same name. To opt in to new defaults and get rid of these warnings now use `set_options(use_new_combine_kwarg_defaults=True) or set compat explicitly.
The new defaults can be tested by setting xr.set_options(use_new_combine_kwarg_defaults=True). This indeed silences the warnings above, and the testcase tests/test_interpolate_grid2bnd.py:test_open_prepare_dataset_slightly_different_latlons also still passes with new defaults. This is because we use join='exact' troughout the dfm_tools code, which is strict enough even with compat='override'.
Some options:
- setting the option in
__init__.pybreaks all older xarray versions, so that is not desireable - setting compat explicitly in all xarray mergings is possible, but that is additional code only to suppress a warning
- we can temporarily suppress the warning via pyproject.toml, but that still gives a warning for users.
Option 2 seems most useful since the warning is only given by dfmt.merge_meteofiles() so it is not too much additional code.
Metadata
Metadata
Assignees
Labels
No labels