AER-3988 Improve flow on handling import year#350
Merged
Hilbrand merged 1 commit intoaerius:mainfrom Sep 19, 2025
Merged
Conversation
When importing the sources are checked for having emissions. However when both the specific import year and year in gml are for years for which no emission factors are available all sources that calculate emissions will be reported as having no emissions. This is not desired because upstream the year will be set to an valid year and emissions will be recalcated again making these earlier reported missing emissions invalid. Therefore it is better to always make sure the year used is a valid year. Because it's not known what a valid year is this is delegated by adding a method to GMLHelper to get the year. The implementation should always return a valid year, and also the implementation has the option to report a warning about the year in case it was adjusted. This implementation uses a default implementation in the interface, which makes it backwards compatible. With this new implementation we always assume the year is adjusted to a valid year it doesn't add much to also validate the year to be out of certain ranges. Therefore these GMLValidator#validateYear method has been removed.
8093fe2 to
a269ca8
Compare
MichielJanssen-DAT
approved these changes
Sep 19, 2025
Contributor
MichielJanssen-DAT
left a comment
There was a problem hiding this comment.
1 question, besides that it LGTM
source/imaer-gml/src/main/java/nl/overheid/aerius/gml/base/GMLHelper.java
Show resolved
Hide resolved
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.
When importing the sources are checked for having emissions. However when both the specific import year and year in gml are for years for which no emission factors are available all sources that calculate emissions will be reported as having no emissions. This is not desired because upstream the year will be set to an valid year and emissions will be recalcated again making these earlier reported missing emissions invalid. Therefore it is better to always make sure the year used is a valid year. Because it's not known what a valid year is this is delegated by adding a method to GMLHelper to get the year. The implementation should always return a valid year, and also the implementation has the option to report a warning about the year in case it was adjusted.
This implementation uses a default implementation in the interface, which makes it backwards compatible. With this new implementation we always assume the year is adjusted to a valid year it doesn't add much to also validate the year to be out of certain ranges. Therefore these GMLValidator#validateYear method has been removed.