@@ -13,7 +13,7 @@ def __init__(self):
1313
1414 Instantiate an OpenDSS circuit that user can build circuit components on.
1515 Stores numbers of circuit components to ensure unique naming of repeat circuit components.
16-
16+
1717 Attributes:
1818 num_loads (int): Number of loads in circuit so far.
1919 num_lines (int): Number of lines in circuit so far.
@@ -29,12 +29,15 @@ def __init__(self):
2929 altdss .ClearAll ()
3030 altdss ('new circuit.MyCircuit' )
3131
32- def add_load_nodes (self , load_type : str = "house" , params : dict [str , int ] = None , num : int = 1 ):
32+ def add_load_nodes (self ,
33+ load_type : str = "house" ,
34+ params : dict [str , int ] = None ,
35+ num : int = 1 ):
3336 """Adds Load Node(s) to circuit.
3437
3538 Allows the user to add num load nodes, either with customized parameters or using a default load_type.
3639
37- Args:
40+ Args:
3841 load_type (str, optional):
3942 Load type as a string, one of "house", "commercial", "industrial". Defaults to "house".
4043 params (dict[str, int], optional):
@@ -75,7 +78,10 @@ def update_source(self, source_type: str = "turbine", params: dict[str, int] = N
7578 params = params or dict ()
7679 return _make_source_node (params , source_type )
7780
78- def add_PVSystem (self , load_nodes : list [str ], params : dict [str , int ] = None , num_panels : int = 1 ):
81+ def add_PVSystem (self ,
82+ load_nodes : list [str ],
83+ params : dict [str , int ] = None ,
84+ num_panels : int = 1 ):
7985 """Adds a photovoltaic (PV) system to the specified load nodes.
8086
8187 Adds PV system with num_panels to each of the listed load nodes.
@@ -103,10 +109,10 @@ def add_PVSystem(self, load_nodes: list[str], params: dict[str, int] = None, num
103109 self .num_pv += 1
104110
105111 return PV_nodes
106-
112+
107113 def add_generator (self , num : int = 1 , gen_type : str = "small" , params : dict [str , int ] = None ):
108114 """Adds generator(s) to the system.
109-
115+
110116 Args:
111117 num (int, optional):
112118 The number of generator units to add. Defaults to 1.
@@ -126,9 +132,12 @@ def add_generator(self, num: int = 1, gen_type: str = "small", params: dict[str,
126132 self .num_generators += 1
127133
128134 return generators
129-
130135
131- def add_lines (self , connections : list [tuple ], line_type : str = "lv" , params : dict [str , int ] = None , transformer : bool = True ):
136+ def add_lines (self ,
137+ connections : list [tuple ],
138+ line_type : str = "lv" ,
139+ params : dict [str , int ] = None ,
140+ transformer : bool = True ):
132141 """Adds lines to the system.
133142
134143 Adds electrical lines according to the given connections.
@@ -155,18 +164,18 @@ def add_lines(self, connections: list[tuple], line_type: str = "lv", params: dic
155164 def solve (self ):
156165 """Solves the OpenDSS circuit.
157166
158- Initializes "solve" mode in OpenDSS, which then allows the user to query results on the circuit.
167+ Initializes "solve" mode in OpenDSS, which allows user to query results on the circuit.
159168
160169 Returns:
161170 None
162171 """
163172 altdss .Solution .Solve ()
164173
165- def results (self , queries : list [str ], export_path = "" ):
174+ def results (self , queries : list [str ], export_path = "" ):
166175 """Gets simulation results based on specified queries.
167-
176+
168177 Allows the user to query for many results at once by providing a list of desired queries.
169-
178+
170179 Args:
171180 queries (list[str]):
172181 A list of queries to the circuit ("Voltages", "Losses", "TotalPower")
@@ -185,7 +194,7 @@ def results(self, queries: list[str], export_path = ""):
185194 _export_results (results , export_path )
186195
187196 return results
188-
197+
189198 def clear (self ):
190199 """Clears the OpenDSS circuit.
191200
0 commit comments