将 from app.services.tjnetwork import * 改为显式导入
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import clean_project, delete_project
|
||||
|
||||
if __name__ == '__main__':
|
||||
clean_project()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import copy_project, have_project
|
||||
|
||||
def main():
|
||||
argc = len(sys.argv)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import read_inp
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import read_inp
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import delete_project
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import list_project, read_inp
|
||||
read_inp("beibeizone","beibeizone.inp")
|
||||
#open_project('beibeizone')
|
||||
#generate_service_area("beibeizone",0.00001)
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import calculate_service_area, open_project, read_inp
|
||||
|
||||
p = 'dev'
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import dump_inp
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import api, get_all_service_area_ids, open_project
|
||||
from get_realValue import *
|
||||
from get_hist_data import *
|
||||
import datetime
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from app.services.tjnetwork import *
|
||||
from get_realValue import *
|
||||
def get_current_total_Q():
|
||||
ids=['3489']
|
||||
|
||||
+261
-1
@@ -51,7 +51,267 @@ import app.services.project_info as project_info
|
||||
from app.infra.db.timescaledb.database import db as tsdb
|
||||
from app.infra.db.postgresql.database import db as pgdb
|
||||
from app.algorithms.online_Analysis import *
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import (
|
||||
Any,
|
||||
ChangeSet,
|
||||
PIPE_STATUS_OPEN,
|
||||
VALVES_TYPE_PRV,
|
||||
add_curve,
|
||||
add_district_metering_area,
|
||||
add_junction,
|
||||
add_label,
|
||||
add_mixing,
|
||||
add_pattern,
|
||||
add_pipe,
|
||||
add_pump,
|
||||
add_region,
|
||||
add_reservoir,
|
||||
add_scada_device,
|
||||
add_scada_device_data,
|
||||
add_scada_element,
|
||||
add_service_area,
|
||||
add_source,
|
||||
add_tank,
|
||||
add_valve,
|
||||
add_vertex,
|
||||
add_virtual_district,
|
||||
api,
|
||||
calculate_demand_to_network,
|
||||
calculate_demand_to_nodes,
|
||||
calculate_demand_to_region,
|
||||
calculate_district_metering_area_for_network,
|
||||
calculate_district_metering_area_for_nodes,
|
||||
calculate_district_metering_area_for_region,
|
||||
calculate_service_area,
|
||||
calculate_virtual_district,
|
||||
clean_scada_device,
|
||||
clean_scada_device_data,
|
||||
clean_scada_element,
|
||||
close_project,
|
||||
convert_inp_v3_to_v2,
|
||||
copy_project,
|
||||
create_project,
|
||||
delete_curve,
|
||||
delete_district_metering_area,
|
||||
delete_junction,
|
||||
delete_label,
|
||||
delete_mixing,
|
||||
delete_pattern,
|
||||
delete_pipe,
|
||||
delete_project,
|
||||
delete_pump,
|
||||
delete_region,
|
||||
delete_reservoir,
|
||||
delete_scada_device,
|
||||
delete_scada_device_data,
|
||||
delete_scada_element,
|
||||
delete_service_area,
|
||||
delete_source,
|
||||
delete_tank,
|
||||
delete_valve,
|
||||
delete_virtual_district,
|
||||
dump_inp,
|
||||
dump_output,
|
||||
execute_batch_command,
|
||||
execute_batch_commands,
|
||||
execute_redo,
|
||||
execute_undo,
|
||||
export_inp,
|
||||
generate_district_metering_area,
|
||||
generate_service_area,
|
||||
generate_sub_district_metering_area,
|
||||
generate_virtual_district,
|
||||
get_all_burst_locate_results,
|
||||
get_all_district_metering_area_ids,
|
||||
get_all_district_metering_areas,
|
||||
get_all_extension_data,
|
||||
get_all_extension_data_keys,
|
||||
get_all_junctions,
|
||||
get_all_pipes,
|
||||
get_all_pumps,
|
||||
get_all_reservoirs,
|
||||
get_all_scada_device_ids,
|
||||
get_all_scada_devices,
|
||||
get_all_scada_elements,
|
||||
get_all_scada_info,
|
||||
get_all_schemes,
|
||||
get_all_sensor_placements,
|
||||
get_all_service_areas,
|
||||
get_all_tanks,
|
||||
get_all_users,
|
||||
get_all_valves,
|
||||
get_all_vertex_links,
|
||||
get_all_vertices,
|
||||
get_all_virtual_districts,
|
||||
get_backdrop,
|
||||
get_backdrop_schema,
|
||||
get_control,
|
||||
get_control_schema,
|
||||
get_current_operation,
|
||||
get_curve,
|
||||
get_curve_schema,
|
||||
get_curves,
|
||||
get_demand,
|
||||
get_demand_schema,
|
||||
get_district_metering_area,
|
||||
get_district_metering_area_schema,
|
||||
get_element_properties,
|
||||
get_element_properties_with_type,
|
||||
get_element_type,
|
||||
get_element_type_value,
|
||||
get_emitter,
|
||||
get_emitter_schema,
|
||||
get_energy,
|
||||
get_energy_schema,
|
||||
get_extension_data,
|
||||
get_junction,
|
||||
get_junction_schema,
|
||||
get_label,
|
||||
get_label_schema,
|
||||
get_link_properties,
|
||||
get_link_type,
|
||||
get_links,
|
||||
get_major_node_coords,
|
||||
get_major_pipe_nodes,
|
||||
get_mixing,
|
||||
get_mixing_schema,
|
||||
get_network_link_nodes,
|
||||
get_network_node_coords,
|
||||
get_network_pipe_risk_probability_now,
|
||||
get_node_coord,
|
||||
get_node_links,
|
||||
get_node_properties,
|
||||
get_node_type,
|
||||
get_nodes,
|
||||
get_option_v3,
|
||||
get_option_v3_schema,
|
||||
get_pattern,
|
||||
get_pattern_schema,
|
||||
get_patterns,
|
||||
get_pipe,
|
||||
get_pipe_reaction,
|
||||
get_pipe_reaction_schema,
|
||||
get_pipe_risk_probability,
|
||||
get_pipe_risk_probability_geometries,
|
||||
get_pipe_risk_probability_now,
|
||||
get_pipe_schema,
|
||||
get_pipes_risk_probability,
|
||||
get_pump,
|
||||
get_pump_energy,
|
||||
get_pump_energy_schema,
|
||||
get_pump_schema,
|
||||
get_quality,
|
||||
get_quality_schema,
|
||||
get_reaction,
|
||||
get_reaction_schema,
|
||||
get_region,
|
||||
get_region_schema,
|
||||
get_reservoir,
|
||||
get_reservoir_schema,
|
||||
get_restore_operation,
|
||||
get_rule,
|
||||
get_rule_schema,
|
||||
get_scada_device,
|
||||
get_scada_device_data,
|
||||
get_scada_device_data_schema,
|
||||
get_scada_device_schema,
|
||||
get_scada_element,
|
||||
get_scada_element_schema,
|
||||
get_scada_info,
|
||||
get_scada_info_schema,
|
||||
get_scheme,
|
||||
get_scheme_schema,
|
||||
get_service_area,
|
||||
get_service_area_schema,
|
||||
get_source,
|
||||
get_source_schema,
|
||||
get_status,
|
||||
get_status_schema,
|
||||
get_tag,
|
||||
get_tag_schema,
|
||||
get_tags,
|
||||
get_tank,
|
||||
get_tank_reaction,
|
||||
get_tank_reaction_schema,
|
||||
get_tank_schema,
|
||||
get_time,
|
||||
get_time_schema,
|
||||
get_title,
|
||||
get_title_schema,
|
||||
get_user,
|
||||
get_user_schema,
|
||||
get_valve,
|
||||
get_valve_schema,
|
||||
get_vertex,
|
||||
get_vertex_schema,
|
||||
get_virtual_district,
|
||||
get_virtual_district_schema,
|
||||
have_project,
|
||||
have_snapshot,
|
||||
have_snapshot_for_current_operation,
|
||||
have_snapshot_for_operation,
|
||||
import_inp,
|
||||
is_curve,
|
||||
is_junction,
|
||||
is_link,
|
||||
is_node,
|
||||
is_pattern,
|
||||
is_pipe,
|
||||
is_project_open,
|
||||
is_pump,
|
||||
is_reservoir,
|
||||
is_tank,
|
||||
is_valve,
|
||||
list_project,
|
||||
list_snapshot,
|
||||
open_project,
|
||||
pick_operation,
|
||||
pick_snapshot,
|
||||
read_inp,
|
||||
run_inp,
|
||||
run_project,
|
||||
run_project_return_dict,
|
||||
set_backdrop,
|
||||
set_control,
|
||||
set_curve,
|
||||
set_demand,
|
||||
set_district_metering_area,
|
||||
set_emitter,
|
||||
set_energy,
|
||||
set_extension_data,
|
||||
set_junction,
|
||||
set_label,
|
||||
set_option_v3,
|
||||
set_pattern,
|
||||
set_pipe,
|
||||
set_pipe_reaction,
|
||||
set_pump,
|
||||
set_pump_energy,
|
||||
set_quality,
|
||||
set_reaction,
|
||||
set_region,
|
||||
set_reservoir,
|
||||
set_restore_operation,
|
||||
set_rule,
|
||||
set_scada_device,
|
||||
set_scada_device_data,
|
||||
set_scada_element,
|
||||
set_service_area,
|
||||
set_source,
|
||||
set_status,
|
||||
set_tag,
|
||||
set_tank,
|
||||
set_tank_reaction,
|
||||
set_time,
|
||||
set_title,
|
||||
set_valve,
|
||||
set_vertex,
|
||||
set_virtual_district,
|
||||
sync_with_server,
|
||||
take_snapshot,
|
||||
take_snapshot_for_current_operation,
|
||||
take_snapshot_for_operation,
|
||||
)
|
||||
|
||||
|
||||
JUNCTION = 0
|
||||
|
||||
@@ -1,5 +1,35 @@
|
||||
import os
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import (
|
||||
ChangeSet,
|
||||
OPTION_DEMAND_MODEL_PDA,
|
||||
OPTION_QUALITY_CHEMICAL,
|
||||
SOURCE_TYPE_CONCEN,
|
||||
add_pattern,
|
||||
add_source,
|
||||
close_project,
|
||||
copy_project,
|
||||
delete_project,
|
||||
dump_inp,
|
||||
get_demand,
|
||||
get_emitter,
|
||||
get_node_links,
|
||||
get_option,
|
||||
get_pattern,
|
||||
get_pipe,
|
||||
get_source,
|
||||
get_tank,
|
||||
get_time,
|
||||
have_project,
|
||||
is_junction,
|
||||
is_project_open,
|
||||
open_project,
|
||||
read_inp,
|
||||
set_demand,
|
||||
set_emitter,
|
||||
set_option,
|
||||
set_source,
|
||||
set_time,
|
||||
)
|
||||
from app.native.wndb.project import copy_project
|
||||
from app.algorithms.simulation.runner import run_simulation_ex, from_clock_to_seconds_2
|
||||
from math import sqrt, pi
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import open_project
|
||||
|
||||
def main():
|
||||
open_project('szh')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import close_project, open_project, restore
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import close_project, list_project, open_project, restore
|
||||
|
||||
def main():
|
||||
for p in list_project():
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import open_project
|
||||
from get_current_status import *
|
||||
|
||||
def run_simulation(cur_datetime:str=None)->str:
|
||||
|
||||
+249
-1
@@ -1,6 +1,254 @@
|
||||
import pytest
|
||||
import random
|
||||
from app.services.tjnetwork import *
|
||||
from app.services.tjnetwork import (
|
||||
API_ADD,
|
||||
API_DELETE,
|
||||
API_UPDATE,
|
||||
CURVE,
|
||||
CURVE_TYPE_EFFICIENCY,
|
||||
CURVE_TYPE_PUMP,
|
||||
ChangeSet,
|
||||
JUNCTION,
|
||||
LINK_STATUS_OPEN,
|
||||
MIXING_MODEL_2COMP,
|
||||
MIXING_MODEL_MIXED,
|
||||
OPTION_DEMAND_MODEL_DDA,
|
||||
OPTION_DEMAND_MODEL_PDA,
|
||||
OPTION_HEADLOSS_DW,
|
||||
OPTION_HEADLOSS_HW,
|
||||
OPTION_PRESSURE_KPA,
|
||||
OPTION_PRESSURE_METERS,
|
||||
OPTION_PRESSURE_PSI,
|
||||
OPTION_QUALITY_NONE,
|
||||
OPTION_QUALITY_TRACE,
|
||||
OPTION_UNBALANCED_CONTINUE,
|
||||
OPTION_UNBALANCED_STOP,
|
||||
OPTION_UNITS_GPM,
|
||||
OPTION_UNITS_LPS,
|
||||
OPTION_V3_DEMAND_MODEL_CONSTRAINED,
|
||||
OPTION_V3_DEMAND_MODEL_FIXED,
|
||||
OPTION_V3_DEMAND_MODEL_LOGISTIC,
|
||||
OPTION_V3_DEMAND_MODEL_POWER,
|
||||
OPTION_V3_FLOW_UNITS_GPM,
|
||||
OPTION_V3_FLOW_UNITS_LPS,
|
||||
OPTION_V3_HEADLOSS_MODEL_DW,
|
||||
OPTION_V3_HEADLOSS_MODEL_HW,
|
||||
OPTION_V3_IF_UNBALANCED_CONTINUE,
|
||||
OPTION_V3_IF_UNBALANCED_STOP,
|
||||
OPTION_V3_LEAKAGE_MODEL_NONE,
|
||||
OPTION_V3_LEAKAGE_MODEL_POWER,
|
||||
OPTION_V3_PRESSURE_UNITS_KPA,
|
||||
OPTION_V3_PRESSURE_UNITS_METERS,
|
||||
OPTION_V3_PRESSURE_UNITS_PSI,
|
||||
OPTION_V3_QUALITY_MODEL_CHEMICAL,
|
||||
OPTION_V3_QUALITY_MODEL_NONE,
|
||||
OPTION_V3_QUALITY_MODEL_TRACE,
|
||||
OPTION_V3_QUALITY_UNITS_HRS,
|
||||
OPTION_V3_QUALITY_UNITS_MGL,
|
||||
OPTION_V3_STEP_SIZING_FULL,
|
||||
OPTION_V3_STEP_SIZING_RELAXATION,
|
||||
OVERFLOW_NO,
|
||||
OVERFLOW_YES,
|
||||
PATTERN,
|
||||
PIPE,
|
||||
PIPE_STATUS_CLOSED,
|
||||
PIPE_STATUS_OPEN,
|
||||
PUMP,
|
||||
RESERVOIR,
|
||||
SCADA_DEVICE_TYPE_FLOW,
|
||||
SCADA_DEVICE_TYPE_PRESSURE,
|
||||
SCADA_ELEMENT_STATUS_OFFLINE,
|
||||
SCADA_ELEMENT_STATUS_ONLINE,
|
||||
SCADA_MODEL_TYPE_JUNCTION,
|
||||
SCADA_MODEL_TYPE_PIPE,
|
||||
SOURCE_TYPE_CONCEN,
|
||||
SOURCE_TYPE_FLOWPACED,
|
||||
TAG_TYPE_LINK,
|
||||
TAG_TYPE_NODE,
|
||||
TANK,
|
||||
TIME_STATISTIC_AVERAGED,
|
||||
TIME_STATISTIC_NONE,
|
||||
VALVE,
|
||||
VALVES_TYPE_FCV,
|
||||
VALVES_TYPE_GPV,
|
||||
add_curve,
|
||||
add_district_metering_area,
|
||||
add_junction,
|
||||
add_label,
|
||||
add_mixing,
|
||||
add_pattern,
|
||||
add_pipe,
|
||||
add_pump,
|
||||
add_region,
|
||||
add_reservoir,
|
||||
add_scada_device,
|
||||
add_scada_device_data,
|
||||
add_scada_element,
|
||||
add_service_area,
|
||||
add_source,
|
||||
add_tank,
|
||||
add_valve,
|
||||
add_virtual_district,
|
||||
calculate_boundary,
|
||||
calculate_convex_hull,
|
||||
calculate_demand_to_network,
|
||||
calculate_demand_to_nodes,
|
||||
calculate_demand_to_region,
|
||||
calculate_district_metering_area_for_network,
|
||||
calculate_district_metering_area_for_nodes,
|
||||
calculate_district_metering_area_for_region,
|
||||
calculate_service_area,
|
||||
calculate_virtual_district,
|
||||
clean_scada_device,
|
||||
clean_scada_device_data,
|
||||
clean_scada_element,
|
||||
close_project,
|
||||
create_project,
|
||||
delete_curve,
|
||||
delete_district_metering_area,
|
||||
delete_junction,
|
||||
delete_label,
|
||||
delete_mixing,
|
||||
delete_pattern,
|
||||
delete_pipe,
|
||||
delete_project,
|
||||
delete_pump,
|
||||
delete_region,
|
||||
delete_reservoir,
|
||||
delete_scada_device,
|
||||
delete_scada_device_data,
|
||||
delete_scada_element,
|
||||
delete_service_area,
|
||||
delete_source,
|
||||
delete_tank,
|
||||
delete_valve,
|
||||
delete_virtual_district,
|
||||
execute_batch_command,
|
||||
execute_batch_commands,
|
||||
execute_redo,
|
||||
execute_undo,
|
||||
generate_district_metering_area,
|
||||
generate_service_area,
|
||||
generate_sub_district_metering_area,
|
||||
generate_virtual_district,
|
||||
get_all_district_metering_area_ids,
|
||||
get_all_extension_data,
|
||||
get_all_extension_data_keys,
|
||||
get_all_scada_device_ids,
|
||||
get_all_scada_element_ids,
|
||||
get_all_service_area_ids,
|
||||
get_all_service_areas,
|
||||
get_all_virtual_district_ids,
|
||||
get_all_virtual_districts,
|
||||
get_backdrop,
|
||||
get_control,
|
||||
get_current_operation,
|
||||
get_curve,
|
||||
get_demand,
|
||||
get_district_metering_area,
|
||||
get_emitter,
|
||||
get_energy,
|
||||
get_extension_data,
|
||||
get_junction,
|
||||
get_label,
|
||||
get_links,
|
||||
get_links_on_region_boundary,
|
||||
get_mixing,
|
||||
get_node_links,
|
||||
get_nodes,
|
||||
get_nodes_in_boundary,
|
||||
get_nodes_in_region,
|
||||
get_operation_by_snapshot,
|
||||
get_option,
|
||||
get_option_v3,
|
||||
get_pattern,
|
||||
get_pipe,
|
||||
get_pipe_reaction,
|
||||
get_pump,
|
||||
get_pump_energy,
|
||||
get_quality,
|
||||
get_reaction,
|
||||
get_region,
|
||||
get_reservoir,
|
||||
get_restore_operation,
|
||||
get_rule,
|
||||
get_scada_device,
|
||||
get_scada_device_data,
|
||||
get_scada_element,
|
||||
get_service_area,
|
||||
get_snapshot_by_operation,
|
||||
get_source,
|
||||
get_status,
|
||||
get_tag,
|
||||
get_tags,
|
||||
get_tank,
|
||||
get_tank_reaction,
|
||||
get_time,
|
||||
get_title,
|
||||
get_valve,
|
||||
get_vertex,
|
||||
get_virtual_district,
|
||||
have_project,
|
||||
inflate_boundary,
|
||||
inflate_region,
|
||||
is_curve,
|
||||
is_junction,
|
||||
is_link,
|
||||
is_node,
|
||||
is_pattern,
|
||||
is_pipe,
|
||||
is_project_open,
|
||||
is_pump,
|
||||
is_reservoir,
|
||||
is_tank,
|
||||
is_valve,
|
||||
open_project,
|
||||
pick_operation,
|
||||
pick_snapshot,
|
||||
read_all,
|
||||
read_inp,
|
||||
set_backdrop,
|
||||
set_control,
|
||||
set_curve,
|
||||
set_demand,
|
||||
set_district_metering_area,
|
||||
set_emitter,
|
||||
set_energy,
|
||||
set_extension_data,
|
||||
set_junction,
|
||||
set_label,
|
||||
set_mixing,
|
||||
set_option,
|
||||
set_option_v3,
|
||||
set_pattern,
|
||||
set_pipe,
|
||||
set_pipe_reaction,
|
||||
set_pump,
|
||||
set_pump_energy,
|
||||
set_quality,
|
||||
set_reaction,
|
||||
set_region,
|
||||
set_reservoir,
|
||||
set_rule,
|
||||
set_scada_device,
|
||||
set_scada_device_data,
|
||||
set_scada_element,
|
||||
set_service_area,
|
||||
set_source,
|
||||
set_status,
|
||||
set_tag,
|
||||
set_tank,
|
||||
set_tank_reaction,
|
||||
set_time,
|
||||
set_title,
|
||||
set_valve,
|
||||
set_vertex,
|
||||
set_virtual_district,
|
||||
sync_with_server,
|
||||
take_snapshot,
|
||||
update_snapshot_for_current_operation,
|
||||
write,
|
||||
)
|
||||
|
||||
class TestApi:
|
||||
def enter(self, p):
|
||||
|
||||
Reference in New Issue
Block a user