Skip to content

Commit c891aa9

Browse files
committed
Version V0.0.2 final
1 parent c8a8c0e commit c891aa9

File tree

11 files changed

+857
-20
lines changed

11 files changed

+857
-20
lines changed

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ include CONTRIBUTING.rst
1414
include LICENSE
1515
include README.rst
1616
include *.py
17+
include *.dss
1718
recursive-include src\py_dss_interface\DDLL *.dll
1819
recursive-include src\py_dss_interface\DDLL *.exe
1920
recursive-include tests\py_dss_interface\DDLL *.dll

README.rst

+18-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Overview
5151

5252
.. end-badges
5353
54-
py-dss-interface is a Windows Python package providing access to OpenDSS direct dll version of OpenDSS.
54+
py-dss-interface is a Windows Python package providing access to OpenDSS direct dll version of OpenDSS - Version 8.6.7.1 (64-bit build); License Status: Open and Version 8.6.7.1 (32-bit build); License Status: Open.
5555

5656
* Free software: MIT license
5757

@@ -64,6 +64,23 @@ Installation
6464

6565
Documentation
6666
=============
67+
You can access the documentation through:
6768

69+
1 - The Read the Docs (the only problem is that it could not generate the doc using the docstring from the DSSDLL class. This class uses ctypes in a way that just works with Windows, but the Read the Docs uses linux to create it - Any help would be great!)
6870

6971
https://py_dss_interface.readthedocs.io/
72+
73+
2 - Well, there is a solution (I hate it, but works), you can download the docs created offline and open that in your browser.
74+
75+
https://github.com/PauloRadatz/py_dss_interface/tree/master/docs/my_doc
76+
77+
3 - Another good resource is the OpenDSS_Direct_DLL.pdf doc created by Davis Montenegro. The package has been done based on this documentation.
78+
79+
https://sourceforge.net/p/electricdss/code/HEAD/tree/trunk/Version8/Distrib/Doc/OpenDSS_Direct_DLL.pdf
80+
81+
82+
Thanks
83+
=============
84+
Thanks to Celso Rocha for starting the main script with me back in 2016/2017.
85+
86+

Usage.ipynb

