补充 __init__.py 导出;将 from app.services.tjnetwork import * 改为显式导入;删除以下仅做 @staticmethod 转发的类,保留模块级函数
This commit is contained in:
@@ -4,6 +4,9 @@ from app.algorithms.sensor import (
|
|||||||
pressure_sensor_placement_kmeans,
|
pressure_sensor_placement_kmeans,
|
||||||
)
|
)
|
||||||
from app.algorithms.isolation.valve import valve_isolation_analysis
|
from app.algorithms.isolation.valve import valve_isolation_analysis
|
||||||
|
from app.algorithms.leakage import LeakageIdentifier
|
||||||
|
from app.algorithms.health import PipelineHealthAnalyzer
|
||||||
|
from app.algorithms.burst_location import run_burst_location
|
||||||
from app.algorithms.simulation.scenarios import (
|
from app.algorithms.simulation.scenarios import (
|
||||||
convert_to_local_unit,
|
convert_to_local_unit,
|
||||||
burst_analysis,
|
burst_analysis,
|
||||||
@@ -27,4 +30,7 @@ __all__ = [
|
|||||||
"age_analysis",
|
"age_analysis",
|
||||||
"pressure_regulation",
|
"pressure_regulation",
|
||||||
"valve_isolation_analysis",
|
"valve_isolation_analysis",
|
||||||
|
"LeakageIdentifier",
|
||||||
|
"PipelineHealthAnalyzer",
|
||||||
|
"run_burst_location",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -770,27 +770,3 @@ def DN_search_multi_simple_add_flow_count_new(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class BurstLocator:
|
|
||||||
@staticmethod
|
|
||||||
def DN_search_multi_simple_add_flow_count_new(*args, **kwargs):
|
|
||||||
return DN_search_multi_simple_add_flow_count_new(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def area_output_num_ki_improve(*args, **kwargs):
|
|
||||||
return area_output_num_ki_improve(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_DtoTop1(*args, **kwargs):
|
|
||||||
return cal_DtoTop1(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_RR(*args, **kwargs):
|
|
||||||
return cal_RR(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_cover(*args, **kwargs):
|
|
||||||
return cal_cover(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_SD(*args, **kwargs):
|
|
||||||
return cal_SD(*args, **kwargs)
|
|
||||||
|
|||||||
@@ -561,47 +561,3 @@ def extract_links(data, link_types, direction):
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class LeakSimulator:
|
|
||||||
@staticmethod
|
|
||||||
def simple_add_leak(*args, **kwargs):
|
|
||||||
return simple_add_leak(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def simple_recover_wn(*args, **kwargs):
|
|
||||||
return simple_recover_wn(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def leak_simulation_pipe_dd_multi_pf(*args, **kwargs):
|
|
||||||
return leak_simulation_pipe_dd_multi_pf(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def normal_simulation_pf(*args, **kwargs):
|
|
||||||
return normal_simulation_pf(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def normal_simulation_multi_pf(*args, **kwargs):
|
|
||||||
return normal_simulation_multi_pf(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def simple_simulation_pf(*args, **kwargs):
|
|
||||||
return simple_simulation_pf(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_sum_demand(*args, **kwargs):
|
|
||||||
return cal_sum_demand(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_signature_pipe_multi_pf(*args, **kwargs):
|
|
||||||
return cal_signature_pipe_multi_pf(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_possible_pipe(*args, **kwargs):
|
|
||||||
return cal_possible_pipe(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def pick_pipe(*args, **kwargs):
|
|
||||||
return pick_pipe(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def extract_links(*args, **kwargs):
|
|
||||||
return extract_links(*args, **kwargs)
|
|
||||||
|
|||||||
@@ -135,35 +135,3 @@ def _build_node_pipe_maps(
|
|||||||
return node_pipe_dic, couple_node_length
|
return node_pipe_dic, couple_node_length
|
||||||
|
|
||||||
|
|
||||||
class NetworkModelReader:
|
|
||||||
@staticmethod
|
|
||||||
def load_inp(*args, **kwargs):
|
|
||||||
return load_inp(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def read_inf_inp(*args, **kwargs):
|
|
||||||
return read_inf_inp(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def read_inf_inp_other(*args, **kwargs):
|
|
||||||
return read_inf_inp_other(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def construct_graph(*args, **kwargs):
|
|
||||||
return construct_graph(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_pipe_coordinate(*args, **kwargs):
|
|
||||||
return cal_pipe_coordinate(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_node_coordinate(*args, **kwargs):
|
|
||||||
return cal_node_coordinate(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def produce_pattern_value(*args, **kwargs):
|
|
||||||
return produce_pattern_value(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def build_node_pipe_maps(*args, **kwargs):
|
|
||||||
return _build_node_pipe_maps(*args, **kwargs)
|
|
||||||
|
|||||||
@@ -454,31 +454,3 @@ def cal_group_num(candidate_node_input, cal_group_num):
|
|||||||
return group_num_input
|
return group_num_input
|
||||||
|
|
||||||
|
|
||||||
class NetworkPartitioner:
|
|
||||||
@staticmethod
|
|
||||||
def metis_grouping_pipe_weight(*args, **kwargs):
|
|
||||||
return metis_grouping_pipe_weight(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def visualize_metis_partition(*args, **kwargs):
|
|
||||||
return visualize_metis_partition(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def generate_adjlist_with_all_edges(*args, **kwargs):
|
|
||||||
return generate_adjlist_with_all_edges(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def pick_center_pipe(*args, **kwargs):
|
|
||||||
return pick_center_pipe(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def find_new_center_pipe(*args, **kwargs):
|
|
||||||
return find_new_center_pipe(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_area_node_linked_pipe(*args, **kwargs):
|
|
||||||
return cal_area_node_linked_pipe(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_group_num(*args, **kwargs):
|
|
||||||
return cal_group_num(*args, **kwargs)
|
|
||||||
|
|||||||
@@ -196,39 +196,3 @@ def change_para_of_wn(wn, pipe_roughness_change):
|
|||||||
return wn
|
return wn
|
||||||
|
|
||||||
|
|
||||||
class NoiseGenerator:
|
|
||||||
@staticmethod
|
|
||||||
def add_noise_pd(*args, **kwargs):
|
|
||||||
return add_noise_pd(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def add_noise_number(*args, **kwargs):
|
|
||||||
return add_noise_number(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def add_noise_number_flow(*args, **kwargs):
|
|
||||||
return add_noise_number_flow(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def add_noise_percentage_pd(*args, **kwargs):
|
|
||||||
return add_noise_percentage_pd(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def produce_noise_number(*args, **kwargs):
|
|
||||||
return produce_noise_number(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def add_noise_in_wn_pf(*args, **kwargs):
|
|
||||||
return add_noise_in_wn_pf(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def change_node_demand(*args, **kwargs):
|
|
||||||
return change_node_demand(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def change_node_demand_leak(*args, **kwargs):
|
|
||||||
return change_node_demand_leak(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def change_para_of_wn(*args, **kwargs):
|
|
||||||
return change_para_of_wn(*args, **kwargs)
|
|
||||||
|
|||||||
@@ -856,59 +856,3 @@ def decode_mode(similarity_mode):
|
|||||||
return if_flow, if_only_cos, if_only_flow
|
return if_flow, if_only_cos, if_only_flow
|
||||||
|
|
||||||
|
|
||||||
class SimilarityCalculator:
|
|
||||||
@staticmethod
|
|
||||||
def cal_similarity_simple_return_dd(*args, **kwargs):
|
|
||||||
return cal_similarity_simple_return_dd(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_similarity_all_cos_dis(*args, **kwargs):
|
|
||||||
return cal_similarity_all_cos_dis(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_similarity_all_multi_new_sq_improve_double_lzr(*args, **kwargs):
|
|
||||||
return cal_similarity_all_multi_new_sq_improve_double_lzr(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_sq_all_multi(*args, **kwargs):
|
|
||||||
return cal_sq_all_multi(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_sq_single_array(*args, **kwargs):
|
|
||||||
return cal_sq_single_array(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def add_weight_for_SQ(*args, **kwargs):
|
|
||||||
return add_weight_for_SQ(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def adjust_ratio(*args, **kwargs):
|
|
||||||
return adjust_ratio(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def adjust(*args, **kwargs):
|
|
||||||
return adjust(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_top_sensors(*args, **kwargs):
|
|
||||||
return cal_top_sensors(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def cal_top_f_sensor(*args, **kwargs):
|
|
||||||
return cal_top_f_sensor(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def remove_3_sigma(*args, **kwargs):
|
|
||||||
return remove_3_sigma(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def update_similarity(*args, **kwargs):
|
|
||||||
return update_similarity(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def extra_judge(*args, **kwargs):
|
|
||||||
return extra_judge(*args, **kwargs)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def decode_mode(*args, **kwargs):
|
|
||||||
return decode_mode(*args, **kwargs)
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ from sklearn.cluster import KMeans
|
|||||||
from wntr.epanet.toolkit import EpanetException
|
from wntr.epanet.toolkit import EpanetException
|
||||||
from numpy.linalg import slogdet
|
from numpy.linalg import slogdet
|
||||||
import random
|
import random
|
||||||
from app.services.tjnetwork import *
|
|
||||||
from matplotlib.lines import Line2D
|
from matplotlib.lines import Line2D
|
||||||
from sklearn.cluster import SpectralClustering
|
from sklearn.cluster import SpectralClustering
|
||||||
import libpysal as ps
|
import libpysal as ps
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
ChangeSet,
|
||||||
|
close_project,
|
||||||
|
copy_project,
|
||||||
|
delete_project,
|
||||||
|
get_pattern,
|
||||||
|
get_patterns,
|
||||||
|
get_pump,
|
||||||
|
get_reservoir,
|
||||||
|
get_status,
|
||||||
|
get_tank,
|
||||||
|
get_time,
|
||||||
|
have_project,
|
||||||
|
is_project_open,
|
||||||
|
open_project,
|
||||||
|
read_all,
|
||||||
|
run_project,
|
||||||
|
set_pattern,
|
||||||
|
set_status,
|
||||||
|
set_tank,
|
||||||
|
set_time,
|
||||||
|
)
|
||||||
# from get_real_status import *
|
# from get_real_status import *
|
||||||
from datetime import datetime,timedelta
|
from datetime import datetime,timedelta
|
||||||
from math import modf
|
from math import modf
|
||||||
|
|||||||
@@ -11,7 +11,34 @@ from app.algorithms.simulation.runner import (
|
|||||||
)
|
)
|
||||||
from app.infra.epanet.epanet import Output
|
from app.infra.epanet.epanet import Output
|
||||||
from app.services.scheme_management import store_scheme_info
|
from app.services.scheme_management import store_scheme_info
|
||||||
from app.services.tjnetwork import *
|
from app.services.tjnetwork import (
|
||||||
|
ChangeSet,
|
||||||
|
OPTION_DEMAND_MODEL_PDA,
|
||||||
|
OPTION_QUALITY_CHEMICAL,
|
||||||
|
SOURCE_TYPE_SETPOINT,
|
||||||
|
add_pattern,
|
||||||
|
add_source,
|
||||||
|
close_project,
|
||||||
|
copy_project,
|
||||||
|
delete_project,
|
||||||
|
get_demand,
|
||||||
|
get_emitter,
|
||||||
|
get_node_links,
|
||||||
|
get_option,
|
||||||
|
get_pattern,
|
||||||
|
get_pipe,
|
||||||
|
get_source,
|
||||||
|
get_time,
|
||||||
|
have_project,
|
||||||
|
is_junction,
|
||||||
|
is_project_open,
|
||||||
|
open_project,
|
||||||
|
set_demand,
|
||||||
|
set_emitter,
|
||||||
|
set_option,
|
||||||
|
set_source,
|
||||||
|
set_time,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user