Contributors to this version: Juliette Lavoie (@juliettelavoie), Pascal Bourgault (@aulemahal), Trevor James Smith (@Zeitsperre), David Huard (@huard), Éric Dupuis (@coxipi), Dante Castro (@profesorpaiche), Gabriel Rondeau-Genesse (@RondeauG).
Announcements
xclim
no longer supports Python3.8. (GH/1268, PR/1565).xclim
now officially supports Python3.12 (requiresnumba>=0.59.0
). (PR/1613).xclim
now adheres to theSemantic Versioning 2.0.0 <https://semver.org/>
_ specification. (GH/1556, PR/1569).- The
xclim
repository now uses GitHub Discussions to offer help for users, coordinate translation efforts, and support general Q&A for thexclim
community. Thexclim
Gitter
room has been deprecated in favour of GitHub Discussions. (GH/1571, PR/1572). - For secure correspondence,
xclim
now offers a PGP key for users to encrypt sensitive communications. For more information, see theSECURITY.md
. (GH/1181, PR/1604).
New features and enhancements
- Added uncertainty partitioning method
lafferty_sriver
from Lafferty and Sriver (2023), which can partition uncertainty related to the downscaling method. (GH/1497, PR/1529). - Validate YAML indicators description before trying to build module. (GH/1523, GH/1595, PR/1560, PR/1596, PR/1600).
- Support
indexer
keyword in YAML indicator description. (GH/1522, PR/1561). - New
xclim.core.calendar.stack_periods
andunstack_periods
for performingrolling(time=...).construct(..., stride=...)
but with non-uniform temporal periods like years or months. They replacexclim.sdba.processing.construct_moving_yearly_window
andunpack_moving_yearly_window
which are deprecated and will be removed in a future release. - New
as_dataset
options forxclim.set_options
. When True, indicators will output Datasets instead of DataArrays. (GH/1257, PR/1625). - Added new option for
universal_thermal_climate_index
calculation (wind_cap_min: bool
) to cap low wind velocities to a minimum of 0.5 m/s following Bröde (2012) guidelines. (GH/1634, PR/1635). - Added option
never_reached
todegree_days_exceedance_date
to assign a custom value when the sum threshold is never reached. (GH/1459, PR/1647). - Added option
min_members
to ensemble statistics to mask elements when the number of valid members is under a threshold. (GH/1459, PR/1647). - Distribution instances can now be passed to the
dist
argument of most statistical indices. (PR/1644). - Added a new
xclim.indices.generic.select_rolling_resample_op
function to allow for computing rolling statistics. (GH/1480, PR/1643). - Add the possibility to use a group with a window in
xc.sdba.processing.reordering
. (PR/1566).
Breaking changes
xclim
base Python version has been raised to Python3.9. Python3.9+ coding conventions are now supported. (GH/1268, PR/1565).xclim
base dependencies have been raised topandas>=2.2.0
andxarray>=2023.11.0
to reflect changes to time frequency codes introduced inpandas==2.2.0
. (GH/1534, PR/1565; see also:pydata/xarray GH/8394 <https://github.com/pydata/xarray/issues/8394>
_ and ). Many default frequency string outputs have been modified (:- 'Y' (year) -> 'YE' (year end). (see:
pandas PR/55792 <https://github.com/pandas-dev/pandas/pull/55792>
_). - 'M' (month) -> 'ME' (month end). (see:
pandas PR/52064 <https://github.com/pandas-dev/pandas/pull/52064>
_). - 'Q' (quarter) -> 'QE' (quarter end). (see:
pandas PR/55553 <https://github.com/pandas-dev/pandas/pull/55553>
_) - 'A' and 'AS' have been removed (use 'YE' and 'YS' instead). (see:
pandas PR/55252 <https://github.com/pandas-dev/pandas/pull/55252>
_). ('YE' is only supported for cftime data inxarray >= 2024.1.1
). - 'T' (minute), 'L' (millisecond), 'U' (microsecond), and 'N' (nanosecond) -> 'min', 'ms', 'us', and 'ns'. (see:
pandas PR/54061 <https://github.com/pandas-dev/pandas/pull/54061>
_).
- 'Y' (year) -> 'YE' (year end). (see:
bump2version
has been replaced withbump-my-version
to bump the version number using configurations set in thepyproject.toml
file. (GH/1557, PR/1569).xclim
's units registry and units formatting are now extended fromcf-xarray
. The exponent sign "^" is now never added in theunits
attribute. For example, square meters are given as "m2" instead of "m^2" byxclim
. Both signs are still accepted as inputs. (GH/1010, PR/1590).yamale
is now listed as a core dependency (was previously listed in thedev
installation recipe). (GH/1595, PR/1596).- Due to a licensing limitation, the calculation of empirical orthogonal function based on
eofs
(xclim.sdba.properties.first_eof
) has been removed fromxclim
. (GH/1620, PR/1621). black
formatting style has been updated to the 2024 stable conventions.isort
has been added to thedev
installation recipe. (PR/1626).- The indice and indicator for
winter_storm
has been removed (deprecated sincexclim>=0.46.0
in favour ofsnd_storm_days
). (PR/1565). xclim
has dropped support forscipy
versions below v1.9.0 andnumpy
versions below v1.20.0. (PR/1565).- For generic function
select_resample_op
andcore.units.to_agg_units
, operation "sum" will now return the same units as the input, and not implicitly be translated to an "integral". (GH/1645, PR/1649). lmoments3
was removed as a dependency ofxclim
due to incompatible licensing (GPLv3 vsxclim
's Apache 2.0). Depending on the outcome of efforts to modify the licensing oflmoments3
, this change may eventually be reverted. SeeOuranosinc/lmoments3#12 <https://github.com/Ouranosinc/lmoments3/issues/12>
_. See also the "frequency analysis" notebook for an example on how to continue using the probability weighted moments method for fitting distributions. (GH/1620, PR/1644).
Bug fixes
- Fixed passing
missing=0
toxclim.core.calendar.convert_calendar
. (GH/1562, PR/1563). - Fixed wrong
window
attributes inxclim.indices.standardized_precipitation_index
,xclim.indices.standardized_precipitation_evapotranspiration_index
. (GH/1552 PR/1554). - Fixed the daily case
freq='D'
forxclim.stats.preprocess_standardized_index
(GH/1602 PR/1607). - Several spelling mistakes have been corrected within the documentation and codebase. (PR/1576).
- Added missing
xclim.ensembles.robustness_fractions
andxclim.ensembles.robustness_categories
in API doc section. (PR/1630). - Fixed an issue that can occur when fetching the testing data and running tests on Windows systems. Adapted a few existing tests for Windows support. (PR/1648).
Internal changes
- The
flake8
configuration has been migrated fromsetup.cfg
to.flake8
;setup.cfg
has been removed. (PR/1569) - The
bump-version.yml
workflow has been adjusted to bump thepatch
version when the last version is determined to have been arelease
version; otherwise, thebuild
version is bumped. (GH/1557, PR/1569). - The GitHub Workflows now use the
step-security/harden-runner
action to monitor source code, actions, and dependency safety. All workflows now employ more constrained permissions rule sets to prevent security issues. (PR/1577, PR/1578, PR/1597). - Updated the
CONTRIBUTING.rst
directions to showcase the new versioning system. (GH/1557, PR/1573). - The
codespell
library is now a development dependency for thedev
installation recipe with configurations found withinpyproject.toml
. This is also now a linting step and integrated as apre-commit
hook. For more information, see the codespell documentation (PR/1576). - Climate indicators search page now prioritizes the "official" indicators (atmos, land, seaIce and generic), virtual submodules can be added to search through checkbox option. (GH/1559, PR/1593).
- The OpenSSF StepSecurity bot has contributed some changes to the workflows and pre-commit. (GH/1181, PR/1606):
- Dependabot has been configured to monitor the
xclim
repository for dependency updates. Theactions-version-updater.yml
workflow has been deprecated. - GitHub Actions are now pinned to their commit hashes to prevent unexpected changes in the future.
- A new GitHub Workflow (
workflow-warning.yml
) has been added to warn maintainers when a forked repository has been used to open a Pull Request that modifies GitHub Workflows. pylint
has been configured to provide some overhead checks of thexclim
codebase as well as run as part ofxclim
'spre-commit
hooks.- Some small adjustments to code organization to address
pylint
errors.
- Dependabot has been configured to monitor the
dev
formatting tools (black
,blackdoc
,isort
) are now pinned to theirpre-commit
hook version equivalents in bothpyproject.toml
andtox.ini
. (PR/1626).black
,isort
, andpyupgrade
code formatters no longer target Python3.8 coding style conventions. (PR/1565).- The GitHub Workflows now include builds to run tests against both Windows and MacOS. (PR/1648).
prefetch
is now available as atox
environment modifier in order to download the testing data before launchingpytest
(e.g.py3x-prefetch
). This is required for running tests the first time on Windows if the testing data has not already been installed. (PR/1648).- Removed
step-security/harden-runner
from thefinish
job as it does not work on container images lackingsudo
access. (PR/1655).