Skip to content

Commit b51f941

Browse files
committed
Version v0.0.4
1 parent 451379a commit b51f941

File tree

93 files changed

+3895
-521
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3895
-521
lines changed
+247
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
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": 1,
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": 2,
57+
"metadata": {},
58+
"outputs": [
59+
{
60+
"name": "stdout",
61+
"output_type": "stream",
62+
"text": [
63+
"OpenDSS Started successfully! \n",
64+
"OpenDSS Version 8.6.7.1 (64-bit build); License Status: Open \n",
65+
"\n",
66+
"\n"
67+
]
68+
}
69+
],
70+
"source": [
71+
"dss = py_dss_interface.DSSDLL()"
72+
]
73+
},
74+
{
75+
"cell_type": "markdown",
76+
"metadata": {},
77+
"source": [
78+
"If you want to use your OpenDSS, you will need to pass the OpenDSS path as argument to the DSSDLL class, as can be seen below:"
79+
]
80+
},
81+
{
82+
"cell_type": "code",
83+
"execution_count": 3,
84+
"metadata": {},
85+
"outputs": [],
86+
"source": [
87+
"opendss_path = r\"C:\\Program Files\\OpenDSS\""
88+
]
89+
},
90+
{
91+
"cell_type": "markdown",
92+
"metadata": {},
93+
"source": [
94+
"Creates a dss object with your OpenDSS"
95+
]
96+
},
97+
{
98+
"cell_type": "code",
99+
"execution_count": 4,
100+
"metadata": {},
101+
"outputs": [
102+
{
103+
"name": "stdout",
104+
"output_type": "stream",
105+
"text": [
106+
"OpenDSS Started successfully! \n",
107+
"OpenDSS Version 8.6.7.1 (64-bit build); License Status: Open \n",
108+
"\n",
109+
"\n"
110+
]
111+
}
112+
],
113+
"source": [
114+
"dss = py_dss_interface.DSSDLL(opendss_path)"
115+
]
116+
},
117+
{
118+
"cell_type": "markdown",
119+
"metadata": {},
120+
"source": [
121+
"Select the DSS model"
122+
]
123+
},
124+
{
125+
"cell_type": "code",
126+
"execution_count": 5,
127+
"metadata": {},
128+
"outputs": [],
129+
"source": [
130+
"dss_file = r\"C:\\MeuTCC\\Paulo_Example\\DSSFiles\\MASTER_RedeTeste13Barras.dss\""
131+
]
132+
},
133+
{
134+
"cell_type": "markdown",
135+
"metadata": {},
136+
"source": [
137+
"Compile"
138+
]
139+
},
140+
{
141+
"cell_type": "code",
142+
"execution_count": 6,
143+
"metadata": {},
144+
"outputs": [],
145+
"source": [
146+
"dss.text(\"compile {}\".format(dss_file))"
147+
]
148+
},
149+
{
150+
"cell_type": "markdown",
151+
"metadata": {},
152+
"source": [
153+
"Solve - You can use the text interface as well: dss.text(\"solve\")"
154+
]
155+
},
156+
{
157+
"cell_type": "code",
158+
"execution_count": 7,
159+
"metadata": {},
160+
"outputs": [
161+
{
162+
"data": {
163+
"text/plain": [
164+
"0"
165+
]
166+
},
167+
"execution_count": 7,
168+
"metadata": {},
169+
"output_type": "execute_result"
170+
}
171+
],
172+
"source": [
173+
"dss.solution_solve()"
174+
]
175+
},
176+
{
177+
"cell_type": "markdown",
178+
"metadata": {},
179+
"source": [
180+
"Show Voltage Report"
181+
]
182+
},
183+
{
184+
"cell_type": "code",
185+
"execution_count": 8,
186+
"metadata": {},
187+
"outputs": [],
188+
"source": [
189+
"dss.text(\"show voltages\")"
190+
]
191+
},
192+
{
193+
"cell_type": "markdown",
194+
"metadata": {},
195+
"source": [
196+
"Get all buses voltages"
197+
]
198+
},
199+
{
200+
"cell_type": "code",
201+
"execution_count": 9,
202+
"metadata": {},
203+
"outputs": [],
204+
"source": [
205+
"allbusvolts = dss.circuit_allbusvolts()"
206+
]
207+
},
208+
{
209+
"cell_type": "code",
210+
"execution_count": 10,
211+
"metadata": {},
212+
"outputs": [
213+
{
214+
"name": "stdout",
215+
"output_type": "stream",
216+
"text": [
217+
"(57499.99984854059, 33197.64043666635, -9.850168857798125e-06, -66395.28082241151, -57499.99983869039, 33197.64039870235, 2521.7380661242582, -0.033332433156079276, -1245.8787300524257, -2157.924347023293, -1260.82801155609, 2183.904446042037, 2447.0051283472344, -21.90789306454855, -1219.3723934741943, -2138.9560914885365, -1206.3038367162885, 2085.3954297178566, 2429.501899704568, -31.198358333109713, -1203.2056471193102, -2152.310316449565, -1195.7215248567497, 2055.0852535673275, 2391.084320783626, -50.062131096842805, -1173.690262916864, -2184.4446438534164, -1188.2054759675134, 1996.7915167349508, 2400.2310288860003, -4.936891840982341, -1132.6674904482488, -2201.9831980231393, -1234.9597193512514, 1973.2329294055412, 2439.72672684693, -24.570582224732526, -1218.7845460017886, -2133.897053719238, -1202.9249506150766, 2080.0210888156566, -1205.0143876822408, 2080.9143155817396, -1215.2647596418246, -2115.8095371195886, -1204.2592626597598, 2075.7516204362637, -1216.061165717514, -2110.6466988639604, 2390.808195032073, -50.22915289202546, -1173.7854073662652, -2184.432600932979, -1187.9686135815562, 1996.6985720515652, 2375.2196161407214, -60.36283167374468, -1182.8077277041098, -2185.8222050310314, -1186.0448159963867, 1992.4002359846927, 2386.353397345648, -50.914573469570655, -1182.200990121016, 1994.7177220557478, -1174.6338021812282, 1993.5752272005625, 2373.0662121128853, -47.62346752050522, 274.7965425038391, -6.024932145551775, -140.047848266581, -240.58126637198527, -134.11350748578673, 236.5815972605969, 2401.7759437795626, -0.0004178201077101414, -1200.8882119836212, -2079.9992432513623, -1200.8874940740557, 2079.9991885692953, 267.7345981151209, 59.996080180480014, -74.74933913449347, -273.6209533797813, -189.79998261133724, 185.5877875805238)\n"
218+
]
219+
}
220+
],
221+
"source": [
222+
"print(dss.circuit_allbusvolts())"
223+
]
224+
}
225+
],
226+
"metadata": {
227+
"kernelspec": {
228+
"display_name": "Python 3",
229+
"language": "python",
230+
"name": "python3"
231+
},
232+
"language_info": {
233+
"codemirror_mode": {
234+
"name": "ipython",
235+
"version": 3
236+
},
237+
"file_extension": ".py",
238+
"mimetype": "text/x-python",
239+
"name": "python",
240+
"nbconvert_exporter": "python",
241+
"pygments_lexer": "ipython3",
242+
"version": "3.7.8"
243+
}
244+
},
245+
"nbformat": 4,
246+
"nbformat_minor": 4
247+
}

AUTHORS.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Authors
33
=======
44

5-
* Paulo Radatz - https://www.linkedin.com/in/pauloradatz/
5+
* Paulo Radatz - https://www.linkedin.com/in/pauloradatz/ and [email protected]

CHANGELOG.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
Changelog
33
=========
44

5+
0.0.4 (2020-08-17)
6+
------------------
7+
8+
* DSSDLL class can receive OpenDSS folder in order to use the user own OpenDSS.
9+
510
0.0.1 (2020-06-12)
611
------------------
712

8-
* Integrating CI
13+
* Integrating CI.
914

1015

1116
0.0.0 (2020-06-12)

README.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ py-dss-interface is a Windows Python package providing access to OpenDSS direct
5555

5656
* Free software: MIT license
5757

58+
Disclaimer
59+
============
60+
This Python Package is purely responsibility of Paulo Radatz and not his employer. Use this package at your own risk.
61+
5862
Installation
5963
============
6064

@@ -70,7 +74,7 @@ You can access the documentation through:
7074

7175
https://py_dss_interface.readthedocs.io/
7276

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.
77+
2 - Well, there is a solution (I hate it, but works), you can download the docs created offline and open that in your browser.
7478

7579
https://github.com/PauloRadatz/py_dss_interface/tree/master/docs/my_doc
7680

0 commit comments

Comments
 (0)