============================
Breaking changes
----------------
This version introduces a lot of breaking changes. We are trying to overhaul ``climpred`` to have an intuitive API that also forces users to think about methodology choices when running functions. The main breaking changes we introduced are for :py:meth:`.HindcastEnsemble.verify` and :py:meth:`.PerfectModelEnsemble.verify`. Now, instead of assuming defaults for most keywords, we require the user to define ``metric``, ``comparison``, ``dim``, and ``alignment`` (for hindcast systems). We also require users to designate the number of ``iterations`` for bootstrapping.
- User now has to designate number of iterations with ``iterations=...`` in
:py:meth:`.HindcastEnsemble.bootstrap` (:issue:`384`, :pr:`436`)
`Aaron Spring`_ and `Riley X. Brady`_.
- Make ``metric``, ``comparison``, ``dim``, and ``alignment`` required (previous default
``None``) arguments for :py:meth:`.HindcastEnsemble.verify`
(:issue:`384`, :pr:`436`) `Aaron Spring`_ and `Riley X. Brady`_.
- Metric :py:class:`~climpred.metrics._brier_score` and
:py:func:`~climpred.metrics._threshold_brier_score` now requires callable keyword
argument ``logical`` instead of ``func`` (:pr:`388`) `Aaron Spring`_.
- :py:meth:`.HindcastEnsemble.verify` does not correct ``dim``
automatically to ``member`` for probabilistic metrics.
(:issue:`282`, :pr:`407`) `Aaron Spring`_.
- Users can no longer add multiple observations to
:py:class:`.HindcastEnsemble`. This will make current and future
development much easier on maintainers (:issue:`429`, :pr:`453`) `Riley X. Brady`_.
- Standardize the names of the output coordinates for
:py:meth:`.PredictionEnsemble.verify` and
:py:meth:`.PredictionEnsemble.bootstrap` to ``initialized``,
``uninitialized``, and ``persistence``. ``initialized`` showcases the metric result
after comparing the initialized ensemble to the verification data; ``uninitialized``
when comparing the uninitialized (historical) ensemble to the verification data;
``persistence`` is the evaluation of the persistence forecast
(:issue:`460`, :pr:`478`, :issue:`476`, :pr:`480`) `Aaron Spring`_.
- ``reference`` keyword in :py:meth:`.HindcastEnsemble.verify` should
be choosen from [``uninitialized``, ``persistence``]. ``historical`` no longer works.
(:issue:`460`, :pr:`478`, :issue:`476`, :pr:`480`) `Aaron Spring`_.
- :py:meth:`.HindcastEnsemble.verify` returns no ``skill`` dimension
if ``reference=None`` (:pr:`480`) `Aaron Spring`_.
- ``comparison`` is not applied to uninitialized skill in
:py:meth:`.HindcastEnsemble.bootstrap`.
(:issue:`352`, :pr:`418`) `Aaron Spring`_.
New Features
------------
This release is accompanied by a bunch of new features. Math operations can now be used with our :py:class:`.PredictionEnsemble` objects and their variables can be sub-selected. Users can now quick plot time series forecasts with these objects. Bootstrapping is available for :py:class:`.HindcastEnsemble`. Spatial dimensions can be passed to metrics to do things like pattern correlation. New metrics have been implemented based on Contingency tables. We now include an early version of bias removal for :py:class:`.HindcastEnsemble`.
- Use math operations like ``+-*/`` with :py:class:`.HindcastEnsemble`
and :py:class:`.PerfectModelEnsemble`. See
`demo <prediction-ensemble-object.html>`_
Arithmetic-Operations-with-PredictionEnsemble-Objects. (:pr:`377`) `Aaron Spring`_.
- Subselect data variables from :py:class:`.PerfectModelEnsemble` as
from :py:class:`xarray.Dataset`:
``PredictionEnsemble[["var1", "var3"]]`` (:pr:`409`) `Aaron Spring`_.
- Plot all datasets in :py:class:`.HindcastEnsemble` or
:py:class:`.PerfectModelEnsemble` by
:py:meth:`.PredictionEnsemble.plot` if no other spatial dimensions
are present. (:pr:`383`) `Aaron Spring`_.
- Bootstrapping now available for :py:class:`.HindcastEnsemble` as
:py:meth:`.HindcastEnsemble.bootstrap`, which is analogous to
the :py:class:`.PerfectModelEnsemble` method.
(:issue:`257`, :pr:`418`) `Aaron Spring`_.
- :py:meth:`.HindcastEnsemble.verify` allows all dimensions from
``initialized`` ensemble as ``dim``. This allows e.g. spatial dimensions to be used
for pattern correlation. Make sure to use ``skipna=True`` when using spatial
dimensions and output has NaNs (in the case of land, for instance).
(:issue:`282`, :pr:`407`) `Aaron Spring`_.
- Allow binary forecasts at when calling
:py:meth:`.HindcastEnsemble.verify`,
rather than needing to supply binary results beforehand. In other words,
``hindcast.verify(metric='bs', comparison='m2o', dim='member', logical=logical)``
is now the same as
``hindcast.map(logical).verify(metric='brier_score', comparison='m2o', dim='member'``.
(:pr:`431`) `Aaron Spring`_.
- Check ``calendar`` types when using
:py:meth:`.HindcastEnsemble.add_observations`,
:py:meth:`.HindcastEnsemble.add_uninitialized`,
:py:meth:`.PerfectModelEnsemble.add_control` to ensure that the
verification data calendars match that of the initialized ensemble.
(:issue:`300`, :pr:`452`, :issue:`422`, :pr:`462`)
`Riley X. Brady`_ and `Aaron Spring`_.
- Implement new metrics which have been ported over from
https://github.com/csiro-dcfp/doppyo/ to ``xskillscore`` by `Dougie Squire`_.
(:pr:`439`, :pr:`456`) `Aaron Spring`_
* rank histogram :py:func:`~climpred.metrics._rank_histogram`
* discrimination :py:func:`~climpred.metrics._discrimination`
* reliability :py:func:`~climpred.metrics._reliability`
* ranked probability score :py:func:`~climpred.metrics._rps`
* contingency table and related scores :py:func:`~climpred.metrics._contingency`
- Perfect Model :py:meth:`.PerfectModelEnsemble.verify`
no longer requires ``control`` in :py:class:`.PerfectModelEnsemble`.
It is only required when ``reference=['persistence']``. (:pr:`461`) `Aaron Spring`_.
- Implemented bias removal
:py:class:`~climpred.classes.HindcastEnsemble.remove_bias`.
``remove_bias(how='mean')`` removes the mean bias of initialized hindcasts with
respect to observations. See `example <bias_removal.html>`__.
(:pr:`389`, :pr:`443`, :pr:`459`) `Aaron Spring`_ and `Riley X. Brady`_.
Depreciated
-----------
- ``spatial_smoothing_xrcoarsen`` no longer used for spatial smoothing.
(:pr:`391`) `Aaron Spring`_.
- ``compute_metric``, ``compute_uninitialized`` and ``compute_persistence`` no longer
in use for :py:class:`.PerfectModelEnsemble` in favor of
:py:meth:`.PerfectModelEnsemble.verify` with the ``reference``
keyword instead.
(:pr:`436`, :issue:`468`, :pr:`472`) `Aaron Spring`_ and `Riley X. Brady`_.
- ``'historical'`` no longer a valid choice for ``reference``. Use ``'uninitialized'``
instead. (:pr:`478`) `Aaron Spring`_.
Bug Fixes
---------
- :py:meth:`.PredictionEnsemble.verify` and
:py:meth:`.PredictionEnsemble.bootstrap` now accept
``metric_kwargs``. (:pr:`387`) `Aaron Spring`_.
- :py:meth:`.PerfectModelEnsemble.verify` now accepts
``'uninitialized'`` as a reference. (:pr:`395`) `Riley X. Brady`_.
- Spatial and temporal smoothing :py:meth:`.PredictionEnsemble.smooth`
now work as expected and rename time dimensions after
:py:meth:`~climpred.classes.PredictionEnsembleEnsemble.verify`.
(:pr:`391`) `Aaron Spring`_.
- ``PredictionEnsemble.verify(comparison='m2o', references=['uninitialized',
'persistence']`` does not fail anymore. (:issue:`385`, :pr:`400`) `Aaron Spring`_.
- Remove bias using ``dayofyear`` in
:py:meth:`.HindcastEnsemble.reduce_bias`.
(:pr:`443`) `Aaron Spring`_.
- ``climpred`` works with ``dask=>2.28``. (:issue:`479`, :pr:`482`) `Aaron Spring`_.
Documentation
-------------
- Updates ``climpred`` tagline to "Verification of weather and climate forecasts."
(:pr:`420`) `Riley X. Brady`_.
- Adds section on how to use arithmetic with
:py:class:`.HindcastEnsemble`.
(:pr:`378`) `Riley X. Brady`_.
- Add docs section for similar open-source forecasting packages.
(:pr:`432`) `Riley X. Brady`_.
- Add all metrics to main API in addition to metrics page.
(:pr:`438`) `Riley X. Brady`_.
- Add page on bias removal `Aaron Spring`_.
Internals/Minor Fixes
---------------------
- :py:meth:`.PredictionEnsemble.verify` replaces deprecated
``PerfectModelEnsemble.compute_metric()`` and accepts ``reference`` as keyword.
(:pr:`387`) `Aaron Spring`_.
- Cleared out unnecessary statistics functions from ``climpred`` and migrated them to
``esmtools``. Add ``esmtools`` as a required package. (:pr:`395`) `Riley X. Brady`_.
- Remove fixed pandas dependency from ``pandas=0.25`` to stable ``pandas``.
(:issue:`402`, :pr:`403`) `Aaron Spring`_.
- ``dim`` is expected to be a list of strings in
:py:func:`~climpred.prediction.compute_perfect_model` and
`~climpred.prediction.compute_hindcast`.
(:issue:`282`, :pr:`407`) `Aaron Spring`_.
- Update ``cartopy`` requirement to 0.0.18 or greater to release lock on
``matplotlib`` version. Update ``xskillscore`` requirement to 0.0.18 to
cooperate with new ``xarray`` version. (:pr:`451`, :pr:`449`)
`Riley X. Brady`_
- Switch from Travis CI and Coveralls to Github Actions and CodeCov.
(:pr:`471`) `Riley X. Brady`_
- Assertion functions added for :py:class:`.PerfectModelEnsemble`:
:py:func:`~climpred.testing.assert_PredictionEnsemble`. (:pr:`391`) `Aaron Spring`_.
- Test all metrics against synthetic data. (:pr:`388`) `Aaron Spring`_.