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 merge Exchanges #5408

Merged
merged 16 commits into from
May 22, 2023
Merged

Add merge Exchanges #5408

merged 16 commits into from
May 22, 2023

Conversation

unitrium
Copy link
Contributor

@unitrium unitrium commented May 16, 2023

Issue

As mentioned on #5350, we also need a way of merging exchanges inside the new list datastructures as this is needed in the ENTSO-E parser at least. As it is looking at imports first and then merging with exports.

Description

  • Adds a static method to ExchangeList to merge outputs together.
  • Add a parent class MergeableList to hold common code between ProductionBreakdownList and ExchangeList.
  • Add testing of Exchange merges.

Double check

  • I have tested my parser changes locally with poetry run test_parser "zone_key"
  • I have run pnpx prettier --write . and poetry run format to format my changes.

@unitrium unitrium requested review from a user, VIKTORVAV99 and pierresegonne May 16, 2023 10:11
Copy link
Member

@VIKTORVAV99 VIKTORVAV99 left a comment

Choose a reason for hiding this comment

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

Bunch of small comments in regards to types plus some general questions and suggestions.

Will be nice to get this added!

electricitymap/contrib/lib/models/event_lists.py Outdated Show resolved Hide resolved
electricitymap/contrib/lib/models/event_lists.py Outdated Show resolved Hide resolved
electricitymap/contrib/lib/models/event_lists.py Outdated Show resolved Hide resolved
electricitymap/contrib/lib/tests/test_event_lists.py Outdated Show resolved Hide resolved
Copy link
Member

@VIKTORVAV99 VIKTORVAV99 left a comment

Choose a reason for hiding this comment

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

I added a suggestion to change the docstring but beyond that this looks good to me.

I also took the liberty to format the files and fix a small spelling error. I hope you don't mind.

electricitymap/contrib/lib/models/event_lists.py Outdated Show resolved Hide resolved
@unitrium
Copy link
Contributor Author

As discussed with @mathilde-daugy offline we decided to rename it to AggregatableEventList.
Will merge it after her review.

@unitrium unitrium requested a review from a user May 19, 2023 09:12
electricitymap/contrib/lib/models/event_lists.py Outdated Show resolved Hide resolved
electricitymap/contrib/lib/models/event_lists.py Outdated Show resolved Hide resolved
electricitymap/contrib/lib/models/event_lists.py Outdated Show resolved Hide resolved
electricitymap/contrib/lib/models/event_lists.py Outdated Show resolved Hide resolved
electricitymap/contrib/lib/models/event_lists.py Outdated Show resolved Hide resolved
Copy link
Member

@pierresegonne pierresegonne left a comment

Choose a reason for hiding this comment

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

Looks better :)

@unitrium unitrium merged commit 51c223c into master May 22, 2023
16 checks passed
@unitrium unitrium deleted the robin/ele-2121-exchange-merges branch May 22, 2023 14:32
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.

None yet

3 participants