-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(parsers): parse entsoe generation outage #8364
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
base: hack-days/outages
Are you sure you want to change the base?
Conversation
unitrium
left a comment
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.
Looks good a few comments :)
| @staticmethod | ||
| def mapping_code_to_type(code: str) -> "OutageType": | ||
| return { | ||
| "A53": OutageType.PLANNED, |
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 is only for ENTSO-E, since this part is supposed to be more generic I would recommend to keep this mapping inside the ENTSO-E parser.
|
|
||
|
|
||
| class Outage(Event): | ||
| sourceType: EventSourceType = EventSourceType.forecasted |
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.
Actually now I remembered this field is not super clear so I think this would rather be measured especially if it's for a current event.
| sourceType: EventSourceType = EventSourceType.forecasted | |
| sourceType: EventSourceType = EventSourceType.measured |
|
|
||
|
|
||
| def parse_outages( | ||
| xml_text: str, |
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.
Could this be rather an xml tree object ? Because the return of the other function is a list of xml trees ? Otherwise we need to change the other one.
Description
We add a parser for ENTSOE generation unit outage files provided as XML.
An outage event is stored for each hour betwen the beginning and the end of the outage.
We add a fixture and a snapshot test.
Preview
One event the following form (here the one stored as snapshot):
{
'capacity_reduction': 1030.0,
'datetime': datetime.datetime(2025, 8, 31, 22, 0, tzinfo=datetime.timezone.utc),
'fuel_type': 'nuclear',
'generator_id': '22WTIHANG000242R',
'outage_type': <OutageType.PLANNED: 'planned'>,
'reason': 'Shutdown date as provided by the law',
'source': 'entsoe.eu',
'zoneKey': 'BE',
}
Double check
poetry run test_parser "zone_key"pnpx prettier@2 --write .andpoetry run formatin the top level directory to format my changes.