-
Notifications
You must be signed in to change notification settings - Fork 52
feat: python recipes #420
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
base: main
Are you sure you want to change the base?
feat: python recipes #420
Conversation
…o feat/recipe-generator
…o feat/recipe-generator
Co-authored-by: Florian Pinault <[email protected]>
aaron-hopkinson
left a comment
There was a problem hiding this 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. |
There was a problem hiding this comment.
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
docs/building/introduction.rst
Outdated
| @@ -105,3 +105,14 @@ operations can be combined to build complex datasets. | |||
| :caption: Naming Conventions | |||
|
|
|||
| naming-conventions | |||
|
|
|||
| **************** | |||
There was a problem hiding this comment.
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
docs/datasets/building/filters.rst
Outdated
|
|
||
| Filters are used to modify the data or metadata in a dataset. | ||
|
|
||
| See :ref:`anemoi-transform <anemoi-transform:list-of-filters>` for more |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not define __eq__?
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/