Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ricnogfer committed Feb 3, 2025
1 parent 62e3e08 commit 6427fb5
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 143 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@ This will create a PyPSA-based network made of the following components:
network = pypsa.Network(name = "My Dummy Network")

# add some dummy components to dummy network
network.add("Bus", "oil")
network.add("Bus", "electricity")
network.add("Bus", "transport")
network.add("Generator", "oil", bus = "oil")
network.add("Bus", "hydrogen")
network.add("Generator", "wind", bus = "electricity")
network.add("Generator", "solar", bus = "electricity")
network.add("Load", "vehicle", bus = "transport")
network.add("Load", "transport", bus = "electricity")
network.add("Load", "industry", bus = "hydrogen")
network.add("Store", "battery", bus = "electricity")
network.add("StorageUnit", "hydro", bus = "electricity")
network.add("Link", "ICEV", bus0 = "oil", bus1 = "transport")
network.add("Link", "BEV", bus0 = "electricity", bus1 = "transport")
network.add("Link", "electrolysis", bus0 = "electricity", bus1 = "hydrogen")
```
... as well as generate the corresponding topographical representation of the network in the SVG format:

<kbd>
<img src = "https://raw.githubusercontent.com/ricnogfer/pypsatopo/master/resources/topography.svg" alt = "Topographical representation of network 'My Dummy Network'" style = "background-color: white;" width = 575>
<img src = "https://raw.githubusercontent.com/ricnogfer/pypsatopo/master/resources/topography.svg" alt = "Topographical representation of network 'My Dummy Network'" style = "background-color: white;" width = 650>
</kbd>


Expand Down
11 changes: 5 additions & 6 deletions pypsatopo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1868,16 +1868,15 @@ def generate(network, focus = None, neighbourhood = 0, bus_filter = None, genera


# add some dummy components to dummy network
network.add("Bus", "oil")
network.add("Bus", "electricity")
network.add("Bus", "transport")
network.add("Generator", "oil", bus = "oil")
network.add("Bus", "hydrogen")
network.add("Generator", "wind", bus = "electricity")
network.add("Generator", "solar", bus = "electricity")
network.add("Load", "vehicle", bus = "transport")
network.add("Load", "transport", bus = "electricity")
network.add("Load", "industry", bus = "hydrogen")
network.add("Store", "battery", bus = "electricity")
network.add("StorageUnit", "hydro", bus = "electricity")
network.add("Link", "ICEV", bus0 = "oil", bus1 = "transport")
network.add("Link", "BEV", bus0 = "electricity", bus1 = "transport")
network.add("Link", "electrolysis", bus0 = "electricity", bus1 = "hydrogen")


# generate topographical representation of dummy network
Expand Down
13 changes: 6 additions & 7 deletions resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@ This will create a PyPSA-based network made of the following components:
network = pypsa.Network(name = "My Dummy Network")

# add some dummy components to dummy network
network.add("Bus", "oil")
network.add("Bus", "electricity")
network.add("Bus", "transport")
network.add("Generator", "oil", bus = "oil")
network.add("Bus", "hydrogen")
network.add("Generator", "wind", bus = "electricity")
network.add("Generator", "solar", bus = "electricity")
network.add("Load", "vehicle", bus = "transport")
network.add("Load", "transport", bus = "electricity")
network.add("Load", "industry", bus = "hydrogen")
network.add("Store", "battery", bus = "electricity")
network.add("StorageUnit", "hydro", bus = "electricity")
network.add("Link", "ICEV", bus0 = "oil", bus1 = "transport")
network.add("Link", "BEV", bus0 = "electricity", bus1 = "transport")
network.add("Link", "electrolysis", bus0 = "electricity", bus1 = "hydrogen")
```
... as well as generate the corresponding topographical representation of the network in the SVG format:

<kbd>
<img src = "https://raw.githubusercontent.com/ricnogfer/pypsatopo/master/resources/topography.svg" alt = "Topographical representation of network 'My Dummy Network'" style = "background-color: white;" width = 575>
<img src = "https://raw.githubusercontent.com/ricnogfer/pypsatopo/master/resources/topography.svg" alt = "Topographical representation of network 'My Dummy Network'" style = "background-color: white;" width = 650>
</kbd>

69 changes: 24 additions & 45 deletions resources/topography.dot
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Generated by PyPSATopo version 1.0.3 (on the 2024/08/19 at 07:37:17) using the following parameters:
// Generated by PyPSATopo version 1.0.4 (on the 2025/02/03 at 14:01:20) using the following parameters:
//
// file_input=None
// focus=None
Expand All @@ -18,7 +18,7 @@
// context=False
// file_output=topography.svg
// file_format=svg
// log=True
// log=False
// log_info=False
// log_warning=False
//
Expand All @@ -33,12 +33,12 @@ digraph "My Dummy Network"
"
tooltip = "Network: My Dummy Network
Buses: 3 (out of 3)
Buses: 2 (out of 2)
Generators: 2 (out of 2)
Loads: 1 (out of 1)
Loads: 2 (out of 2)
Stores: 1 (out of 1)
Storage units: 1 (out of 1)
Links: 2 (out of 2)
Links: 1 (out of 1)
Lines: 0 (out of 0)
Snapshots: 1"
rankdir = "TB"
Expand All @@ -48,47 +48,35 @@ Snapshots: 1"
node [fontname = "Courier New", fontsize = 8.00]
edge [fontname = "Courier New", fontsize = 8.00]

