pypi xclim 0.48.0
v0.48.0

latest releases: 0.49.0, 0.48.2, 0.48.1...
2 months ago

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 (requires numba>=0.59.0). (PR/1613).
  • xclim now adheres to the Semantic 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 the xclim community. The xclim 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 the SECURITY.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 and unstack_periods for performing rolling(time=...).construct(..., stride=...) but with non-uniform temporal periods like years or months. They replace xclim.sdba.processing.construct_moving_yearly_window and unpack_moving_yearly_window which are deprecated and will be removed in a future release.
  • New as_dataset options for xclim.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 to degree_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 to pandas>=2.2.0 and xarray>=2023.11.0 to reflect changes to time frequency codes introduced in pandas==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 in xarray >= 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>_).
  • bump2version has been replaced with bump-my-version to bump the version number using configurations set in the pyproject.toml file. (GH/1557, PR/1569).
  • xclim's units registry and units formatting are now extended from cf-xarray. The exponent sign "^" is now never added in the units attribute. For example, square meters are given as "m2" instead of "m^2" by xclim. Both signs are still accepted as inputs. (GH/1010, PR/1590).
  • yamale is now listed as a core dependency (was previously listed in the dev 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 from xclim. (GH/1620, PR/1621).
  • black formatting style has been updated to the 2024 stable conventions. isort has been added to the dev installation recipe. (PR/1626).
  • The indice and indicator for winter_storm has been removed (deprecated since xclim>=0.46.0 in favour of snd_storm_days). (PR/1565).
  • xclim has dropped support for scipy versions below v1.9.0 and numpy versions below v1.20.0. (PR/1565).
  • For generic function select_resample_op and core.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 of xclim due to incompatible licensing (GPLv3 vs xclim's Apache 2.0). Depending on the outcome of efforts to modify the licensing of lmoments3, this change may eventually be reverted. See Ouranosinc/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 to xclim.core.calendar.convert_calendar. (GH/1562, PR/1563).
  • Fixed wrong window attributes in xclim.indices.standardized_precipitation_index, xclim.indices.standardized_precipitation_evapotranspiration_index. (GH/1552 PR/1554).
  • Fixed the daily case freq='D' for xclim.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 and xclim.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 from setup.cfg to .flake8; setup.cfg has been removed. (PR/1569)
  • The bump-version.yml workflow has been adjusted to bump the patch version when the last version is determined to have been a release version; otherwise, the build 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 the dev installation recipe with configurations found within pyproject.toml. This is also now a linting step and integrated as a pre-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. The actions-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 the xclim codebase as well as run as part of xclim's pre-commit hooks.
    • Some small adjustments to code organization to address pylint errors.
  • dev formatting tools (black, blackdoc, isort) are now pinned to their pre-commit hook version equivalents in both pyproject.toml and tox.ini. (PR/1626).
  • black, isort, and pyupgrade 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 a tox environment modifier in order to download the testing data before launching pytest (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 the finish job as it does not work on container images lacking sudo access. (PR/1655).

Don't miss a new xclim release

NewReleases is sending notifications on new releases.