-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### What kind of change does this PR introduce? * Calendar utilities that have an equivalent in xarray have been deprecated and will be removed in 0.51. This concerns the following members of ``xclim.core.calendar``: - ``convert_calendar`` : Use ``Dataset.convert_calendar``, ``DataArray.convert_calendar`` or ``xr.coding.calendar_ops.convert_calendar`` instead. + If your code passes ``target`` as an array, first convert the source to the target's calendar and then reindex the result to ``target``. + If you were using the ``doy=True`` option, replace it with ``xc.core.calendar.convert_doy(source, target_cal).convert_calendar(target_cal)``. + ``"default"`` is no longer a valid calendar name for any xclim functions and will not be returned by ``get_calendar``. Xarray has a ``use_cftime`` argument, xclim exposes it when the distinction is needed. - ``date_range`` : Use ``xarray.date_range`` instead. - ``date_range_like``: Use ``xarray.date_range_like`` instead. - ``interp_calendar`` : Use ``xarray.coding.calendar_ops.interp_calendar`` instead. - ``days_in_year`` : Use ``xarray.coding.calendar_ops._days_in_year`` instead. - ``datetime_to_decimal_year`` : Use ``xarray.coding.calendar_ops._datetime_to_decimal_year`` instead. ### Does this PR introduce a breaking change? Yes. - Some options of `convert_calendar` are not possible with xarray, suggestions are made above. - "default" is not a calendar name anymore.
- Loading branch information
Showing
16 changed files
with
206 additions
and
727 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.