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(opennem) upgrade OPENNEM parser with event classes and replace arrow #6614

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

amv213
Copy link
Contributor

@amv213 amv213 commented Apr 2, 2024

Issue

#6011
#6135

Description

This PR upgrades the OPENNEM parser to use event classes, and drops usage of arrow in favour of the datetime library.

Double check

  • I have tested my parser changes locally with poetry run test_parser "zone_key"
  • I have run pnpx prettier@2 --write . and poetry run format in the top level directory to format my changes.

@github-actions github-actions bot added parser python Pull requests that update Python code tests labels Apr 2, 2024
Comment on lines -304 to -317
"capacity": {
"coal": sum_vector(capacities, OPENNEM_PRODUCTION_CATEGORIES["coal"]),
"gas": sum_vector(capacities, OPENNEM_PRODUCTION_CATEGORIES["gas"]),
"oil": sum_vector(capacities, OPENNEM_PRODUCTION_CATEGORIES["oil"]),
"hydro": sum_vector(capacities, OPENNEM_PRODUCTION_CATEGORIES["hydro"]),
"wind": sum_vector(capacities, OPENNEM_PRODUCTION_CATEGORIES["wind"]),
"biomass": sum_vector(
capacities, OPENNEM_PRODUCTION_CATEGORIES["biomass"]
),
"solar": sum_vector(capacities, OPENNEM_PRODUCTION_CATEGORIES["solar"]),
"hydro storage": capacities.get(OPENNEM_STORAGE_CATEGORIES["hydro"][0]),
"battery storage": capacities.get(
OPENNEM_STORAGE_CATEGORIES["battery"][0]
),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

question: @VIKTORVAV99 what is the recommended way to deal with this capacity data given that it cannot be captured in a ProductionMix?

I see references to OPENNEM.fetch_production_capacity in some configs but I can't seem to find it. Is that a function that I need to write or was it dynamically generated from something else?

Copy link
Member

Choose a reason for hiding this comment

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

So this is a small mess right now and I don't really know why but the capacity parsers live in an entirely different folder.

And yes as you mention there is no way to currently return the live capacity data. Honestly I'd leave it as a draft for now until I have discussed with the team on how to handle this.

But I'll probably end up creating a capacity mix class or something similar so we can keep parsing this data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perfect! Thanks

Copy link
Member

Choose a reason for hiding this comment

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

So I have been trying to figure out how to do this, what I thought was going to be pretty straight forward is not as the space in the "hydro storage" and "battery storage" modes. This means they can't be used as variables which is kind of needed for it to plug into the existing solution we have. All workarounds I have create more errors than I can count 😅

There is a TODO about removing that space and simplifying things a bit and I think I'll have to do that first before working on the "capacity mixes".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries!! Thanks for the update

@VIKTORVAV99
Copy link
Member

Just adding this as a suggestion here but it's by no means required. If you want you can split this PR up by removing arrow in one and migrating it to parser classes in the other while we figure out how to handle live capacities with the new system.

PS: You can also add a PR that adds you as a contributor to all to zones you have helped upgrade. It's optional but you deserve the credit!
(It's done in the zone configs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser python Pull requests that update Python code tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants