eelib.utils.simulation_setup.helper_create_grid
Helper functions for the generation of new simulations.
Module Contents
Functions
|
Applies some general formatting to an existing grid, e.g. setting predefined values, removing |
|
Unified generation method to create a grid in different ways. Choose one way of creation: |
|
Create pandapower grid including saved json file from information about pandapower template. |
|
Create pandapower grid file from am predefined simbench grid including saved json file from |
|
Create pandapower grid file for a radial grid based on the number of loads for each string. |
|
Renames the busses, loads, lines and transformers in the grid. |
|
Rename all buses in one feeder according to the feeder number and starting from one bus. |
Attributes
- bus_fields = "['index', 'vn_kv', 'name', 'in_service', 'geodata']"
- load_fields = "['bus', 'name', 'scaling']"
- ext_grid_fields = "['bus', 'name', 'in_service']"
- trafo_fields = "['hv_bus', 'lv_bus', 'std_type', 'name', 'in_service', 'parallel']"
- line_fields = "['from_bus', 'to_bus', 'name', 'in_service', 'length_km', 'std_type', 'parallel']"
- grid
- format_grid(grid: pandapower.auxiliary.pandapowerNet, keep_profiles: bool = False) pandapower.auxiliary.pandapowerNet
Applies some general formatting to an existing grid, e.g. setting predefined values, removing attributes not used in eElib, …
- Parameters:
grid (pandapowerNet) – The unformatted grid.
keep_profiles (bool) – Some grids ship with profiles, especially load profiles. The assignment is done via
grid.load.profilecolumn, while the whole profiles are stored ingrid.profiles. This bool drops all profiles from the grid file.
- Returns:
The formatted grid.
- Return type:
pandapowerNet
- create_grid(pp_code: str | None = None, sb_code: str | None = None, loads_at_branches: list | None = None, do_rename_elements: bool = True, plot_grid: bool = True, save_as_json_file: bool = False, keep_profiles: bool = False) pandapower.auxiliary.pandapowerNet | None
Unified generation method to create a grid in different ways. Choose one way of creation: Pandapower: Fill a
pp_code. SimBench: Fill ansb_code. Custom radial: Fillloads_at_brancheslist.- Parameters:
pp_code (str | None, optional) – Name of method for pre-defined pandapower grid. (see [method library](https://pandapower.readthedocs.io/en/latest/networks.html))
sb_code (str | None, optional) – Code for pre-defined SimBench grid (see [grid code library](https://simbench.de/de/datensaetze/)).
loads_at_branches (list | None, optional) – Listing of the number of nodes at each radial string in the grid, so the length of the list defines the number of strings.
do_rename_elements (bool) – Whether grid elements should be adequately renamed. Watch out: This will not work for multi-voltage-level grids and those with circular structure, as we go by each feeder for renaming. Defaults to True.
plot_grid (bool, optional) – whether to create simple plot of grid. Defaults to False.
save_as_json_file (bool, optional) – Whether to save the grid as a file additionaly to returning it.
keep_profiles (bool, optional) – Some grids ship with profiles, especially load profiles. The assignment is done via
grid.load.profilecolumn, while the whole profiles are stored ingrid.profiles. This bool drops all profiles from the grid file.
- Raises:
ValueError – If not supplied with input for exactly one way of grid generation:
pp_code,sb_code, orloads_at_branches.- Returns:
- The grid from the specified source, formatted to eElib standards.
Might be None at first execution when going fully custom.
- Return type:
pandapowerNet | None
- create_grid_pp_code(pp_code: str = 'create_kerber_landnetz_kabel_1', adjust_comp_names: bool = True) tuple[str, pandapower.auxiliary.pandapowerNet]
Create pandapower grid including saved json file from information about pandapower template.
- Parameters:
pp_code (str, optional) – Name of method for pre-defined pandapower grid. (see [method library](https://pandapower.readthedocs.io/en/latest/networks.html))
adjust_comp_names (bool) – whether to adjust component names if None. Defaults to True.
- Returns:
Name and the grid from the predefined Pandapower code.
- Return type:
tuple[str, pandapowerNet]
- create_grid_sb_code(sb_code: str = '1-LV-rural1--0-sw') tuple[str, pandapower.auxiliary.pandapowerNet]
Create pandapower grid file from am predefined simbench grid including saved json file from information about grid components.
- Parameters:
sb_code (str, optional) – Code for pre-defined SimBench grid (see [grid code library](https://simbench.de/de/datensaetze/)).
- Raises:
KeyError – If
sb_codeis not a valid SimBenchCode.- Returns:
Name and the grid from the SimBench code.
- Return type:
tuple[str, pandapowerNet]
- create_grid_radial_lv(loads_at_branches: list = [6, 2]) tuple[str, pandapower.auxiliary.pandapowerNet]
Create pandapower grid file for a radial grid based on the number of loads for each string.
- Parameters:
loads_at_branches (list) – Listing of the number of nodes at each radial string in the grid, so the length of the list defines the number of strings.
- Returns:
Name and the radial low voltage grid.
- Return type:
tuple[str, pandapowerNet]
- rename_elements(grid: pandapower.auxiliary.pandapowerNet)
Renames the busses, loads, lines and transformers in the grid.
- Parameters:
grid (pandapowerNet) – A pandapower grid.
- rename_buses_of_feeder(grid: pandapower.auxiliary.pandapowerNet, feeder_num: int, starting_bus_idx: int, bus_idx_stop: list[int], counter_feeder: int = 1) int
Rename all buses in one feeder according to the feeder number and starting from one bus.
- Parameters:
grid (pandapowerNet) – The corresponding pandapower grid
feeder_num (int) – the assigned number for this feeder (to name the buses to)
starting_bus_idx (int) – The index of the bus that this naming should start with (before going to the next bus etc.)
bus_idx_stop (list[int]) – list of bus indices that should not be considered, i.e. the busbar that represents the “limit” for this feeder
counter_feeder (int, optional) – Number to assign for the naming of the next bus (if some already set). Defaults to 1.
- Returns:
The last number that was assigned for this (sub-)feeder
- Return type:
int