Skip to content

Commit

Permalink
Add warning when there is really a 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 bd8e344 commit ab5a1bb
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions LocalFeeder/FeederSimulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,9 +831,13 @@ def get_incidences(self) -> IncidenceList:
if len(names) != 2:
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
names = list(dict.fromkeys(bus_names))
if len(names) != 2:
logging.info(
f"Line {line} has {len(names)} terminals, skipping in incidence matrix"
)
continue
from_bus, to_bus = names
from_list.append(from_bus.upper())
to_list.append(to_bus.upper())
equipment_ids.append(line)
Expand All @@ -842,8 +846,16 @@ def get_incidences(self) -> IncidenceList:
dss.Circuit.SetActiveElement("Transformer." + transformer)
names = dss.CktElement.BusNames()
if len(names) != 2:
logging.info(
f"Transformer {transformer} has 3-terms, skipping in incidence matrix"
)
bus_names = map(lambda x: x.split(".")[0], names)
from_bus, to_bus = dict.fromkeys(bus_names)
names = list(dict.fromkeys(bus_names))
if len(names) != 2:
logging.info(
f"Transformer {transformer} has {len(names)} terminals, skipping in incidence matrix"
)
continue
from_bus, to_bus = names
from_list.append(from_bus.upper())
to_list.append(to_bus.upper())
Expand Down

0 comments on commit ab5a1bb

Please sign in to comment.