Skip to content

Commit 200101e

Browse files
Iain-Smchantry
andauthored
fix: Target docs (#704)
Replace ``_target`` with ``_target_``. Fix YAML indentation. ## Description <!-- What issue or task does this change relate to? --> Typo(s) in the docs. ## What problem does this change solve? <!-- Describe if it's a bugfix, new feature, doc update, or breaking change --> Bugfix ## What issue or task does this change relate to? <!-- link to Issue Number --> N/A ## Additional notes ## <!-- Include any additional information, caveats, or considerations that the reviewer should be aware of. --> I think that this reference to `_target` is a typo, which should say `_target_`. I believe that some YAML blocks are not valid (as tested with `yaml.safe_load(the_text)`) and that YAML objects can either be lists or dicts but not a mixture of both. Not valid (raises ParserError): ```yaml a_key: - a list item another_key: a value ``` Valid: ```yaml a_key: - a_list_of_dicts_key_1: val a_list_of_dicts_key_2: val ``` [rstcheck](https://github.com/rstcheck/rstcheck/tree/main) catches these (and a few others). I'd be happy to add it to the CI system if that's something you'd be interested in. ***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.](https://github.com/ecmwf/codex/blob/main/Legal/contributor_license_agreement.md) <!-- readthedocs-preview anemoi-training start --> ---- 📚 Documentation preview 📚: https://anemoi-training--704.org.readthedocs.build/en/704/ <!-- readthedocs-preview anemoi-training end --> <!-- readthedocs-preview anemoi-graphs start --> ---- 📚 Documentation preview 📚: https://anemoi-graphs--704.org.readthedocs.build/en/704/ <!-- readthedocs-preview anemoi-graphs end --> <!-- readthedocs-preview anemoi-models start --> ---- 📚 Documentation preview 📚: https://anemoi-models--704.org.readthedocs.build/en/704/ <!-- readthedocs-preview anemoi-models end --> --------- Co-authored-by: Matthew Chantry <[email protected]>
1 parent 9574ff1 commit 200101e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

graphs/docs/graphs/post_processor.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ attribute where the masking indices will be stored.
4242
4343
post_processors:
4444
- _target_: anemoi.graphs.processors.RemoveUnconnectedNodes
45-
nodes_name: data
46-
save_mask_indices_to_attr: indices_connected_nodes # optional
45+
nodes_name: data
46+
save_mask_indices_to_attr: indices_connected_nodes # optional
4747
4848
The ``RemoveUnconnectedNodes`` post-processor also supports an
4949
``ignore`` argument, which is optional but highly convenient in certain
@@ -62,9 +62,9 @@ preserved. For example:
6262
6363
post_processors:
6464
- _target_: anemoi.graphs.processors.RemoveUnconnectedNodes
65-
nodes_name: data
66-
ignore: important_nodes
67-
save_mask_indices_to_attr: indices_connected_nodes # optional
65+
nodes_name: data
66+
ignore: important_nodes
67+
save_mask_indices_to_attr: indices_connected_nodes # optional
6868
6969
In this configuration, any node with the attribute `important_nodes` set
7070
will not be pruned, regardless of its connectivity status.
@@ -87,8 +87,8 @@ retained in the graph.
8787
8888
post_processors:
8989
- _target_: anemoi.graphs.processors.SubsetNodesInArea
90-
nodes_name: [data, hidden]
91-
area: [40, 10, 20, 30] # (north, west, south, east)
90+
nodes_name: [data, hidden]
91+
area: [40, 10, 20, 30] # (north, west, south, east)
9292
9393
The area is defined by four values representing the northern, western,
9494
southern, and eastern boundaries, in that order: `(north, west, south,
@@ -171,7 +171,7 @@ can be configured to sort in either ascending or descending order:
171171
172172
post_processors:
173173
- _target_: anemoi.graphs.processors.SortEdgeIndexBySourceNodes
174-
descending: True # optional, defaults to true
174+
descending: True # optional, defaults to true
175175
176176
SortEdgeIndexByTargetNodes
177177
==========================
@@ -183,7 +183,7 @@ indices based on the target nodes:
183183
184184
post_processors:
185185
- _target_: anemoi.graphs.processors.SortEdgeIndexByTargetNodes
186-
descending: True # optional, defaults to true
186+
descending: True # optional, defaults to true
187187
188188
Both processors maintain the consistency of all edge attributes while
189189
sorting, ensuring that the relationship between edge indices and their

training/docs/modules/diagnostics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Callbacks are configured in the config file under the
3030

3131
For regular callbacks, they can be provided as a list of dictionaries
3232
underneath the ``config.diagnostics.callbacks`` key. Each dictionary
33-
must have a ``_target`` key which is used by hydra to instantiate the
33+
must have a ``_target_`` key which is used by hydra to instantiate the
3434
callback, any other kwarg is passed to the callback's constructor.
3535

3636
.. code:: yaml

0 commit comments

Comments
 (0)