edisgo.network.grids

Module Contents

Classes

Grid

Defines a basic grid in eDisGo.

MVGrid

Defines a medium voltage network in eDisGo.

LVGrid

Defines a low voltage network in eDisGo.

class edisgo.network.grids.Grid(**kwargs)[source]

Bases: abc.ABC

digraph inheritancec58dfcc66a { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [URL="https://docs.python.org/3/library/abc.html#abc.ABC",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Helper class that provides a standard way to create an ABC using"]; "Grid" [URL="#edisgo.network.grids.Grid",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Defines a basic grid in eDisGo."]; "ABC" -> "Grid" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Defines a basic grid in eDisGo.

Parameters:
  • edisgo_obj (EDisGo)

  • id (str or int, optional) – Identifier

property id

ID of the grid.

property edisgo_obj

EDisGo object the grid is stored in.

property nominal_voltage

Nominal voltage of network in kV.

Parameters:

nominal_voltage (float)

Returns:

Nominal voltage of network in kV.

Return type:

float

property graph

Graph representation of the grid.

Returns:

Graph representation of the grid as networkx Ordered Graph, where lines are represented by edges in the graph, and buses and transformers are represented by nodes.

Return type:

networkx.Graph

property geopandas

Returns components as geopandas.GeoDataFrames

Returns container with geopandas.GeoDataFrames containing all georeferenced components within the grid.

Returns:

Data container with GeoDataFrames containing all georeferenced components within the grid(s).

Return type:

GeoPandasGridContainer or list(GeoPandasGridContainer)

property station

DataFrame with form of buses_df with only grid’s station’s secondary side bus information.

property station_name

Name of station to the overlying voltage level.

Name of station is composed of grid name with the extension ‘_station’.

property generators_df

Connected generators within the network.

Returns:

Dataframe with all generators in topology. For more information on the dataframe see generators_df.

Return type:

pandas.DataFrame

property generators

Connected generators within the network.

Returns:

List of generators within the network.

Return type:

list(Generator)

property loads_df

Connected loads within the network.

Returns:

Dataframe with all loads in topology. For more information on the dataframe see loads_df.

Return type:

pandas.DataFrame

property loads

Connected loads within the network.

Returns:

List of loads within the network.

Return type:

list(Load)

property storage_units_df

Connected storage units within the network.

Returns:

Dataframe with all storage units in topology. For more information on the dataframe see storage_units_df.

Return type:

pandas.DataFrame

property charging_points_df

Connected charging points within the network.

Returns:

Dataframe with all charging points in topology. For more information on the dataframe see loads_df.

Return type:

pandas.DataFrame

property switch_disconnectors_df

Switch disconnectors in network.

Switch disconnectors are points where rings are split under normal operating conditions.

Returns:

Dataframe with all switch disconnectors in network. For more information on the dataframe see switches_df.

Return type:

pandas.DataFrame

property switch_disconnectors

Switch disconnectors within the network.

Returns:

List of switch disconnectory within the network.

Return type:

list(Switch)

property lines_df

Lines within the network.

Returns:

Dataframe with all buses in topology. For more information on the dataframe see lines_df.

Return type:

pandas.DataFrame

abstract property buses_df

Buses within the network.

Returns:

Dataframe with all buses in topology. For more information on the dataframe see buses_df.

Return type:

pandas.DataFrame

property weather_cells

Weather cells in network.

Returns:

List of weather cell IDs in network.

Return type:

list(int)

property peak_generation_capacity

Cumulative peak generation capacity of generators in the network in MW.

Returns:

Cumulative peak generation capacity of generators in the network in MW.

Return type:

float

property peak_generation_capacity_per_technology

Cumulative peak generation capacity of generators in the network per technology type in MW.

Returns:

Cumulative peak generation capacity of generators in the network per technology type in MW.

Return type:

pandas.DataFrame

property p_set

Cumulative peak load of loads in the network in MW.

Returns:

Cumulative peak load of loads in the network in MW.

Return type:

float

property p_set_per_sector

Cumulative peak load of loads in the network per sector in MW.

Returns:

Cumulative peak load of loads in the network per sector in MW.

Return type:

pandas.DataFrame

assign_length_to_grid_station()[source]

Assign length in km from each bus in the grid to the grid’s station.

The length is written to column ‘length_to_grid_station’ in buses_df.

assign_grid_feeder(mode: str = 'grid_feeder')[source]

Assigns MV or LV feeder to each bus and line, depending on the mode.

See assign_feeders for more information.

Parameters:

mode (str) – Specifies whether to assign MV or grid feeder. If mode is “mv_feeder” the MV feeder the buses and lines are in are determined. If mode is “grid_feeder” LV buses and lines are assigned the LV feeder they are in and MV buses and lines are assigned the MV feeder they are in. Default: “grid_feeder”.

get_feeder_stats() pandas.DataFrame[source]

Generate statistics of the grid’s feeders.

So far, only the feeder length is determined.

Returns:

Dataframe with feeder name in index and column ‘length’ containing the respective feeder length in km.

Return type:

pandas.DataFrame

__repr__()[source]

Return repr(self).

class edisgo.network.grids.MVGrid(**kwargs)[source]

Bases: Grid

digraph inheritanceb2aa05ddef { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [URL="https://docs.python.org/3/library/abc.html#abc.ABC",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Helper class that provides a standard way to create an ABC using"]; "Grid" [URL="#edisgo.network.grids.Grid",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Defines a basic grid in eDisGo."]; "ABC" -> "Grid" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MVGrid" [URL="#edisgo.network.grids.MVGrid",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Defines a medium voltage network in eDisGo."]; "Grid" -> "MVGrid" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Defines a medium voltage network in eDisGo.

property lv_grids

Yields generator object with all underlying low voltage grids.

Returns:

Yields generator object with LVGrid object.

Return type:

LVGrid

property buses_df

Buses within the network.

Returns:

Dataframe with all buses in topology. For more information on the dataframe see buses_df.

Return type:

pandas.DataFrame

property transformers_df

Transformers to overlaying network.

Returns:

Dataframe with all transformers to overlaying network. For more information on the dataframe see transformers_df.

Return type:

pandas.DataFrame

abstract draw()[source]

Draw MV network.

class edisgo.network.grids.LVGrid(**kwargs)[source]

Bases: Grid

digraph inheritance79fbd32814 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [URL="https://docs.python.org/3/library/abc.html#abc.ABC",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Helper class that provides a standard way to create an ABC using"]; "Grid" [URL="#edisgo.network.grids.Grid",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Defines a basic grid in eDisGo."]; "ABC" -> "Grid" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LVGrid" [URL="#edisgo.network.grids.LVGrid",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Defines a low voltage network in eDisGo."]; "Grid" -> "LVGrid" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Defines a low voltage network in eDisGo.

property buses_df

Buses within the network.

Returns:

Dataframe with all buses in topology. For more information on the dataframe see buses_df.

Return type:

pandas.DataFrame

property transformers_df

Transformers to overlaying network.

Returns:

Dataframe with all transformers to overlaying network. For more information on the dataframe see transformers_df.

Return type:

pandas.DataFrame

abstract property geopandas

Remove this as soon as LVGrids are georeferenced

Type:

TODO

draw(node_color='black', edge_color='black', colorbar=False, labels=False, filename=None)[source]

Draw LV network.

Currently, edge width is proportional to nominal apparent power of the line and node size is proportional to peak load of connected loads.

Parameters:
  • node_color (str or pandas.Series) – Color of the nodes (buses) of the grid. If provided as string all nodes will have that color. If provided as series, the index of the series must contain all buses in the LV grid and the corresponding values must be float values, that will be translated to the node color using a colormap, currently set to “Blues”. Default: “black”.

  • edge_color (str or pandas.Series) – Color of the edges (lines) of the grid. If provided as string all edges will have that color. If provided as series, the index of the series must contain all lines in the LV grid and the corresponding values must be float values, that will be translated to the edge color using a colormap, currently set to “inferno_r”. Default: “black”.

  • colorbar (bool) – If True, a colorbar is added to the plot for node and edge colors, in case these are sequences. Default: False.

  • labels (bool) – If True, displays bus names. As bus names are quite long, this is currently not very pretty. Default: False.

  • filename (str or None) – If a filename is provided, the plot is saved under that name but not displayed. If no filename is provided, the plot is only displayed. Default: None.