+235
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# How to Use py-dss-interface Python package"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"## py-dss-interface Python package"
15+
]
16+
},
17+
{
18+
"cell_type": "markdown",
19+
"metadata": {},
20+
"source": [
21+
"py-dss-interface is a Windows Python package providing access to OpenDSS direct dll."
22+
]
23+
},
24+
{
25+
"cell_type": "markdown",
26+
"metadata": {},
27+
"source": [
28+
"## Simple Usage"
29+
]
30+
},
31+
{
32+
"cell_type": "markdown",
33+
"metadata": {},
34+
"source": [
35+
"First import the Package"
36+
]
37+
},
38+
{
39+
"cell_type": "code",
40+
"execution_count": 8,
41+
"metadata": {},
42+
"outputs": [],
43+
"source": [
44+
"import py_dss_interface"
45+
]
46+
},
47+
{
48+
"cell_type": "markdown",
49+
"metadata": {},
50+
"source": [
51+
"Creates an OpenDSS object"
52+
]
53+
},
54+
{
55+
"cell_type": "code",
56+
"execution_count": 9,
57+
"metadata": {},
58+
"outputs": [],
59+
"source": [
60+
"dss = py_dss_interface.DSSDLL()"
61+
]
62+
},
63+
{
64+
"cell_type": "markdown",
65+
"metadata": {},
66+
"source": [
67+
"If you want to use your OpenDSS, you should pass an argument to the DSSDLL class which is the path to the DLL folder, as shown below:"
68+
]
69+
},
70+
{
71+
"cell_type": "code",
72+
"execution_count": 10,
73+
"metadata": {},
74+
"outputs": [],
75+
"source": [
76+
"dll_path = r\"C:\\PauloRadatz\\GitLab\\opendsspy_workflow\\DDLL\""
77+
]
78+
},
79+
{
80+
"cell_type": "markdown",
81+
"metadata": {},
82+
"source": [
83+
"The folder DDLL should have both version of the OpenDSS direct dll, placed in the folders as shown below:\n",
84+
"<ul><li>64<ul><li>OpenDSSDirect.dll</li><li>KLUSolve.dll</li><li>DSSView.exe</li></ul></li><li>32<ul><li>OpenDSSDirect.dll</li><li>KLUSolve.dll</li><li>DSSView.exe</li></ul></li></ul>\n",
85+
"\n",
86+
"DSSView.exe allows the tool to plot OpenDSS results such as Circuit and monitors plots."
87+
]
88+
},
89+
{
90+
"cell_type": "markdown",
91+
"metadata": {},
92+
"source": [
93+
"Creates a dss object with your OpenDSS"
94+
]
95+
},
96+
{
97+
"cell_type": "code",
98+
"execution_count": 11,
99+
"metadata": {},
100+
"outputs": [],
101+
"source": [
102+
"dss = py_dss_interface.DSSDLL(dll_path)"
103+
]
104+
},
105+
{
106+
"cell_type": "markdown",
107+
"metadata": {},
108+
"source": [
109+
"Select the DSS model"
110+
]
111+
},
112+
{
113+
"cell_type": "code",
114+
"execution_count": 12,
115+
"metadata": {},
116+
"outputs": [],
117+
"source": [
118+
"dss_file = r\"C:\\OpenDSS_svn\\Version8\\Distrib\\IEEETestCases\\13Bus\\IEEE13Nodeckt.dss\""
119+
]
120+
},
121+
{
122+
"cell_type": "markdown",
123+
"metadata": {},
124+
"source": [
125+
"Compile"
126+
]
127+
},
128+
{
129+
"cell_type": "code",
130+
"execution_count": 13,
131+
"metadata": {},
132+
"outputs": [],
133+
"source": [
134+
"dss.text(\"compile {}\".format(dss_file))"
135+
]
136+
},
137+
{
138+
"cell_type": "markdown",
139+
"metadata": {},
140+
"source": [
141+
"Solve - You can use the text interface as well: dss.text(\"solve\")"
142+
]
143+
},
144+
{
145+
"cell_type": "code",
146+
"execution_count": 14,
147+
"metadata": {},
148+
"outputs": [
149+
{
150+
"data": {
151+
"text/plain": [
152+
"0"
153+
]
154+
},
155+
"execution_count": 14,
156+
"metadata": {},
157+
"output_type": "execute_result"
158+
}
159+
],
160+
"source": [
161+
"dss.solution_solve()"
162+
]
163+
},
164+
{
165+
"cell_type": "markdown",
166+
"metadata": {},
167+
"source": [
168+
"Show Voltage Report"
169+
]
170+
},
171+
{
172+
"cell_type": "code",
173+
"execution_count": 15,
174+
"metadata": {},
175+
"outputs": [],
176+
"source": [
177+
"dss.text(\"show voltages\")"
178+
]
179+
},
180+
{
181+
"cell_type": "markdown",
182+
"metadata": {},
183+
"source": [
184+
"Get all buses voltages"
185+
]
186+
},
187+
{
188+
"cell_type": "code",
189+
"execution_count": 16,
190+
"metadata": {},
191+
"outputs": [],
192+
"source": [
193+
"allbusvolts = dss.circuit_allbusvolts()"
194+
]
195+
},
196+
{
197+
"cell_type": "code",
198+
"execution_count": 17,
199+
"metadata": {},
200+
"outputs": [
201+
{
202+
"name": "stdout",
203+
"output_type": "stream",
204+
"text": [
205+
"(57502.68657444459, 33189.47582751112, -10.988164394741505, -66394.86913593691, -57491.69841004984, 33205.3933213843, 2401.5628101023703, -0.4668918200941385, -1201.237671677943, -2079.7175222940314, -1200.311653100388, 2080.141949991376, 2536.3561735751905, -0.5793185283079451, -1246.2598694166902, -2157.48772341857, -1267.5878413546532, 2196.935571488354, 2426.425943474452, -109.95862245792503, -1300.0214661176267, -2096.2770897808796, -1120.4367179288215, 2128.614974757371, 273.12114108033103, -15.65235754302226, -149.2212490974322, -236.28695774995873, -124.74067151469185, 242.00907089788834, 2350.078612278651, -221.06904907887537, -1338.4093354936983, -2109.7885897297024, -1015.4271681140748, 2083.131981642726, -1295.6881026261967, -2078.358923233928, -1122.400505964402, 2129.5714566690303, -1296.245262941303, -2073.152331293206, -1121.8021030579102, 2124.3630783208437, -1015.4271623240293, 2083.1319645675635, 2350.0785903696974, -221.06904177805635, -1338.4093393325584, -2109.7885840555614, 2333.5010209870284, -229.74415641869274, -1347.9866729361388, -2110.40099772813, -1013.9884003655168, 2078.6662098826223, -1002.146986487873, 2078.7704807720934, 2332.4283404892512, -217.29865419693618, 2407.0547918738666, -145.36409129295672, -1312.3049779525563, -2102.363108766874, -1083.0150310009187, 2116.119667082487, 2433.849895854283, -107.51619491330662, -1300.765241902797, -2101.2624606223394, -1123.5766850756647, 2134.1483915378726, 2350.0786408803283, -221.06906658917558, -1338.4093587456503, -2109.788617194392, -1015.4271724421402, 2083.1320163774312, 2345.3894199668225, -221.58915837414344, -1009.5895426635545, 2080.54927101747)\n"
206+
]
207+
}
208+
],
209+
"source": [
210+
"print(dss.circuit_allbusvolts())"
211+
]
212+
}
213+
],
214+
"metadata": {
215+
"kernelspec": {
216+
"display_name": "Python 3",
217+
"language": "python",
218+
"name": "python3"
219+
},
220+
"language_info": {
221+
"codemirror_mode": {
222+
"name": "ipython",
223+
"version": 3
224+
},
225+
"file_extension": ".py",
226+
"mimetype": "text/x-python",
227+
"name": "python",
228+
"nbconvert_exporter": "python",
229+
"pygments_lexer": "ipython3",
230+
"version": "3.8.3"
231+
}
232+
},
233+
"nbformat": 4,
234+
"nbformat_minor": 4
235+
}

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
year = '2020'
2929
author = 'Paulo Radatz'
3030
copyright = '{0}, {1}'.format(year, author)
31-
version = release = '0.0.1'
31+
version = release = '0.0.2'
3232

3333

3434
extensions = [

0 commit comments

Comments
 (0)