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

Add overrides for isLowCarbon and isRenewable contributions for CH #4088

Merged

Conversation

pierresegonne
Copy link
Member

Description

Adds zoneOverrides for the considering the contribution of unknownto the renewable and carbon-free percentages for CH.
The rationale is detailed in the source provided, but the TLDR; is that 52% of the unknown is hydro discharge, for a zone where more than 80% of the production is carbon free.

Copy link
Member

@corradio corradio left a comment

Choose a reason for hiding this comment

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

Great stuff! Maybe it's worth rounding the values to two decimals so we avoid having a file that is so large (and a diff that is quite big)

@github-actions github-actions bot added the tests label May 5, 2022
@pierresegonne
Copy link
Member Author

@FelixDQ let's have a look together before merging, I'd like to discuss data format for these parameters (TLDR they don't respect the same format as the other parameters)

Copy link
Member

@FelixDQ FelixDQ left a comment

Choose a reason for hiding this comment

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

I would probably also update the other values, so that we only use numbers and not a combination of booleans and numbers.

Also remember that we need to update the code here when we merge this:
https://github.com/electricitymap/electricitymap/blob/master/libs/flowtracing/electricitymap/flowtracing/flowtracing.py#L326-L334

and here
https://github.com/electricitymap/electricitymap/blob/7c11216a4cb241b5f9ff483900381c3eab6450fe/libs/flowtracing/electricitymap/flowtracing/flowtracing.py#L375-L383

@@ -138,6 +160,80 @@ def callback2(ratio, _zone):
)
self.check_power_origin_ratios(callback1, callback2)

def check_contribution_object(self, contribution, zone, mode, contribution_name):
Copy link
Member Author

Choose a reason for hiding this comment

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

testing for two things mainly:

  • datetimes - if the contributions for a mode are given as a list with datetimes, we verify that each element of the list have a valid datetime + that the list is ordered by these datetimes
  • values for the contributions - check that all contributions have a key "value" and that the value is between 0 and 1

@pierresegonne pierresegonne enabled auto-merge (squash) May 6, 2022 14:39
@pierresegonne pierresegonne merged commit 7f2247f into master May 6, 2022
@pierresegonne pierresegonne deleted the ps/add_overrides_for_unknown_renewable_lowCarbon_CH branch May 6, 2022 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants