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

AER3-429 Standard road emission factors #19

Merged
merged 8 commits into from
Dec 22, 2023

Conversation

BertScholten
Copy link
Member

Methods to obtain the emission factors for the standard road categories (light traffic, medium freight, heavy freight and autobus).

This is quite different from farm lodgings, and isn't that straight forward: the speed profiles and different applications in SRM1/SRM2 (for non urban roads) make it complicated. The idea is to first pick a road type, then pick a speed profile based on that road type and some other properties, and use that along with the vehicle type and year to arrive at the correct emission factors.

Not sure yet if this is final: road has some weird stuff in it due to the difference between SRM1/SRM2, strict and non-strict speed enforcement, etc.
The SRM1/SRM2 part is annoying, would rather have columns in the database so we didn't have to do this determination ourselves. But since we're working on existing database structure...
Saves some repetition in the service definition.
This way we can add more information like the speed profile category, the year and the vehicle type. While this information is (indirectly) supplied by the client in the URL, this is more in line with how we're working for farms so far: always return the code that is used as well.
Since this isn't really a category (unique by 1 code), did not inherit from the Category object for this wrapping object. Could perhaps combine something to make a surrogate unique code, but that seems overkill at the moment.
Road structure has changed a bit since last time this PR was changed, so stuff had to be adjusted.
It is now partially implemented, but at least it's mergeable again. Not entirely sure if API definition is complete like this, think this is the bare minimum.
As it was, a circular error would appear, because we've mapped everything under /api/v1/, which is directly used within a Controller.
As that controller did not have something mapped for '/error', an error would occur, and that in turn would try to lookup something mapped for '/error', which...
Also means we can skip the whitelabel configuration.
Copy link
Member

@JornC JornC left a comment

Choose a reason for hiding this comment

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

LGTM

@BertScholten BertScholten merged commit 6f99636 into aerius:main Dec 22, 2023
1 check passed
@BertScholten BertScholten deleted the api_road branch December 22, 2023 08:51
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