Add NutsProcessor for NUTS region aggregation#569
Open
dc-almeida wants to merge 21 commits intoIAMconsortium:mainfrom
Open
Add NutsProcessor for NUTS region aggregation#569dc-almeida wants to merge 21 commits intoIAMconsortium:mainfrom
NutsProcessor for NUTS region aggregation#569dc-almeida wants to merge 21 commits intoIAMconsortium:mainfrom
Conversation
Contributor
Author
|
Contributor
Author
|
phackstock
requested changes
Apr 17, 2026
Contributor
phackstock
left a comment
There was a problem hiding this comment.
Thanks for adding a lot of functionality @dc-almeida. The PR looks good to me in principle. There a number of comments below but most of them are minor changes to make the code easier to read and maintain.
| target_regions: list[str], | ||
| variable_codelist: VariableCodeList, | ||
| rtol_difference: float = 0.01, | ||
| return_aggregation_difference: bool = False, |
Contributor
There was a problem hiding this comment.
Not part of this PR and my own fault after consulting git blame but this variable does not do what it claims. The aggregation difference is always returned, the only thing that it does is that if the variable is set to False it additionally issues a log message detailing how to get the difference, I'm opening an issue.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #563.
NutsProcessorperforms aggregation based on the NUTS regions available in the dataframe and defined in the project configuration.If there are regions in the data that were not previously defined in
nomenclature.yaml, it raises (e.g.: if NUTS regions for Belgium are in the data, but BE is not listed in the config file).If regions within a NUTS hierarchy are missing (e.g.: for AT11, AT111 is present but AT112 is missing), aggregation runs with the existing ones.
RegionProcessorinto helper functions that are shared withNutsProcessor