epyt-flow 0.1.0__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- epyt_flow/EPANET/compile_linux.sh +4 -0
- epyt_flow/VERSION +1 -1
- epyt_flow/__init__.py +21 -8
- epyt_flow/rest_api/scada_data/__init__.py +0 -0
- epyt_flow/rest_api/{scada_data_handler.py → scada_data/data_handlers.py} +3 -162
- epyt_flow/rest_api/scada_data/export_handlers.py +140 -0
- epyt_flow/rest_api/scada_data/handlers.py +167 -0
- epyt_flow/rest_api/scenario/__init__.py +0 -0
- epyt_flow/rest_api/scenario/event_handlers.py +118 -0
- epyt_flow/rest_api/{scenario_handler.py → scenario/handlers.py} +86 -67
- epyt_flow/rest_api/scenario/simulation_handlers.py +174 -0
- epyt_flow/rest_api/scenario/uncertainty_handlers.py +118 -0
- epyt_flow/rest_api/server.py +59 -24
- epyt_flow/simulation/scada/scada_data.py +2 -2
- epyt_flow/simulation/scada/scada_data_export.py +1 -7
- epyt_flow/simulation/scenario_config.py +12 -18
- epyt_flow/simulation/scenario_simulator.py +387 -132
- epyt_flow/simulation/sensor_config.py +370 -9
- epyt_flow/topology.py +47 -6
- epyt_flow/utils.py +75 -18
- {epyt_flow-0.1.0.dist-info → epyt_flow-0.2.0.dist-info}/METADATA +29 -5
- {epyt_flow-0.1.0.dist-info → epyt_flow-0.2.0.dist-info}/RECORD +25 -18
- epyt_flow/EPANET/compile.sh +0 -4
- {epyt_flow-0.1.0.dist-info → epyt_flow-0.2.0.dist-info}/LICENSE +0 -0
- {epyt_flow-0.1.0.dist-info → epyt_flow-0.2.0.dist-info}/WHEEL +0 -0
- {epyt_flow-0.1.0.dist-info → epyt_flow-0.2.0.dist-info}/top_level.txt +0 -0
|
@@ -118,7 +118,6 @@ class ScadaData(Serializable):
|
|
|
118
118
|
|
|
119
119
|
The default is False.
|
|
120
120
|
"""
|
|
121
|
-
|
|
122
121
|
def __init__(self, sensor_config: SensorConfig, sensor_readings_time: np.ndarray,
|
|
123
122
|
pressure_data_raw: np.ndarray = None, flow_data_raw: np.ndarray = None,
|
|
124
123
|
demand_data_raw: np.ndarray = None, node_quality_data_raw: np.ndarray = None,
|
|
@@ -132,7 +131,8 @@ class ScadaData(Serializable):
|
|
|
132
131
|
sensor_faults: list[SensorFault] = [],
|
|
133
132
|
sensor_reading_attacks: list[SensorReadingAttack] = [],
|
|
134
133
|
sensor_reading_events: list[SensorReadingEvent] = [],
|
|
135
|
-
sensor_noise: SensorNoise = None, frozen_sensor_config: bool = False,
|
|
134
|
+
sensor_noise: SensorNoise = None, frozen_sensor_config: bool = False,
|
|
135
|
+
**kwds):
|
|
136
136
|
if not isinstance(sensor_config, SensorConfig):
|
|
137
137
|
raise TypeError("'sensor_config' must be an instance of " +
|
|
138
138
|
"'epyt_flow.simulation.SensorConfig' but not of " +
|
|
@@ -73,13 +73,7 @@ class ScadaDataExport():
|
|
|
73
73
|
"""
|
|
74
74
|
old_sensor_config = scada_data.sensor_config
|
|
75
75
|
|
|
76
|
-
sensor_config = SensorConfig(
|
|
77
|
-
links=old_sensor_config.links,
|
|
78
|
-
valves=old_sensor_config.valves,
|
|
79
|
-
pumps=old_sensor_config.pumps,
|
|
80
|
-
tanks=old_sensor_config.tanks,
|
|
81
|
-
bulk_species=old_sensor_config.bulk_species,
|
|
82
|
-
surface_species=old_sensor_config.surface_species)
|
|
76
|
+
sensor_config = SensorConfig.create_empty_sensor_config(old_sensor_config)
|
|
83
77
|
sensor_config.pressure_sensors = sensor_config.nodes
|
|
84
78
|
sensor_config.flow_sensors = sensor_config.links
|
|
85
79
|
sensor_config.demand_sensors = sensor_config.nodes
|
|
@@ -582,24 +582,18 @@ class ScenarioConfig(Serializable):
|
|
|
582
582
|
sensor_config = None
|
|
583
583
|
from .scenario_simulator import ScenarioSimulator
|
|
584
584
|
with ScenarioSimulator(f_inp_in) as scenario:
|
|
585
|
-
sensor_config = SensorConfig(
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
valve_state_sensors=valve_state_sensors,
|
|
598
|
-
pump_state_sensors=pump_state_sensors,
|
|
599
|
-
tank_volume_sensors=tank_volume_sensors,
|
|
600
|
-
bulk_species_node_sensors=bulk_species_node_sensors,
|
|
601
|
-
bulk_species_link_sensors=bulk_species_link_sensors,
|
|
602
|
-
surface_species_sensors=surface_species_sensors)
|
|
585
|
+
sensor_config = SensorConfig.create_empty_sensor_config(scenario.sensor_config)
|
|
586
|
+
sensor_config.pressure_sensors = pressure_sensors
|
|
587
|
+
sensor_config.flow_sensors = flow_sensors
|
|
588
|
+
sensor_config.demand_sensors = demand_sensors
|
|
589
|
+
sensor_config.quality_node_sensors = node_quality_sensors
|
|
590
|
+
sensor_config.quality_link_sensors = link_quality_sensors
|
|
591
|
+
sensor_config.valve_state_sensors = valve_state_sensors
|
|
592
|
+
sensor_config.pump_state_sensors = pump_state_sensors
|
|
593
|
+
sensor_config.tank_volume_sensors = tank_volume_sensors
|
|
594
|
+
sensor_config.bulk_species_node_sensors = bulk_species_node_sensors
|
|
595
|
+
sensor_config.bulk_species_link_sensors = bulk_species_link_sensors
|
|
596
|
+
sensor_config.surface_species_sensors = surface_species_sensors
|
|
603
597
|
|
|
604
598
|
# Create final scenario configuration
|
|
605
599
|
return ScenarioConfig(f_inp_in=f_inp_in, f_msx_in=f_msx_in, general_params=general_params,
|