Skip to content

Commit d9309ef

Browse files
committed
remove unnecessary view functions
1 parent ec8bccd commit d9309ef

File tree

4 files changed

+4
-44
lines changed

4 files changed

+4
-44
lines changed

pygridsim/core.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -101,43 +101,6 @@ def add_lines(self, connections: list[tuple], line_type: str = "lv", params = {}
101101
make_line(src, dst, line_type, self.num_lines, params, transformer)
102102
self.num_lines += 1
103103

104-
def view_load_nodes(self, indices: list = []):
105-
"""
106-
View load nodes (what their parameters are) at the given indices.
107-
108-
Args:
109-
indices (optional): Which indices to view the nodes at.
110-
If none given, display all
111-
"""
112-
load_nodes = []
113-
if not indices:
114-
indices = [i for i in range(self.num_loads)]
115-
116-
for idx in indices:
117-
load_obj = altdss.Load["load" + str(idx)]
118-
load_info = {}
119-
load_info["name"] = "load" + str(idx)
120-
load_info["kV"] = load_obj.kV
121-
load_info["kW"] = load_obj.kW
122-
load_info["kVar"] = load_obj.kvar
123-
load_nodes.append(load_info)
124-
return load_nodes
125-
126-
127-
def view_source_node(self):
128-
"""
129-
View source nodes (what their parameters are) at the given indices.
130-
131-
Args:
132-
indices (optional): Which indices to view the nodes at.
133-
If none given, display all
134-
"""
135-
source_obj = altdss.Vsource["source"]
136-
source_info = {}
137-
source_info["name"] = "source"
138-
source_info["kV"] = source_obj.BasekV
139-
return source_info
140-
141104
def solve(self):
142105
"""
143106
Initialize "solve" mode in AltDSS, then allowing the user to query various results on the circuit

sim.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"Voltages": {
3-
"source": 2282.7562444775963,
4-
"load0": 206.47949848565221
3+
"source": 1735.8007811315708,
4+
"load0": 205.64441923330276
55
},
66
"Losses": {
7-
"Active Power Loss": 370747.6727038353,
8-
"Reactive Power Loss": 770855.4012118444
7+
"Active Power Loss": 198582.96141955358,
8+
"Reactive Power Loss": 412884.39931989944
99
}
1010
}
-242 Bytes
Binary file not shown.

tests/test_circuit.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ def test_001_one_source_one_load(self):
3838
circuit.update_source(source_type="turbine")
3939
circuit.add_load_nodes(num=1, load_type="house")
4040
circuit.add_lines([("source", "load0")], "MV")
41-
#circuit.add_transformers([("source", "load0")], params={"Conns": [Connection.wye, Connection.delta]})
42-
print("Load Nodes:", circuit.view_load_nodes())
43-
print("Source Nodes:", circuit.view_source_node())
4441
circuit.solve()
4542
print(circuit.results(["Voltages", "Losses"]))
4643
circuit.clear()

0 commit comments

Comments
 (0)