epyt-flow 0.10.0__py3-none-any.whl → 0.12.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/VERSION +1 -1
- epyt_flow/data/benchmarks/gecco_water_quality.py +2 -2
- epyt_flow/data/benchmarks/leakdb.py +40 -5
- epyt_flow/data/benchmarks/water_usage.py +4 -3
- epyt_flow/data/networks.py +27 -14
- epyt_flow/gym/__init__.py +0 -3
- epyt_flow/gym/scenario_control_env.py +11 -13
- epyt_flow/rest_api/scenario/control_handlers.py +118 -0
- epyt_flow/rest_api/scenario/event_handlers.py +114 -1
- epyt_flow/rest_api/scenario/handlers.py +33 -0
- epyt_flow/rest_api/server.py +14 -2
- epyt_flow/serialization.py +1 -0
- epyt_flow/simulation/__init__.py +0 -1
- epyt_flow/simulation/backend/__init__.py +1 -0
- epyt_flow/simulation/backend/my_epyt.py +1056 -0
- epyt_flow/simulation/events/actuator_events.py +7 -1
- epyt_flow/simulation/events/quality_events.py +3 -1
- epyt_flow/simulation/scada/scada_data.py +716 -5
- epyt_flow/simulation/scenario_config.py +1 -40
- epyt_flow/simulation/scenario_simulator.py +645 -119
- epyt_flow/simulation/sensor_config.py +18 -2
- epyt_flow/topology.py +24 -7
- epyt_flow/uncertainty/model_uncertainty.py +80 -62
- epyt_flow/uncertainty/sensor_noise.py +15 -4
- epyt_flow/uncertainty/uncertainties.py +71 -18
- epyt_flow/uncertainty/utils.py +40 -13
- epyt_flow/utils.py +45 -1
- epyt_flow/visualization/__init__.py +2 -0
- epyt_flow/visualization/scenario_visualizer.py +1240 -0
- epyt_flow/visualization/visualization_utils.py +738 -0
- {epyt_flow-0.10.0.dist-info → epyt_flow-0.12.0.dist-info}/METADATA +15 -4
- {epyt_flow-0.10.0.dist-info → epyt_flow-0.12.0.dist-info}/RECORD +35 -36
- {epyt_flow-0.10.0.dist-info → epyt_flow-0.12.0.dist-info}/WHEEL +1 -1
- epyt_flow/gym/control_gyms.py +0 -47
- epyt_flow/metrics.py +0 -466
- epyt_flow/models/__init__.py +0 -2
- epyt_flow/models/event_detector.py +0 -31
- epyt_flow/models/sensor_interpolation_detector.py +0 -118
- epyt_flow/simulation/scada/advanced_control.py +0 -138
- epyt_flow/simulation/scenario_visualizer.py +0 -1307
- {epyt_flow-0.10.0.dist-info → epyt_flow-0.12.0.dist-info/licenses}/LICENSE +0 -0
- {epyt_flow-0.10.0.dist-info → epyt_flow-0.12.0.dist-info}/top_level.txt +0 -0
|
@@ -3,7 +3,6 @@ Module provides a class for specifying scenario configurations.
|
|
|
3
3
|
"""
|
|
4
4
|
from typing import Any
|
|
5
5
|
from copy import deepcopy
|
|
6
|
-
import warnings
|
|
7
6
|
import os
|
|
8
7
|
import json
|
|
9
8
|
from pathlib import Path
|
|
@@ -91,8 +90,6 @@ class ScenarioConfig(Serializable):
|
|
|
91
90
|
def __init__(self, scenario_config: Any = None, f_inp_in: str = None, f_msx_in: str = None,
|
|
92
91
|
general_params: dict = None, sensor_config: SensorConfig = None,
|
|
93
92
|
memory_consumption_estimate: float = None,
|
|
94
|
-
controls: list = None,
|
|
95
|
-
advanced_controls: list = None,
|
|
96
93
|
custom_controls: list[CustomControlModule] = [],
|
|
97
94
|
simple_controls: list[SimpleControlModule] = [],
|
|
98
95
|
complex_controls: list[ComplexControlModule] = [],
|
|
@@ -100,13 +97,6 @@ class ScenarioConfig(Serializable):
|
|
|
100
97
|
model_uncertainty: ModelUncertainty = None,
|
|
101
98
|
system_events: list[SystemEvent] = [],
|
|
102
99
|
sensor_reading_events: list[SensorReadingEvent] = [], **kwds):
|
|
103
|
-
if controls is not None:
|
|
104
|
-
warnings.warn("'controls' is deprecated and will be removed in future releases")
|
|
105
|
-
advanced_controls = controls
|
|
106
|
-
if advanced_controls is not None:
|
|
107
|
-
warnings.warn("'advanced_controls' is deprecated and will be removed in " +
|
|
108
|
-
"future releases -- use 'custom_controls' instead")
|
|
109
|
-
|
|
110
100
|
if f_inp_in is None and scenario_config is None:
|
|
111
101
|
raise ValueError("Either 'f_inp_in' or 'scenario_config' must be given")
|
|
112
102
|
if scenario_config is not None:
|
|
@@ -135,16 +125,6 @@ class ScenarioConfig(Serializable):
|
|
|
135
125
|
if not isinstance(memory_consumption_estimate, float) or \
|
|
136
126
|
memory_consumption_estimate <= 0:
|
|
137
127
|
raise ValueError("'memory_consumption_estimate' must be a positive integer")
|
|
138
|
-
if advanced_controls is not None:
|
|
139
|
-
if not isinstance(advanced_controls, list):
|
|
140
|
-
raise TypeError("'advanced_controls' must be an instance of " +
|
|
141
|
-
"'list[epyt_flow.simulation.scada.AdvancedControlModule]' but no of " +
|
|
142
|
-
f"'{type(advanced_controls)}'")
|
|
143
|
-
|
|
144
|
-
from .scada.advanced_control import AdvancedControlModule
|
|
145
|
-
if any(not isinstance(c, AdvancedControlModule) for c in advanced_controls):
|
|
146
|
-
raise TypeError("Each item in 'advanced_controls' must be an instance of " +
|
|
147
|
-
"'epyt_flow.simulation.scada.AdvancedControlModule'")
|
|
148
128
|
if len(custom_controls) != 0:
|
|
149
129
|
if any(not isinstance(c, CustomControlModule) for c in custom_controls):
|
|
150
130
|
raise TypeError("Each item in 'custom_controls' must be an instance of " +
|
|
@@ -207,11 +187,6 @@ class ScenarioConfig(Serializable):
|
|
|
207
187
|
else:
|
|
208
188
|
self.__memory_consumption_estimate = memory_consumption_estimate
|
|
209
189
|
|
|
210
|
-
self.__advanced_controls = advanced_controls
|
|
211
|
-
if advanced_controls is not None:
|
|
212
|
-
if len(advanced_controls) == 0:
|
|
213
|
-
self.__advanced_controls = scenario_config.advanced_controls
|
|
214
|
-
|
|
215
190
|
if len(custom_controls) == 0:
|
|
216
191
|
self.__custom_controls = scenario_config.custom_controls
|
|
217
192
|
else:
|
|
@@ -252,7 +227,6 @@ class ScenarioConfig(Serializable):
|
|
|
252
227
|
self.__general_params = general_params
|
|
253
228
|
self.__sensor_config = sensor_config
|
|
254
229
|
self.__memory_consumption_estimate = memory_consumption_estimate
|
|
255
|
-
self.__advanced_controls = advanced_controls
|
|
256
230
|
self.__custom_controls = custom_controls
|
|
257
231
|
self.__simple_controls = simple_controls
|
|
258
232
|
self.__complex_controls = complex_controls
|
|
@@ -341,18 +315,6 @@ class ScenarioConfig(Serializable):
|
|
|
341
315
|
"""
|
|
342
316
|
return self.__memory_consumption_estimate
|
|
343
317
|
|
|
344
|
-
@property
|
|
345
|
-
def advanced_controls(self) -> list:
|
|
346
|
-
"""
|
|
347
|
-
Gets the list of all (advanced) control modules that are active during the simulation.
|
|
348
|
-
|
|
349
|
-
Returns
|
|
350
|
-
-------
|
|
351
|
-
list[:class:`~epyt_flow.simulation.scada.advanced_control.AdvancedControlModule`]
|
|
352
|
-
List of all control modules that are active during the simulation.
|
|
353
|
-
"""
|
|
354
|
-
return deepcopy(self.__advanced_controls)
|
|
355
|
-
|
|
356
318
|
@property
|
|
357
319
|
def custom_controls(self) -> list[CustomControlModule]:
|
|
358
320
|
"""
|
|
@@ -462,7 +424,6 @@ class ScenarioConfig(Serializable):
|
|
|
462
424
|
and self.__general_params == other.general_params \
|
|
463
425
|
and self.__memory_consumption_estimate == other.memory_consumption_estimate \
|
|
464
426
|
and self.__sensor_config == other.sensor_config \
|
|
465
|
-
and np.all(self.__advanced_controls == other.advanced_controls) \
|
|
466
427
|
and np.all(self.__custom_controls == other.custom_controls) \
|
|
467
428
|
and np.all(self.__simple_controls == other.simple_controls) \
|
|
468
429
|
and np.all(self.__complex_controls == other.complex_controls) \
|
|
@@ -474,7 +435,7 @@ class ScenarioConfig(Serializable):
|
|
|
474
435
|
return f"f_inp_in: {self.f_inp_in} f_msx_in: {self.f_msx_in} " + \
|
|
475
436
|
f"general_params: {self.general_params} sensor_config: {self.sensor_config} " + \
|
|
476
437
|
f"memory_consumption_estimate: {self.memory_consumption_estimate} " + \
|
|
477
|
-
f"
|
|
438
|
+
f"simple_controls: {self.simple_controls} " + \
|
|
478
439
|
f"complex_controls: {self.__complex_controls} " + \
|
|
479
440
|
f"custom_controls: {self.__custom_controls}" + \
|
|
480
441
|
f"sensor_noise: {self.sensor_noise} model_uncertainty: {self.model_uncertainty} " + \
|