-
Notifications
You must be signed in to change notification settings - Fork 961
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
for values in data_tag: | ||
pumping_load_at_time_dict[values["date"]] = float(values["value1"]) - float( | ||
values["value2"] | ||
) |
There was a problem hiding this comment.
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"]] |
There was a problem hiding this comment.
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.
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
Double check
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 issuepnpx prettier@2 --write .
andpoetry run format
in the top level directory to format my changes.