Releases: Ouranosinc/xclim
v0.32.0
Contributors to this version: Pascal Bourgault (@aulemahal), Travis Logan (@tlogan2000), Trevor James Smith (@Zeitsperre), Abel Aoun (@bzah), David Huard (@huard), Clair Barnes (@clairbarnes), Raquel Alegre (@raquel-ucl), Jamie Quinn (@JamieJQuinn), Maliko Tanguy (@malngu), Aaron Spring (@aaronspring).
Announcements
- Code coverage (
coverage/coveralls
) is now a required CI check for merging Pull Requests. Requirements are now:- No individual run may report <80% code coverage.
- Some drop in coverage is now tolerable, but runs cannot dip below -0.25% relative to the main branch.
New features and enhancements
- Added an optimized pathway for
xclim.indices.run_length
functions whenwindow=1
. (PR/911, GH/910). - The data input frequency expected by
Indicator
is now in thesrc_freq
attribute and is thus controllable by subclassing existing indicators. (GH/898, PR/927). - New
**indexer
keyword args added to many indicators, it accepts the same arguments asxclim.indices.generic.select_time
, which has been improved. Unless otherwise specified, the time selection is done before any computation. (PR/934, GH/899). - Rewrite of
xclim.sdba.ExtremeValues
, now fixed with a correct algorithm. It has not been tested extensively and should be considered experimental. (PR/914, GH/789, GH/790). - Added
days_over_precip_doy_thresh
andfraction_over_precip_doy_thresh
indicators to distinguish between WMO and ECAD definition of the Rxxp and RxxpTot indices. (GH/931, PR/940). - Update
xclim.core.utils.nan_calc_percentiles
to improve maintainability. (PR/942). - Added
heat_index
indicator. Addedheat_index
indicator. This is similar tohumidex
but uses a different dew point as well as heat balance equations which account for variables other than vapor pressure. (GH/807) and (PR/915). - Added alternative method for
xclim.indices.potential_evapotranspiration
based onmcguinnessbordne05
(from Tanguay et al. 2018). (PR/926, GH/925). - Added
snw_max
andsnw_max_doy
indicators to compute the maximum snow amount and the day of year of the maximum snow amount respectively. (GH/776, PR/950). - Added index for calculating ratio of convective to total precipitation. (GH/920, PR/921).
- Added
wetdays_prop
indicator to calculate the proportion of days in a period where the precipitation is greater than a threshold. (PR/919, GH/918).
Breaking changes
- Following version 1.9 of the CF Conventions, published in September 2021, the calendar name "gregorian" is deprecated.
core.calendar.get_calendar
will return "standard", even if the underlying cftime objects still use "gregorian" (cftime <= 1.5.1). (PR/935). xclim.sdba.utils.extrapolate_qm
is now deprecated and will be removed in version 0.33. ([PR/941](https://github.com/Ourano- Dependency
pint
minimum necessary version is now 0.10. (PR/959).
sinc/xclim/pull/941)).
Internal changes
- Removed some logging configurations in
xclim.core.dataflags
that were polluting python's main logging configuration. (PR/909). - Synchronized logging formatters in
xclim.ensembles
andxclim.core.utils
. (PR/909). - Added a helper function for generating the release notes with dynamically-generated ReStructuredText or Markdown-formatted hyperlinks (PR/922, GH/907).
- Split of resampling-related functionality of
Indicator
into newResamplingIndicator
andResamplingIndicatorWithIndexing
subclasses. The use of new (private) methods makes it easier to inject functionality in indicator subclasses. (GH/867, PR/927, PR/934). - French translation metadata fields are now cleaner and much more internally consistent, and many empty metadata fields (e.g.
comment_fr
) have been removed. (PR/930, GH/929). - Adjustments to the
tox
builds so that slow tests are now run alongside standard tests (for more accurate coverage reporting). (PR/938). - Use
xarray.apply_ufunc
to vectorize statistical functions. (PR/943). - Refactor of
xclim.sdba.utils.interp_on_quantiles
so that it now handles the extrapolation directly and to better handle missing values. (PR/941). - Updated
heating_degree_days
andfraction_over_precip_thresh
documentations. (GH/952, PR/953). - Added an intersphinx mapping to xarray. (PR/955).
- Added a CodeQL security analysis GitHub CI hook on push to master and on Friday nights. (PR/960).
Bug fixes
- Fix bugs in the
cf_attrs
and/orabstract
ofcontinuous_snow_cover_end
andcontinuous_snow_cover_start
. (PR/908). - Remove unnecessary
keep_attrs
fromresample
call which would raise an error in futur Xarray version. (PR/937). - Fixed a bug in the regex that parses usernames in the history. (PR/945).
- Fixed a bug in
xclim.indices.generic.doymax
andxclim.indices.generic.doymin
that prevented the use of the functions on multidimensional data. (PR/950, GH/951). - Skip all missing values in
xclim.sdba.utils.interp_on_quantiles
, drop them from both the old and new coordinates, as well as from the old values. (PR/941). - "degrees_north" and "degrees_east" (and their variants) are now considered independent units, so that
pint
andxclim.core.units.ensure_cf_units
don't convert them to "deg". (PR/959). - Fixed a bug in
xclim.core.dataflags
that would misidentify the "extra" variable to be called when running multivariate checks. (PR/957, GH/861).
v0.31.0
Contributors to this version: Abel Aoun (@bzah), Pascal Bourgault (@aulemahal), David Huard (@huard), Juliette Lavoie (@juliettelavoie), Travis Logan (@tlogan2000), Trevor James Smith (@Zeitsperre).
New indicators
thawing_degree_days
indicator returns degree-days above a default ofthresh="0 degC"
. (PR/895, GH/887).freezing_degree_days
indicator returns degree-days below a default ofthresh="0 degC"
. (PR/895, GH/887).- Several frost-free season calculations are now available as both indices and indicators. (PR/895, GH/887):
frost_free_season_start
frost_free_season_end
frost_free_season_length
growing_season_start
is now offered as an indice and as an indicator to complement other growing season-based indicators (threshold calculation withop=">="
). (PR/895, GH/887).
New features and enhancements
- Improve cell_methods checking to search the wanted method within the whole string. (PR/866, GH/863).
- New
align_on='random
option forxclim.core.calendar.convert_calendar
, for conversions involving '360_day' calendars. (PR/875, GH/841). dry_spell_frequency
now has a parameterop: {"sum", "max"}
to choose if the threshold is compared against the accumulated or maximal precipitation, over the given window. (PR/879).maximum_consecutive_frost_free_days
is now checking that the minimum temperature is above or equal to the threshold ( instead of only above). (PR/883, GH/881).- The ANUCLIM virtual module has been updated to accept weekly and monthly inputs and with improved metadata. (PR/885, GH/538)
- The
sdba.loess
algorithm has been optimized to run faster in all cases, with an even faster special case (equal_spacing=True
) when the x coordinate is equally spaced. When activated, this special case might return results different from without, up to around 0.1%. (PR/865). - Add support for group's window and additional dimensions in
LoessDetrend
. Add newRollingMeanDetrend
object. (PR/865). - Missing value algorithms now try to infer the source timestep of the input data when it is not given. (PR/885).
- On indices,
bootstrap
parameter documentation has been updated to explain when and why it should be used. (PR/893, GH/846).
Breaking changes
- Major changes in the YAML schema for virtual submodules, now closer to how indicators are declared dynamically, see the doc for details. (PR/849, GH/848).
- Removed
xclim.generic.daily_downsampler
, as it served no purpose now that xarray's resampling works with cftime (PR/888, GH/889). - Refactor of
xclim.core.calendar.parse_offset
, output types were changed to useful ones (PR/885). - Major changes on how parameters are passed to indicators. (PR/873):
- Their signature is now consistent : input variables (DataArrays, optional or not) are positional or keyword arguments and all other parameters are keyword only. (GH/855, GH/857)
- Some indicators have modified signatures because we now rename variables when wrapping generic indices. This is the case for the whole cf module, for example.
Indicator.parameters
is now a property generated fromIndicator._all_parameters
, as the latter includes the injected parameters. The keys of the former are instances of newxclim.core.indicator.Parameter
, and not dictionaries as before.- New
Indicator.injected_parameters
to see which compute function arguments will be injected at call time. - See the pull request (PR/873) for all information.
- The call signature for
huglin_index
has been modified to reflect the correct variables used in its formula (tasmin
->tas
;thresh_tasmin
->thresh
). (PR/903, GH/902).
Internal changes
- Pull Request contributions now require hyperlinks to the issue and pull request pages on GitHub listed alongside changess in HISTORY.rst. (PR/860,GH/854).
- Updated the contribution guidelines to better give credit to contributors and more easily track changes. (PR/869, GH/868).
- Enabled coveralls code coverage reporting for GitHub CI. (PR/870).
- Added automated TestPyPI and PyPI-publishing workflows for GitHub CI. (PR/872).
- Changes on how indicators are constructed. (PR/873).
- Added missing algorithms tests for conversion from hourly to daily. (PR/888).
- Updated pre-commit hooks to use black v21.10.b0. (PR/896).
- Moved
stack_variables
,unstack_variables
,construct_moving_yearly_window
andunpack_moving_yearly_window
fromxclim.sdba.base
toxclim.sdba.processing
. They still are imported inxclim.sdba
as before. (PR/892). - Many improvements to the documentation. (PR/892, GH/880).
- Added regex replacement handling in setup.py to facilitate publishing contributor/contribution links on PyPI. (PR/906).
Bug fixes
- Fix a bug in bootstrapping where computation would fail when the dataset time coordinate is encoded using
cftime.datetime
. (PR/859). - Fix a bug in
build_indicator_module_from_yaml
where bases classes (Daily, Hourly, etc) were not usable with thebase
field. (PR/885). percentile_doy
alpha and beta parameters are now properly transmitted to bootstrap calls of this function. (PR/893, GH/846).- When called with a 1D da and ND index,
xclim.indices.run_length.lazy_indexing
now drops the auxiliary coordinate corresponding to da's index. This fixes a bug with ND data inxclim.indices.run_length.season
. (PR/900). - Fix name of heating degree days in French (
"chauffe"
-> "chauffage
"). (PR/895). - Corrected several French indicator translation description strings (bad usages of
"."
indescription
andlong_name
fields). (PR/895). - Fixed an error with the formula for
huglin_index
wheretasmin
was being used in the calculation instead oftas
. (PR/903, GH/902).
v0.30.1
Bug fixes
- Fix a bug in
xclim.sdba
'smap_groups
where 1D input including an auxiliary coordinate would fail with an obscure error on a reducing operation.
v0.30.0
New indicators
climatological_mean_doy
indice returns the mean and standard deviation across a climatology according to day-of-year (xarray.DataArray.groupby("time.dayofyear")
). A moving window averaging of days can also be supplied (default:window=1
).within_bnds_doy
indice returns a boolean array indicating whether or not array's values are within bounds for each day of the year.- Added
atmos.wet_precip_accumulation
, an indicator accumulating precipitation over wet days. - Module ICCLIM now includes
PRCPTOT
, which accumulates precipitation for days with precipitation above 1 mm/day.
New features and enhancements
-
xclim.core.utils.nan_calc_percentiles
now uses a custom algorithm instead ofnumpy.nanpercentiles
to have more flexibility on the interpolation method. The performance is also improved. -
xclim.core.calendar.percentile_doy
now uses the 8th method of Hyndman & Fan for linear interpolation (alpha = beta = 1/3). Previously, the function used Numpy's percentile, which corresponds to the 7th method. This change is motivated by the fact that the 8th is recommended by Hyndman & Fay, and it ensures consistency with other climate indices packages (climdex
,icclim
). Usingalpha = beta = 1
restores the previous behaviour. -
xclim.core.utils._cal_perc
is now only a proxy forxc.core.utils.nan_calc_percentiles
with some axis moves. -
xclim
now implements many data quality assurance flags (xclim.core.dataflags
) for temperature and precipitation based onICCLIM documentation guidelines <https://eca.knmi.nl/documents/atbd.pdf>
_. These checks include the following:- Temperature (variables:
tas
,tasmin
,tasmax
):tasmax_below_tasmin
,tas_exceeds_tasmax
,tas_below_tasmin
,temperature_extremely_low
(thresh="-90 degC"
),temperature_extremely_high
(thresh="60 degC"
). - Precipitation-specific (variables:
pr
,prsn
, ):negative_accumulation_values
,very_large_precipitation_events
(thresh="300 mm d-1"
). - Wind-specific (variables:
sfcWind
,wsgsmax
/sfcWindMax
):wind_values_outside_of_bounds
- Generic:
outside_n_standard_deviations_of_climatology
,values_repeating_for_n_or_more_days
,values_op_thresh_repeating_for_n_or_more_days
,percentage_values_outside_of_bounds
.
These quality-assurance checks are selected according to CF-standard variable names, and can be triggered via
xclim.core.dataflags.data_flags(xarray.DataArray, xarray.Dataset)
. These checks are separate from the Indicator-defineddatachecks
and must be launched manually. They'll return an array of data_flags as boolean variables.
If called withraise_flags=True
, will raise an Exception with comments for each quality control check raised. - Temperature (variables:
-
A convenience function (
xclim.core.dataflags.ecad_compliant
) is also offered as a method for asserting that data adheres to all relevant ECAD/ICCLIM checks. For more information on usage, consult the docstring/documentation. -
A new utility "
dataflags
" is also available for performing fast quality control checks from the command-line (xclim dataflags --help
). See the CLI documentation page for usage examples. -
Added missing typed call signatures, expected returns and docstrings for many
xclim.core.calendar
functions.
Breaking changes
- All "ANUCLIM" indices and indicators have lost their
src_timestep
argument. Most of them were not using it and now every function infers the frequency from the data directly. This may add stricter constraints on the time coordinate, the same as forxarray.infer_freq
. - Many functions found within
xclim.core.cfchecks
(generate_cfcheck
andcheck_valid_*
) have been removed as existing indicator CF-standard checks and data checks rendered them redundant/obsolete.
Bug fixes
- Fixes in
sdba
for (1) inputs with dimensions without coordinates, for (2)sdba.detrending.MeanDetrend
and for (3)DetrendedQuantileMapping
when used with dask's distributed scheduler. - Replaced instances of
'◦'
("White bullet") with'°'
("Degree Sign") inicclim.yaml
as it was causing issues for non-UTF8 environments. - Addressed an edge case where
test_sdba::test_standardize
randomness could generate values that surpass the test error tolerance. - Added a missing
.txt
file to the MANIFEST of the source distributable in order to be able to run all tests. xc.core.units.rate2amount
is now exact when the sampling frequency is monthly, seasonal or yearly. Earlier, monthly and yearly data were computed using constant month and year length. End-of-period frequencies are also correctly understood (ex: "M" vs "MS").- In the
potential_evapotranspiration
indice, add abbreviatedmethod
names to docstring. - Fixed an issue that prevented using the default
group
arg in adjustment objects. - Fix bug in
missing_wmo
, where a period would be considered valid if all months met WMO criteria, but complete months in a year were missing. Now, if any month does not meet criteria or is absent, the period will be considered missing. - Fix bootstrapping with dask arrays. Dask does not support using
loc
with multiple indexes to set new values, so a workaround was necessary. - Fix bootstrapping when the bootstrapped year must be converted to a 366_day calendar.
- Virtual modules and translations now use 'UTF-8' by default when reading yaml or json file, instead of a machine-dependent encoding.
Internal Changes
xclim
code quality checks now use the newestblack
(v21.8-beta). Checks launched viatox
andpre-commit
now run formatting modifications over Jupyter notebooks found underdocs
.
v0.29.0
Announcements
- It was found that the
ExtremeValues
adjustment algorithm was not as accurate and stable as first thought. It is now hidden fromxclim.sdba
but can still be accessed viaxclim.sdba.adjustment
, with a warning. Work on improving the algorithm is ongoing, and a better implementation will be in a future version. - It was found that the
add_dims
argument ofsdba.Grouper
had some caveats throughoutsdba
. This argument is to be used with care before a careful analysis and more testing is done withinxclim
.
Breaking changes
xclim
has switched back to updating thehistory
attribute (instead ofxclim_history
). This impacts all indicators, most ensemble functions,percentile_doy
andsdba.processing
(see below).- Refactor of
sdba.processing
. Now all functions take one or more dataarrays as input, plus some parameters. And output one or more dataarrays (not Datasets). Units and metadata is handled. This impactssdba.processing.adapt_freq
especially. - Add unit handling in
sdba
. Most parameters involving quantities are now expecting strings (and not numbers). Adjustment objects will ensure ref, hist and sim all have the same units (taking ref as reference). - The Adjustment` classes of
xclim.sdba
have been refactored into 2 categories:TrainAdjust
objects (most of the algorithms), which are created and trained in the same call:
obj = Adj.train(ref, hist, **kwargs)
. The.adjust
step stays the same.Adjust
objects (onlyNpdfTransform
), which are never initialized. Theiradjust
class method performs all the work in one call.
snowfall_approximation
used a"<"
condition instead of"<="
to determine the snow fraction based on the freezing point temperature. The new version sticks to the convention used in the Canadian Land Surface Scheme (CLASS).- Removed the
"gis"
,"docs"
,"test"
and"setup"
extra dependencies fromsetup.py
. Thedev
recipe now includes all tools needed for xclim's development.
New features and enhancements
snowfall_approximation
has gained support for new estimation methods used in CLASS: 'brown' and 'auer'.- A
ValidationError
will be raised if temperature units are given as 'deg C', which is misinterpreted by pint. - Functions computing run lengths (sequences of consecutive
"True"
values) now take theindex
argument. Possible values arefirst
andlast
, indicating which item in the run should be used to index the run length. The default is set to"first"
, preserving the current behavior. - New
sdba_encode_cf
option to workaround a cftime/xarray performance issue when using dask.
New indicators
effective_growing_degree_days
indice returns growing degree days using dynamic start and end dates for the growing season (based on Bootsma et al. (2005)). This has also been wrapped as an indicator.qian_weighted_mean_average
(based on Qian et al. (2010)) is offered as an alternate method for determining the start date using a weighted 5-day average (method="qian"
). Can also be used directly as an indice.cold_and_dry_days
indicator returns the number of days where the mean daily temperature is below the 25th percentile and the mean daily precipitation is below the 25th percentile over period. Added asCD
indicator to ICCLIM module.warm_and_dry_days
indicator returns the number of days where the mean daily temperature is above the 75th percentile and the mean daily precipitation is below the 25th percentile over period. Added asWD
indicator to ICCLIM module.warm_and_wet_days
indicator returns the number of days where the mean daily temperature is above the 75th percentile and the mean daily precipitation is above the 75th percentile over period. Added asWW
indicator to ICCLIM module.cold_and_wet_days
indicator returns the number of days where the mean daily temperature is below the 25th percentile and the mean daily precipitation is above the 75th percentile over period. Added asCW
indicator to ICCLIM module.calm_days
indicator returns the number of days where surface wind speed is below threshold.windy_days
indicator returns the number of days where surface wind speed is above threshold.
Bug fixes
- Various bug fixes in bootstrapping:
- in
percentile_bootstrap
decorator, fix the popping of bootstrap argument to propagate in to the function call. - in
bootstrap_func
, fix some issues with the resampling frequency which was not working when anchored.
- in
- Made argument
thresh
ofsdba.LOCI
required, as not giving it raised an error. Made defaults explicit in the adjustments docstrings. - Fixes in
sdba.processing.adapt_freq
andsdba.nbutils.vecquantiles
when handling all-nan slices. - Dimensions in a grouper's
add_dims
are now taken into consideration in function wrapped withmap_blocks/groups
. This feature is still not fully tested throughoutsdba
though, so use with caution. - Better dtype preservation throughout
sdba
. - "constant" extrapolation in the quantile mappings' adjustment is now padding values just above and under the target's max and min, instead of
±np.inf
. - Fixes in
sdba.LOCI
for the case where a grouping with additionnal dimensions is used.
Internal Changes
- The behaviour of
xclim.testing._utils.getfile
was adjusted to launch file download requests for web-hosted md5 files for every call to compare against local test data.
This was done to validate that locally-stored test data is identical to test data available online, without resorting to git-based actions. This approach may eventually be revised/optimized in the future.
v0.28.1
Announcements
- The
xclim
binary package available on conda-forge will no longer supplyclisops
by default. Installation ofclisops
must be performed explicitly to preserve subsetting capabilities.
New indicators
snow_depth
indicator returns the mean snow depth over period. Added asSD
to ICCLIM module.
Internal Changes
- Minor modifications to many function call signatures (type hinting) and docstrings (numpy docstring compliance).
v0.28.0
New features and enhancements
- Automatic load of translations on import and possibility to pass translations for virtual modules.
- New
xclim.testing.list_datasets
function listing all available test datasets in repoxclim-testdata
. spatial_analogs
accepts multi-indexes as thedist_dim
parameter and will work with candidates and target arrays of different lengths.humidex
can be computed using relative humidity instead of dewpoint temperature.- New
sdba.construct_moving_yearly_window
andsdba.unpack_moving_yearly_window
for moving window adjustments. - New
sdba.adjustment.NpdfTransform
which is an adaptation of Alex Cannon's version of Pitié's N-dimensional probability density function transform. Uses newsdba.utils.rand_rot_matrix
. Experimental, subject to changes. - New
sdba.processing.standardize
,.unstandardize
and.reordering
. All of them, tools needed to replicate Cannon's MBCn algorithm. - New
sdba.processing.escore
, backed bysdba.nbutils._escore
to evaluate the performance of the N pdf transform. - New function
xclim.indices.clausius_clapeyron_scaled_precipitation
can be used to scale precipitation according to changes in mean temperature. - Percentile based indices gained a
bootstrap
argument that applies a bootstrapping algorithm to reduce biases on exceedance frequencies computed over in base and out of base periods. Experimental, subject to changes. - Added a
.zenodo.json
file for collecting and maintaining author order and tracking ORCIDs.
Bug fixes
-
Various bug fixes in sdba :
- in
QDM.adjust
, fix bug occuring with coords of 'object' dtype andinterp='nearest'
. - in
nbutils.quantiles
, fix dtype bug when usingfloat32
data. - raise a proper error when
ref
andhist
have a different calendar for map_blocks-backed adjustments.
- in
Breaking changes
spatial_analogs
does not support sequence ofdist_dim
anymore. Users are responsible for stacking dimensions prior to callingspatial_analogs
.
New indicators
-
biologically_effective_degree_days
(withmethod="gladstones"
) indice computes degree-days between two specific dates, with a capped daily max value as well as latitude and temperature range swing as modifying coefficients (based on Gladstones, J. (1992)). This has also been wrapped as an indicator. -
An alternative implementation of
biologically_effective_degree_days
(withmethod="icclim"
, based on ICCLIM formula) ignores latitude and temperature range swing modifiers and uses an alternateend_date
. Wrapped and available as an ICCLIM indicator. -
cool_night_index
indice returns the mean minimum temperature in September (lat >= 0
deg N) or March (lat < 0
deg N), based on Tonietto & Carbonneau, 2004 (10.1016/j.agrformet.2003.06.001). Also available as an indicator (see indicesNotes
section on indicator usage recommendations). -
latitude_temperature_index
indice computes LTI values based on mean temperature of warmest month and a parameterizable latitude coefficient (default:lat_factor=75
) based on Jackson & Cherry, 1988, and Kenny & Shao, 1992 (10.1080/00221589.1992.11516243). This has also been wrapped as an indicator. -
huglin_index
indice computes Huglin Heliothermal Index (HI) values based on growing degrees and a latitude-influenced coefficient for day-length (based on Huglin. (1978)). The indice supports several methods of estimating the latitude coefficient:method="smoothed"
: Marks latitudes between -40 N and 40 N withk=1
, and linearly increases tok=1.06
at|lat|==50
.method="icclim"
: Uses a stepwise function based on the the original method as presented by Huglin (1978). Identical to the ICCLIM implementation.method="jones"
: Uses a more robust calculation for calculating day-lengths, based on Hall & Jones (2010). This method is now also available forbiologically_effective_degree_days
.
-
The generic indice
day_length
, used for calculating approximate daily day-length in hours per day or, givenstart_date
andend_date
, the total aggregated day-hours over period. Uses axial tilt, start and end dates, calendar, and approximate date of northern hemisphere summer solstice, based on Hall & Jones (2010).
Internal Changes
aggregate_between_dates
(introduced in v0.27.0) now acceptsDayOfYear
-like strings for supplying start and end dates (e.g.start="02-01", end="10-31"
).- The indicator call sequence now considers "variable" the inputs annoted so. Dropped the
nvar
attribute. - Default cfcheck is now to check metadata according to the variable name, using CMIP6 names in xclim/data/variable.yml.
Indicator.missing
defaults to "skip" iffreq
is absent from the list of parameters.- Minor modifications to the GitHub Pull Requests template.
- Simplification of some yaml elements for virtual modules.
- Allow injecting
freq
without the missing checks failing.
v0.27.0
New features and enhancements
- Rewrite of nearly all adjustment methods in
sdba
, with use ofxr.map_blocks
to improve scalability with dask. Rewrite of some parts of the algorithms with numba-accelerated code. - "GFWED" specifics for fire weather computation implemented back into the FWI module. Outputs are within 3% of GFWED data.
- Addition of the
run_length_ufunc
option to control which run length algorithm gets run. Defaults stay the same (automatic switch dependent of the input array : the 1D version is used with non-dask arrays with less than 9000 points per slice). - Indicator modules built from YAML can now use custom indices. A mapping or module of them can be given to
build_indicator_module_from_yaml
with theindices
keyword. - Virtual submodules now include an
iter_indicators
function to iterate over the pairs of names and indicator objects in that module. - The indicator string formatter now accepts a "r" modifier which passes the raw strings instead of the adjective version.
- Addition of the
sdba_extra_output
option to adds extra diagnostic variables to the outputs of Adjustment objects. Implementation ofsim_q
in QuantileDeltaMapping andnclusters
in ExtremeValues.
Breaking changes
-
The
tropical_nights
indice is being deprecated in favour oftn_days_above
withthresh="20 degC"
. The indicator remains valid, now wrapping this new indice. -
Results of
sdba.Grouper.apply
forGrouper
s without a group (ex:Grouper('time')
) will contain agroup
singleton dimension. -
The
daily_freezethaw_cycles
indice is being deprecated in favour ofmultiday_temperature_swing`` with temp thresholds at 0 degC and
window=1, op="sum"`. The indicator remains valid, now wrapping this new indice. -
CMIP6 variable names have been adopted whenever possible in xclim. Changes are:
swe
is nowsnw
(snw
is the snow amount [kg / m²] andswe
the liquid water equivalent thickness [m])rh
is nowhurs
dtas
is nowtdps
ws
(in FWI) is nowsfcWind
sic
is nowsiconc
area
(of sea ice indicators) is nowareacello
- Indicators
RH
andRH_FROMDEWPOINT
have be renamed toHURS
andHURS_FROMDEWPOINT
. These are changes in the identifiers, the python names (relative_humidity[...]
) are unchanged.
New indicators
atmos.corn_heat_units
computes the daily temperature-based index for corn growth.- New indices and indicators for
tx_days_below
,tg_days_above
,tg_days_below
, andtn_days_above
. atmos.humidex
returns the Canadian humidex, an indicator of perceived temperature account for relative humidity.multiday_temperature_swing
indice for returning general statistics based on spells of doubly-thresholded temperatures (Tmin < T1, Tmax > T2).- New indicators
atmos.freezethaw_frequency
,atmos.freezethaw_spell_mean_length
,atmos.freezethaw_spell_max_length
for statistics of Tmin < 0 degC and Tmax > 0 deg C days now available (wrapped frommultiday_temperature_swing
). atmos.wind_chill_index
computes the daily wind chill index. The default is similar to what Environment and Climate Change Canada does, options are tunable to get the version of the National Weather Service.
Internal Changes
run_length.rle_statistics
now accepts awindow
argument.- Common arguments to the
op
parameter now have better adjective and noun formattings. - Added and adjusted typing in call signatures and docstrings, with grammar fixes, for many
xclim.indices
operations.
v0.26.1 (May the fourth be with you)
Bug fixes
- Bug fix release adding
ExtremeValues
to publicly exposed bias-adjustment methods.
v0.26.0
Announcements
xclim
no longer supports Python3.6. Code conventions and new features from Python3.7 (PEP 537) are now accepted.
New features and enhancements
core.calendar.doy_to_days_since
anddays_since_to_doy
to allow meaningful statistics on doy data.- New bias second-order adjustment method "ExtremeValues", intended for re-adjusting extreme precipitation values.
- Virtual indicators modules can now be built from YAML files.
- Indicators can now be built from dictionaries.
- New generic indices, implementation of
clix-meta
's index functions. - On-the-fly generation of climate and forecasting convention (CF) checks with
xc.core.cfchecks.generate_cfcheck
, for a few known variables only. - New
xc.indices.run_length.rle_statistics
for min, max, mean, std (etc) statistics on run lengths. - New virtual submodule
cf
, with CF standard indices defined in clix-meta. - Indices returning day-of-year data add two new attributes to the output:
is_dayofyear
(=1) andcalendar
.
Breaking changes
xclim
now requiresxarray>=0.17
.- Virtual submodules
icclim
andanuclim
are not available at the top level anymore (only throughxclim.indicators
). - Virtual submodules
icclim
andanuclim
now provide Indicators and not indices. - Spatial analog methods "KLDIV" and "Nearest Neighbor" now require
scipy>=1.6.0
.
Bug fixes
from_string
object creation in sdba has been removed. Now replaced with use of a new dependency,jsonpickle
.
Internal Changes
pre-commit
linting checks now run formatting hookblack==21.4b2
.- Code cleaning (more accurate call signatures, more use of https links, docstring updates, and typo fixes).