Skip to content

Commit

Permalink
add model_name literal consts to SLOTH and PET
Browse files Browse the repository at this point in the history
  • Loading branch information
aaraney committed Jul 24, 2023
1 parent 13c106a commit 074a882
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/ngen_conf/src/ngen/config/pet.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class PET(BMIC):
#should all be reasonable defaults for pET
main_output_variable: Literal["water_potential_evaporation_flux"] = "water_potential_evaporation_flux"
#NOTE aliases don't propagate to subclasses, so we have to repeat the alias
model_name: str = Field("PET", alias="model_type_name")
model_name: Literal["PET"] = Field("PET", alias="model_type_name")
# source: https://github.com/NOAA-OWP/evapotranspiration/blob/0a66999db9695bccf4c1e35d904aa86f04e6cacf/src/bmi_pet.c#L1215
registration_function: str = "register_bmi_pet"

Expand Down
4 changes: 2 additions & 2 deletions python/ngen_conf/src/ngen/config/sloth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, Mapping
from typing import Literal, Optional, Mapping
from pydantic import BaseModel, Field

from .bmi_formulation import BMICxx
Expand All @@ -9,4 +9,4 @@ class SLOTH(BMICxx):
model_params: Optional[Mapping[str, str]] #Is this a better represntation of SLOTH params??? just generic mappings?
registration_function: str = "none" #FIXME this isn't required for CXX bmi in ngen?
#NOTE aliases don't propagate to subclasses, so we have to repeat the alias
model_name: str = Field("SLOTH", const=True, alias="model_type_name")
model_name: Literal["SLOTH"] = Field("SLOTH", const=True, alias="model_type_name")

0 comments on commit 074a882

Please sign in to comment.