github Ouranosinc/xclim v0.37.0

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

Contributors to this version: Abel Aoun (@bzah), Pascal Bourgault (@aulemahal), Trevor James Smith (@Zeitsperre), Gabriel Rondeau-Genesse (@RondeauG), Juliette Lavoie (@juliettelavoie), Ludwig Lierhammer (@ludwiglierhammer).

Announcements

  • xclim is now compliant with PEP 563. Python3.10-style annotations are now permitted. (GH/1065, PR/1071).
  • xclim is now fully compatible with xarray's flox-enabled GroupBy and resample operations. (PR/1081).
  • xclim now (properly) enforces docstring compliance checks using pydocstyle with modified numpy-style docstrings. Docstring errors will now cause build failures. See the pydocstyle documentation for more information. (PR/1074).
  • xclim now uses GitHub Actions to manage patch version bumping. Merged Pull Requests that modify xclim code now trigger version-bumping automatically when pushed to the main development branch. Running $ bump2version patch within development branches is no longer necessary. (PR/1102).

New features and enhancements

  • Add "Celsius" to aliases of "celsius" unit. (GH/1067, PR/1068).
  • All indicators now have indexing enabled, except those computing statistics on spells. (GH/1069, PR/1070).
  • A convenience function for returning the version numbers for relevant xclim dependencies (xclim.testing.show_versions) is now offered. (PR/1073).
    • A CLI version of this function is also available from the command line ($ xclim show_version_info). (PR/1073).
  • New "keep_attrs" option to control the handling of the attributes within the indicators. (GH/1026, PR/1076).
  • Added a notebook showcasing some simple examples of Spatial Analogues. (GH/585, PR/1075).
  • create_ensembles now accepts a glob string to find datasets. (PR/1081).
  • Improved percentile based indicators metadata with the window, threshold and climatology period used to compute percentiles. (GH/1047, PR/1050).
  • New xclim.core.calendar.construct_offset, the inverse operation of parse_offset. (PR/1090).
  • Rechunking operations in xclim.indices.run_length.rle are now synchronized with dask's options. (PR/1090).
  • A mention of the "missing" checks and options is added to the history attribute of indicators, where appropriate. (GH/1100, PR/1103).

Breaking changes

  • xclim.atmos.water_budget has been separated into water_budget (calculated directly with 'evspsblpot') and water_budget_from_tas (original function). (PR/1086).
  • Injected parameters in indicators are now left out of a function's signature and will not be included in the history attribute. (PR/1086).
  • The signature for the following Indicators have been modified (PR/1050):
    • cold_spell_duration_index, tg90p, tg10p, tx90p, tx10p, tn90p, tn10p, warm_spell_duration_index, days_over_precip_doy_thresh, days_over_precip_thresh, fraction_over_precip_doy_thresh, fraction_over_precip_thresh, cold_and_dry_days, warm_and_dry_days, warm_and_wet_days, cold_and_wet_days
  • The parameter for percentile values is now named after the variable it is supposed to be computed upon. (PR/1050).
  • pytest-runner has been removed as a dependency (it was never needed for xclim development). (PR/1074).
  • xclim.testing._utils.py has been renamed to xclim.testing.utils.py for added documentation visibility. (PR/1074).
    • Some unused functions and classes (as_tuple, TestFile, TestDataSet) have been removed. (PR/1107).

New indicators

  • universal_thermal_climate_index and mean_radiant_temperature for computing the universal thermal climate index from the near-surface temperature, relative humidity, near-surface windspeed and radiation. (GH/1060, PR/1062).
    • A new method ITS90 has also been added for calculating saturation water vapour pressure. (GH/1060, PR/1062).

Internal changes

  • Typing syntax has been updated within pre-commit via isort. Pre-commit hooks now append from __future__ import annotations to all python module imports for backwards compatibility. (GH/1065, PR/1071)
  • isort project configurations are now set in setup.cfg. (PR/1071).
  • Many function docstrings, external target links, and internal section references have been adjusted to reduce warnings when building the docs. (PR/1074).
  • Code snippets within documentation are now checked and reformatted to black conventions with blackdoc. A pre-commit hook is now in place to run these checks. (PR/1098).
  • Test coverage statistic no longer includes coverage of the test files themselves. Coverage now reflects lines of usable code covered. (PR/1101).
  • Reordered listed authors alphabetically. Promoted @bzah to core contributor. (PR/1105).
  • Tests have been added for some functions in xclim.testing.utils.py; some previously uncaught bugs in list_input_variables, publish_release_notes, and show_versions have been patched. (GH/1078, PR/1107).
  • A convenience command for installing xclim with key development branches of some dependencies has been added ($ make upstream). (GH/1088, PR/1092; amended in GH/1113, PR/1114).
    • This build configuration is also available in tox for local development purposes ($ tox -e pyXX-upstream).

Bug fixes

  • Clean the bias_adjustement and history attributes created by xclim.sdba.adjust (e.g. when an argument is an xr.DataArray, only print the name instead of the whole array). (GH/1083, PR/1087).
  • pydocstyle checks were silently failing in the pre-commit configuration due to a badly-formed regex. This has been adjusted. (PR/1074).
  • adjust_doy_calendar was broken when the source or the target were seasonal. (GH/1097, GH/1091, PR/1099)

Don't miss a new xclim release

NewReleases is sending notifications on new releases.