Breaking changes
- Refactoring of the
Indicator
class. Thecfprobe
method has been renamed tocfcheck
and thevalidate
method has been renamed todatacheck
. More importantly, instantiatingIndicator
creates a new subclass on
the fly and stores it in a registry, allowing users to subclass existing indicators easily. The algorithm for
missing values is identified by its registered name, e.g. "any", "pct", etc, along with itsmissing_options
. - xclim now requires xarray >= 0.16, ensuring that xclim.sdba is fully functional.
- The dev requirements now include
xdoctest
-- a rewrite of the standard library module,doctest
. xclim.core.locales.get_local_attrs
now uses the indicator's class name instead of the indicator itself and no
longer accepts thefill_missing
keyword. Behaviour is now the same as passingFalse
.Indicator.cf_attrs
is now a list of dictionaries.Indicator.json
puts all the metadata attributes in the key "outputs" (a list of dicts).
All variable metadata (names inIndicator._cf_names
) might be strings or lists of strings when accessed as object attributes.- Passing doctests are now strictly enforced as a build requirement in the Travis CI testing ensemble.
New features and enhancements
- New
ensembles.kkz_reduce_ensemble
method to select subsets of an ensemble based on the KKZ algorithm. - Create new Indicator
Daily
,Daily2D
subclasses for indicators using daily input data. - The
Indicator
class now supports outputing multiple indices for the same inputs. xclim.core.units.declare_units
now works with indices outputting multiple DataArrays.- Doctests now make use of the
xdoctest_namespace
in order to more easily access mdoules and tesdata.
Bug fixes
- Fix
generic.fit
dimension ordering. This caused errors when "time" was not the first dimension in a DataArray.
Internal changes
datachecks.check_daily
now usesxr.infer_freq
.- Indicator subclasses
Tas
,Tasmin
,Tasmax
,Pr
andStreamflow
now inherit fromDaily
. - Indicator subclasses
TasminTasmax
andPrTas
now inherit fromDaily2D
. - Docstring style now enforced using the
pydocstyle
withnumpy
doctsring conventions. - Doctests are now performed for all docstring
Examples
usingxdoctest
. Failing examples must be explicitly skipped otherwise build will now fail. - Indicator methods
update_attrs
andformat
are now classmethods, attrs to update must be passed. - Indicators definitions without an accompanying translation (presently French) will cause build failures.
- Major refactoring of the internal marchinery of
Indicator
to support multiple outputs.