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

Validate "directional" region code #181

Open
danielhuppmann opened this issue Sep 14, 2022 · 1 comment
Open

Validate "directional" region code #181

danielhuppmann opened this issue Sep 14, 2022 · 1 comment
Assignees

Comments

@danielhuppmann
Copy link
Member

In the openENTRANCE project, we introduced a > character to define "directional" variable, for example trade flows from Country A to Country B. The region code then has the structure: Austria>Germany, see here for more info.

It would be useful that the nomenclature validation also checks that for any "directional" code in the region list, there can only be two components (Austria>Germany>France) is invalid and both components must be valid regions.

See here for the current prototype in the openENTRANCE workflow.

@danielhuppmann danielhuppmann changed the title Validate "directional" data Validate "directional" region code Sep 14, 2022
@danielhuppmann
Copy link
Member Author

PR openENTRANCE/openentrance#296 ran into a similar issue, where the region-mapping fails unless a directional region code Austria>Germany is not stated explicitly in the mapping.

Possible solutions for the region-validation:

  • Add a keyword-argument allow_directional=False (or similar) when initializing a DataStructureDefinition
  • Add a config-file in the "definitions/region" folder
  • Add an attribute to the RegionCodeList which can set after initializing a DataStructureDefinition
    e.g., dsd.region.allow_directional = True

in each of these cases, any possible combination x>y will be added to the RegionCodeList. Question is how to determine a suitable "hierarchy" name.

Possible solution for the region-processing:

  • Add an attribute allow_directional to the region-mapping file.

Note that this solution must also take care of renaming, so that if "AT" is renamed to "Austria", then "AT>..." must also be renamed to "Austria>".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants