epyt-flow 0.3.0__tar.gz → 0.5.0__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 (151) hide show
  1. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/PKG-INFO +2 -1
  2. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/REQUIREMENTS.txt +1 -0
  3. epyt_flow-0.5.0/epyt_flow/VERSION +1 -0
  4. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/data/benchmarks/leakdb.py +1 -1
  5. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/events/leakages.py +1 -1
  6. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/parallel_simulation.py +7 -7
  7. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/scada/scada_data.py +6 -0
  8. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/scada/scada_data_export.py +1 -1
  9. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/scenario_config.py +5 -3
  10. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/scenario_simulator.py +37 -13
  11. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/scenario_visualizer.py +1 -1
  12. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/sensor_config.py +37 -1
  13. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/topology.py +282 -10
  14. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/uncertainty/model_uncertainty.py +26 -19
  15. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/utils.py +26 -3
  16. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow.egg-info/PKG-INFO +2 -1
  17. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow.egg-info/requires.txt +1 -0
  18. epyt_flow-0.5.0/epyt_flow.egg-info/top_level.txt +12 -0
  19. epyt_flow-0.3.0/epyt_flow/VERSION +0 -1
  20. epyt_flow-0.3.0/epyt_flow.egg-info/top_level.txt +0 -6
  21. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/CITATION.cff +0 -0
  22. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/CODE_OF_CONDUCT.md +0 -0
  23. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/LICENSE +0 -0
  24. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/MANIFEST.in +0 -0
  25. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/README.md +0 -0
  26. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/AUTHORS +0 -0
  27. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/LICENSE +0 -0
  28. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/Readme_SRC_Engines.txt +0 -0
  29. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/enumstxt.h +0 -0
  30. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/epanet.c +0 -0
  31. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/epanet2.c +0 -0
  32. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/epanet2.def +0 -0
  33. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/errors.dat +0 -0
  34. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/funcs.h +0 -0
  35. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/genmmd.c +0 -0
  36. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/hash.c +0 -0
  37. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/hash.h +0 -0
  38. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/hydcoeffs.c +0 -0
  39. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/hydraul.c +0 -0
  40. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/hydsolver.c +0 -0
  41. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/hydstatus.c +0 -0
  42. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2.h +0 -0
  43. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_2.h +0 -0
  44. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_enums.h +0 -0
  45. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/inpfile.c +0 -0
  46. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/input1.c +0 -0
  47. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/input2.c +0 -0
  48. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/input3.c +0 -0
  49. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/main.c +0 -0
  50. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/mempool.c +0 -0
  51. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/mempool.h +0 -0
  52. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/output.c +0 -0
  53. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/project.c +0 -0
  54. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/quality.c +0 -0
  55. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/qualreact.c +0 -0
  56. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/qualroute.c +0 -0
  57. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/report.c +0 -0
  58. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/rules.c +0 -0
  59. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/smatrix.c +0 -0
  60. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/text.h +0 -0
  61. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET/SRC_engines/types.h +0 -0
  62. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/MSX_Updates.txt +0 -0
  63. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/dispersion.h +0 -0
  64. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/hash.c +0 -0
  65. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/hash.h +0 -0
  66. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx.h +0 -0
  67. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx_export.h +0 -0
  68. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.c +0 -0
  69. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.h +0 -0
  70. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/mempool.c +0 -0
  71. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/mempool.h +0 -0
  72. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxchem.c +0 -0
  73. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxcompiler.c +0 -0
  74. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxdict.h +0 -0
  75. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxdispersion.c +0 -0
  76. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxerr.c +0 -0
  77. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxfile.c +0 -0
  78. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.c +0 -0
  79. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.h +0 -0
  80. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxinp.c +0 -0
  81. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxout.c +0 -0
  82. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxproj.c +0 -0
  83. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxqual.c +0 -0
  84. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxrpt.c +0 -0
  85. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxtank.c +0 -0
  86. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxtoolkit.c +0 -0
  87. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxtypes.h +0 -0
  88. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxutils.c +0 -0
  89. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxutils.h +0 -0
  90. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/newton.c +0 -0
  91. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/newton.h +0 -0
  92. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/rk5.c +0 -0
  93. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/rk5.h +0 -0
  94. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/ros2.c +0 -0
  95. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/ros2.h +0 -0
  96. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/smatrix.c +0 -0
  97. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/Src/smatrix.h +0 -0
  98. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/EPANET-MSX/readme.txt +0 -0
  99. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/compile_linux.sh +0 -0
  100. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/EPANET/compile_macos.sh +0 -0
  101. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/__init__.py +0 -0
  102. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/data/__init__.py +0 -0
  103. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/data/benchmarks/__init__.py +0 -0
  104. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/data/benchmarks/batadal.py +0 -0
  105. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/data/benchmarks/batadal_data.py +0 -0
  106. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/data/benchmarks/battledim.py +0 -0
  107. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/data/benchmarks/battledim_data.py +0 -0
  108. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/data/benchmarks/gecco_water_quality.py +0 -0
  109. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/data/benchmarks/leakdb_data.py +0 -0
  110. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/data/benchmarks/water_usage.py +0 -0
  111. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/data/networks.py +0 -0
  112. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/gym/__init__.py +0 -0
  113. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/gym/control_gyms.py +0 -0
  114. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/gym/scenario_control_env.py +0 -0
  115. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/metrics.py +0 -0
  116. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/models/__init__.py +0 -0
  117. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/models/event_detector.py +0 -0
  118. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/models/sensor_interpolation_detector.py +0 -0
  119. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/__init__.py +0 -0
  120. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/base_handler.py +0 -0
  121. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/res_manager.py +0 -0
  122. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/scada_data/__init__.py +0 -0
  123. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/scada_data/data_handlers.py +0 -0
  124. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/scada_data/export_handlers.py +0 -0
  125. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/scada_data/handlers.py +0 -0
  126. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/scenario/__init__.py +0 -0
  127. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/scenario/event_handlers.py +0 -0
  128. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/scenario/handlers.py +0 -0
  129. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/scenario/simulation_handlers.py +0 -0
  130. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/scenario/uncertainty_handlers.py +0 -0
  131. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/rest_api/server.py +0 -0
  132. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/serialization.py +0 -0
  133. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/__init__.py +0 -0
  134. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/events/__init__.py +0 -0
  135. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/events/actuator_events.py +0 -0
  136. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/events/event.py +0 -0
  137. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/events/sensor_faults.py +0 -0
  138. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/events/sensor_reading_attack.py +0 -0
  139. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/events/sensor_reading_event.py +0 -0
  140. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/events/system_event.py +0 -0
  141. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/scada/__init__.py +0 -0
  142. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/simulation/scada/advanced_control.py +0 -0
  143. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/uncertainty/__init__.py +0 -0
  144. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/uncertainty/sensor_noise.py +0 -0
  145. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/uncertainty/uncertainties.py +0 -0
  146. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow/uncertainty/utils.py +0 -0
  147. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow.egg-info/SOURCES.txt +0 -0
  148. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/epyt_flow.egg-info/dependency_links.txt +0 -0
  149. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/pyproject.toml +0 -0
  150. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/setup.cfg +0 -0
  151. {epyt_flow-0.3.0 → epyt_flow-0.5.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: epyt-flow
3
- Version: 0.3.0
3
+ Version: 0.5.0
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: MIT License
@@ -30,6 +30,7 @@ Requires-Dist: tqdm>=4.66.2
30
30
  Requires-Dist: openpyxl>=3.1.2
31
31
  Requires-Dist: falcon>=3.1.3
32
32
  Requires-Dist: multiprocess>=0.70.16
33
+ Requires-Dist: geopandas>=0.14.4
33
34
  Requires-Dist: psutil
34
35
 
35
36
  [![pypi](https://img.shields.io/pypi/v/epyt-flow.svg)](https://pypi.org/project/epyt-flow/)
@@ -8,4 +8,5 @@ tqdm>=4.66.2
8
8
  openpyxl>=3.1.2
9
9
  falcon>=3.1.3
10
10
  multiprocess>=0.70.16
11
+ geopandas>=0.14.4
11
12
  psutil
@@ -0,0 +1 @@
1
+ 0.5.0
@@ -543,7 +543,7 @@ def load_scenarios(scenarios_id: list[int], use_net1: bool = True,
543
543
 
544
544
  my_uncertainties = {"pipe_length_uncertainty": MyUniformUncertainty(low=0, high=0.25),
545
545
  "pipe_roughness_uncertainty": MyUniformUncertainty(low=0, high=0.25),
546
- "demand_base_uncertainty": MyUniformUncertainty(low=0, high=0.25)}
546
+ "base_demand_uncertainty": MyUniformUncertainty(low=0, high=0.25)}
547
547
  model_uncertainty = ModelUncertainty(**my_uncertainties)
548
548
 
549
549
  # Create sensor config (place pressure and flow sensors everywhere)
@@ -182,7 +182,7 @@ class Leakage(SystemEvent, JsonSerializable):
182
182
  raise TypeError(f"Can not compare 'Leakage' instance with '{type(other)}' instance")
183
183
 
184
184
  return super().__eq__(other) and self.__link_id == other.link_id \
185
- and self.__diameter == other.diameter and self.__profile == other.profile \
185
+ and self.__diameter == other.diameter and np.all(self.__profile == other.profile) \
186
186
  and self.__node_id == other.node_id and self.area == other.area
187
187
 
188
188
  def __str__(self) -> str:
@@ -1,7 +1,7 @@
1
1
  """
2
2
  Module provides functions for simulating several scenarios in parallel.
3
3
  """
4
- from typing import Callable
4
+ from typing import Callable, Any
5
5
  import os
6
6
  import warnings
7
7
  from multiprocess import Pool, cpu_count
@@ -38,9 +38,9 @@ def callback_save_to_file(folder_out: str = "") -> Callable[[ScadaData, Scenario
38
38
 
39
39
 
40
40
  def _run_scenario_simulation(scenario_config: ScenarioConfig, scenario_idx: int,
41
- callback: Callable[[ScadaData, ScenarioConfig, int], None]) -> None:
41
+ callback: Callable[[ScadaData, ScenarioConfig, int], Any]) -> Any:
42
42
  with ScenarioSimulator(scenario_config=scenario_config) as sim:
43
- callback(sim.run_simulation(), scenario_config, scenario_idx)
43
+ return callback(sim.run_simulation(), scenario_config, scenario_idx)
44
44
 
45
45
 
46
46
  class ParallelScenarioSimulation():
@@ -50,8 +50,8 @@ class ParallelScenarioSimulation():
50
50
  @staticmethod
51
51
  def run(scenarios: list[ScenarioConfig], n_jobs: int = -1,
52
52
  max_working_memory_consumption: int = None,
53
- callback: Callable[[ScadaData, ScenarioConfig, int], None] = callback_save_to_file()
54
- ) -> None:
53
+ callback: Callable[[ScadaData, ScenarioConfig, int], Any] = callback_save_to_file()
54
+ ) -> Any:
55
55
  """
56
56
  Simulates multiple scenarios in parallel.
57
57
 
@@ -76,7 +76,7 @@ class ParallelScenarioSimulation():
76
76
 
77
77
  The callback gets the simulation results as a
78
78
  :class:`~epyt_flow.simulation.scada.scada_data.ScadaData` instance, the scenario
79
- configuration as a :class: `epyt_flow.simulation.scenario_config.ScenarioConfig`
79
+ configuration as a :class:`~epyt_flow.simulation.scenario_config.ScenarioConfig`
80
80
  instance, and the index of the scenario in 'scenarios' as arguments.
81
81
 
82
82
  The default is :func:`~epyt_flow.simulation.parallel_simulation.callback_save_to_file`.
@@ -144,4 +144,4 @@ class ParallelScenarioSimulation():
144
144
  scenarios_task.append((scenario, scenario_idx, callback))
145
145
 
146
146
  with Pool(processes=n_parallel_scenarios, maxtasksperchild=1) as pool:
147
- pool.starmap(_run_scenario_simulation, scenarios_task)
147
+ return pool.starmap(_run_scenario_simulation, scenarios_task)
@@ -1163,6 +1163,9 @@ class ScadaData(Serializable):
1163
1163
  :func:`~epyt_flow.simulation.scada.scada_data.ScadaData.get_data` --
1164
1164
  calling this function is the only way of accessing the energy usage of each pump.
1165
1165
 
1166
+ The odering in the returned NumPy array corresponds to the ordering
1167
+ of the pumps in EPANET.
1168
+
1166
1169
  Returns
1167
1170
  -------
1168
1171
  `numpy.ndarray`
@@ -1180,6 +1183,9 @@ class ScadaData(Serializable):
1180
1183
  :func:`~epyt_flow.simulation.scada.scada_data.ScadaData.get_data` --
1181
1184
  calling this function is the only way of accessing the pumps' efficiency.
1182
1185
 
1186
+ The odering in the returned NumPy array corresponds to the ordering
1187
+ of the pumps in EPANET.
1188
+
1183
1189
  Returns
1184
1190
  -------
1185
1191
  `numpy.ndarray`
@@ -109,7 +109,7 @@ class ScadaDataExport():
109
109
 
110
110
  def __get_sensor_unit(sensor_type):
111
111
  if sensor_type == "pressure":
112
- if is_flowunit_simetric(scada_data.sensor_config.flow_unit):
112
+ if not is_flowunit_simetric(scada_data.sensor_config.flow_unit):
113
113
  return "psi"
114
114
  else:
115
115
  return "meter"
@@ -4,6 +4,7 @@ Module provides a class for specifying scenario configurations.
4
4
  from typing import Any
5
5
  from copy import deepcopy
6
6
  import json
7
+ import numpy as np
7
8
 
8
9
  from ..uncertainty import AbsoluteGaussianUncertainty, RelativeGaussianUncertainty, \
9
10
  AbsoluteUniformUncertainty, RelativeUniformUncertainty, ModelUncertainty, \
@@ -350,10 +351,11 @@ class ScenarioConfig(Serializable):
350
351
  return self.__f_inp_in == other.f_inp_in and self.__f_msx_in == other.f_msx_in \
351
352
  and self.__general_params == other.general_params \
352
353
  and self.__memory_consumption_estimate == other.memory_consumption_estimate \
353
- and self.__sensor_config == other.sensor_config and self.__controls == other.controls \
354
+ and self.__sensor_config == other.sensor_config \
355
+ and np.all(self.__controls == other.controls) \
354
356
  and self.__model_uncertainty == other.model_uncertainty \
355
- and self.__system_events == other.system_events \
356
- and self.__sensor_reading_events == other.sensor_reading_events
357
+ and np.all(self.__system_events == other.system_events) \
358
+ and np.all(self.__sensor_reading_events == other.sensor_reading_events)
357
359
 
358
360
  def __str__(self) -> str:
359
361
  return f"f_inp_in: {self.f_inp_in} f_msx_in: {self.f_msx_in} " + \
@@ -298,6 +298,7 @@ class ScenarioSimulator():
298
298
 
299
299
  return deepcopy(list(filter(lambda e: isinstance(e, Leakage), self.__system_events)))
300
300
 
301
+ @property
301
302
  def actuator_events(self) -> list[ActuatorEvent]:
302
303
  """
303
304
  Gets all actuator events.
@@ -483,6 +484,7 @@ class ScenarioSimulator():
483
484
 
484
485
  if inp_file_path is not None:
485
486
  self.epanet_api.saveInputFile(inp_file_path)
487
+ self.__f_inp_in = inp_file_path
486
488
 
487
489
  if export_sensor_config is True:
488
490
  report_desc = "\n\n[REPORT]\n"
@@ -537,6 +539,7 @@ class ScenarioSimulator():
537
539
 
538
540
  if self.__f_msx_in is not None and msx_file_path is not None:
539
541
  self.epanet_api.saveMSXFile(msx_file_path)
542
+ self.__f_msx_in = msx_file_path
540
543
 
541
544
  if export_sensor_config is True:
542
545
  report_desc = "\n\n[REPORT]\n"
@@ -708,8 +711,9 @@ class ScenarioSimulator():
708
711
 
709
712
  general_params = {"hydraulic_time_step": self.get_hydraulic_time_step(),
710
713
  "quality_time_step": self.get_quality_time_step(),
714
+ "reporting_time_step": self.epanet_api.getTimeReportingStep(),
711
715
  "simulation_duration": self.get_simulation_duration(),
712
- "flow_units": self.get_flow_units(),
716
+ "flow_units_id": self.get_flow_units(),
713
717
  "quality_model": self.get_quality_model(),
714
718
  "demand_model": self.get_demand_model()}
715
719
 
@@ -766,6 +770,7 @@ class ScenarioSimulator():
766
770
  node_tank_names = self.epanet_api.getNodeTankNameID()
767
771
 
768
772
  links_id = self.epanet_api.getLinkNameID()
773
+ links_type = self.epanet_api.getLinkType()
769
774
  links_data = self.epanet_api.getNodesConnectingLinksID()
770
775
  links_diameter = self.epanet_api.getLinkDiameter()
771
776
  links_length = self.epanet_api.getLinkLength()
@@ -774,6 +779,11 @@ class ScenarioSimulator():
774
779
  links_wall_coeff = self.epanet_api.getLinkWallReactionCoeff()
775
780
  links_loss_coeff = self.epanet_api.getLinkMinorLossCoeff()
776
781
 
782
+ pumps_id = self.epanet_api.getLinkPumpNameID()
783
+ pumps_type = self.epanet_api.getLinkPumpType()
784
+
785
+ valves_id = self.epanet_api.getLinkValveNameID()
786
+
777
787
  # Build graph describing the topology
778
788
  nodes = []
779
789
  for node_id, node_elevation, node_type, node_coord in zip(nodes_id, nodes_elevation,
@@ -788,16 +798,30 @@ class ScenarioSimulator():
788
798
  nodes.append((node_id, node_info))
789
799
 
790
800
  links = []
791
- for link_id, link, diameter, length, roughness_coeff, bulk_coeff, wall_coeff, loss_coeff \
792
- in zip(links_id, links_data, links_diameter, links_length, links_roughness_coeff,
793
- links_bulk_coeff, links_wall_coeff, links_loss_coeff):
794
- links.append((link_id, link, {"diameter": diameter, "length": length,
795
- "roughness_coeff": roughness_coeff,
796
- "bulk_coeff": bulk_coeff, "wall_coeff": wall_coeff,
797
- "loss_coeff": loss_coeff}))
798
-
799
- return NetworkTopology(f_inp=self.f_inp_in, nodes=nodes, links=links,
800
- units=self.get_units_category())
801
+ for link_id, link_type, link, diameter, length, roughness_coeff, bulk_coeff, wall_coeff, loss_coeff \
802
+ in zip(links_id, links_type, links_data, links_diameter, links_length,
803
+ links_roughness_coeff, links_bulk_coeff, links_wall_coeff, links_loss_coeff):
804
+ links.append((link_id, list(link),
805
+ {"type": link_type, "diameter": diameter, "length": length,
806
+ "roughness_coeff": roughness_coeff,
807
+ "bulk_coeff": bulk_coeff, "wall_coeff": wall_coeff,
808
+ "loss_coeff": loss_coeff}))
809
+
810
+ pumps = {}
811
+ for pump_id, pump_type in zip(pumps_id, pumps_type):
812
+ link_idx = links_id.index(pump_id)
813
+ link = links_data[link_idx]
814
+ pumps[pump_id] = {"type": pump_type, "end_points": link}
815
+
816
+ valves = {}
817
+ for valve_id in valves_id:
818
+ link_idx = links_id.index(valve_id)
819
+ link = links_data[link_idx]
820
+ valve_type = links_type[link_idx]
821
+ valves[valve_id] = {"type": valve_type, "end_points": link}
822
+
823
+ return NetworkTopology(f_inp=self.f_inp_in, nodes=nodes, links=links, pumps=pumps,
824
+ valves=valves, units=self.get_units_category())
801
825
 
802
826
  def randomize_demands(self) -> None:
803
827
  """
@@ -1818,14 +1842,14 @@ class ScenarioSimulator():
1818
1842
 
1819
1843
  Parameters
1820
1844
  ----------
1821
- model_uncertainty : :class:`~epyt_flow.uncertainties.model_uncertainty.ModelUncertainty`
1845
+ model_uncertainty : :class:`~epyt_flow.uncertainty.model_uncertainty.ModelUncertainty`
1822
1846
  Model uncertainty specifications.
1823
1847
  """
1824
1848
  self.__adapt_to_network_changes()
1825
1849
 
1826
1850
  if not isinstance(model_uncertainty, ModelUncertainty):
1827
1851
  raise TypeError("'model_uncertainty' must be an instance of " +
1828
- "'epyt_flow.uncertainties.ModelUncertainty' but not of " +
1852
+ "'epyt_flow.uncertainty.ModelUncertainty' but not of " +
1829
1853
  f"'{type(model_uncertainty)}'")
1830
1854
 
1831
1855
  self.__model_uncertainty = model_uncertainty
@@ -12,7 +12,7 @@ class ScenarioVisualizer():
12
12
 
13
13
  Parameters
14
14
  ----------
15
- scenario : :class:`epyt_flow.simulation.scenario_simulator.ScenarioSimulator`
15
+ scenario : :class:`~epyt_flow.simulation.scenario_simulator.ScenarioSimulator`
16
16
  Scenario to be visualized.
17
17
  """
18
18
  def __init__(self, scenario: ScenarioSimulator):
@@ -1647,6 +1647,42 @@ class SensorConfig(JsonSerializable):
1647
1647
  """
1648
1648
  return deepcopy(self.__sensors_id_to_idx)
1649
1649
 
1650
+ def get_as_dict(self) -> dict:
1651
+ """
1652
+ Gets the sensor configuration as a dictionary.
1653
+
1654
+ Returns
1655
+ -------
1656
+ `dict`
1657
+ Dictionary of set sensors -- the keys are the sensor types.
1658
+ """
1659
+ r = {}
1660
+
1661
+ if self.__pressure_sensors != []:
1662
+ r["pressure"] = self.__pressure_sensors
1663
+ if self.__flow_sensors != []:
1664
+ r["flow"] = self.__flow_sensors
1665
+ if self.__demand_sensors != []:
1666
+ r["demand"] = self.__demand_sensors
1667
+ if self.__tank_volume_sensors != []:
1668
+ r["tank_volume"] = self.__tank_volume_sensors
1669
+ if self.__valve_state_sensors != []:
1670
+ r["valve_state"] = self.__valve_state_sensors
1671
+ if self.__pump_state_sensors != []:
1672
+ r["pump_state"] = self.__pump_state_sensors
1673
+ if self.__quality_node_sensors != []:
1674
+ r["node_quality"] = self.__quality_node_sensors
1675
+ if self.__quality_link_sensors != []:
1676
+ r["link_quality"] = self.__quality_link_sensors
1677
+ if self.__bulk_species_node_sensors != {}:
1678
+ r["node_bulk_species"] = self.__bulk_species_node_sensors
1679
+ if self.__bulk_species_link_sensors != {}:
1680
+ r["link_bulk_species"] = self.__bulk_species_link_sensors
1681
+ if self.__surface_species_sensors != {}:
1682
+ r["surface_species"] = self.__surface_species_sensors
1683
+
1684
+ return r
1685
+
1650
1686
  def get_attributes(self) -> dict:
1651
1687
  attr = {"nodes": self.__nodes, "links": self.__links,
1652
1688
  "valves": self.__valves, "pumps": self.__pumps,
@@ -1719,7 +1755,7 @@ class SensorConfig(JsonSerializable):
1719
1755
  f"pump_id_to_idx: {self.__pump_id_to_idx} tank_id_to_idx: {self.__tank_id_to_idx} " +\
1720
1756
  f"valve_id_to_idx: {self.__valve_id_to_idx} " +\
1721
1757
  f"bulkspecies_id_to_idx: {self.__bulkspecies_id_to_idx} " +\
1722
- f"surfacespecies_id_to_idx: {self.__surfacespecies_id_to_idx}" +\
1758
+ f"surfacespecies_id_to_idx: {self.__surfacespecies_id_to_idx} " +\
1723
1759
  f"pressure_sensors: {self.__pressure_sensors} flow_sensors: {self.__flow_sensors} " +\
1724
1760
  f"demand_sensors: {self.__demand_sensors} " +\
1725
1761
  f"quality_node_sensors: {self.__quality_node_sensors} " +\