Skip to content

pz-max/pypsa_netview

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPSA NetView - Visualize PyPSA networks

PyPSA NetView is build to visualize networks from the PyPSA power systems simulation framework. PyPSA NetView automatically creates a visual representation of a given PyPSA network, showing buses, components on buses and links between buses. PyPSA NetView is very much in early development.

PyPSA NetView is currently being tested, and can only be installed from testpypi: https://test.pypi.org/project/pypsa-netview/0.1.0/

PyPSA NetView is built on the Schemdraw package.

Current limitations

  • By default, PyPSA NetView will create a circular layout with each bus being a point on a circle. Custom positioning is possible, but not implemented in a good way yet.

  • PyPSA NetView can currently only visualize certain components on a bus. These are Loads, Generators and Stores. StorageUnits and the like are not supported yet.

  • PyPSA NetView will always show the entire network.

Input parameters

The following parameters can be passed to draw_network:

  • show_capcities = True: If the network has been solved, show capacities for bus components and links

  • filename = 'yourdrawing.pdf' : A drawing can be saved as pdf by passing a filename.

  • spacing : Increase or decrease distance between buses for automatically generated bus positions

Code example

The following code produces the example drawing with two buses:

import pypsa
from pypsa_netview.draw import draw_network

n = pypsa.Network()

# Add buses, a bidirectional link, a load and a generator
n.madd('Bus',  ['Bus0', 'Bus1'])
n.add("Link", 'Link0', bus0 = 'Bus0', bus1 = 'Bus1', p_nom = 20, p_min_pu = -1,)
n.add("Load", 'Load0', bus = 'Bus0', p_set = 10)
n.add("Generator", 'Generator1', bus = 'Bus1', p_nom = 20)

# Solve the network (or not) and create visualization
n.lopf()
draw_network(n)

Dependencies

  • PyPSA

  • Schemdraw

  • Pandas

  • NumPy

Example drawings

An exmaple of an unsolved two-bus network:

Two bus network example

An example of a solved four-bus network:

Image Description

About

Package for visualizing networks in PyPSA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%