-
Notifications
You must be signed in to change notification settings - Fork 902
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
feat(ENTSOE.py): Parse and combine both kinds of exchange forecasts #6577
base: master
Are you sure you want to change the base?
Conversation
@@ -926,13 +936,45 @@ def parse_exchange( | |||
datetime_start = datetime.fromisoformat( | |||
zulu_to_utc(timeseries.find_all("start")[0].contents[0]) | |||
) | |||
# Only use contract_marketagreement.type == A01 (Total to avoid double counting some columns) |
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.
What about this? Are we not risking the double counting if we start ingesting the other forecasts?
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.
Both kinds are returned in the same API call so in order to parse it we need to make this dynamic.
Right now it calls the parser function twice, first for the day-ahead values and a second time for the total values to then combine them.
Functionally it should do the same but just use a dynamic config instead of a static value.
|
||
return ExchangeList(logger).merge_exchanges(raw_exchange_lists, logger) | ||
if raw_exchange is None: |
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.
Can't we separate more clearly the forecast and non forecasts cases?
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.
We can but it would likely result in more code duplication, if that's okay I can do right ahead and split them apart further.
marketAgreementType = timeseries.find("contract_marketagreement.type").contents[ | ||
0 | ||
] | ||
if marketAgreementType and marketAgreementType != market_type.value: |
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.
@pierresegonne here is the functional equivalent of the previous check.
Issue
Currently we are only parsing the Total forecasts which are the most accurate but this means we are missing out on the day ahead forecasts which are available further into the future than the total forecasts are.
Description
This PR duplicates some functionality for the sake of simple logic in order to parse the day_ahead forecasts and then update them with the total forecasts so we get benefits of the longer day_ahead forecasts while retaining the shorter term accuracy of the total forecasts.
TODO:
Preview
Latest value on master
Latest value on this branch
Double check
poetry run test_parser "zone_key"
pnpx prettier@2 --write .
andpoetry run format
in the top level directory to format my changes.