Skip to content
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

Feature/ucte converter #2498

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0f65001
UCTE converter first code draft (untested)
SteffenMeinecke Oct 28, 2024
efbc1e7
pandas usage improvements
SteffenMeinecke Oct 28, 2024
00c8bc4
Merge branch 'develop' of https://github.com/e2nIEE/pandapower into f…
SteffenMeinecke Nov 7, 2024
4f0e760
add testfile for ucte conversion
SteffenMeinecke Nov 13, 2024
b98286e
Merge branch 'develop' of https://github.com/e2nIEE/pandapower into f…
SteffenMeinecke Nov 13, 2024
1dbced0
ucte converter: add pf results as csv
SteffenMeinecke Nov 13, 2024
892cfab
update ucte converter code
SteffenMeinecke Nov 18, 2024
310bfc6
ucte test ready for comparing power flow results
SteffenMeinecke Nov 18, 2024
0d70564
ucte: test improvements
SteffenMeinecke Nov 20, 2024
df45b2d
ucte target results with voltage dep. load results -> results has cha…
SteffenMeinecke Nov 20, 2024
c85a065
remove empty tutorial
SteffenMeinecke Nov 27, 2024
8cb0864
required standard type parameters are made available by function requ…
SteffenMeinecke Dec 5, 2024
2c1b520
Merge branch 'develop' of https://github.com/e2nIEE/pandapower into f…
SteffenMeinecke Dec 11, 2024
e54dd28
Merge branch 'develop' of https://github.com/e2nIEE/pandapower into f…
SteffenMeinecke Dec 11, 2024
06f87bd
Merge branch 'develop' into feature/make_available_required_std_type_…
SteffenMeinecke Dec 12, 2024
f2afba4
Merge branch 'develop' of https://github.com/e2nIEE/pandapower into f…
SteffenMeinecke Dec 12, 2024
fc33305
pp_import_functions:
SteffenMeinecke Dec 13, 2024
046542c
add missing zone info
SteffenMeinecke Dec 13, 2024
60e841b
fix elements in add_zones_to_elements()
SteffenMeinecke Dec 13, 2024
038f56c
Merge branch 'feature/make_available_required_std_type_params' into f…
SteffenMeinecke Dec 16, 2024
e95448f
add rename_std_type
SteffenMeinecke Dec 16, 2024
f225fd9
some utc test updates
SteffenMeinecke Dec 17, 2024
216592e
complete ucte converter test
SteffenMeinecke Dec 18, 2024
92c535e
(hopefully) complete UCTE converter
SteffenMeinecke Dec 18, 2024
058cc22
update e2n logo
SteffenMeinecke Dec 19, 2024
bb81e08
extend changelog
SteffenMeinecke Dec 19, 2024
052065c
Merge branch 'develop' of https://github.com/e2nIEE/pandapower into f…
SteffenMeinecke Dec 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ Change Log
- [FIXED] Increasing geojson precision as the default precision might cause problems with pandahub
- [ADDED] converter for European EHV grid data from JAO, the "Single Allocation Platform (SAP) for all European Transmission System Operators (TSOs) that operate in accordance to EU legislation"
- [ADDED] Add GeographicalRegion and SubGeographicalRegion names and ids to bus df in cim converter
- [ADDED] API function rename_std_type()
- [CHANGED] Capitalize first letter of columns busbar_id, busbar_name and substation_id in bus df for cim converter
- [CHANGED] required standard type parameters are made available by function :code:`required_std_type_parameters()`
- [FIXED] Do not modify pandas options when importing pandapower
- [FIXED] fixed copy-paste error in contingency results "max_limit_nminus1" and "min_limit_nminus1"
- [FIXED] default elements in toolbox function add_zones_to_elements()
- [ADDED] improved lightsim2grid documentation including compatibitliy issues
- [FIXED] cim2pp: set default xml encoding to None to avoid error after changing to lxml
- [FIXED] PandaModels OPF with 'bus_dc' key errors
Expand Down Expand Up @@ -95,7 +98,9 @@ Change Log
- [CHANGED] Trafo Controllers can now be added to elements that are out of service, changed self.nothing_to_do()
- [ADDED] Discrete shunt controller for local voltage regulation with shunt steps
- [ADDED] fix lengths missmatch of output if ignore_zero_length is False in plotting utility function coords_from_node_geodata() and rename ignore_zero_length by ignore_no_geo_diff
- [FIXED] from_powerfactory() converter: error that crept in `obj.GetAttributes(a)` instead of `obj.GetAttribute(a)`
- [ADDED] converter for European EHV grid data from JAO, the "Single Allocation Platform (SAP) for all European Transmission System Operators (TSOs) that operate in accordance to EU legislation"
- [ADDED] UCTE-DEF (UCTE Data Exchange Format) converter
- [ADDED] cim2pp converter: Using lxml to parse XML files (better performance)
- [FIXED] OC relay name attribute error

Expand Down
1 change: 1 addition & 0 deletions doc/converter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ These tools are:
converter/matpower
converter/powerfactory
converter/cgmes
converter/ucte
converter/jao

4 changes: 2 additions & 2 deletions doc/converter/jao.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Documentation for the JAO Static Grid Model Converter Function
==============================================================
JAO Static Grid Model Converter Function
========================================

