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

Pumping storage fix for CZ parser #7530

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dermotmolony
Copy link

@dermotmolony dermotmolony commented Dec 7, 2024

Issue

Closes #5426

Description

Creates get_pumping_load function which fetches pumping load data from ceps.cz and computes the current load at each timestamp that is being used for pumping.

Modifies fetch_production to call get_pumping_load, whose dictionary is then used to add the amount of energy being stored to hydro at each timestamp.

Preview

The hydro storage values from fetch_production() showing the new positive values calculated from load_including_pumping-load
image

Double check

  • I have tested my parser changes locally with poetry run test_parser "zone_key" - I got the error marking ":( >2h from now !!!" but the original CZ parser code produces the exact same error locally. I tried to see if it was a time conversion issue but didn't have any luck locating the source of the issue
  • 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 labels Dec 7, 2024
@dermotmolony dermotmolony marked this pull request as ready for review December 7, 2024 23:41
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.

There are some type issues to look at and how to better use the parser functions as intended but otherwise it seems to work.

Thanks for opening the PR.

session: Session = Session(),
target_datetime: datetime | None = None,
logger: Logger = getLogger(__name__),
) -> list:
Copy link
Member

Choose a reason for hiding this comment

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

This has the return type list.

zone_key,
)

return pumping_load_at_time_dict
Copy link
Member

Choose a reason for hiding this comment

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

But this is returning a dict.

Comment on lines +174 to +177
for values in data_tag:
pumping_load_at_time_dict[values["date"]] = float(values["value1"]) - float(
values["value2"]
)
Copy link
Member

Choose a reason for hiding this comment

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

This also contains type errors. Such as "__getitem__" method not defined on type "PageElement"

storage.add_value(mode=generator, value=float(values[v]) * -1)
pumping_storage = float(values[v]) * -1
if values["date"] in pumping_load_at_time:
pumping_storage += pumping_load_at_time[values["date"]]
Copy link
Member

Choose a reason for hiding this comment

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

Why are you summing things up here?

If there are multiple storage entries they should be looped over and add_value should be called on each of them as it handles summing up values of the same type.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Data Issue]: new CZ (CEPS) parser is missing pumping demand for pumped hydro
2 participants