Skip to content

Conversation

@b8raoult
Copy link
Collaborator

@b8raoult b8raoult commented Sep 21, 2025

Description

This allows the creation of YAML recipe files from python. Complex recipes are difficult to build. With Python, one can create loops, functions, etc... to simplify the creation of the recipes.

What problem does this change solve?

What issue or task does this change relate to?

Additional notes

As a contributor to the Anemoi framework, please ensure that your changes include unit tests, updates to any affected dependencies and documentation, and have been tested in a parallel setting (i.e., with multiple GPUs). As a reviewer, you are also responsible for verifying these aspects and requesting changes if they are not adequately addressed. For guidelines about those please refer to https://anemoi.readthedocs.io/en/latest/

By opening this pull request, I affirm that all authors agree to the Contributor License Agreement.


📚 Documentation preview 📚: https://anemoi-datasets--420.org.readthedocs.build/en/420/

@github-project-automation github-project-automation bot moved this to To be triaged in Anemoi-dev Sep 21, 2025
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 21, 2025
@b8raoult b8raoult marked this pull request as ready for review September 21, 2025 18:09
Copy link
Contributor

@aaron-hopkinson aaron-hopkinson left a comment

Choose a reason for hiding this comment

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

I feel like we'd benefit from tests for the new functionality - without tests I think the code can be a bit hard to follow



Anemoi datasets are stored in a zarr format and can be located on a local file system or on a remote server.
The `inspect` command is used to inspect the contents of a dataset.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy & paste? Should be recipe and describe what the command does

@@ -105,3 +105,14 @@ operations can be combined to build complex datasets.
:caption: Naming Conventions

naming-conventions

****************
Copy link
Contributor

Choose a reason for hiding this comment

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

This results in an empty subsection on the "building your own datasets" page (along with "naming conventions" which is also empty but not caused by this change). I think we should just have the toctree directives and not the header here


Filters are used to modify the data or metadata in a dataset.

See :ref:`anemoi-transform <anemoi-transform:list-of-filters>` for more
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need a separate page here, we could just put this as a subsection on the main "building your own datasets" page (docs/datasets/building/introduction.rst)

.. literalinclude:: code/using-python-1.py
:language: python

you can pass parameters to the ``Recipe`` constructor:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might be useful to highlight the link between valid attributes/arguments and the vocabulary of the YAML (as you do later with the sources/filters)

def __repr__(self):
return f"Index({self.name})"

def same(self, other):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not define __eq__?

@github-project-automation github-project-automation bot moved this from To be triaged to Under Review in Anemoi-dev Sep 29, 2025
Base automatically changed from feat/refactor-create to main October 6, 2025 12:15
@aaron-hopkinson aaron-hopkinson requested a review from a team as a code owner October 6, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ATS approval needed documentation Improvements or additions to documentation

Projects

Status: Under Review

Development

Successfully merging this pull request may close these issues.

5 participants