Skip to content

Commit

Permalink
Fix enum use in config (#356)
Browse files Browse the repository at this point in the history
* Use enum values for NomenclatureConfig

* Adjust tests
  • Loading branch information
phackstock authored Jul 9, 2024
1 parent 7979c79 commit bc5a133
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nomenclature/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ class NomenclatureConfig(BaseModel):
definitions: DataStructureConfig = Field(default_factory=DataStructureConfig)
mappings: RegionMappingConfig = Field(default_factory=RegionMappingConfig)

model_config = ConfigDict(use_enum_values=True)

@model_validator(mode="after")
@classmethod
def check_definitions_repository(
Expand Down
1 change: 1 addition & 0 deletions tests/data/general-config/nomenclature.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dimensions: [region, variable]
repositories:
common-definitions:
url: https://github.com/IAMconsortium/common-definitions.git/
Expand Down

0 comments on commit bc5a133

Please sign in to comment.