v0.49.0
Contributors to this version: Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal), Juliette Lavoie (@juliettelavoie), David Huard (@huard), Gabriel Rondeau-Genesse (@RondeauG), Javier Diez-Sierra (@JavierDiezSierra), Sarah Gammon (@SarahG-579462), Éric Dupuis (@coxipi).
Announcements
New features and enhancements
- Indicator
xclim.atmos.potential_evapotranspiration
and indicexclim.indices.potential_evapotranspiration
now accept a new value (DA02
) for argumentmethod
implementing potential evapotranspiration based on Droogers and Allen (2002). (GH/1710, PR/1723). - The documentation now uses the furo theme for Sphinx. This theme supports native "light" and "dark" modes, adaptive screen resolution, as well as provides a better navigation layout for pages housing long lists of entries (e.g.
indices
). (GH/1693, PR/1731). xclim.ensembles.ensemble_percentiles
now takes amethod
argument, accepting one of:'interpolated_inverted_cdf'
,'hazen'
,'weibull'
,'linear'
(default),'median_unbiased'
, or'normal_unbiased'
. (GH/1694, PR/1732).- Distributions with negative values are directly fitted without need for an offset for distributions such as
'gamma'
and'fisk'
inxclim.indices.standardized_precipitation_evapotranspiration_index
. (GH/1477 PR/1720). xclim.indices.stats_fit_start
gives an estimate of theloc
parameter for'gamma'
and'fisk'
distributions. (GH/1477 PR/1720).
New indicators
- New
snw_season_length
andsnd_season_length
computing the duration between the start and the end of the snow season, both defined as the first day of a continuous period with snow above/under a threshold. Previous versions of these indicators were renamedsnw_days_above
andsnd_days_above
to better reflect what they computed : the number of days with snow above a given threshold (with no notion of continuity). (GH/1703, PR/1708). - Added
xclim.atmos.duff_moisture_code
, part of the Canadian Forest Fire Weather Index System. It was already an output of thexclim.atmos.cffwis_indices
, but now has its own standalone indicator. (GH/1698, PR/1712).
Breaking changes
- The previously deprecated functions
xclim.sdba.processing.construct_moving_yearly_window
andxclim.sdba.processing.unpack_moving_yearly_window
have been removed. These functions have been replaced byxclim.core.calendar.stack_periods
andxclim.core.calendar.unstack_periods
. (PR/1717). - The previously deprecated function
xclim.ensembles.change_significance
has been removed. (PR/1737). - Indicators
snw_season_length
andsnd_season_length
have been modified. (GH/1703, PR/1708). - The
'hargeaves85'
/'hg85'
method for thepotential_evapotranspiration
indicator and indice has been modified for precision and consistency with recent academic literature. (GH/1710, PR/1723). - The
__getitem__
method ofxclim.core.indicator.Parameter
instances has been removed. Accessing members ofParameters
now uniquely uses dot notation. (PR/1721). - The obsolete function wrapper for generating Indicators
xclim.core.utils.wrapped_partial
has been removed. (PR/1721). - The default documentation theme has changed from
sphinx-rtd-theme
tofuro
; Several modifications to the documentation configuration and CSS overrides have been made to accommodate the changes.furo
is now adocs
dependency. (GH/1693, PR/1731). - Estimation of parameters using
_fit_start
forgamma
andfisk
has been changed and can affect the results obtained with full-fledged (e.g. "ML") methods. (GH/1477 PR/1720). - Method
APP
inxclim.indices.standardized_precipitation_index
andxclim.indices.standardized_precipitation_evapotranspiration_index
now requires the user to impose aloc
parameter throughfitkwargs['floc']
. (GH/1477, PR/1720). - Zero inflated distributions used in
xclim.stats.standardized_index
now appropriately use the probability of zeroes in the calibration data and not the entire dataset. (GH/1477 PR/1720).
Bug fixes
- Fixed a bug in
sdba
'smap_groups
that prevented passing DataArrays with cftime coordinates if thesdba_encode_cf
option was'True'
. (GH/1673, PR/1674). - Fixed bug in
sdba
where a loaded training dataset could not be used for adjustment. (GH/1678, PR/1679). - Fixed bug with loess smoothing for an array full of NaNs. (PR/1699).
- Fixed and adapted
time_bnds
to the newest xarray. (PR/1700). - Fixed "agreement fraction" in
robustness_fractions
to distinguish between negative change and no change. Added "negative" and "changed negative" fractions (GH/1690, PR/1711). make_criteria
now skips columns with NaNs across all realizations. (PR/1713).- Fixed bug where
QuantileDeltaMapping
adjustment was failing for seasonal grouping. (GH/1704, PR/1716). - The codebase has been adjusted to address several (~400)
mypy
-related errors attributable to inaccurate function call signatures and variable name shadowing. (GH/1719, PR/1721). xclim.core.formatting.generate_indicator_docstring
has been modified to ensure that thenumpy
-docstrings of all Indicators are consistent in their formatting. (PR/1731).- Fixed documentation example for frequency adaptation with
sdba
. (GH/1740, PR/1742).
Internal changes
- Added "doymin" and "doymax" to the possible operations of
generic.stats
. Fixed a warning issue whenop
was "integral". (PR/1672). - Reorganized GitHub CI build matrices to run the doctests more consistently. (PR/1709).
- Removed the experimental
numba
andllvm
dependency installation steps in thetox.ini
file. Addednumba@main
to the upstream dependencies. (PR/1709). - Added the
tox-gh
dependency to the development installation recipe. This will soon be required for running thetox
test ensemble on GitHub Workflows. (PR/1709). - Added the
vulture
static code analysis tool for finding dead code to the development dependency list and linters (makefile, tox and pre-commit hooks). (PR/1717). - Added error message when using
xclim.indices.stats.dist_method
withnnlf
and included note in docstring. (GH/1683, PR/1714). - PEP8 rule
N802
is now enabled in theruff
formatter. Function names should follow Snake case, with rare exceptions. (PR/1721). - Linting dependencies have been updated to the latest versions and made consistent across
environment.yml
,pyproject.toml
andtox.ini
files. (PR/1717). - Code styling for the documentation now uses
sas
("light" theme) andlightbulb
("dark" theme) in order to ensure adequate contrast for code blocks. (PR/1731). - Added several CSS overrides related to the HTML elements generated by
xarray
in the notebook-sourced documentation. (PR/1731).