github Ouranosinc/xclim v0.40.0

latest release: v0.41.0
21 months ago

History

0.40.0 (2023-01-13)

Contributors to this version: Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal), David Huard (@huard), Juliette Lavoie (@juliettelavoie).

New features and enhancements

  • Virtual modules can add variables to xclim.core.utils.VARIABLES through the new variables section of the yaml files. (GH/1129, PR/1231).
  • xclim.core.units.convert_units_to can now perform automatic conversions based on the standard name of the input when needed. (GH/1205, PR/1206).
    • Conversion from amount (thickness) to flux (rate), using amount2rate and rate2amount.
    • Conversion from amount to thickness for liquid water quantities, using the new amount2lwethickness and lwethickness2amount. This is similar to the implicit transformations enabled by the "hydro" unit context.
    • Passing context='infer' will activate the "hydro" context if the source or the target are DataArrays with a standard name that is compatible, as decided by the new xclim.core.units.infer_context function.
  • New generic indicator realm. Now holds indicators previously meant for streamflow analysis in the land realm: fit, return_level (previously freq_analysis) and stats. (GH/1130, PR/1225).
  • Thresholds and other quantities passed as parameters of indicators can now be multi-dimensional DataArrays. xarray broadcasting mechanisms will apply. These parameters are now annotated as "Quantity" in the signatures (xclim.core.utils.Quantity), instead of "str" as before. Attributes where such thresholds where included will now read "" (french: "") for these new cases. Multi-dimensional quantities are still largely unsupported, except where documented in the docstring. (GH/1093, PR/1236).

Breaking changes

  • Rewrite of xclim.core.calendar.time_bnds. It should now be more resilient and versatile, but all cftime_* and cfindex_* functions were removed. (GH/74, PR/1207).
  • hydro context is not always enabled, as it led to unwanted unit conversions. Unit conversion operations now need to explicitly declare the hydro context to support conversions from kg / m2 /s to mm/day. (GH/1208, PR/1227).
  • Many previously deprecated indices and indicators have been removed from xclim (PR/1228), with replacement indices/indicators suggested as follows:
    • xclim.indicators.atmos.fire_weather_indexesxclim.indicators.atmos.cffwis_indices
    • xclim.indices.freshet_startxclim.indices.first_day_temperature_above
    • xclim.indices.first_day_abovexclim.indices.first_day_temperature_above
    • xclim.indices.first_day_belowxclim.indices.first_day_temperature_below
    • xclim.indices.tropical_nightsxclim.indices.tn_days_above
    • xclim.indices.generic.degree_daysxclim.indices.generic.cumulative_difference
  • The following modules have been removed (PR/1228):
    • xclim.indices.fwi → functions migrated to xclim.indices.fire
    • xclim.subset (mock submodule) → functions migrated to clisops.core.subset
  • Indicators standardized_precipitation_index and standardized_precipitation_evapotranspiration_index will now require pr_cal and wb_cal as keyword arguments only. (PR/1236).
  • The internal object PercentileDataArray has been removed. (PR/1236).
  • The xclim.testing.utils.get_all_CMIP6_variables and xclim.testing.utils.update_variable_yaml function were removed as the former was extremely slow and unusable. (PR/1258).
  • The wind speed input of atmos.potential_evapotranspiration and atmos.water_budget was renamed to sfcWind (capital W) as this is the correct CMIP6 name. (PR/1258).
  • Indicator land.stats, land.fit and land.freq_analysis are now deprecated and will be removed in version 0.43. They are being phased out in favor of generic indicators generic.stats, generic.fit and generic.return_level respectively. (GH/1130, PR/1225).

Bug fixes

  • The weighted ensemble statistics are now performed within a context in order to preserve data attributes. (GH/1232, PR/1234).
  • The make docs Makefile recipe was failing with an esoteric error. This has been resolved by splitting the linkcheck and docs steps into separate actions. (GH/1248. PR/1251).
  • The setup step for pytest needed to be addressed due to the fact that files were being accessed/modified by multiple tests at a time, causing segmentation faults in some tests. This has been resolved by splitting functions into those that fetch or generate test data (under xclim.testing.tests.data) and the fixtures that supply accessors to them (under xclim.testing.tests.conftest). (GH/1238, PR/1254).
  • Relaxed the expected output for test_spatial_analogs[friedman_rafsky] to support expected results from scikit-learn 1.2.0.
  • The MBCn example in documentation has been fixed to properly imitate the source. (GH/1249, PR/1250).
  • Streamflow indicators relying on indices defined in xclim.indices.stats were not checking input variable units. These indicators will now raise an error if input data units are not m^3/s. (GH/1130, PR/1225).
  • Adjusted some documentation examples were not being rendered properly. (GH/1264, PR/1266).

Internal changes

  • Minor adjustments to GitHub Actions workflows (newest Ubuntu images, updated actions version, better CI triggering). (PR/1221).
  • Pint units context added to various operations, tests and Indicator attributes. (GH/1208, PR/1227).
  • Updated article from Alavoine & Grenier (2022) within documentation. Many article reference URLs have been updated to use HTTPS where possible. (GH/1246, PR/1247).
  • Added relevant variable dataflag checks for potential evaporation, convective precipitation, and air pressure at sea level. (PR/1241).
  • Documentation restructured to include ReadMe page (as About) with some minor changes to documentation titles. (PR/1233).
  • xclim development build now uses nbqa to effectively run black checks over notebook cells. (PR/1233).
  • Some tox recipes (opt-slow, conda) are temporarily deactivated until a tox>=4.0-compatible tox-conda plugin is released. (PR/1258).
  • A notebook (extendingxclim.ipynb) has been updated to remove mentions of obsolete xclim.subset module. (PR/1258).
  • Merge of sdba documentation from the module and the rst files, some cleanup and addition of a section refering to github issues. (PR/1230).

Don't miss a new xclim release

NewReleases is sending notifications on new releases.