epyt-flow 0.12.0__tar.gz → 0.13.1__tar.gz

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 (153) hide show
  1. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/PKG-INFO +1 -1
  2. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxtoolkit.c +1 -1
  3. epyt_flow-0.13.1/epyt_flow/VERSION +1 -0
  4. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/gym/scenario_control_env.py +2 -2
  5. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/scenario_simulator.py +37 -28
  6. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/uncertainty/sensor_noise.py +2 -9
  7. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow.egg-info/PKG-INFO +1 -1
  8. epyt_flow-0.12.0/epyt_flow/VERSION +0 -1
  9. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/CITATION.cff +0 -0
  10. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/CODE_OF_CONDUCT.md +0 -0
  11. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/LICENSE +0 -0
  12. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/MANIFEST.in +0 -0
  13. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/README.md +0 -0
  14. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/REQUIREMENTS.txt +0 -0
  15. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/AUTHORS +0 -0
  16. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/LICENSE +0 -0
  17. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/Readme_SRC_Engines.txt +0 -0
  18. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/enumstxt.h +0 -0
  19. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/epanet.c +0 -0
  20. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/epanet2.c +0 -0
  21. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/epanet2.def +0 -0
  22. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/errors.dat +0 -0
  23. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/funcs.h +0 -0
  24. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/genmmd.c +0 -0
  25. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/hash.c +0 -0
  26. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/hash.h +0 -0
  27. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/hydcoeffs.c +0 -0
  28. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/hydraul.c +0 -0
  29. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/hydsolver.c +0 -0
  30. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/hydstatus.c +0 -0
  31. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2.h +0 -0
  32. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_2.h +0 -0
  33. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_enums.h +0 -0
  34. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/inpfile.c +0 -0
  35. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/input1.c +0 -0
  36. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/input2.c +0 -0
  37. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/input3.c +0 -0
  38. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/main.c +0 -0
  39. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/mempool.c +0 -0
  40. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/mempool.h +0 -0
  41. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/output.c +0 -0
  42. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/project.c +0 -0
  43. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/quality.c +0 -0
  44. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/qualreact.c +0 -0
  45. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/qualroute.c +0 -0
  46. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/report.c +0 -0
  47. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/rules.c +0 -0
  48. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/smatrix.c +0 -0
  49. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/text.h +0 -0
  50. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET/SRC_engines/types.h +0 -0
  51. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/MSX_Updates.txt +0 -0
  52. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/dispersion.h +0 -0
  53. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/hash.c +0 -0
  54. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/hash.h +0 -0
  55. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx.h +0 -0
  56. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx_export.h +0 -0
  57. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.c +0 -0
  58. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.h +0 -0
  59. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/mempool.c +0 -0
  60. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/mempool.h +0 -0
  61. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxchem.c +0 -0
  62. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxcompiler.c +0 -0
  63. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxdict.h +0 -0
  64. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxdispersion.c +0 -0
  65. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxerr.c +0 -0
  66. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxfile.c +0 -0
  67. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.c +0 -0
  68. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.h +0 -0
  69. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxinp.c +0 -0
  70. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxout.c +0 -0
  71. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxproj.c +0 -0
  72. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxqual.c +0 -0
  73. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxrpt.c +0 -0
  74. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxtank.c +0 -0
  75. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxtypes.h +0 -0
  76. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxutils.c +0 -0
  77. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxutils.h +0 -0
  78. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/newton.c +0 -0
  79. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/newton.h +0 -0
  80. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/rk5.c +0 -0
  81. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/rk5.h +0 -0
  82. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/ros2.c +0 -0
  83. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/ros2.h +0 -0
  84. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/smatrix.c +0 -0
  85. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/Src/smatrix.h +0 -0
  86. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/EPANET-MSX/readme.txt +0 -0
  87. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/compile_linux.sh +0 -0
  88. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/EPANET/compile_macos.sh +0 -0
  89. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/__init__.py +0 -0
  90. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/data/__init__.py +0 -0
  91. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/data/benchmarks/__init__.py +0 -0
  92. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/data/benchmarks/batadal.py +0 -0
  93. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/data/benchmarks/batadal_data.py +0 -0
  94. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/data/benchmarks/battledim.py +0 -0
  95. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/data/benchmarks/battledim_data.py +0 -0
  96. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/data/benchmarks/gecco_water_quality.py +0 -0
  97. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/data/benchmarks/leakdb.py +0 -0
  98. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/data/benchmarks/leakdb_data.py +0 -0
  99. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/data/benchmarks/water_usage.py +0 -0
  100. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/data/networks.py +0 -0
  101. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/gym/__init__.py +0 -0
  102. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/__init__.py +0 -0
  103. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/base_handler.py +0 -0
  104. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/res_manager.py +0 -0
  105. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/scada_data/__init__.py +0 -0
  106. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/scada_data/data_handlers.py +0 -0
  107. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/scada_data/export_handlers.py +0 -0
  108. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/scada_data/handlers.py +0 -0
  109. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/scenario/__init__.py +0 -0
  110. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/scenario/control_handlers.py +0 -0
  111. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/scenario/event_handlers.py +0 -0
  112. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/scenario/handlers.py +0 -0
  113. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/scenario/simulation_handlers.py +0 -0
  114. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/scenario/uncertainty_handlers.py +0 -0
  115. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/rest_api/server.py +0 -0
  116. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/serialization.py +0 -0
  117. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/__init__.py +0 -0
  118. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/backend/__init__.py +0 -0
  119. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/backend/my_epyt.py +0 -0
  120. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/events/__init__.py +0 -0
  121. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/events/actuator_events.py +0 -0
  122. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/events/event.py +0 -0
  123. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/events/leakages.py +0 -0
  124. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/events/quality_events.py +0 -0
  125. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/events/sensor_faults.py +0 -0
  126. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/events/sensor_reading_attack.py +0 -0
  127. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/events/sensor_reading_event.py +0 -0
  128. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/events/system_event.py +0 -0
  129. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/parallel_simulation.py +0 -0
  130. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/scada/__init__.py +0 -0
  131. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/scada/complex_control.py +0 -0
  132. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/scada/custom_control.py +0 -0
  133. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/scada/scada_data.py +0 -0
  134. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/scada/scada_data_export.py +0 -0
  135. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/scada/simple_control.py +0 -0
  136. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/scenario_config.py +0 -0
  137. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/simulation/sensor_config.py +0 -0
  138. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/topology.py +0 -0
  139. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/uncertainty/__init__.py +0 -0
  140. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/uncertainty/model_uncertainty.py +0 -0
  141. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/uncertainty/uncertainties.py +0 -0
  142. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/uncertainty/utils.py +0 -0
  143. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/utils.py +0 -0
  144. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/visualization/__init__.py +0 -0
  145. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/visualization/scenario_visualizer.py +0 -0
  146. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow/visualization/visualization_utils.py +0 -0
  147. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow.egg-info/SOURCES.txt +0 -0
  148. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow.egg-info/dependency_links.txt +0 -0
  149. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow.egg-info/requires.txt +0 -0
  150. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/epyt_flow.egg-info/top_level.txt +0 -0
  151. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/pyproject.toml +0 -0
  152. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/setup.cfg +0 -0
  153. {epyt_flow-0.12.0 → epyt_flow-0.13.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: epyt-flow
3
- Version: 0.12.0
3
+ Version: 0.13.1
4
4
  Summary: EPyT-Flow -- EPANET Python Toolkit - Flow
5
5
  Author-email: André Artelt <aartelt@techfak.uni-bielefeld.de>, "Marios S. Kyriakou" <kiriakou.marios@ucy.ac.cy>, "Stelios G. Vrachimis" <vrachimis.stelios@ucy.ac.cy>
6
6
  License-Expression: MIT
@@ -203,7 +203,7 @@ int MSXDLLEXPORT MSXusehydfile(char *fname)
203
203
  // --- read length of simulation period covered by file
204
204
 
205
205
  fread(&n, sizeof(INT4), 1, MSX.HydFile.file);
206
- MSX.Dur = 1000 * n;
206
+ MSX.Dur = INT64_C(1000) * n;
207
207
  MSX.HydOffset = ftell(MSX.HydFile.file);
208
208
  return 0;
209
209
  }
@@ -0,0 +1 @@
1
+ 0.13.1
@@ -131,7 +131,7 @@ class ScenarioControlEnv(ABC):
131
131
  def _next_sim_itr(self) -> Union[tuple[ScadaData, bool], ScadaData]:
132
132
  try:
133
133
  next(self._sim_generator)
134
- scada_data = self._sim_generator.send(False)
134
+ scada_data, terminated = self._sim_generator.send(False)
135
135
 
136
136
  if self._scenario_sim.f_msx_in is not None:
137
137
  cur_time = int(scada_data.sensor_readings_time[0])
@@ -142,7 +142,7 @@ class ScenarioControlEnv(ABC):
142
142
  if self.autoreset is True:
143
143
  return scada_data
144
144
  else:
145
- return scada_data, False
145
+ return scada_data, terminated
146
146
  except StopIteration:
147
147
  if self.__autoreset is True:
148
148
  return self.reset()
@@ -1999,12 +1999,12 @@ class ScenarioSimulator():
1999
1999
  result = None
2000
2000
 
2001
2001
  gen = self.run_advanced_quality_simulation_as_generator
2002
- for scada_data in gen(hyd_file_in=hyd_file_in,
2003
- verbose=verbose,
2004
- return_as_dict=True,
2005
- frozen_sensor_config=frozen_sensor_config,
2006
- use_quality_time_step_as_reporting_time_step=
2007
- use_quality_time_step_as_reporting_time_step):
2002
+ for scada_data, _ in gen(hyd_file_in=hyd_file_in,
2003
+ verbose=verbose,
2004
+ return_as_dict=True,
2005
+ frozen_sensor_config=frozen_sensor_config,
2006
+ use_quality_time_step_as_reporting_time_step=
2007
+ use_quality_time_step_as_reporting_time_step):
2008
2008
  if result is None:
