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: upgrade CA-YT with event classes #6062

Merged
merged 6 commits into from
Nov 21, 2023

Conversation

kruschk
Copy link
Contributor

@kruschk kruschk commented Oct 28, 2023

Issue

Refs: #6011, #6062

Description

Upgrade the parser to use the ProductionBreakdownList, ProductionMix, StorageMix, and ZoneKey classes. This should yield no functional change. Additionally:

  • Comply with Black's 88-column default line length limit.
  • Define global constants to replace magic values.
  • Eliminate a few unnecessary variables.

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.

parsers/CA_YT.py Outdated Show resolved Hide resolved
Upgrade the parser to use the ProductionBreakdownList, ProductionMix,
StorageMix, and ZoneKey classes. This should yield no functional change.
Additionally:

- Comply with Black's 88-column default line length limit.
- Define global constants to replace magic values.
- Eliminate a few unnecessary variables.

Refs: electricitymaps#6011, electricitymaps#6062
Pass data to the ProductionMix object using the add_value method instead
of during object instantiaton.

Refs: electricitymaps#6011, electricitymaps#6062
parsers/CA_YT.py Outdated Show resolved Hide resolved
parsers/CA_YT.py Outdated Show resolved Hide resolved
@VIKTORVAV99 VIKTORVAV99 self-requested a review November 2, 2023 21:58
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.

A few things to check on before this can proceede

parsers/CA_YT.py Outdated Show resolved Hide resolved
parsers/CA_YT.py Outdated Show resolved Hide resolved
parsers/CA_YT.py Outdated Show resolved Hide resolved
@VIKTORVAV99 VIKTORVAV99 self-requested a review November 21, 2023 09:44
@github-actions github-actions bot added the zone config Pull request or issue for zone configurations label Nov 21, 2023
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.

LGTM!

Thanks for doing this!

I took the opportunity to rename the parser to match what we have discussed internally, I hope you don't mind.

@VIKTORVAV99 VIKTORVAV99 merged commit 18cfa7b into electricitymaps:master Nov 21, 2023
16 checks passed
@kruschk
Copy link
Contributor Author

kruschk commented Nov 22, 2023

I don't mind at all! Thanks for accepting this!

@kruschk kruschk deleted the kruschk/6011-ca-yt branch November 22, 2023 00:10
ghost pushed a commit that referenced this pull request Nov 23, 2023
* refactor: upgrade CA-YT with event classes

Upgrade the parser to use the ProductionBreakdownList, ProductionMix,
StorageMix, and ZoneKey classes. This should yield no functional change.
Additionally:

- Comply with Black's 88-column default line length limit.
- Define global constants to replace magic values.
- Eliminate a few unnecessary variables.

Refs: #6011, #6062

* refactor: switch to ProductionMix.add_value method

Pass data to the ProductionMix object using the add_value method instead
of during object instantiaton.

Refs: #6011, #6062

* tiny cleanup

* rename CA_YT.py to YUKONENERGY.py

---------

Co-authored-by: Viktor Andersson <30777521+VIKTORVAV99@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted parser zone config Pull request or issue for zone configurations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants