Skip to content

Commit

Permalink
Enabled capability to display the topographical representation of a P…
Browse files Browse the repository at this point in the history
…yPSA-based network in Jupyter
  • Loading branch information
ricnogfer committed Dec 20, 2024
1 parent 8a2bd2e commit 62e3e08
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion pypsatopo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


__project__ = "PyPSATopo"
__version__ = "1.0.3"
__version__ = "1.0.4"
__description__ = "PyPSATopo is a tool that allows generating the topographical representation of any arbitrary PyPSA-based network"
__license__ = "BSD 3-Clause"
__author__ = "Energy Systems Group at Aarhus University (Denmark)"
Expand Down Expand Up @@ -1762,6 +1762,19 @@ def generate(network, focus = None, neighbourhood = 0, bus_filter = None, genera
print("[INF] Finished generating topographical representation of the network!")


# display topographical representation (only when running from Jupyter)
if not status:
try:
if get_ipython().__class__.__name__ == "ZMQInteractiveShell": # in Jupyter
import IPython.display
if file_format == "svg":
display(IPython.display.SVG(file_output))
else:
display(IPython.display.Image(file_output))
except:
pass


return status


Expand Down
2 changes: 1 addition & 1 deletion resources/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pypsatopo"
version = "1.0.3"
version = "1.0.4"
description = "PyPSATopo is a tool that allows generating the topographical representation of any arbitrary PyPSA-based network"
authors = [{name = "Energy Systems Group at Aarhus University (Denmark)", email = "[email protected]"}]
requires-python = ">=3.2"
Expand Down

0 comments on commit 62e3e08

Please sign in to comment.