Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use site-specific lists of recipes in the RTW #3856

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

chrisbillowsMO
Copy link
Contributor

@chrisbillowsMO chrisbillowsMO commented Jan 9, 2025

Description


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number of pull requests:

@chrisbillowsMO chrisbillowsMO added the Recipe Test Workflow (RTW) Items relevant to the Recipe Test Workflow label Jan 9, 2025
@chrisbillowsMO chrisbillowsMO self-assigned this Jan 9, 2025
@chrisbillowsMO chrisbillowsMO added this to the v2.12.0 milestone Jan 9, 2025
@chrisbillowsMO chrisbillowsMO marked this pull request as ready for review January 9, 2025 11:21
@chrisbillowsMO chrisbillowsMO requested review from ehogan and removed request for ehogan January 9, 2025 11:21
Copy link
Contributor

@ehogan ehogan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @chrisbillowsMO 🥳

I haven't yet reviewed the documentation, but I have run out of time today, so I'm sharing the review comments I have made so far. It's unlikely I'll have any time tomorrow to complete the review, so I'll do it first thing on Monday 👍

doc/sphinx/source/utils/RTW/tested_recipes.rst Outdated Show resolved Hide resolved
Comment on lines 19 to 21
- The files use the Jinja2 templating language (see this
:ref:`note <jinja2_templating_language>`, the `Cylc Jinja2`_ documentation
or the `Jinja2`_ documentation for more information).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a link to more infomation (the first link) is great! 🥳 I wonder whether this second link should be included somewhere within the first link (if that's where more information about the files is located)? 🤔

Copy link
Contributor Author

@chrisbillowsMO chrisbillowsMO Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second and third links were in the first link AS WELL...! Which is how I prefer it - but I merrily defer to the single source of truth doctrine. Despicable duplicate links removed here: 3445729 😉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A summary of the discussion Chris and I had just now: we agreed to remove the second point completely from this file, since the Jinja2 information is available in the documentation linked to in the first point. I'll add a separate comment to suggest potentially moving the Jinja2 information to the top of the documentation 😊

Comment on lines 10 to 11
"is undefined and must be set, usually in '" ~ SITE_RECIPES_FILE ~ " - see 'How to "
"add a recipe to the RTW' documentation for more information."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify the request. Also, I found out recently that, when writing documentation: use inclusive language that doesn't always refer to "seeing" an element. Unfortunately this is something I used to do a lot and I keep finding occurrences of it! 😱 I have made a suggestion below, but feel free to adjust 😊

Suggested change
"is undefined and must be set, usually in '" ~ SITE_RECIPES_FILE ~ " - see 'How to "
"add a recipe to the RTW' documentation for more information."
"is undefined and must be set in '" ~ SITE_RECIPES_FILE ~ ". The 'How to "
"add a recipe to the RTW' documentation provides more information."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commited your suggestion but have reverted the . to a - (keeping your text) here: 2bb79fc

Jinja2 renders . as a line break.
E.g.

Jinja2Error: Jinja2 Assertion Error: FAST_RECIPES is undefined and must be set in 'site/metoffice-recipes.cylc'.
The 'How to add a recipe to the RTW' documentation provides more
information.

I did experiment with getting a . (e.g. using \., {% raw %} from here, using an utf-8 full stop) - but it made me feel like too much of a failure. I could live with the dash...!

(I didn't comment it in the file; it didn't feel a big enough issue. Let me know if we should have a comment)

esmvaltool/utils/recipe_test_workflow/flow.cylc Outdated Show resolved Hide resolved
esmvaltool/utils/recipe_test_workflow/flow.cylc Outdated Show resolved Hide resolved
esmvaltool/utils/recipe_test_workflow/site/metoffice.cylc Outdated Show resolved Hide resolved
Comment on lines 6 to 7
{% set SITE_RECIPES_FILE = 'site/' ~ SITE ~ '-recipes.cylc' %}
{% from SITE_RECIPES_FILE import FAST_RECIPES, MEDIUM_RECIPES %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you spent a lot of time investigating this, and apologies if you already told me the answer to this question, but if the file is included (e.g. {% include 'site/' ~ SITE ~ '-recipes.cylc' %}) are the FAST_RECIPES and MEDIUM_RECIPES variables not recognised? 🤔

Copy link
Contributor

@ehogan ehogan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @chrisbillowsMO! 🎉 I am pleased with the removal of some of the more complex parts of those instructions! 🥳

If the recipe takes less than 10 minutes to run then it should be added
to the ``fast`` option. Recipes that take longer than ten minutes should
be added to the ``medium`` option.
Run a Recipe in the |RTW|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this heading should be "Add the recipe to the RTW", but that's quite similar to the title of this documentation page! 😱

Comment on lines +40 to +41
#. ``<site>-recipes.cylc`` contains **two lists of dictionaries**. The lists
are ``FAST_RECIPES`` and ``MEDIUM_RECIPES``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each point must describe an instruction. This point contains only information, which means it would be better located in an info (or equivalent) box.

Comment on lines +34 to +38
#. The recipe should now be added to your ``<site>-recipes.cylc`` file. (Where
``<site>`` is your site). Find this in the
``esmvaltool/utils/recipe_test_workflow/site/`` directory. Add the recipe in
alphabetical order for easy user reference:
:ref:`Currently tested recipes <currently_tested_recipes>`.
Copy link
Contributor

@ehogan ehogan Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use more commanding language, e.g. "Add the recipe to the <site>-recipes.cylc file in the esmvaltool/utils/recipe_test_workflow/site/ directory. Then maybe add the "in alphabetical order" to a "note" box?

Comment on lines +69 to +71
* - ``actual``
- A note of the recipe's actual resource usage. From the successful run
of the recipe on the compute server at your site.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth including the text in point 3 above here (i.e. how to get this information from the ESMValTool log)?

Comment on lines +92 to +98
.. _jinja2_templating_language:

.. note::
The ``<site>-recipes.cylc`` file is actually written in the `Jinja2`_
templating language. Jinja2 gives |Cylc| many powerful features (visit
`Cylc Jinja2`_). This is beyond the scope of this guide. Follow the links
for more information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the opening points of this documentation should be updated to give more information about what will happen when adding a recipe. For example, they will be editing a single file in the RTW, and it's Jinja2, and then include this information.

Comment on lines +88 to +90
#. Once the recipe dictionary is added to either ``FAST_RECIPES`` or
``MEDIUM_RECIPES``, the recipe will run as part of the |RTW| at your site.
Next, the recipe will need |KGOs| to run successfully in the RTW.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each point must describe an instruction. This point contains only information, which means it would be better located in an info (or equivalent) box.

@@ -104,15 +136,6 @@ How to add a recipe to the |RTW|
#. Run the |RTW| again, as detailed in the :ref:`quick_start_guide`; the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this be the first time the RTW is run now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Recipe Test Workflow (RTW) Items relevant to the Recipe Test Workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use site-specific lists of recipes in the RTW
2 participants