Skip to content

AER-3988 Improve flow on handling import year#350

Merged
Hilbrand merged 1 commit intoaerius:mainfrom
Hilbrand:AER-3988-no-emissions-warning
Sep 19, 2025
Merged

AER-3988 Improve flow on handling import year#350
Hilbrand merged 1 commit intoaerius:mainfrom
Hilbrand:AER-3988-no-emissions-warning

Conversation

@Hilbrand
Copy link
Member

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.

@Hilbrand Hilbrand requested a review from tom-h42 September 18, 2025 09:09
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.
@Hilbrand Hilbrand force-pushed the AER-3988-no-emissions-warning branch from 8093fe2 to a269ca8 Compare September 18, 2025 09:41
Copy link
Contributor

@MichielJanssen-DAT MichielJanssen-DAT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 question, besides that it LGTM

@Hilbrand Hilbrand merged commit 628a9e0 into aerius:main Sep 19, 2025
1 check passed
@Hilbrand Hilbrand deleted the AER-3988-no-emissions-warning branch September 19, 2025 08:25
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

Successfully merging this pull request may close these issues.

2 participants