增加 wn_inp_path 参数以支持多进程处理
This commit is contained in:
@@ -23,6 +23,7 @@ from .similarity_calculator import (
|
||||
|
||||
def _ensure_signatures_for_centers(
|
||||
wn,
|
||||
wn_inp_path,
|
||||
center_list, # 本轮要用到的中心(list[str])
|
||||
pressure_leak_all,
|
||||
flow_leak_all, # 全量缓存(可为空 DF)
|
||||
@@ -71,6 +72,7 @@ def _ensure_signatures_for_centers(
|
||||
timestep_list,
|
||||
sensor_name_all,
|
||||
n_workers=n_workers,
|
||||
wn_inp_path=wn_inp_path,
|
||||
)
|
||||
# 初始化空缓存时,做一次“同构化”
|
||||
if pressure_leak_all is None or len(pressure_leak_all) == 0:
|
||||
@@ -296,6 +298,7 @@ def cal_SD(located_pipe, real_pipe, pipe_x, pipe_y):
|
||||
|
||||
def DN_search_multi_simple_add_flow_count_new(
|
||||
wn,
|
||||
wn_inp_path,
|
||||
G0,
|
||||
all_node,
|
||||
node_x,
|
||||
@@ -390,6 +393,7 @@ def DN_search_multi_simple_add_flow_count_new(
|
||||
pressure_leak, flow_leak, pressure_leak_all, flow_leak_all = (
|
||||
_ensure_signatures_for_centers(
|
||||
wn=wn,
|
||||
wn_inp_path=wn_inp_path,
|
||||
center_list=candidate_center_list,
|
||||
pressure_leak_all=pressure_leak_all,
|
||||
flow_leak_all=flow_leak_all,
|
||||
@@ -440,6 +444,7 @@ def DN_search_multi_simple_add_flow_count_new(
|
||||
pressure_add, flow_add, pressure_leak_all, flow_leak_all = (
|
||||
_ensure_signatures_for_centers(
|
||||
wn=wn,
|
||||
wn_inp_path=wn_inp_path,
|
||||
center_list=add_center,
|
||||
pressure_leak_all=pressure_leak_all,
|
||||
flow_leak_all=flow_leak_all,
|
||||
@@ -555,6 +560,7 @@ def DN_search_multi_simple_add_flow_count_new(
|
||||
pressure_leak_sp, flow_leak_sp, pressure_leak_all, flow_leak_all = (
|
||||
_ensure_signatures_for_centers(
|
||||
wn=wn,
|
||||
wn_inp_path=wn_inp_path,
|
||||
center_list=final_area_pipe, # 这次要用的“最终区域里的所有管段”
|
||||
pressure_leak_all=pressure_leak_all, # 累积缓存(会被更新)
|
||||
flow_leak_all=flow_leak_all,
|
||||
|
||||
Reference in New Issue
Block a user