-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for illegal characters in codelists (#418)
* Allow checking illegal characters defined in nomenclature.yaml * Update testing * Add defaults and check_illegal_characters field * Add `ErrorCollector` and pydantic `model_dump` * Delete common-definitions stray index * Add newlines * Allow single quote, disallow double-quote Co-authored-by: Daniel Huppmann <dh@dergelbesalon.at> * Fix typing --------- Co-authored-by: Daniel Huppmann <dh@dergelbesalon.at>
- Loading branch information
1 parent
c16ee58
commit 4e059f8
Showing
12 changed files
with
89 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/data/codelist/illegal_chars/char_in_external_repo/nomenclature.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
dimensions: | ||
- variable | ||
repositories: | ||
common-definitions: | ||
url: https://github.com/IAMconsortium/common-definitions.git/ | ||
hash: 3b75bb9 | ||
definitions: | ||
variable: | ||
repository: | ||
- common-definitions | ||
check_illegal_characters: true | ||
illegal_characters: ['"' , ";"] # these are known to be present in common-definitions variables |
7 changes: 7 additions & 0 deletions
7
tests/data/codelist/illegal_chars/char_in_str/definitions/variable/variables.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- Primary Energy: | ||
definition: Total primary energy consumption | ||
unit: EJ/yr | ||
- Primary Energy|Coal: | ||
definition: Primary energy consumption of coal | ||
unit: EJ/yr | ||
info: Additional info with illegal " character |
3 changes: 3 additions & 0 deletions
3
tests/data/codelist/illegal_chars/char_in_str/nomenclature.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dimensions: | ||
- variable | ||
illegal_characters: ['"' , ";"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,3 @@ | |
- Valid information. | ||
- Invalid bracket { information. | ||
- Another valid information. | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ dimensions: | |
definitions: | ||
region: | ||
country: true | ||
illegal_characters: [";", ":"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters