Alt-DSS python - Batch for Buses #39
Replies: 1 comment 2 replies
-
No, right now bus batches can't be created (directly by the user). We plan to add some support later. Buses are not really DSS objects (you don't have an equivalent "new Bus.bus_name" like for loads and other objects), they are implicitly defined by the circuit elements. If the circuit elements that create a certain a bus are disabled, the bus ceases to exist, and that presents an extra difficulty for tracking the bus references in batches.
I don't recommend using NumPy arrays for lists of general objects or strings, a simple Python list is enough for those cases. A simpler version: busnames_hv = [
name
for name, kv, nnodes in zip(altdss.Bus.Name(), altdss.Bus.kVBase(), altdss.Bus.NumNodes())
if kv > 1 and nnodes == 3
] |
Beta Was this translation helpful? Give feedback.
-
I've written this simple code to select all 3phase Buses with KV > 1VK.
buses = altdss.Bus.Name()
busesvoltages = altdss.Bus.kVBase()
busesnumnodes = altdss.Bus.NumNodes()
for bus in range(len(buses)):
if buses[bus] != 'sourcebus' and busesvoltages[bus] > 1 and busesnumnodes[bus] == 3:
mv_buses = np.append(mv_buses, buses[bus])
However, I've seen in the documentation that we can do batch features with conditionals to select Loads, but for Buses I didn't find the same feature.
Am I doing something wrong?
The aforementioned script works well with no problems, but, is there a batch way to do this? Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions