============================
Bug Fixes
---------
- Fix when creating ``valid_time`` from ``lead.attrs["units"]`` in
``["seasons", "years"]`` with multi-month stride in ``init``.
(:issue:`698`, :pr:`700`) `Aaron Spring`_.
- Fix ``seasonality="season"`` in ``reference="climatology"``.
(:issue:`641`, :pr:`703`) `Aaron Spring`_.
New Features
------------
- Upon instantiation, :py:class:`.PredictionEnsemble` generates new
2-dimensional coordinate ``valid_time`` for ``initialized`` from ``init`` and
``lead``, which is matched with ``time`` from ``verification`` during alignment.
(:issue:`575`, :pr:`675`, :pr:`678`) `Aaron Spring`_.
.. :: python
>>> hind = climpred.tutorial.load_dataset("CESM-DP-SST")
>>> hind.lead.attrs["units"] = "years"
>>> climpred.HindcastEnsemble(hind).get_initialized()
<xarray.Dataset>
Dimensions: (lead: 10, member: 10, init: 64)
Coordinates:
* lead (lead) int32 1 2 3 4 5 6 7 8 9 10
* member (member) int32 1 2 3 4 5 6 7 8 9 10
* init (init) object 1954-01-01 00:00:00 ... 2017-01-01 00:00:00
valid_time (lead, init) object 1955-01-01 00:00:00 ... 2027-01-01 00:00:00
Data variables:
SST (init, lead, member) float64 ...
- Allow ``lead`` as ``float`` also if ``calendar="360_day"`` or ``lead.attrs["units"]``
not in ``["years","seasons","months"]``. (:issue:`564`, :pr:`675`) `Aaron Spring`_.
- Implement :py:meth:`.HindcastEnsemble.generate_uninitialized` resampling years
without replacement from ``initialized``. (:issue:`589`, :pr:`591`) `Aaron Spring`_.
- Implement Logarithmic Ensemble Skill Score :py:func:`~climpred.metrics._less`.
(:issue:`239`, :pr:`687`) `Aaron Spring`_.
- :py:meth:`.HindcastEnsemble.remove_seasonality` and
:py:meth:`.PerfectModelEnsemble.remove_seasonality` remove the
seasonality of all ``climpred`` datasets. (:issue:`530`, :pr:`688`) `Aaron Spring`_.
- Add keyword ``groupby`` in :py:meth:`.HindcastEnsemble.verify`,
:py:meth:`.PerfectModelEnsemble.verify`, :py:meth:`.HindcastEnsemble.bootstrap` and
:py:meth:`.PerfectModelEnsemble.bootstrap` to group skill by
initializations seasonality. (:issue:`635`, :pr:`690`) `Aaron Spring`_.
.. :: python
>>> import climpred
>>> hind = climpred.tutorial.load_dataset("NMME_hindcast_Nino34_sst")
>>> obs = climpred.tutorial.load_dataset("NMME_OIv2_Nino34_sst")
>>> hindcast = climpred.HindcastEnsemble(hind).add_observations(obs)
>>> skill for each init month separated
>>> skill = hindcast.verify(
... metric="rmse",
... dim="init",
... comparison="e2o",
... skipna=True,
... alignment="maximize",
... groupby="month",
... )
>>> skill
<xarray.Dataset>
Dimensions: (month: 12, lead: 12, model: 12)
Coordinates:
* lead (lead) float64 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0
* model (model) object 'NCEP-CFSv2' 'NCEP-CFSv1' ... 'GEM-NEMO'
skill <U11 'initialized'
* month (month) int64 1 2 3 4 5 6 7 8 9 10 11 12
Data variables:
sst (month, lead, model) float64 0.4127 0.3837 0.3915 ... 1.255 3.98
>>> skill.sst.plot(hue="model", col="month", col_wrap=3)
- :py:meth:`.HindcastEnsemble.plot_alignment` shows how forecast and
observations are aligned based on the `alignment <alignment.html>`_ keyword.
This may help understanding which dates are matched for the different ``alignment``
approaches. (:issue:`701`, :pr:`702`) `Aaron Spring`_.
.. ipython:: python
:okwarning:
:okexcept:
from climpred.tutorial import load_dataset
hindcast = climpred.HindcastEnsemble(
load_dataset("CESM-DP-SST")
).add_observations(load_dataset("ERSST"))
savefig plot_alignment_example.png width=100%
hindcast.plot_alignment(edgecolor="w")
- Add ``attrs`` to new ``coordinates`` created by ``climpred``.
(:issue:`695`, :pr:`697`) `Aaron Spring`_.
- Add ``seasonality="weekofyear"`` in ``reference="climatology"``.
(:pr:`703`) `Aaron Spring`_.
- Compute ``reference="persistence"`` in
:py:class:`.PerfectModelEnsemble` from ``initialized`` first ``lead``
if :py:class:`~climpred.options.set_options`
``(PerfectModel_persistence_from_initialized_lead_0=True)`` (``False`` by default)
using :py:func:`~climpred.reference.compute_persistence_from_first_lead`.
(:issue:`637`, :pr:`706`) `Aaron Spring`_.
Internals/Minor Fixes
---------------------
- Reduce dependencies. (:pr:`686`) `Aaron Spring`_.
- Add `typing <https://docs.python.org/3/library/typing.html>`_.
(:issue:`685`, :pr:`692`) `Aaron Spring`_.
- refactor ``add_attrs`` into :py:meth:`.HindcastEnsemble.verify` and
:py:meth:`.HindcastEnsemble.bootstrap`. Now all keywords are
captured in the skill dataset attributes ``.attrs``.
(:issue:`475`, :pr:`694`) `Aaron Spring`_.
- docstrings formatting with `blackdocs <https://github.com/keewis/blackdoc>`_.
(:pr:`708`) `Aaron Spring`_.
Documentation
-------------
- Refresh all docs with ``sphinx_book_theme`` and ``myst_nb``.
(:issue:`707`, :pr:`708`, :pr:`709`, :pr:`710`) `Aaron Spring`_.