-
Is OpenDSS plotting function implemented in altdss-python? Can someone provide an example using only altDSS-Python? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The plotting backend is shared across our Python modules, and DSS-Python is currently always installed as a dependency of AltDSS-Python due to some shared code (the same OpenDSS/AltDSS engine is used across AltDSS-Python, DSS-Python and OpenDSSDirect.py). The examples for plotting can be adapted since they're independent from the user-facing interface, i.e., they're mostly DSS commands, not Python code. As mentioned in the linked notebook ( https://dss-extensions.org/DSS-Python/examples/Plotting.html ), plotting is disabled by default. After you enable it, you can run DSS plot commands through .dss scripts. As a reminder, you need matplotlib installed to use this. The examples from the notebook work as-is if you enable the plotting system and then run commands through AltDSS-Python. But if you don't want to import DSS-Python explicitly, you can use the following: from altdss import altdss
altdss.to_dss_python().Plotting.enable()
altdss('redirect "path_to/IEEETestCases/13Bus/IEEE13Nodeckt.dss"')
altdss('plot circuit') Jupyter notebook integration as shown in the link also works, etc. |
Beta Was this translation helpful? Give feedback.
-
This is helpful! Thanks! |
Beta Was this translation helpful? Give feedback.
The plotting backend is shared across our Python modules, and DSS-Python is currently always installed as a dependency of AltDSS-Python due to some shared code (the same OpenDSS/AltDSS engine is used across AltDSS-Python, DSS-Python and OpenDSSDirect.py). The examples for plotting can be adapted since they're independent from the user-facing interface, i.e., they're mostly DSS commands, not Python code.
As mentioned in the linked notebook ( https://dss-extensions.org/DSS-Python/examples/Plotting.html ), plotting is disabled by default. After you enable it, you can run DSS plot commands through .dss scripts. As a reminder, you need matplotlib installed to use this.
The examples from the no…