Announcements
- It was found that the
ExtremeValues
adjustment algorithm was not as accurate and stable as first thought. It is now hidden fromxclim.sdba
but can still be accessed viaxclim.sdba.adjustment
, with a warning. Work on improving the algorithm is ongoing, and a better implementation will be in a future version. - It was found that the
add_dims
argument ofsdba.Grouper
had some caveats throughoutsdba
. This argument is to be used with care before a careful analysis and more testing is done withinxclim
.
Breaking changes
xclim
has switched back to updating thehistory
attribute (instead ofxclim_history
). This impacts all indicators, most ensemble functions,percentile_doy
andsdba.processing
(see below).- Refactor of
sdba.processing
. Now all functions take one or more dataarrays as input, plus some parameters. And output one or more dataarrays (not Datasets). Units and metadata is handled. This impactssdba.processing.adapt_freq
especially. - Add unit handling in
sdba
. Most parameters involving quantities are now expecting strings (and not numbers). Adjustment objects will ensure ref, hist and sim all have the same units (taking ref as reference). - The Adjustment` classes of
xclim.sdba
have been refactored into 2 categories:TrainAdjust
objects (most of the algorithms), which are created and trained in the same call:
obj = Adj.train(ref, hist, **kwargs)
. The.adjust
step stays the same.Adjust
objects (onlyNpdfTransform
), which are never initialized. Theiradjust
class method performs all the work in one call.
snowfall_approximation
used a"<"
condition instead of"<="
to determine the snow fraction based on the freezing point temperature. The new version sticks to the convention used in the Canadian Land Surface Scheme (CLASS).- Removed the
"gis"
,"docs"
,"test"
and"setup"
extra dependencies fromsetup.py
. Thedev
recipe now includes all tools needed for xclim's development.
New features and enhancements
snowfall_approximation
has gained support for new estimation methods used in CLASS: 'brown' and 'auer'.- A
ValidationError
will be raised if temperature units are given as 'deg C', which is misinterpreted by pint. - Functions computing run lengths (sequences of consecutive
"True"
values) now take theindex
argument. Possible values arefirst
andlast
, indicating which item in the run should be used to index the run length. The default is set to"first"
, preserving the current behavior. - New
sdba_encode_cf
option to workaround a cftime/xarray performance issue when using dask.
New indicators
effective_growing_degree_days
indice returns growing degree days using dynamic start and end dates for the growing season (based on Bootsma et al. (2005)). This has also been wrapped as an indicator.qian_weighted_mean_average
(based on Qian et al. (2010)) is offered as an alternate method for determining the start date using a weighted 5-day average (method="qian"
). Can also be used directly as an indice.cold_and_dry_days
indicator returns the number of days where the mean daily temperature is below the 25th percentile and the mean daily precipitation is below the 25th percentile over period. Added asCD
indicator to ICCLIM module.warm_and_dry_days
indicator returns the number of days where the mean daily temperature is above the 75th percentile and the mean daily precipitation is below the 25th percentile over period. Added asWD
indicator to ICCLIM module.warm_and_wet_days
indicator returns the number of days where the mean daily temperature is above the 75th percentile and the mean daily precipitation is above the 75th percentile over period. Added asWW
indicator to ICCLIM module.cold_and_wet_days
indicator returns the number of days where the mean daily temperature is below the 25th percentile and the mean daily precipitation is above the 75th percentile over period. Added asCW
indicator to ICCLIM module.calm_days
indicator returns the number of days where surface wind speed is below threshold.windy_days
indicator returns the number of days where surface wind speed is above threshold.
Bug fixes
- Various bug fixes in bootstrapping:
- in
percentile_bootstrap
decorator, fix the popping of bootstrap argument to propagate in to the function call. - in
bootstrap_func
, fix some issues with the resampling frequency which was not working when anchored.
- in
- Made argument
thresh
ofsdba.LOCI
required, as not giving it raised an error. Made defaults explicit in the adjustments docstrings. - Fixes in
sdba.processing.adapt_freq
andsdba.nbutils.vecquantiles
when handling all-nan slices. - Dimensions in a grouper's
add_dims
are now taken into consideration in function wrapped withmap_blocks/groups
. This feature is still not fully tested throughoutsdba
though, so use with caution. - Better dtype preservation throughout
sdba
. - "constant" extrapolation in the quantile mappings' adjustment is now padding values just above and under the target's max and min, instead of
±np.inf
. - Fixes in
sdba.LOCI
for the case where a grouping with additionnal dimensions is used.
Internal Changes
- The behaviour of
xclim.testing._utils.getfile
was adjusted to launch file download requests for web-hosted md5 files for every call to compare against local test data.
This was done to validate that locally-stored test data is identical to test data available online, without resorting to git-based actions. This approach may eventually be revised/optimized in the future.