2009
2009
  result = {}
2010
2010
  for data_type, data in scada_data.items():
@@ -2032,7 +2032,7 @@ class ScenarioSimulator():
2032
2032
  return_as_dict: bool = False,
2033
2033
  frozen_sensor_config: bool = False,
2034
2034
  use_quality_time_step_as_reporting_time_step: bool = False,
2035
- ) -> Generator[Union[ScadaData, dict], bool, None]:
2035
+ ) -> Generator[Union[tuple[ScadaData, bool], tuple[dict, bool]], bool, None]:
2036
2036
  """
2037
2037
  Runs an advanced quality analysis using EPANET-MSX.
2038
2038
 
@@ -2066,7 +2066,7 @@ class ScenarioSimulator():
2066
2066
  -------
2067
2067
  :class:`~epyt_flow.simulation.scada.scada_data.ScadaData`
2068
2068
  Generator containing the current EPANET-MSX simulation results as SCADA data
2069
- (i.e. species concentrations).
2069
+ (i.e. species concentrations) and a boolean indicating whether the simulation terminated or not.
2070
2070
  """
2071
2071
  if self.__running_simulation is True:
2072
2072
  raise RuntimeError("A simulation is already running.")
@@ -2175,13 +2175,16 @@ class ScenarioSimulator():
2175
2175
  data = {"bulk_species_node_concentration_raw": bulk_species_node_concentrations,
2176
2176
  "bulk_species_link_concentration_raw": bulk_species_link_concentrations,
2177
2177
  "surface_species_concentration_raw": surface_species_concentrations,
2178
- "sensor_readings_time": np.array([0])}
2178
+ "sensor_readings_time": np.array([0]),
2179
+ "warnings_code": np.array([0]) # TODO: Replace with MSX error
2180
+ }
2179
2181
  else:
2180
2182
  data = ScadaData(network_topo=network_topo, sensor_config=self._sensor_config,
2181
2183
  bulk_species_node_concentration_raw=bulk_species_node_concentrations,
2182
2184
  bulk_species_link_concentration_raw=bulk_species_link_concentrations,
2183
2185
  surface_species_concentration_raw=surface_species_concentrations,
2184
2186
  sensor_readings_time=np.array([0]),
2187
+ warnings_code=np.array([0]), # TODO: Replace with MSX error
2185
2188
  sensor_reading_events=self._sensor_reading_events,
2186
2189
  sensor_noise=self._sensor_noise,
2187
2190
  frozen_sensor_config=frozen_sensor_config)
@@ -2191,7 +2194,7 @@ class ScenarioSimulator():
2191
2194
  if abort is True:
2192
2195
  return None
2193
2196
 
2194
- yield data
2197
+ yield (data, False)
2195
2198
 
2196
2199
  # Run step-by-step simulation
2197
2200
  tleft = 1
@@ -2219,7 +2222,9 @@ class ScenarioSimulator():
2219
2222
  "bulk_species_link_concentration_raw":
2220
2223
  bulk_species_link_concentrations,
2221
2224
  "surface_species_concentration_raw": surface_species_concentrations,
2222
- "sensor_readings_time": np.array([total_time])}
2225
+ "sensor_readings_time": np.array([total_time]),
2226
+ "warnings_code": np.array([0]), # TODO: Replace with MSX error
2227
+ }
2223
2228
  else:
2224
2229
  data = ScadaData(network_topo=network_topo,
2225
2230
  sensor_config=self._sensor_config,
@@ -2230,6 +2235,7 @@ class ScenarioSimulator():
2230
2235
  surface_species_concentration_raw=
2231
2236
  surface_species_concentrations,
2232
2237
  sensor_readings_time=np.array([total_time]),
2238
+ warnings_code=np.array([0]), # TODO: Replace with MSX error
2233
2239
  sensor_reading_events=self._sensor_reading_events,
2234
2240
  sensor_noise=self._sensor_noise,
2235
2241
  frozen_sensor_config=frozen_sensor_config)
@@ -2239,7 +2245,7 @@ class ScenarioSimulator():
2239
2245
  if abort is not False:
2240
2246
  break
2241
2247
 
2242
- yield data
2248
+ yield (data, tleft <= 0)
2243
2249
 
2244
2250
  self.__running_simulation = False
2245
2251
 
@@ -2284,12 +2290,12 @@ class ScenarioSimulator():
2284
2290
 
2285
2291
  # Run simulation step-by-step
2286
2292
  gen = self.run_basic_quality_simulation_as_generator
2287
- for scada_data in gen(hyd_file_in=hyd_file_in,
2288
- verbose=verbose,
2289
- return_as_dict=True,
2290
- frozen_sensor_config=frozen_sensor_config,
2291
- use_quality_time_step_as_reporting_time_step=
2292
- use_quality_time_step_as_reporting_time_step):
2293
+ for scada_data, _ in gen(hyd_file_in=hyd_file_in,
2294
+ verbose=verbose,
2295
+ return_as_dict=True,
2296
+ frozen_sensor_config=frozen_sensor_config,
2297
+ use_quality_time_step_as_reporting_time_step=
2298
+ use_quality_time_step_as_reporting_time_step):
2293
2299
  if result is None:
2294
2300
  result = {}
2295
2301
  for data_type, data in scada_data.items():
@@ -2314,7 +2320,7 @@ class ScenarioSimulator():
2314
2320
  return_as_dict: bool = False,
2315
2321
  frozen_sensor_config: bool = False,
2316
2322
  use_quality_time_step_as_reporting_time_step: bool = False
2317
- ) -> Generator[Union[ScadaData, dict], bool, None]:
2323
+ ) -> Generator[Union[tuple[ScadaData, bool], tuple[dict, bool]], bool, None]:
2318
2324
  """
2319
2325
  Runs a basic quality analysis using EPANET.
2320
2326
 
@@ -2349,11 +2355,13 @@ class ScenarioSimulator():
2349
2355
  Returns
2350
2356
  -------
2351
2357
  :class:`~epyt_flow.simulation.scada.scada_data.ScadaData`
2352
- Generator with the current simulation results/states as SCADA data.
2358
+ Generator with the current simulation results/states as SCADA data and a
2359
+ boolean indicating whether the simulation terminated or not.
2353
2360
  """
2354
2361
  if self.__running_simulation is True:
2355
2362
  raise RuntimeError("A simulation is already running.")
2356
2363
 
2364
+ requested_total_time = self.epanet_api.getTimeSimulationDuration()
2357
2365
  requested_time_step = self.epanet_api.getTimeHydraulicStep()
2358
2366
  reporting_time_start = self.epanet_api.getTimeReportingStart()
2359
2367
  reporting_time_step = self.epanet_api.getTimeReportingStep()
@@ -2424,7 +2432,7 @@ class ScenarioSimulator():
2424
2432
  if abort is True:
2425
2433
  break
2426
2434
 
2427
- yield data
2435
+ yield (data, total_time >= requested_total_time)
2428
2436
 
2429
2437
  # Next
2430
2438
  tstep = self.epanet_api.api.ENstepQ()
@@ -2471,10 +2479,10 @@ class ScenarioSimulator():
2471
2479
 
2472
2480
  # Run hydraulic simulation step-by-step
2473
2481
  gen = self.run_hydraulic_simulation_as_generator
2474
- for scada_data in gen(hyd_export=hyd_export,
2475
- verbose=verbose,
2476
- return_as_dict=True,
2477
- frozen_sensor_config=frozen_sensor_config):
2482
+ for scada_data, _ in gen(hyd_export=hyd_export,
2483
+ verbose=verbose,
2484
+ return_as_dict=True,
2485
+ frozen_sensor_config=frozen_sensor_config):
2478
2486
  if result is None:
2479
2487
  result = {}
2480
2488
  for data_type, data in scada_data.items():
@@ -2499,7 +2507,7 @@ class ScenarioSimulator():
2499
2507
  support_abort: bool = False,
2500
2508
  return_as_dict: bool = False,
2501
2509
  frozen_sensor_config: bool = False,
2502
- ) -> Generator[Union[ScadaData, dict], bool, None]:
2510
+ ) -> Generator[Union[tuple[ScadaData, bool], tuple[dict, bool]], bool, None]:
2503
2511
  """
2504
2512
  Runs the hydraulic simulation of this scenario (incl. basic quality if set) and
2505
2513
  provides the results as a generator.
@@ -2540,7 +2548,7 @@ class ScenarioSimulator():
2540
2548
  -------
2541
2549
  :class:`~epyt_flow.simulation.scada.scada_data.ScadaData`
2542
2550
  Generator with the current simulation results/states as SCADA data
2543
- (i.e. sensor readings).
2551
+ (i.e. sensor readings) and a boolean indicating whether the simulation terminated or not.
2544
2552
  """
2545
2553
  if self.__running_simulation is True:
2546
2554
  raise RuntimeError("A simulation is already running.")
@@ -2556,6 +2564,7 @@ class ScenarioSimulator():
2556
2564
  self.epanet_api.initializeHydraulicAnalysis(ToolkitConstants.EN_SAVE)
2557
2565
  self.epanet_api.initializeQualityAnalysis(ToolkitConstants.EN_SAVE)
2558
2566
 
2567
+ requested_total_time = self.epanet_api.getTimeSimulationDuration()
2559
2568
  requested_time_step = self.epanet_api.getTimeHydraulicStep()
2560
2569
  reporting_time_start = self.epanet_api.getTimeReportingStart()
2561
2570
  reporting_time_step = self.epanet_api.getTimeReportingStep()
@@ -2655,7 +2664,7 @@ class ScenarioSimulator():
2655
2664
  if abort is True:
2656
2665
  break
2657
2666
 
2658
- yield data
2667
+ yield (data, total_time >= requested_total_time)
2659
2668
 
2660
2669
  # Apply control modules
2661
2670
  for control in self._custom_controls:
@@ -3,7 +3,6 @@ Module provides a class for implementing sensor noise (e.g. uncertainty in senso
3
3
  """
4
4
  from typing import Optional, Callable
5
5
  from copy import deepcopy
6
- import warnings
7
6
  import numpy
8
7
  from numpy.random import default_rng
9
8
 
@@ -32,18 +31,12 @@ class SensorNoise(JsonSerializable):
32
31
 
33
32
  The default is None.
34
33
  """
35
- def __init__(self, uncertainty: Optional[Uncertainty] = None,
36
- global_uncertainty: Optional[Uncertainty] = None,
34
+ def __init__(self, global_uncertainty: Optional[Uncertainty] = None,
37
35
  local_uncertainties: Optional[dict[int, str, Uncertainty]] = None,
38
36
  seed: Optional[int] = None,
39
37
  **kwds):
40
- if uncertainty is not None:
41
- global_uncertainty = uncertainty
42
- warnings.warn("'uncertainty' is deprecated and will be removed in future releases. " +
43
- "Use 'global_uncertainty' instead")
44
-
45
38
  if not isinstance(global_uncertainty, Uncertainty):
46
- raise TypeError("'uncertainty' must be an instance of " +
39
+ raise TypeError("'global_uncertainty' must be an instance of " +
47
40
  "'epyt_flow.uncertainty.Uncertainty' but not of " +
48
41
  f"'{type(global_uncertainty)}'")
49
42
  if local_uncertainties is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: epyt-flow
3
- Version: 0.12.0
3
+ Version: 0.13.1
4
4
  Summary: EPyT-Flow -- EPANET Python Toolkit - Flow
5
5
  Author-email: André Artelt <aartelt@techfak.uni-bielefeld.de>, "Marios S. Kyriakou" <kiriakou.marios@ucy.ac.cy>, "Stelios G. Vrachimis" <vrachimis.stelios@ucy.ac.cy>
6
6
  License-Expression: MIT
@@ -1 +0,0 @@
1
- 0.12.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes