Skip to content

Commit

Permalink
Fix connect_to_lv_bus return type and error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
joda9 committed Sep 27, 2024
1 parent b2d6cff commit 0c8b175
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion edisgo/network/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -2603,7 +2603,10 @@ def handle_voltage_level_7():
target_bus = self._connect_to_lv_bus(
edisgo_object, lv_buses.distance.idxmin(), comp_type, comp_data
)
return target_bus, ModuleNotFoundError
if isinstance(target_bus, str):
return target_bus, None
elif isinstance(target_bus, pd.DataFrame):
return target_bus.index[0], None

else:
target_bus = lv_buses_masked.loc[lv_buses_masked.distance.idxmin()]
Expand Down

0 comments on commit 0c8b175

Please sign in to comment.