Skip to content

Conversation

@florianscheidl
Copy link
Contributor

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

  • 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 Aug 20, 2025
Copy link
Contributor

@unitrium unitrium left a 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,
Copy link
Contributor

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
Copy link
Contributor

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.

Suggested change
sourceType: EventSourceType = EventSourceType.forecasted
sourceType: EventSourceType = EventSourceType.measured



def parse_outages(
xml_text: str,
Copy link
Contributor

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.

@VIKTORVAV99 VIKTORVAV99 removed their request for review August 22, 2025 06:09
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.

3 participants