Contributors to this version: Éric Dupuis (@coxipi), Trevor James Smith (@Zeitsperre), Juliette Lavoie (@juliettelavoie), Pascal Bourgault (@aulemahal), Armin Hofmann (@HofmannGeo), Baptiste Hamon (@baptistehamon).
Announcements
- The
xclim.sdba
module has been split fromxclim
into the new package xsdba. Users must installxsdba
fromPyPI
orconda-forge
in order to maintainxclim.sdba
functionality. Refer to the xsdba Migration Guide for more information. (GH/2074, PR/2099).
New indicators and features
- New indicator
xclim.atmos.clearness_index
computes theclearness_index
(ratio of downwards solar radiation to extraterrestrial solar radiation). (PR/2140). - New conversion indice
xclim.indices.shortwave_downwelling_radiation_from_clearness_index
provides the inverse ofxclim.indices.clearness_index
. (PR/2140). - Added
cooling_degree_days_approximation
andheating_degree_days_approximation
indices to compute the number of cooling and heating degree days with consideration for daily temperature cycles. (GH/1941, PR/2135). - Added dtr in variables.yml. (GH/2146, PR/2147).
- Added Mahalanobis distance. (GH/2151, PR/2157).
- Support for
DataTree
objects in indicators. All non-empty nodes of the tree must contain all required variables, non-variable parameters are the same for all nodes. (GH/2127, PR/2144). - Support for
Dataset
andDataTree
objects inxclim.core.units.convert_units_to
. Target units are passed as a mapping from variable name to units. Unmentioned variables are left untouched. (GH/2127, PR/2144).
Bug fixes
- Adjustments were made to the
xclim[docs]
installation recipe to ensure that the documentation builds correctly. The minimum required Python for rendering the documentation is now 3.11. (PR/2141). xclim.core.calendar.stack_periods
was fixed to work with larger-than-daily source timesteps. Users are still encouraged to useda.resample(time=FREQ).construct('period')
when possible. (GH/2148, PR/2150).- Updated the
create_ensemble
docstring to avoid confusion about how the function aligns realizations with different calendars. (GH/2108, PR/2164). - Fixed
xclim.indices.run_length.find_events
for multidimensional input using acftime
calendar. (PR/2172). xclim.ensembles.robustness_fractions
will now return '0' when all members are invalid (have missing values), avoiding faulty flags inrobustness_categories
. The latter was also modified to read thevalid
fraction and mask its output accordingly. (GH/2167, PR/2178).
Breaking changes
xclim.sdba
is now a convenience mapping that importsxsdba
members instead of being its own submodule. This implies a number of breaking changes (GH/2074, PR/2099, PR/2181):- The sub-module
xclim.sdba
is no longer installed by default. Users must installxsdba
separately usingpip install xclim[extras]
or{pip|conda} install xsdba
. - Units handling: The "infer" context is no longer used in unit conversion in
xclim.sdba
functions. - The
SDBA_EXTRA_OUTPUT
global option can no longer be activated withxclim.set_options
; Instead usexsdba.set_options
where the option is now calledEXTRA_OUTPUT
. - The other global variable
SDBA_ENCODE_CF
was removed as it has been rendered obsolete.
- The sub-module
- The previously deprecated functions
sfcwind_2_uas_vas
anduas_vas_2_sfcwind
have been removed. (PR/2139). xclim.testing.open_dataset
has been significantly modified and is now a thin wrapper for thenimbus
testing data fetching class. It also no longer supports thedap_url
parameter. Contributors are encouraged to consult the documentation pertaining toxclim.testing.utils.nimbus
for the new approach to fetching testing data. (PR/2139).- The
xclim[dev]
installation recipe now requirespytest-timeout
for ending stalled tests. (PR/2176).
Internal changes
- Added a
pre-commit
hook for formatting BibTeX files and reformatted existing BibTeX files. (PR/2135). pre-commit
hooks have been updated to their latest versions. (PR/2141).- Updated a deprecated
pathlib
usage in thexclim
documentation that was causing failures under Python 3.13. (PR/2141). - Call signatures for most
op
arguments inxclim
have been updated to use 'Literal' types instead of 'str'. This change is intended to improve type checking and code clarity. (GH/1810, PR/2168). - Changes to
pylint
configuration and to address low-hangingpylint
issues. (PR/2170). - The
pyproject.toml
file has been adjusted to leveragepytest-timeout
with a maximum session time of 15 minutes and a maximum test duration of five (5) minutes. (PR/2176). - Fixed a bug present in tests due to the
netcdf4
engine found intest_wind.py
that was causing failures when run in parallel. (GH/2179, PR/2176). - Faster backend for run length computations where the time is unchunked.
xclim.indices.run_length._cumsum_reset
was rewritten to include the fast track which is called withxclim.indices.run_length._cumsum_reset_np
. The slow track usesxclim.indices.run_length._cumsum_reset_xr
which preserves all functionalities of the oldxclim.indices.run_length._cumsum_reset
. (PR/2136).