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
|
@@ -134,7 +134,13 @@ class PumpStateEvent(PumpEvent, JsonSerializable):
|
|
|
134
134
|
def apply(self, cur_time: int) -> None:
|
|
135
135
|
pump_idx = self._epanet_api.getLinkPumpNameID().index(self.pump_id) + 1
|
|
136
136
|
pump_link_idx = self._epanet_api.getLinkPumpIndex(pump_idx)
|
|
137
|
-
|
|
137
|
+
|
|
138
|
+
pattern_idx = self._epanet_api.getLinkPumpPatternIndex(pump_idx)
|
|
139
|
+
if pattern_idx != 0:
|
|
140
|
+
warnings.warn(f"Can not set pump state of pump {self.pump_id} " +
|
|
141
|
+
"because a pump pattern exists")
|
|
142
|
+
else:
|
|
143
|
+
self._epanet_api.setLinkStatus(pump_link_idx, self.__pump_state)
|
|
138
144
|
|
|
139
145
|
|
|
140
146
|
@serializable(PUMP_SPEED_EVENT_ID, ".epytflow_pump_speed_event")
|
|
@@ -27,6 +27,8 @@ class SpeciesInjectionEvent(SystemEvent, JsonSerializable):
|
|
|
27
27
|
profile : `numpy.ndarray <https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html>`_
|
|
28
28
|
Injection strength profile -- i.e. every entry corresponds to the strength of the injection
|
|
29
29
|
at a point in time. Pattern will repeat if it is shorter than the total injection time.
|
|
30
|
+
|
|
31
|
+
Note that the pattern time step is equivalent to the EPANET pattern time step.
|
|
30
32
|
source_type : `int`
|
|
31
33
|
Type of the bulk species injection source -- must be one of
|
|
32
34
|
the following EPANET toolkit constants:
|
|
@@ -198,7 +200,7 @@ class SpeciesInjectionEvent(SystemEvent, JsonSerializable):
|
|
|
198
200
|
pattern_id)
|
|
199
201
|
|
|
200
202
|
def cleanup(self) -> None:
|
|
201
|
-
warnings.warn("Can not undo
|
|
203
|
+
warnings.warn("Can not undo SpeciesInjectionEvent -- " +
|
|
202
204
|
"EPANET-MSX does not support removing patterns")
|
|
203
205
|
|
|
204
206
|
def apply(self, cur_time: int) -> None:
|