把所有 list(set(...)) 改为 sorted(set(...)),确保去重后顺序稳定

This commit is contained in:
2026-03-08 21:05:57 +08:00
parent b3d58379ef
commit d55e23bc44
3 changed files with 9 additions and 9 deletions
@@ -32,7 +32,7 @@ def read_inf_inp(wn):
pipe = wn.get_link(p)
if pipe.initial_status == 0: # 状态为'Closed'
n_pipe.append(p)
candidate_pipe_init = list(set(all_pipe) - set(n_pipe))
candidate_pipe_init = sorted(set(all_pipe) - set(n_pipe))
pipe_start_node = wn.query_link_attribute(
"start_node_name", link_type=wntr.network.model.Pipe
)