<jupyter_start><jupyter_text>Finding and listing recipes in a notebookThe goal of this notebook is to demonstrate and test the functionality to list recipes, find recipes using some search patterns, and display nicely formatted recipe metadata in a Jupyter Notebook. See associated PR here: https://github.com/ESMValGroup/ESMValCore/pull/901<jupyter_code>%load_ext autoreload
%autoreload 2<jupyter_output><empty_output><jupyter_text>Getting a recipeIf you already know which recipe you want to get, use `get_recipe`.<jupyter_code>from esmvalcore.experimental import get_recipe

recipe = get_recipe('recipe_climwip')
recipe<jupyter_output>/home/stef/r/esmvalcore/esmvalcore/experimental/__init__.py:5: UserWarning: 
  Thank you for trying out the new ESMValCore API.
  Note that this API is experimental and may be subject to change.
  More info: https://github.com/ESMValGroup/ESMValCore/issues/498
/home/stef/r/esmvalcore/esmvalcore/experimental/config/_config_validators.py:251: ESMValToolDeprecationWarning: `write_plots` will be removed in 2.2.0.
/home/stef/r/esmvalcore/esmvalcore/experimental/config/_config_validators.py:252: ESMValToolDeprecationWarning: `write_netcdf` will be removed in 2.2.0.
/home/stef/r/esmvalcore/esmvalcore/experimental/config/_config_validators.py:253: ESMValToolDeprecationWarning: `output_file_type` will be removed in 2.2.0.<jupyter_text>Recipe InfoNotice how the recipe info above is nicely rendered in Jupyter with a little bit of IPython magic 🧙‍♂️. The recipes are loaded in a `RecipeInfo` object, which has information about the documentation, authors, project, and related references of the recipe. It resolves all the tags in the recipe, so that it knows which institute an author belongs to. It also writes out the references.  List all recipesSometimes, you just want to examine all recipes. To do so, use `get_all_recipes`. This will find all recipes currently available in `ESMValTool`.<jupyter_code>from esmvalcore.experimental import get_all_recipes

recipes = get_all_recipes()
recipes<jupyter_output><empty_output><jupyter_text>To find the recipe you are looking for, you can use the `.find` method. This takes a search query that looks through the recipe metadata and returns any matches. The query can be a regex pattern, so you can make it as complex as you like!<jupyter_code>recipes.find('Geophysical Research Letters')
recipes.find('NLeSC')<jupyter_output><empty_output><jupyter_text>AuthorsAuthor info can be retrieved from their TAG (as defined in `config-references.yml`)<jupyter_code>from esmvalcore.experimental.recipe_info import Contributor

contributor = Contributor.from_tag('righi_mattia')
contributor<jupyter_output><empty_output><jupyter_text>ProjectProjects are also defined by their TAG (as defined in `config-references.yml`)<jupyter_code>from esmvalcore.experimental.recipe_info import Project

proj = Project.from_tag('esmval')
proj<jupyter_output><empty_output><jupyter_text>ReferencesReferences can be loaded using a filename, or using an ESMValTool tag. This uses the `pybtex` library (https://pybtex.org/).<jupyter_code>from esmvalcore.experimental.recipe_info import Reference

ref = Reference.from_tag('sutanudjaja2018gmd')<jupyter_output><empty_output><jupyter_text>Using IPython magic, the reference renders in formatted html.<jupyter_code>ref<jupyter_output><empty_output><jupyter_text>But in other environments, the plain text version is printed.<jupyter_code>print(ref)<jupyter_output><NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, and <NAME>. PCR-GLOBWB 2: a 5 arcmin global hydrological and water resources model. Geoscientific Model Development, 11(6):2429–2453, jun 2018. URL: https://doi.org/10.5194%2Fgmd-11-2429-2018, doi:10.5194/gmd-11-2429-2018.
{'fraction_non_alphanumeric': 0.09143155694879833, 'fraction_numerical': 0.02089864158829676, 'mean_word_length': 6.673346693386773, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '324156', 'license': 'Apache-2.0', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1211, 'n_words': 366, 'path': 'list recipes in notebook.ipynb', 'repo_name': 'stefsmeets/ESMValCore-Notebooks', 'size': '4012'}