Skip to content

Commit

Permalink
Add incidence matrix fix for 3-winding transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph McKinsey committed Mar 25, 2024
1 parent cf87b46 commit bd8e344
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions LocalFeeder/FeederSimulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,9 +829,11 @@ def get_incidences(self) -> IncidenceList:
dss.Circuit.SetActiveElement("Line." + line)
names = dss.CktElement.BusNames()
if len(names) != 2:
logging.info(f"Line {line} does not have two terminals")
continue
from_bus, to_bus = names
bus_names = map(lambda x: x.split(".")[0], names)
# dicts are insert-ordered in >=3.7
from_bus, to_bus = dict.fromkeys(bus_names)
else:
from_bus, to_bus = names
from_list.append(from_bus.upper())
to_list.append(to_bus.upper())
equipment_ids.append(line)
Expand All @@ -840,8 +842,8 @@ def get_incidences(self) -> IncidenceList:
dss.Circuit.SetActiveElement("Transformer." + transformer)
names = dss.CktElement.BusNames()
if len(names) != 2:
logging.info(f"Transformer {transformer} does not have two terminals")
continue
bus_names = map(lambda x: x.split(".")[0], names)
from_bus, to_bus = dict.fromkeys(bus_names)
from_bus, to_bus = names
from_list.append(from_bus.upper())
to_list.append(to_bus.upper())
Expand Down

0 comments on commit bd8e344

Please sign in to comment.