The ``from_jao`` function allows users to convert the Static Grid Model provided by JAO (Joint Allocation Office) into a pandapower network by reading and processing the provided Excel and HTML files.

Expand Down
12 changes: 12 additions & 0 deletions doc/converter/ucte.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
===================================================
UCTE-DEF to pandapower
===================================================

panpapower functionality allows to convert grid data from **UCTE** **d**ata **e**xchange **f**ormat for load flow and three phase short circuit studies (UCTE-DEF) to pandapower.

Check warning on line 5 in doc/converter/ucte.rst

View workflow job for this annotation

GitHub Actions / Sphinx docs check

Inline strong start-string without end-string.

Check warning on line 5 in doc/converter/ucte.rst

View workflow job for this annotation

GitHub Actions / Sphinx docs check

Inline strong start-string without end-string.

Check warning on line 5 in doc/converter/ucte.rst

View workflow job for this annotation

GitHub Actions / Sphinx docs check

Inline strong start-string without end-string.
The UCTE-DEF is a simple data format for electric transmission systems for the exchange of grid data introduced by the *Union for the Co-ordination of Transmission of Electricity (UCTE)*, the predecessor of the ENTSO-E.

Using the Converter
--------------------
In order to start the converter the following method is used. Only the location of the UCTE file that should be converted must be specified.

.. autofunction:: pandapower.converter.cim.cim2pp.from_cim.from_cim
Binary file modified doc/pics/e2n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions pandapower/converter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pandapower.converter.matpower import *
from pandapower.converter.pypower import *
from pandapower.converter.pandamodels import *
from pandapower.converter.ucte import *
from pandapower.converter.cim import *
from pandapower.converter.powerfactory import *
from pandapower.converter.jao import *
1 change: 1 addition & 0 deletions pandapower/converter/cim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Copyright (c) 2016-2023 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.

from .cim2pp import from_cim

__version__ = '3.6.10'
5 changes: 3 additions & 2 deletions pandapower/converter/cim/cim2pp/from_cim.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Copyright (c) 2016-2023 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.

import logging
import time
from typing import Union, List, Type, Dict
Expand All @@ -23,7 +24,7 @@ def from_cim_dict(cim_parser: cim_classes.CimParser, log_debug=False, convert_li
custom_converter_classes: Dict = None,
**kwargs) -> pandapower.auxiliary.pandapowerNet:
"""
Create a pandapower net from a CIM data structure.
Creates a pandapower net from a CIM data structure.

:param cim_parser: The CimParser with parsed cim data.
:param log_debug: Set this parameter to True to enable logging at debug level. Optional, default: False
Expand Down Expand Up @@ -105,7 +106,7 @@ def from_cim(file_list: List[str] = None, encoding: str = None, convert_line_to_
pandapower.auxiliary.pandapowerNet:
# Nur zum Testen, kann wieder gelöscht werden
"""
Convert a CIM net to a pandapower net from XML files.
Converts a CIM net to a pandapower net from XML files.
Additional parameters for kwargs:
- create_measurements (str): Set this parameter to 'SV' to create measurements for the pandapower net from the SV
profile. Set it to 'Analog' to create measurements from Analogs. If the parameter is not set or is set to None, no
Expand Down
2 changes: 1 addition & 1 deletion pandapower/converter/powerfactory/pp_import_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def create_bus(net, item, flag_graphics, is_unbalanced):
'vn_kv': item.uknom,
'in_service': not bool(item.outserv),
'type': usage[item.iUsage],
'geodata': (x, y),
'geodata': geojson.dumps(geojson.Point((x, y))),
}

system_type = {0: "ac", 1: "dc", 2: "ac/bi"}[item.systype]
Expand Down
6 changes: 6 additions & 0 deletions pandapower/converter/ucte/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright (c) 2016-2023 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.

from .from_ucte import from_ucte
66 changes: 66 additions & 0 deletions pandapower/converter/ucte/from_ucte.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# -*- coding: utf-8 -*-

# Copyright (c) 2016-2023 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.

import logging
import os
import time
from typing import Union, List, Type, Dict
from pandapower.converter.ucte.ucte_converter import UCTE2pandapower
from pandapower.converter.ucte.ucte_parser import UCTEParser

logger = logging.getLogger('ucte.from_ucte')


def from_ucte_dict(ucte_parser: UCTEParser):
"""Creates a pandapower net from an UCTE data structure.

Parameters
----------
ucte_parser : UCTEParser
The UCTEParser with parsed UCTE data.

Returns
-------
pandapowerNet
net
"""

ucte_converter = UCTE2pandapower()
net = ucte_converter.convert(ucte_parser.get_data())

return net


def from_ucte(ucte_file: str):
"""Converts net data stored as an UCTE file to a pandapower net.


Parameters
----------
ucte_file : str
_description_

Returns
-------
pandapowerNet
net
"""

time_start_parsing = time.time()

ucte_parser = UCTEParser(ucte_file)
ucte_parser.parse_file()

time_start_converting = time.time()

pp_net = from_ucte_dict(ucte_parser)

time_end_converting = time.time()

logger.info("Needed time for parsing from ucte: %s" % (time_start_converting - time_start_parsing))
logger.info("Needed time for converting from ucte: %s" % (time_end_converting - time_start_converting))
logger.info("Total Time (from_ucte()): %s" % (time_end_converting - time_start_parsing))

return pp_net
Loading
Loading