Skip to content

Commit f021017

Browse files
authored
fix(graphs,schemas): missing type for mask_attr_name in schema (#664)
## Description <!-- What issue or task does this change relate to? --> The `mask_attr_name` is only needed for LAM with boundary forcing, but if you want to build a LAM without boundary forcing, your data nodes will correspond to the area of interest, so you will not need to specify the extra `mask_attr_name`. ***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)
1 parent a0621e1 commit f021017

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

graphs/src/anemoi/graphs/schemas/node_schemas.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from pathlib import Path # noqa: TC003
1313
from typing import Annotated
1414
from typing import Literal
15+
from typing import Optional
1516

1617
from pydantic import Field
1718
from pydantic import PositiveFloat
@@ -106,7 +107,7 @@ class LimitedAreaNPZFileNodesSchema(BaseModel):
106107
"The grid resolution."
107108
reference_node_name: str # TODO(Helen): Check that reference nodes exists in the config
108109
"Name of the reference nodes in the graph to consider for the Area Mask."
109-
mask_attr_name: str # TODO(Helen): Check that mask_attr_name exists in the dataset config
110+
mask_attr_name: Optional[str] # TODO(Helen): Check that mask_attr_name exists in the dataset config
110111
"Name of a node to attribute to mask the reference nodes, if desired. Defaults to consider all reference nodes."
111112
margin_radius_km: PositiveFloat = Field(example=100.0)
112113
"Maximum distance to the reference nodes to consider a node as valid, in kilometers. Defaults to 100 km."
@@ -134,7 +135,7 @@ class LimitedAreaIcosahedralandHealPixNodeSchema(BaseModel):
134135
"Refinement level of the mesh."
135136
reference_node_name: str # TODO(Helen): Discuss check that reference nodes exists in the config
136137
"Name of the reference nodes in the graph to consider for the Area Mask."
137-
mask_attr_name: str # TODO(Helen): Discuss check that mask_attr_name exists in the dataset config
138+
mask_attr_name: Optional[str] # TODO(Helen): Discuss check that mask_attr_name exists in the dataset config
138139
"Name of a node to attribute to mask the reference nodes, if desired. Defaults to consider all reference nodes."
139140
margin_radius_km: PositiveFloat = Field(example=100.0)
140141
"Maximum distance to the reference nodes to consider a node as valid, in kilometers. Defaults to 100 km."
@@ -149,7 +150,7 @@ class StretchedIcosahdralNodeSchema(BaseModel):
149150
"Refinement level of the mesh on the local area."
150151
reference_node_name: str
151152
"Name of the reference nodes in the graph to consider for the Area Mask."
152-
mask_attr_name: str
153+
mask_attr_name: Optional[str]
153154
"Name of a node to attribute to mask the reference nodes, if desired. Defaults to consider all reference nodes."
154155
margin_radius_km: PositiveFloat = Field(example=100.0)
155156
"Maximum distance to the reference nodes to consider a node as valid, in kilometers. Defaults to 100 km."

0 commit comments

Comments
 (0)