The default mechanism for computing the Mean Radiant Temperature, a part of the Universal Thermal Climate Index (UTCI) was broken in xclim v0.44.0 and v0.45.0. This has now been fixed by changing the default settings.
New indicators
xclim.indices.snw_storm_days computes the number of days with snowfall amount accumulation above a given threshold (default: 10 Kg m-2). (PR/1505).
Added xclim.indices.wind_power_potential to estimate the potential for wind power production given wind speed at the turbine hub height and turbine specifications, along with xclim.indices.wind_profile to estimate the wind speed at different heights based on wind speed at a reference height. (GH/1458, PR/1471).
New features and enhancements
xclim now has a dedicated console command for prefetching testing data from xclim-testdata with branch options (e.g.: $ xclim prefetch_testing_data --branch some_development_branch). This command can be used to download the testing data to a local cache, which can then be used to run the testing suite without internet access or in "offline" mode. For more information, see the contributing documentation section for Updating Testing Data. (GH/1468, PR/1473).
The testing suite now offers a means of running tests in "offline" mode (using pytest-socket <https://github.com/miketheman/pytest-socket>_ to block external connections). This requires a local copy of xclim-testdata to be present in the user's home cache directory and for certain pytest options and markers to be set when invoked. For more information, see the contributing documentation section for Running Tests in Offline Mode. (GH/1468, PR/1473).
The SKIP_NOTEBOOKS flag to speed up docs builds is now documented. See the contributing documentation section Get Started! for details. (GH/1470, PR/1476).
Refactored the indicators page with the addition of a search bar (GH/1433, PR/1454).
Indicator xclim.indices.generic.stats now accepts any frequency (previously only daily). (PR/1498).
Added argument "out_units" to select_resample_op to bypass limitations of to_agg_units in custom indicators. Also, added var to supported operations in to_agg_units. (PR/1498).
adapt_freq_thresh argument was added to sdba`` training functions, to facilitate performing frequency adaptation appropriately in each map block. (PR/1407).
Standardized indices (xclim.indices.standardized_precipitation_index and xclim.indices.standardized_precipitation_evapotranspiration_index) (GH/1270, GH/1416, GH/1474, PR/1311) were changed:
Optimized and noticeably faster calculation.
Can be computed in two steps: first compute fit parameters with xclim.indices.stats.standardized_index_fit_params, then use the output in the standardized indices functions.
The standardized index values are now clipped to ±8.21. This reflects the float64 precision of the computation when cumulative distributed function values are inverted to a normal distribution and avoids returning infinite values.
An offset parameter is now available to account for negative water balance valuesxclim.indices.standardized_precipitation_evapotranspiration_index.
Bug fixes
Fixed an error in the pytest configuration that prevented copying of testing data to thread-safe caches of workers under certain conditions (this should always occur). (PR/1473).
Coincidentally, this also fixes an error that caused pytest to error-out when invoked without an active internet connection. Running pytest without network access is now supported (requires cached testing data). (GH/1468).
Calling a sdba.map_blocks-wrapped function with data chunked along the reduced dimensions will raise an error. This forbids chunking the trained dataset along the distribution dimensions, for example. (GH/1481, PR/1482).
Optimization of indicators huglin_index and biologically_effective_degree_days when used with dask and flox. As a side effect, the indice functions (i.e. under xclim.indices) no longer mask incomplete periods. The indicators' output is unchanged under the default "check_missing" setting (GH/1494, PR/1495).
Fixed xclim.indices.run_length.lazy_indexing which would sometimes trigger the loading of auxiliary coordinates. (GH/1483, PR/1484).
Indicators snd_season_length and snw_season_length will return 0 instead of NaN if all inputs have a (non-NaN) zero snow depth (or water-equivalent thickness). (PR/1492, GH/1491)
Fixed a bug in the pytest configuration that could prevent testing data caching from occurring in systems where the platform-dependent cache directory is not found in the user's home. (GH/1468, PR/1473).
Fix xclim.core.dataflags.data_flags variable name generation (PR/1507).
Remove nonsensical stat='average' option for mean_radiant_temperature. (GH/1496, PR/1501).
Breaking changes
pytest-socket is now a required development dependency for running "offline" tests or the "offline" configuration of the tox testing suite. This has been added to the dev installation recipe. (GH/1468, PR/1473).
For better transparency and control in development, the tox configuration has been adapted to allow passing of markers directly to the pytest call. Positional arguments must be passed to tox after the -- separator to select/deselect tests (e.g. 'tox -e py38 -- -m "not slow"'). (PR/1473).
For better accuracy, the tox -e black recipe has been renamed to tox -e lint, as this configuration already included several other linting checks. (PR/1473).
xclim.indices.winter_storm renamed to xclim.indices.snd_storm_days. (PR/1505).
Default threshold in xclim.indices.snw_season_{start|length|end} changed form 20 kg m-2 to 4 kg m-2. (PR/1505).
xclim development dependencies now include ruff. pycodestyle and pydocstyle have been replaced by ruff and removed from the dev installation recipe. (PR/1504).
The mf_file call signature found in xclim.ensembles.create_ensemble (and xclim.ensembles._ens_align_dataset) has been removed (deprecated since xclim v0.43.0). (PR/1506).
xclim.indices.standardized_precipitation_index and xclim.indices.standardized_precipitation_evapotranspiration_index will no longer accept two datasets (data and calibration data). Instead, a single dataset covering both the calibration and evaluation periods is expected. (GH/1270, PR/1311).
Internal changes
Changed "degK" to "K" (used to designate Kelvin units). (PR/1475).
Added a pytest marker (pytest.mark.requires_internet) to allow for skipping of tests that depend on remote network calls to function properly. (PR/1473).
Added handling for pytest-socket's SocketBlockedError in xclim.testing.open_dataset when attempting to fetch md5 validation files for cached testing data while explicitly disabling internet sockets. (GH/1468, PR/1473).
Updated the testing data used in the analogs.ipynb notebook to use the testing data now found in Ouranosinc/xclim-testdata's main branch. (xclim-testdata PR/26 <https://github.com/Ouranosinc/xclim-testdata/pull/26>_, PR/1473).
Contributors to this version: David Huard (:user:huard), Trevor James Smith (:user:Zeitsperre), Pascal Bourgault (:user:aulemahal), Éric Dupuis (:user:coxipi).
Announcements
^^^^^^^^^^^^^
The default mechanism for computing the Mean Radiant Temperature, a part of the Universal Thermal Climate Index (UTCI) was broken in xclim v0.44.0 and v0.45.0. This has now been fixed by changing the default settings.
New indicators
^^^^^^^^^^^^^^
xclim.indices.snw_storm_days computes the number of days with snowfall amount accumulation above a given threshold (default: 10 Kg m-2). (:pull:1505).
Added xclim.indices.wind_power_potential to estimate the potential for wind power production given wind speed at the turbine hub height and turbine specifications, along with xclim.indices.wind_profile to estimate the wind speed at different heights based on wind speed at a reference height. (:issue:1458, :pull:1471).
New features and enhancements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
xclim now has a dedicated console command for prefetching testing data from xclim-testdata with branch options (e.g.: $ xclim prefetch_testing_data --branch some_development_branch). This command can be used to download the testing data to a local cache, which can then be used to run the testing suite without internet access or in "offline" mode. For more information, see the contributing documentation section for Updating Testing Data. (:issue:1468, :pull:1473).
The testing suite now offers a means of running tests in "offline" mode (using pytest-socket <https://github.com/miketheman/pytest-socket>_ to block external connections). This requires a local copy of xclim-testdata to be present in the user's home cache directory and for certain pytest options and markers to be set when invoked. For more information, see the contributing documentation section for Running Tests in Offline Mode. (:issue:1468, :pull:1473).
The SKIP_NOTEBOOKS flag to speed up docs builds is now documented. See the contributing documentation section Get Started! for details. (:issue:1470, :pull:1476).
Refactored the indicators page with the addition of a search bar (:issue:1433, :pull:1454).
Indicator xclim.indices.generic.stats now accepts any frequency (previously only daily). (:pull:1498).
Added argument "out_units" to select_resample_op to bypass limitations of to_agg_units in custom indicators. Also, added var to supported operations in to_agg_units. (:pull:1498).
adapt_freq_thresh argument was added to sdba`` training functions, to facilitate performing frequency adaptation appropriately in each map block. (:pull:1407).
Standardized indices (xclim.indices.standardized_precipitation_index and xclim.indices.standardized_precipitation_evapotranspiration_index) (:issue:1270, :issue:1416, :issue:1474, :pull:1311) were changed:
Optimized and noticeably faster calculation.
Can be computed in two steps: first compute fit parameters with xclim.indices.stats.standardized_index_fit_params, then use the output in the standardized indices functions.
The standardized index values are now clipped to ±8.21. This reflects the float64 precision of the computation when cumulative distributed function values are inverted to a normal distribution and avoids returning infinite values.
An offset parameter is now available to account for negative water balance valuesxclim.indices.standardized_precipitation_evapotranspiration_index.
Bug fixes
^^^^^^^^^
Fixed an error in the pytest configuration that prevented copying of testing data to thread-safe caches of workers under certain conditions (this should always occur). (:pull:1473).
Coincidentally, this also fixes an error that caused pytest to error-out when invoked without an active internet connection. Running pytest without network access is now supported (requires cached testing data). (:issue:1468).
Calling a sdba.map_blocks-wrapped function with data chunked along the reduced dimensions will raise an error. This forbids chunking the trained dataset along the distribution dimensions, for example. (:issue:1481, :pull:1482).
Optimization of indicators huglin_index and biologically_effective_degree_days when used with dask and flox. As a side effect, the indice functions (i.e. under xclim.indices) no longer mask incomplete periods. The indicators' output is unchanged under the default "check_missing" setting (:issue:1494, :pull:1495).
Fixed xclim.indices.run_length.lazy_indexing which would sometimes trigger the loading of auxiliary coordinates. (:issue:1483, :pull:1484).
Indicators snd_season_length and snw_season_length will return 0 instead of NaN if all inputs have a (non-NaN) zero snow depth (or water-equivalent thickness). (:pull:1492, :issue:1491)
Fixed a bug in the pytest configuration that could prevent testing data caching from occurring in systems where the platform-dependent cache directory is not found in the user's home. (:issue:1468, :pull:1473).
Fix xclim.core.dataflags.data_flags variable name generation (:pull:1507).
Remove nonsensical stat='average' option for mean_radiant_temperature. (:issue:1496, :pull:1501).
Breaking changes
^^^^^^^^^^^^^^^^
pytest-socket is now a required development dependency for running "offline" tests or the "offline" configuration of the tox testing suite. This has been added to the dev installation recipe. (:issue:1468, :pull:1473).
For better transparency and control in development, the tox configuration has been adapted to allow passing of markers directly to the pytest call. Positional arguments must be passed to tox after the -- separator to select/deselect tests (e.g. 'tox -e py38 -- -m "not slow"'). (:pull:1473).
For better accuracy, the tox -e black recipe has been renamed to tox -e lint, as this configuration already included several other linting checks. (:pull:1473).
xclim.indices.winter_storm renamed to xclim.indices.snd_storm_days. (:pull:1505).
Default threshold in xclim.indices.snw_season_{start|length|end} changed form 20 kg m-2 to 4 kg m-2. (:pull:1505).
xclim development dependencies now include ruff. pycodestyle and pydocstyle have been replaced by ruff and removed from the dev installation recipe. (:pull:1504).
The mf_file call signature found in xclim.ensembles.create_ensemble (and xclim.ensembles._ens_align_dataset) has been removed (deprecated since xclim v0.43.0). (:pull:1506).
xclim.indices.standardized_precipitation_index and xclim.indices.standardized_precipitation_evapotranspiration_index will no longer accept two datasets (data and calibration data). Instead, a single dataset covering both the calibration and evaluation periods is expected. (:issue:1270, :pull:1311).
Most Recent Ignore Conditions Applied to This Pull Request
| Dependency Name | Ignore Conditions |
| --- | --- |
| xclim | [>= 0.47.a, < 0.48] |
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps xclim from 0.43 to 0.46.0.
Release notes
Sourced from xclim's releases.
... (truncated)
Changelog
Sourced from xclim's changelog.
... (truncated)
Commits
8664d50
Prepare v0.46.0 (#1508)72204bd
CHANGES.rst ordering2ae5368
Merge branch 'master' into prepare_v046044baa6b
Bump version: 0.45.22-beta → 0.45.23-beta7cf2001
Remove faulty default in MRT and UTCI (#1501)5d96c50
Merge branch 'master' into fix-mrt4652182
Bump version: 0.45.21-beta → 0.45.22-betadae1ffd
Improve SPI performance (#1311)59e7df6
only chunk if necessary, check if dask used (review)7f46856
Update CHANGES.rst (review)Most Recent Ignore Conditions Applied to This Pull Request
| Dependency Name | Ignore Conditions | | --- | --- | | xclim | [>= 0.47.a, < 0.48] |Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show