github Ouranosinc/xclim v0.29.0

latest releases: v0.41.0, v0.40.0, v0.39.0...
3 years ago

Announcements

  • It was found that the ExtremeValues adjustment algorithm was not as accurate and stable as first thought. It is now hidden from xclim.sdba but can still be accessed via xclim.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 of sdba.Grouper had some caveats throughout sdba. This argument is to be used with care before a careful analysis and more testing is done within xclim.

Breaking changes

  • xclim has switched back to updating the history attribute (instead of xclim_history). This impacts all indicators, most ensemble functions, percentile_doy and sdba.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 impacts sdba.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 (only NpdfTransform), which are never initialized. Their adjust
      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 from setup.py. The dev 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 the index argument. Possible values are first and last, 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 as CD 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 as WD 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 as WW 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 as CW 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.
  • Made argument thresh of sdba.LOCI required, as not giving it raised an error. Made defaults explicit in the adjustments docstrings.
  • Fixes in sdba.processing.adapt_freq and sdba.nbutils.vecquantiles when handling all-nan slices.
  • Dimensions in a grouper's add_dims are now taken into consideration in function wrapped with map_blocks/groups. This feature is still not fully tested throughout sdba 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.

Don't miss a new xclim release

NewReleases is sending notifications on new releases.