Skip to content

Commit

Permalink
Remove redundant NomenclatureConfig attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
dc-almeida committed Jan 8, 2025
1 parent 044db60 commit b55aff5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
6 changes: 1 addition & 5 deletions nomenclature/codelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,7 @@ def read_excel(cls, name, source, sheet_name, col, attrs=None):

def check_illegal_characters(self, config: NomenclatureConfig) -> dict[str, Code]:
"""Check that no illegal characters are left in codes after tag replacement"""
illegal = (
["{", "}"] + config.illegal_characters
if config.check_illegal_characters
else ["{", "}"]
)
illegal = ["{", "}"] + config.illegal_characters
errors = ErrorCollector()

def _check_string(value):
Expand Down
1 change: 0 additions & 1 deletion nomenclature/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ class NomenclatureConfig(BaseModel):
repositories: dict[str, Repository] = Field(default_factory=dict)
definitions: DataStructureConfig = Field(default_factory=DataStructureConfig)
mappings: RegionMappingConfig = Field(default_factory=RegionMappingConfig)
check_illegal_characters: bool = True
illegal_characters: list[str] = [":", ";", '"']

model_config = ConfigDict(use_enum_values=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ definitions:
variable:
repository:
- common-definitions
check_illegal_characters: true
illegal_characters: ["'"] # these are known to be present in common-definitions variables

0 comments on commit b55aff5

Please sign in to comment.