pypi xclim 0.38.0
v0.38.0

latest releases: 0.50.0, 0.49.0, 0.48.2...
22 months ago

Contributors to this version: Pascal Bourgault (@aulemahal), Éric Dupuis (@coxipi), Trevor James Smith (@Zeitsperre), Abel Aoun (@bzah), Gabriel Rondeau-Genesse (@RondeauG), Dougie Squire (@dougiesquire).

New features and enhancements

  • Adjustment methods of SBCK are wrapped into xclim when that package is installed. (GH/1109, PR/1115).
    • Wrapped SBCK tests are also properly run in the tox testing ensemble. (PR/1119).
  • Method FAO_PM98 (based on Penman-Monteith formula) to compute potential evapotranspiration. (PR/1122).
  • New indices for droughts: SPI (standardized precipitations) and SPEI (standardized water budgets). (GH/131, PR/1096).
  • Most numba functions of sdba.nbutils now use the "lazy" compilation mode. This significantly accelerates the import time of xclim. (GH/1135, PR/1167).
  • Statistical properties and measures from xclim.sdba are now Indicator subclasses (PR/1149).

New indicators

  • xclim now has the McArthur Forest Fire Danger Index and related indices under a new xclim.indices.fire module. These indices are also available as indicators. (GH/1152, PR/1159)
  • Drought-related indicators: SPI (standardized precipitations) and SPEI (standardized water budgets). (GH/131, PR/1096).
  • ensembles.create_ensembles now accepts a realizations argument to assign a coordinate to the "realization" axis. It also accepts a dictionary as input so that keys are used as that coordinate. (PR/1153).
  • ensembles.ensemble_percentiles, ensembles.ensemble_mean_std_max_min and ensembles.change_significance now support weights (PR/1151).
  • Many generic indicators that compare arrays or against thresholds or now accept an op keyword for specifying the logical comparison operation to use in their calculations (i.e. {">", ">=", "<", "<=, "!=", "=="}). (GH/389, PR/1157).
    • In order to prevent user error, many of these generic indices now have a constrain variable that prevents calling an indice with an inappropriate comparison operator. (e.g. The following will raise an error: op=">", constrain=("<", "<=")). This behaviour has been added to indices accepting op where appropriate.

Breaking changes

  • scipy has been pinned below version 1.9 until lmoments3 can be adapted to the new API. (GH/1142, PR/1143).
  • xclim now requires xarray>=2022.06.0. (PR/1151).
  • Documentation CI (ReadTheDocs) builds will now fail if there are any misconfigured pages, internal link/reference warnings, or broken external hyperlinks. (GH/1094, PR/1131, GH/1139, PR/1140, PR/1160).
  • Call signatures for generic indices have been reordered and/or modified to accept op, and optionally constrain, in many cases, and condition/conditional/operation has been renamed to op for consistency. (GH/389, PR/1157). The affected indices are as follows:
    • get_op, compare, threshold_count, get_daily_events, count_level_crossings, count_occurrences, first_occurrence, last_occurrence, spell_length, thresholded_statistics, temperature_sum, degree_days.
  • All indices in xclim.indices.generic now use threshold in lieu of thresh for consistency. (PR/1157).
  • Existing function xclim.indices.generic.compare can now be used to construct operations with op and constrain variables to allow for dynamic comparisons with user input handling. (GH/389, PR/1157).
  • Two deprecated indices have been removed from xclim. (PR/1157):
    • xclim.indices._multivariate.daily_freezethaw_cycles -> Replaceable with the generic multiday_temperature_swing with thresh_tasmax='0 degC', thresh_tasmin='0 degC', window=1, and op='sum'. The indicator version (xclim.atmos.daily_freezethaw_cycles) is unaffected.
    • xclim.indices.generic.select_time -> Was previously moved to xclim.core.calendar.
  • The clix-meta indicator table parsing function (xclim.core.utils.adapt_clix_meta_yaml) has been adapted to support the new "op" operator handler. (PR/1157).
  • Because they have been re-implemented as Indicator subclasses, statistical properties and measures of xclim.sdba no longer preserve attributes of their inputs by default. Use xclim.set_options(keep_attrs=True) to get the previous behaviour. (PR/1149).
  • The xclim.indices.generic.extreme_temperature_range function has been fixed so it now does what its definition says. Results from xclim.indicators.cf.etr will change. (GH/1172, PR/1173).
  • xclim now has a dedicated indices.fire submodule that houses all fire-related indices. The previous xclim.indices.fwi submodule is deprecated and will be removed in a future version. (GH/1152, PR/1159).
  • The indicator xclim.indicators.atmos.fire_weather_indexes and indice xclim.indices.fire_weather_indexes have both been deprecated and renamed to cffwis_indices. Calls using the previous naming will be removed in a future version. (PR/1159).
  • xclim now explicitly requires pybtex in order to generate documentation. (PR/1176).

Bug fixes

  • Fixed saturation_vapor_pressure for temperatures in other units than Kelvins (also fixes relative_humidity_from_dewpoint). (GH/1125, PR/1127).
  • Indicators that do not care about the input frequency of the data will not check the cell methods of their inputs. (PR/1128).
  • Fixed the signature and docstring of heat_index by changing tasmax to tas. (GH/1126, PR/1128).
  • Fixed a formatting issue with virtual indicator modules (_gen_returns_section) that was creating malformed Returns sections in sphinx-generated documentation. (PR/1131).
  • Fix biological_effective_degree_days for non-scalar latitudes, when using method "gladstones". (GH/1136, PR/1137).
  • Fixed some extlink warnings found in sphinx and configured ReadTheDocs to use mamba as the dependency solver. (GH/1139, PR/1140).
  • Fixed some broken hyperlinks to articles, users, and external documentation throughout the code base and jupyter notebooks. (PR/1160).
  • Removed some artefact reference roles introduced in PR/1131 that were causing LaTeX builds of the documentation to fail. (GH/1154, PR/1156).
  • Fix biological_effective_degree_days for non-scalar latitudes, when using method "gladstones". (GH/1136, PR/1137).
  • Fixed some extlink warnings found in sphinx and configured ReadTheDocs to use mamba as the dependency solver. (GH/1139, PR/1140).
  • Fixed some broken hyperlinks to articles, users, and external documentation throughout the code base and jupyter notebooks. (PR/1160).
  • Addressed a bug that was causing pylint to stackoverflow by removing it from the tox configuration. pylint should only be called from an active environment. (PR/1163)
  • Fixed kmeans_reduce_ensemble breaking when using dask arrays (PR/1170)
  • Addressed a bug that was causing pylint to stackoverflow by removing it from the tox configuration. pylint should only be called from an active environment. (PR/1163)

Internal changes

  • Marked a test (test_release_notes_file_not_implemented) that can only pass when source files are available so that it can easily be skipped on conda-forge build tests. (GH/1116, PR/1117).
  • Split a few YAML strings found in the virtual modules that regularly issued warnings on the code checking CI steps. (PR/1118).
  • Function xclim.core.calendar.build_climatology_bounds now exposed via __all__. (PR/1146).
  • Clarifications added to docstring of xclim.core.bootstrapping.bootstrap_func. (PR/1146).
  • Bibliographic references for supporting scientific articles are now found in a bibtex file (docs/references.bib). These are now made available within the generated documentation using sphinxcontrib-bibtex. (GH/1094, PR/1131).
  • Added information URLs to setup.py in order to showcase issue tracker and other sites on PyPI page (PR/1156).
  • Configured the LaTeX build of the documentation to ignore the custom bibliographies, as they were redundant in the generated PDF. (PR/1158).
  • Run length encoding (xclim.indices.run_length.rle) has been optimized. (GH/956, PR/1122).
  • Added a sphinx-build -b linkcheck step to the tox-based "docs" build as well as to the ReadTheDocs configuration. (PR/1160).
  • pylint is now setup to use a pylintrc file, allowing for more granular control of warnings and exceptions. Many errors are still present, so addressing them will need to occur gradually. (PR/1163).
  • The generic indices count_level_crossings, count_occurrences, first_occurrence, and last_occurrence are now fully tested. (PR/1157).
  • Adjusted the ANUCLIM indices by removing "ANUCLIM" from their titles, modifying their docstrings, and handling "op" input in a more user-friendly way. (GH/1055, PR/1169).
  • Documentation for fire-based indices/indicators has been reorganized to reflect the new submodule structure. (PR/1159).

Don't miss a new xclim release

NewReleases is sending notifications on new releases.