Skip to content

Commit

Permalink
Merge branch 'main' into python313
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriupredoi committed Nov 15, 2024
2 parents b082db6 + de43833 commit df6f5f3
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 1,277 deletions.
145 changes: 72 additions & 73 deletions conda-linux-64.lock

Large diffs are not rendered by default.

57 changes: 0 additions & 57 deletions doc/sphinx/source/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -383,63 +383,6 @@ [email protected]
.. _pygithub: https://pygithub.readthedocs.io/en/latest/introduction.html


Recipe filler
=============

If you need to fill in a blank recipe with additional datasets, you can do that with
the command `recipe_filler`. This runs a tool to obtain a set of additional datasets when
given a blank recipe, and you can give an arbitrary number of data parameters. The blank recipe
should contain, to the very least, a list of diagnostics, each with their variable(s).
Example of running the tool:

.. code-block:: bash
recipe_filler recipe.yml
where `recipe.yml` is the recipe that needs to be filled with additional datasets; a minimal
example of this recipe could be:

.. code-block:: yaml
diagnostics:
diagnostic:
variables:
ta:
mip: Amon # required
start_year: 1850 # required
end_year: 1900 # required
Key features
------------

- you can add as many variable parameters as are needed; if not added, the
tool will use the ``"*"`` wildcard and find all available combinations;
- you can restrict the number of datasets to be looked for with the ``dataset:``
key for each variable, pass a list of datasets as value, e.g.
``dataset: [MPI-ESM1-2-LR, MPI-ESM-LR]``;
- you can specify a pair of experiments, e.g. ``exp: [historical, rcp85]``
for each variable; this will look for each available dataset per experiment
and assemble an aggregated data stretch from each experiment to complete
for the total data length specified by ``start_year`` and ``end_year``; equivalent to
ESMValTool's syntax on multiple experiments; this option needs an ensemble
to be declared explicitly; it will return no entry if there are gaps in data;
- ``start_year`` and ``end_year`` are required and are used to filter out the
datasets that don't have data in the interval; as noted above, the tool will not
return datasets with partial coverage from ``start_year`` to ``end_year``;
if you want all possible years hence no filtering on years just use ``"*"``
for start and end years;
- ``config-user: rootpath: CMIPX`` may be a list, rootpath lists are supported;
- all major DRS paths (including ``default``, ``BADC``, ``ETHZ`` etc) are supported;
- speedup is achieved through CMIP mip tables lookup, so ``mip`` is required in recipe;

Caveats
-------

- the tool doesn't yet work with derived variables; it will not return any available datasets;
- operation restricted to CMIP data only, OBS lookup is not available yet.


Extracting a list of input files from the provenance
====================================================

Expand Down
10 changes: 5 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ channels:

dependencies:
- aiohttp
- cartopy # should be free with iris=3.11 https://github.com/ESMValGroup/ESMValTool/issues/3769
- cartopy
- cdo >=2.3.0
- cdsapi
- cf-units
- cfgrib
- cftime
- cmocean
# - curl <8.10 # unpin and remove as soon as Julia can
- curl <8.10 # https://github.com/ESMValGroup/ESMValTool/issues/3758
- cython
- dask !=2024.8.0 # https://github.com/dask/dask/issues/11296
- distributed
- ecmwf-api-client
- eofs
- esmpy # <8.6 safe https://github.com/SciTools/iris-esmf-regrid/issues/415
- esmpy
- esmvalcore 2.11.*
- fiona
- fire
- fsspec
- gdal >=3.9.0
- importlib_metadata <8 # https://github.com/ESMValGroup/ESMValTool/issues/3699 only for Python 3.10/11 and esmpy<8.6
- iris==3.11.0rc0 # first to support numpy2 and Python 3.13 # >=3.6.1
- iris >=3.11
- iris-esmf-regrid >=0.10.0 # github.com/SciTools-incubator/iris-esmf-regrid/pull/342
- jinja2
- joblib
Expand All @@ -42,7 +42,7 @@ dependencies:
- nc-time-axis
- netCDF4
- numba
- numpy !=1.24.3 # should be free with iris=3.11 ,<2.0 # severe masking bug
- numpy !=1.24.3 # severe masking bug
- openpyxl
- packaging
- pandas # ==2.1.4 # unpin when ESMValCore released with https://github.com/ESMValGroup/ESMValCore/pull/2529
Expand Down
8 changes: 4 additions & 4 deletions environment_osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ channels:

