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

refactor: change emission rate type to calendar day #300

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

frodehk
Copy link
Contributor

@frodehk frodehk commented Nov 23, 2023

Why is this pull request needed?

Emission rate type should be CALENDAR_DAY, the same as for fuel rate.

What does this pull request change?

  • Convert emission rate results (in dto) to CALENDAR_DAY
  • Update snapshots

Issues related to this change:

https://equinor-ecalc.atlassian.net/browse/ECALC-495?atlOrigin=eyJpIjoiZGY1YTA5OThkYjc1NGVmNjgxNjIxOTNiYzAwMzBmZjAiLCJwIjoiaiJ9

@frodehk frodehk self-assigned this Nov 23, 2023
@frodehk frodehk requested a review from a team as a code owner November 23, 2023 14:23
@@ -48,7 +48,7 @@ def aggregate_emissions(
emissions_aggregated[emission_name] = PartialEmissionResult(
name=emission_name,
timesteps=emissions[0].timesteps,
rate=reduce(operator.add, [emission.rate for emission in emissions]),
rate=reduce(operator.add, [emission.rate.to_calendar_day() for emission in emissions]),
Copy link
Collaborator

Choose a reason for hiding this comment

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

here the rate should already be calendar day I guess, but it doesn hurt to be sure at least ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I checked (I think), it seemed to be stream:-)

Copy link
Collaborator

@TeeeJay TeeeJay left a comment

Choose a reason for hiding this comment

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

nice, but also here no snapshots change...probably due to regularity = 1 all over the place ...

@frodehk frodehk merged commit f8e5052 into main Nov 23, 2023
6 checks passed
@frodehk frodehk deleted the ECALC-444-change-emissions-to-calendar-day branch November 23, 2023 14:44
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