Contributors to this version: Trevor James Smith (@Zeitsperre), Abel Aoun (@bzah), Éric Dupuis (@coxipi), Travis Logan (@tlogan2000), Pascal Bourgault (@aulemahal).
New features and enhancements
- The general
xclim
description and ReadMe have been updated to reflect recent enhancements. (GH/1185, PR/1209). - Documentation now supports intersphinx mapping references within code examples via
sphinx-codeautolink
and copying of code blocks viasphinx-copybutton
. (PR/1182). - Log-logistic distribution added to
stats.py
for use withstandardized_precipitation_index
andstandardized_precipitation_evapotranspiration_index
. (GH/1141, PR/1183). - New option in many indices allowing for resampling in given periods after
run_length
operations. (GH/505, GH/916, GH/917, PR/1161). - New base indicator class for sdba:
StatisticalPropertyMeasure
, those measures that also reduce the time (as a property does). (PR/1198). xclim.core.calendar.common_calendar
to find the best calendar to use when uniformizing an heterogeneous collection of data. (PR/1217).xclim.ensembles.create_ensemble
now acceptscalendar=None
, and uses the above function to guess the best one. It also now acceptscal_kwargs
to fine tune the calendar conversion. (GH/1190, PR/1217).- New data check :
xclim.core.datachecks.check_common_time
that ensures all inputs of multivariate indicators have the same frequency (and the same time anchoring for daily and hourly data). (GH/1111, PR/1217).
New indicators
- New indices
first_day_temperature_{above | below}
and indicatorsxclim.indices.first_day_{tn | tg | tx}_{above | below}
. These indices/indicators accept operator (op
) keyword for finer threshold comparison controls. (GH/1175, PR/1186). - New generic indice
cumulative_difference
for calculating difference between values and thresholds across time (e.g. temperature: degree-days, precipitation: moisture deficit), with or without resampling/accumulating by frequency. (PR/1202). - New spatial sdba properties and measures :
spatial_correlogram
,scorr
andfirst_eof
. The later needs the optional dependency eofs. (PR/1198).
Breaking changes
- Indices that accept
lat
orlon
coordinates in their call signatures will now usecf-xarray
accessors to gather these variables in the event that they are not explicitly supplied. (PR/1180). This affects the following:huglin_index
,biologically_effective_degree_days
,cool_night_index
,latitude_temperature_index
,water_budget
,potential_evapotranspiration
cool_night_index
now optionally acceptslat: str = "north" | "south"
for calculating CNI over DataArrays lacking a latitude coordinate. (PR/1180).- The offset value in
standardized_precipitation_evapotranspiration_index
is changed to better reproduce results in the reference librarymonocongo/climate_indices
. (GH/1141, PR/1183). - The
first_day_below
andfirst_day_above
indices are now deprecated in order to clearly communicate the variables they act upon (GH/1175, PR/1186). The suggested migrations are as follows:xclim.indices.first_day_above
->xclim.indices.first_day_temperature_above
xclim.indices.first_day_below
->xclim.indices.first_day_temperature_below
- The
first_day_below
andfirst_day_above
atmos indicators are now deprecated in order to clearly communicate the variables they act upon (GH/1175, PR/1186). The suggested migrations are as follows:xclim.atmos.first_day_above
->xclim.indices.first_day_{tn | tg | tx}_above
xclim.atmos.first_day_below
->xclim.indices.first_day_{tn | tg | tx}_below
- The
degree_days
generic indice has been deprecated in favour ofcumulative_difference
that is not limited only to temperature variables (GH/1200, PR/1202). The indices foratmos.{heating | cooling | growing}_degree_days
are now built fromgeneric.cumulative_difference
. - Running
pytest
now requires thepytest-xdist
distributed testing dependency. This library has been added to thedev
requirements and conda environment configuration. (PR/1203). - Parameters
reducer
andwindow
inxclim.indices.rle_statistics
are now positional. (PR/1161). - The
relative_annual_cycle_amplitude
andannual_cycle_amplitude
have been rewritten to match the version defined in the VALUE project, outputs will change drastically (for the better) (PR/1198). - English indicator metadata has been adjusted to remove frequencies from fields in the
long_name
of indicators. English indicators now have an explicittitle
andabstract
. (GH/936, PR/1123). - French indicator metadata translations are now more uniform and more closely follow agreed-upon grammar conventions, while also removing frequency fields in
long_name_fr
. (GH/936, PR/1123). - The
freshet_start
indice is now deprecated in favour offirst_day_temperature_above
withthresh='0 degC', window=5
. Thefreshet_start
indicator is now based onfirst_day_temperature_above
, but is otherwise unaffected. (GH/1195, PR/1196). - Call signatures for several indices/indicators have been modified to optionally accept
op
for manually setting threshold comparison operators (GH/1194, PR/1197). The affected indices and indicators as follows:hot_spell_max_length
,hot_spell_frequency
,cold_spell_days
,cold_spell_frequency
,heat_wave_index
,warm_day_frequency
(indice only),warm_night_frequency
(indice only),dry_days
,wetdays
,wetdays_prop
.
- Cleaner
xclim.core.calendar.parse_offset
: fails on invalid frequencies, return implicit anchors (YS -> JAN, Y -> DEC) and implicitis_start_anchored
(D -> True). (GH/1213, , PR/1217).
Bug fixes
- The docstring of
cool_night_index
suggested thatlat
was an optional parameter. This has been corrected. (GH/1179, PR/1180). - The
mean_radiant_temperature
indice was accessing hardcodedlat
andlon
coordinates from passed DataArrays. This now usescf-xarray
accessors. (PR/1180). - Adopt (and adapt) unit registry declaration and preprocessors from
cf-xarray
to circumvent bugs caused by a refactor inpint
0.20. It also cleans the code a little bit. (GH/1211, PR/1212).
Internal changes
- The documentation build now relies on
sphinx-codeautolink
andsphinx-copybutton
. (PR/1182). - Many docstrings did not fully adhere to the numpy docstring format. Fields and entries for many classes and functions have been adjusted to adhere better. (PR/1182).
- The xdoctest namespace now provides access to session-scoped
{variable}_dataset
accessors, as well as apath_to_atmos_file
object. These can be used for running doctests on all variables made in the pytestatmosds()
fixture. (PR/1882). - Upgrade CodeQL GitHub Action to v2. (GH/1188, PR/1189).
- New generic index
first_day_threshold_reached
is now used to compose allfirst_day_XYZ
indices. (GH/1175, PR/1186). - In order to reduce computation footprint, the GitHub CI full testing suite and doctests are now only run once a pull request has been reviewed and approved. The number of simultaneously triggered builds has also been reduced. (GH/1155, PR/1203).
- ReadTheDocs now only builds full documentation (including running notebooks) when pull requests are merged to the main branch. (GH/1155, PR/1203).
xclim
now leveragespytest-xdist
to distribute tests among Python workers and significantly speed up the testing suite. (PR/1203).show_versions
can now accept a list of dependencies so that other libraries can make use of this utility. (PR/1215).- Pull Requests now are automatically tagged (
CI
,docs
,indicators
, and/orsdba
) according to files modified using the GitHub Labeler Action. (PR/1214).