Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant illegal character check attribute #452

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading