-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bus names are set to lower case: can this be prevented? #136
Comments
Currently, no. Nearly everything in OpenDSS/AltDSS is case-independent, so keeping the original names would either require maintaining copies or applying a upper/lowercase conversion in a lot of places. That is, currently not worth the effort of considering. We can keep this open as a feature request though. We might be able to handle it cleanly in a few months (after the full C++ transition on the engine). |
Any tips on how to deal with indexing into the For example, to get the source nodes one can source_busses: list[str] = []
source_bus_phases: list[list[int]] = []
dss.Circuit.SetActiveClass("VSource")
dss.Vsources.First()
def _update_output():
if dss.CktElement.Enabled():
# BusNames is like ['source', 'source.0.0.0'] for a single 3 phase
# source, and can look like ['newbus.1', 'newbus.0.0.0'] for a
# single 1 phase source.
bus_name = dss.CktElement.BusNames()[0]
# NOTE dss.Bus.Name() does not update with the VSource
if "." in bus_name:
bus_name = bus_name.split(".")[0]
source_busses.append(bus_name)
nodes = set(dss.CktElement.NodeOrder())
nodes.discard(0) # drop ground connections
source_bus_phases.append(list(nodes))
_update_output()
while dss.Vsources.Next() > 0:
_update_output()
source_nodes = [
bus + "." + str(phase)
for bus, phases in zip(source_busses, source_bus_phases)
for phase in phases
] But the |
Maybe we could at least add an option to return lowercase strings from Related to your sample, in the upcoming release, to avoid this common pattern... if "." in bus_name:
bus_name = bus_name.split(".")[0] ... I personally don't like that the bus connections are kept as strings, even in the internal code, but I haven't had the time to try alternatives yet. |
Support Question
I am programmatically defining all circuit elements based on data that can have mixed string cases, and later I need to align the bus names (and many other things in the dss model) with the data. Is there a way to stop dss from changing the capitalization of the bus names?
['capsbus', 'capsbus.0.0.0']
The text was updated successfully, but these errors were encountered: