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.
Files changed (42) hide show
  1. epyt_flow/VERSION +1 -1
  2. epyt_flow/data/benchmarks/gecco_water_quality.py +2 -2
  3. epyt_flow/data/benchmarks/leakdb.py +40 -5
  4. epyt_flow/data/benchmarks/water_usage.py +4 -3
  5. epyt_flow/data/networks.py +27 -14
  6. epyt_flow/gym/__init__.py +0 -3
  7. epyt_flow/gym/scenario_control_env.py +11 -13
  8. epyt_flow/rest_api/scenario/control_handlers.py +118 -0
  9. epyt_flow/rest_api/scenario/event_handlers.py +114 -1
  10. epyt_flow/rest_api/scenario/handlers.py +33 -0
  11. epyt_flow/rest_api/server.py +14 -2
  12. epyt_flow/serialization.py +1 -0
  13. epyt_flow/simulation/__init__.py +0 -1
  14. epyt_flow/simulation/backend/__init__.py +1 -0
  15. epyt_flow/simulation/backend/my_epyt.py +1056 -0
  16. epyt_flow/simulation/events/actuator_events.py +7 -1
  17. epyt_flow/simulation/events/quality_events.py +3 -1
  18. epyt_flow/simulation/scada/scada_data.py +716 -5
  19. epyt_flow/simulation/scenario_config.py +1 -40
  20. epyt_flow/simulation/scenario_simulator.py +645 -119
  21. epyt_flow/simulation/sensor_config.py +18 -2
  22. epyt_flow/topology.py +24 -7
  23. epyt_flow/uncertainty/model_uncertainty.py +80 -62
  24. epyt_flow/uncertainty/sensor_noise.py +15 -4
  25. epyt_flow/uncertainty/uncertainties.py +71 -18
  26. epyt_flow/uncertainty/utils.py +40 -13
  27. epyt_flow/utils.py +45 -1
  28. epyt_flow/visualization/__init__.py +2 -0
  29. epyt_flow/visualization/scenario_visualizer.py +1240 -0
  30. epyt_flow/visualization/visualization_utils.py +738 -0
  31. {epyt_flow-0.10.0.dist-info → epyt_flow-0.12.0.dist-info}/METADATA +15 -4
  32. {epyt_flow-0.10.0.dist-info → epyt_flow-0.12.0.dist-info}/RECORD +35 -36
  33. {epyt_flow-0.10.0.dist-info → epyt_flow-0.12.0.dist-info}/WHEEL +1 -1
  34. epyt_flow/gym/control_gyms.py +0 -47
  35. epyt_flow/metrics.py +0 -466
  36. epyt_flow/models/__init__.py +0 -2
  37. epyt_flow/models/event_detector.py +0 -31
  38. epyt_flow/models/sensor_interpolation_detector.py +0 -118
  39. epyt_flow/simulation/scada/advanced_control.py +0 -138
  40. epyt_flow/simulation/scenario_visualizer.py +0 -1307
  41. {epyt_flow-0.10.0.dist-info → epyt_flow-0.12.0.dist-info/licenses}/LICENSE +0 -0
  42. {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
- self._epanet_api.setLinkStatus(pump_link_idx, self.__pump_state)
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 SpeciedInjectionEvent -- " +
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: