Converter

Besides the grid, profiles and study cases data, this repository provides the converter between pandapower net format and csv files with SimBench data format.

simbench.csv2pp(path, sep=';', add_folder_name=None, nrows=None, no_generic_coord=False)

Conversion function from simbench csv format to pandapower.

INPUT:

path (str) - path of a folder which includes all csv files

sep (str) - gives the seperator of the csv files

OPTIONAL:

add_folder_name (str, None) - name of the subfolder in path, in which the csv data is located.

nrows (int, None) - number of rows to be read for profiles. If None, all rows will be read.

no_generic_coord (bool, False) - if True, no generic coordinates are created in case of missing geodata.

OUTPUT:

net (pandapowerNet) - the created pandapower net from csv files data

EXAMPLE:

import simbench as sb import os path = os.path.join(sb.sb_dir, ‘test’, ‘converter’, ‘test_network’) test_network_1 = sb.csv2pp(path=path, sep=’;’)

simbench.pp2csv(net1, path, export_pp_std_types=False, sep=';', exclude_table={}, nrows=None, mode='w', keep='last', drop_inactive_elements=True, round_qLoad_by_voltLvl=False, reserved_aux_node_names=None)

Conversion function from pandapower to simbench csv format.

INPUT:

net1 (pandapowerNet) - pandapower net that should be converted to simbench csv format

path (str) - folder path, the csv files should be stored into

OPTIONAL:

export_pp_std_types (False, boolean) - defines whether unused pandapower standard types should be stored to simbench csv format

sep (‘;’, str) - gives the seperator of the csv files

exclude_table ({}, set) - set of table names that should not be converted to csv files. Overwrites the possibly given list export_results.

nrows (int, None) - number of rows to be write to csv for profiles. If None, all rows will be written.

mode (‘append’, str) - If csv files already exists in the given path, they can be appended if mode is ‘a’ or ‘append_unique’ they can be replaced if mode is ‘w’. In case of ‘append_unique’, only data with unique name, voltLvl and subnet are kept (which is controlled by parameter keep).

keep (‘last’, str) - decides which duplicated data is kept in case of mode == “append_unique”

drop_inactive_elements (True, boolean) - Per default, only suppliable, active elements get converted to csv files. The user may change this behaviour by setting drop_inactive_elements to False.

round_qLoad_by_voltLvl (False, boolean) - If True, qLoad is rounded to variating accurancy: EHV: 1kVAr, HV: 100VAr, MV: 100VAr, LV: 1VAr”

reserved_aux_node_names (None, set) - set of strings which are not allowed to be used as auxiliary node names

OUTPUT:

reserved_aux_node_names (set) - reserved_aux_node_names appended by created auxiliary node names. Is only returned if given as input

EXAMPLE:

import simbench as sb import pandapower.networks as pn net1 = pn.simple_four_bus_system() test_network_1 = sb.csv2pp(net1, “folder”, sep=’;’)


The converter functions use internal functions which converts between a pandapower net object and a dict object with SimBench data format. This internal functions can be used if no writing or reading from and to csv files is desired.


simbench.csv_data2pp(csv_data)

Internal functionality of csv2pp, but with a given dict of csv_data as input instead of csv files.

simbench.pp2csv_data(net1, export_pp_std_types=False, drop_inactive_elements=True, highest_existing_coordinate_number=- 1, round_qLoad_by_voltLvl=False, reserved_aux_node_names=None)

Internal functionality of pp2csv, but without writing the determined dict to csv files. For parameter explanations, please have a look at the pp2csv() docstring.