From 8baa009ba5db24726cf8cad41514dc74e00e59dc Mon Sep 17 00:00:00 2001 From: Viktor Andersson <30777521+VIKTORVAV99@users.noreply.github.com> Date: Thu, 8 Sep 2022 10:34:03 +0200 Subject: [PATCH] Fix ENTSOE productionPerUnit (#4540) * fix ENTSOE_PARAMETER_BY_GROUP mapping * bump formatting timeout to 5 min * use loops to generate `ENTSOE_PARAMETER_BY_GROUP` * Black + removal of print debug statement. * use dictionary comprehension --- .github/workflows/python.yml | 2 +- parsers/ENTSOE.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 415ac5f1da..2fd4c9734f 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -7,7 +7,7 @@ jobs: formatting: name: Formatting runs-on: ubuntu-latest - timeout-minutes: 2 + timeout-minutes: 5 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/parsers/ENTSOE.py b/parsers/ENTSOE.py index 27a9031cd1..7fff178a37 100644 --- a/parsers/ENTSOE.py +++ b/parsers/ENTSOE.py @@ -69,9 +69,14 @@ }, "storage": {"hydro storage": ["B10"]}, } +# ENTSOE production type codes mapped to their Electricity Maps production type. ENTSOE_PARAMETER_BY_GROUP = { - v: k for k, g in ENTSOE_PARAMETER_GROUPS.items() for v in g + ENTSOE_key: type + for key in ["production", "storage"] + for type, groups in ENTSOE_PARAMETER_GROUPS[key].items() + for ENTSOE_key in groups } + # Get all the individual storage parameters in one list ENTSOE_STORAGE_PARAMETERS = list( itertools.chain.from_iterable(ENTSOE_PARAMETER_GROUPS["storage"].values())