Skip to content

Commit 2dd8837

Browse files
committed
Delete dead code
1 parent f9c3fe1 commit 2dd8837

1 file changed

Lines changed: 0 additions & 44 deletions

File tree

task_queue/grid_optimizer.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -474,12 +474,6 @@ def _placeholder_consumers_for_power_house(self, *, remove=False):
474474
if remove is False:
475475
self.convert_lonlat_xy()
476476

477-
def _clear_nodes(self):
478-
"""
479-
Removes all nodes from the grid.
480-
"""
481-
self.nodes = self.nodes.drop(list(self.nodes.index), axis=0)
482-
483477
def _clear_poles(self):
484478
"""
485479
Removes all poles from the grid.
@@ -1087,44 +1081,6 @@ def _connection_cost_per_consumer(self):
10871081
)
10881082
self.nodes.loc[consumer, "connection_cost_per_consumer"] = connection_cost
10891083

1090-
def get_subbranches(self, branch):
1091-
subbranches = self.nodes[self.nodes["branch"] == branch].index.tolist()
1092-
leaf_branches = self.nodes[self.nodes["n_distribution_links"] == 1][
1093-
"branch"
1094-
].index
1095-
next_sub_branches = self.nodes[self.nodes["parent_branch"] == branch][
1096-
"parent_branch"
1097-
].tolist()
1098-
for _ in range(len(self.nodes["branch"].unique())):
1099-
next_next_sub_branches = []
1100-
for sub_branch in next_sub_branches:
1101-
if sub_branch in leaf_branches:
1102-
break
1103-
for b in next_sub_branches:
1104-
subbranches.append(b)
1105-
next_next_sub_branches.append(sub_branch)
1106-
next_sub_branches = next_next_sub_branches
1107-
if len(next_sub_branches) == 0:
1108-
break
1109-
return subbranches
1110-
1111-
def get_all_consumers_of_subbranches(self, branch):
1112-
branches = self.get_subbranches(branch)
1113-
consumers = self.nodes[
1114-
(self.nodes["node_type"] == "consumer")
1115-
& (self.nodes["branch"].isin(branches))
1116-
& (self.nodes["is_connected"] == True) # noqa:E712
1117-
].index
1118-
return consumers
1119-
1120-
def get_all_consumers_of_branch(self, branch):
1121-
consumers = self.nodes[
1122-
(self.nodes["node_type"] == "consumer")
1123-
& (self.nodes["branch"].isin(branch))
1124-
& (self.nodes["is_connected"] == True) # noqa:E712
1125-
].index
1126-
return consumers
1127-
11281084
def _determine_distribution_links(self):
11291085
pole_like_nodes = self.nodes[
11301086
self.nodes["node_type"].isin(["pole", "power-house"])

0 commit comments

Comments
 (0)