// buses (3)
"oil (bus)" [label = <<font color = "red">oil</font>>, tooltip = "Bus: oil
Carrier: AC
Unit: MW
Generators: 1
Loads: 0
Stores: 0
Storage units: 0
Incoming links: 0
Outgoing links: 1
Lines: 0
Power time series: N/A MW", shape = "underline", width = 3.30, height = 0.30, style = "setlinewidth(7.30)", color = "black"]
// buses (2)
"electricity (bus)" [label = <<font color = "red">electricity</font>>, tooltip = "Bus: electricity
Carrier: AC
Unit: MW
Generators: 1
Loads: 0
Generators: 2
Loads: 1
Stores: 1
Storage units: 1
Incoming links: 0
Outgoing links: 1
Lines: 0
Power time series: N/A MW", shape = "underline", width = 3.30, height = 0.30, style = "setlinewidth(7.30)", color = "black"]
"transport (bus)" [label = <<font color = "red">transport</font>>, tooltip = "Bus: transport
"hydrogen (bus)" [label = <<font color = "red">hydrogen</font>>, tooltip = "Bus: hydrogen
Carrier: AC
Unit: MW
Generators: 0
Loads: 1
Stores: 0
Storage units: 0
Incoming links: 2
Incoming links: 1
Outgoing links: 0
Lines: 0
Power time series: N/A MW", shape = "underline", width = 3.30, height = 0.30, style = "setlinewidth(7.30)", color = "black"]

// generators (2)
"oil (generator)" [label = <<font color = "red">oil</font>>, tooltip = "Generator: oil
Bus: oil
"wind (generator)" [label = <<font color = "red">wind</font>>, tooltip = "Generator: wind
Bus: electricity
Carrier:
Extendable nominal power: False
Nominal power: 0.00 MW
Expand All @@ -98,7 +86,7 @@ Capital cost: 0.00 currency/MW
Marginal cost: 0.00 currency/MWh
Optimised nominal power: 0.00 MW
Power time series: N/A MW", shape = "circle", width = 1.10, style = "setlinewidth(2.00)", color = "black"] "oil (generator)" -> "oil (bus)" [style = "setlinewidth(1.50)", color = "black", arrowhead = "none"]
Power time series: N/A MW", shape = "circle", width = 1.10, style = "setlinewidth(2.00)", color = "black"] "wind (generator)" -> "electricity (bus)" [style = "setlinewidth(1.50)", color = "black", arrowhead = "none"]
"solar (generator)" [label = <<font color = "red">solar</font>>, tooltip = "Generator: solar
Bus: electricity
Carrier:
Expand All @@ -112,11 +100,15 @@ Marginal cost: 0.00 currency/MWh
Optimised nominal power: 0.00 MW
Power time series: N/A MW", shape = "circle", width = 1.10, style = "setlinewidth(2.00)", color = "black"] "solar (generator)" -> "electricity (bus)" [style = "setlinewidth(1.50)", color = "black", arrowhead = "none"]

// loads (1)
"vehicle (load)" [label = <<font color = "red">vehicle</font>>, tooltip = "Load: vehicle
Bus: transport
// loads (2)
"transport (load)" [label = <<font color = "red">transport</font>>, tooltip = "Load: transport
Bus: electricity
Carrier:
Power set: 0.00 MW", shape = "invtriangle", width = 1.50, height = 1.20, style = "setlinewidth(2.00)", color = "black"] "transport (bus)" -> "vehicle (load)" [style = "setlinewidth(1.50)", color = "black", arrowhead = "none"]
Power set: 0.00 MW", shape = "invtriangle", width = 1.50, height = 1.20, style = "setlinewidth(2.00)", color = "black"] "electricity (bus)" -> "transport (load)" [style = "setlinewidth(1.50)", color = "black", arrowhead = "none"]
"industry (load)" [label = <<font color = "red">industry</font>>, tooltip = "Load: industry
Bus: hydrogen
Carrier:
Power set: 0.00 MW", shape = "invtriangle", width = 1.50, height = 1.20, style = "setlinewidth(2.00)", color = "black"] "hydrogen (bus)" -> "industry (load)" [style = "setlinewidth(1.50)", color = "black", arrowhead = "none"]

// stores (1)
"battery (store)" [label = <<font color = "red">battery</font>>, tooltip = "Store: battery
Expand Down Expand Up @@ -147,23 +139,10 @@ Marginal cost: 0.00 currency/MWh
Optimised nominal power: 0.00 MW
Power time series: N/A MW", shape = "parallelogram", width = 1.80, style = "setlinewidth(2.00)", color = "black"] "electricity (bus)" -> "hydro (storage unit)" [style = "setlinewidth(1.50)", color = "black", arrowhead = "vee", arrowtail = "vee", arrowsize = 1.20, dir = "both"]

// links (2)
"oil (bus)" -> "transport (bus)" [label = <<font color = "red">ICEV</font>>, tooltip = "Link: ICEV
From: oil (bus0)
To: transport (bus1)
Carrier:
Extendable nominal power: False
Nominal power: 0.00 MW
Efficiency: 1.00
Capital cost: 0.00 currency/MW
Marginal cost: 0.00 currency/MWh
Optimised nominal power: 0.00 MW
Power time series (p0): N/A MW
Power time series (p1): N/A MW", style = "setlinewidth(1.50)", color = "black", arrowhead = "vee", arrowsize = 1.20]
"electricity (bus)" -> "transport (bus)" [label = <<font color = "red">BEV</font>>, tooltip = "Link: BEV
// links (1)
"electricity (bus)" -> "hydrogen (bus)" [label = <<font color = "red">electrolysis</font>>, tooltip = "Link: electrolysis
From: electricity (bus0)
To: transport (bus1)
To: hydrogen (bus1)
Carrier:
Extendable nominal power: False
Nominal power: 0.00 MW
Expand Down
Loading

0 comments on commit 6427fb5

Please sign in to comment.