dependencies:
- aiohttp
- cartopy <0.24 # https://github.com/ESMValGroup/ESMValTool/issues/3767
- cartopy
- cdo >=2.3.0
- cdsapi
- cf-units
Expand All @@ -22,14 +22,14 @@ dependencies:
- distributed
- ecmwf-api-client
- eofs
- esmpy # <8.6 safe https://github.com/SciTools/iris-esmf-regrid/issues/415
- esmpy
- esmvalcore 2.11.*
- fiona
- fire
- fsspec
- gdal >=3.9.0
- importlib_metadata <8 # https://github.com/ESMValGroup/ESMValTool/issues/3699 only for Python 3.10/11 and esmpy<8.6
- iris >=3.6.1
- iris >=3.11
- iris-esmf-regrid >=0.10.0 # github.com/SciTools-incubator/iris-esmf-regrid/pull/342
- jinja2
- joblib
Expand All @@ -40,7 +40,7 @@ dependencies:
- nc-time-axis
- netCDF4
- numba
- numpy !=1.24.3,<2.0 # severe masking bug
- numpy !=1.24.3 # severe masking bug
- openpyxl
- packaging
- pandas==2.1.4 # unpin when ESMValCore released with https://github.com/ESMValGroup/ESMValCore/pull/2529
Expand Down
10 changes: 5 additions & 5 deletions esmvaltool/config-references.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,11 @@ authors:
name: Lillis, Jon
institute: MetOffice, UK
orcid:
lindenlaub_lukas:
name: Lindenlaub, Lukas
institute: University of Bremen, Germany
orcid: https://orcid.org/0000-0001-6349-9118
github: lukruh
little_bill:
name: Little, Bill
institute: MetOffice, UK
Expand Down Expand Up @@ -466,11 +471,6 @@ authors:
rol_evert:
name: Rol, Evert
orcid: https://orcid.org/0000-0001-8357-4453
ruhe_lukas:
name: Ruhe, Lukas
institute: University of Bremen, Germany
orcid: https://orcid.org/0000-0001-6349-9118
github: lukruh
russell_joellen:
name: Russell, Joellen
institute: Univ. of Arizona, USA
Expand Down
6 changes: 5 additions & 1 deletion esmvaltool/diag_scripts/monitor/multi_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2576,7 +2576,11 @@ def create_hovmoeller_time_vs_lat_or_lon_plot(self, datasets):
# Provenance tracking
provenance_record = {
'ancestors': ancestors,
'authors': ['schlund_manuel', 'kraft_jeremy', 'ruhe_lukas'],
'authors': [
'schlund_manuel',
'kraft_jeremy',
'lindenlaub_lukas'
],
'caption': caption,
'plot_types': ['zonal'],
'long_names': [dataset['long_name']],
Expand Down
23 changes: 22 additions & 1 deletion esmvaltool/diag_scripts/shared/_supermeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import cf_units
import iris
import iris.coord_categorisation
from iris.coord_categorisation import _pt_date
import numpy as np


Expand Down Expand Up @@ -206,6 +205,28 @@ def add_start_hour(cube, coord, name='diurnal_sampling_hour'):
_add_categorised_coord(cube, name, coord, start_hour_from_bounds)


# lifted from iris==3.10 last iris to have it in iris.coord_categorisation
# Private "helper" function
def _pt_date(coord, time):
"""Return the datetime of a time-coordinate point.
Parameters
----------
coord : Coord
Coordinate (must be Time-type).
time : float
Value of a coordinate point.
Returns
-------
cftime.datetime
"""
# NOTE: All of the currently defined categorisation functions are
# calendar operations on Time coordinates.
return coord.units.num2date(time, only_use_cftime_datetimes=True)


def start_hour_from_bounds(coord, _, bounds):
"""Add hour from bounds."""
return np.array([_pt_date(coord, _bounds[0]).hour for _bounds in bounds])
Expand Down
2 changes: 1 addition & 1 deletion esmvaltool/recipes/monitor/recipe_monitor_with_refs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ documentation:
- heuer_helge
- kraft_jeremy
- kuehbacher_birgit
- ruhe_lukas
- lindenlaub_lukas
- sarauer_ellen
- winterstein_franziska
maintainer:
Expand Down
2 changes: 1 addition & 1 deletion esmvaltool/recipes/recipe_shapeselect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ documentation:
- berg_peter

maintainer:
- ruhe_lukas
- lindenlaub_lukas

projects:
- c3s-magic
Expand Down
Loading

0 comments on commit df6f5f3

Please sign in to comment.