epyt-flow 0.3.0__tar.gz → 0.4.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 (150) hide show
  1. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/PKG-INFO +2 -1
  2. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/REQUIREMENTS.txt +1 -0
  3. epyt_flow-0.4.0/epyt_flow/VERSION +1 -0
  4. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/data/benchmarks/leakdb.py +1 -1
  5. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/events/leakages.py +1 -1
  6. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/parallel_simulation.py +7 -7
  7. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/scada/scada_data_export.py +1 -1
  8. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/scenario_config.py +5 -3
  9. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/scenario_simulator.py +37 -13
  10. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/topology.py +210 -8
  11. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/uncertainty/model_uncertainty.py +26 -19
  12. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow.egg-info/PKG-INFO +2 -1
  13. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow.egg-info/requires.txt +1 -0
  14. epyt_flow-0.3.0/epyt_flow/VERSION +0 -1
  15. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/CITATION.cff +0 -0
  16. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/CODE_OF_CONDUCT.md +0 -0
  17. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/LICENSE +0 -0
  18. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/MANIFEST.in +0 -0
  19. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/README.md +0 -0
  20. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/AUTHORS +0 -0
  21. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/LICENSE +0 -0
  22. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/Readme_SRC_Engines.txt +0 -0
  23. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/enumstxt.h +0 -0
  24. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/epanet.c +0 -0
  25. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/epanet2.c +0 -0
  26. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/epanet2.def +0 -0
  27. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/errors.dat +0 -0
  28. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/funcs.h +0 -0
  29. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/genmmd.c +0 -0
  30. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/hash.c +0 -0
  31. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/hash.h +0 -0
  32. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/hydcoeffs.c +0 -0
  33. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/hydraul.c +0 -0
  34. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/hydsolver.c +0 -0
  35. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/hydstatus.c +0 -0
  36. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2.h +0 -0
  37. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_2.h +0 -0
  38. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_enums.h +0 -0
  39. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/inpfile.c +0 -0
  40. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/input1.c +0 -0
  41. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/input2.c +0 -0
  42. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/input3.c +0 -0
  43. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/main.c +0 -0
  44. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/mempool.c +0 -0
  45. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/mempool.h +0 -0
  46. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/output.c +0 -0
  47. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/project.c +0 -0
  48. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/quality.c +0 -0
  49. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/qualreact.c +0 -0
  50. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/qualroute.c +0 -0
  51. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/report.c +0 -0
  52. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/rules.c +0 -0
  53. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/smatrix.c +0 -0
  54. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/text.h +0 -0
  55. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET/SRC_engines/types.h +0 -0
  56. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/MSX_Updates.txt +0 -0
  57. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/dispersion.h +0 -0
  58. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/hash.c +0 -0
  59. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/hash.h +0 -0
  60. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx.h +0 -0
  61. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx_export.h +0 -0
  62. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.c +0 -0
  63. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.h +0 -0
  64. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/mempool.c +0 -0
  65. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/mempool.h +0 -0
  66. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxchem.c +0 -0
  67. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxcompiler.c +0 -0
  68. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxdict.h +0 -0
  69. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxdispersion.c +0 -0
  70. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxerr.c +0 -0
  71. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxfile.c +0 -0
  72. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.c +0 -0
  73. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.h +0 -0
  74. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxinp.c +0 -0
  75. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxout.c +0 -0
  76. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxproj.c +0 -0
  77. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxqual.c +0 -0
  78. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxrpt.c +0 -0
  79. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxtank.c +0 -0
  80. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxtoolkit.c +0 -0
  81. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxtypes.h +0 -0
  82. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxutils.c +0 -0
  83. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxutils.h +0 -0
  84. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/newton.c +0 -0
  85. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/newton.h +0 -0
  86. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/rk5.c +0 -0
  87. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/rk5.h +0 -0
  88. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/ros2.c +0 -0
  89. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/ros2.h +0 -0
  90. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/smatrix.c +0 -0
  91. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/Src/smatrix.h +0 -0
  92. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/EPANET-MSX/readme.txt +0 -0
  93. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/compile_linux.sh +0 -0
  94. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/EPANET/compile_macos.sh +0 -0
  95. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/__init__.py +0 -0
  96. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/data/__init__.py +0 -0
  97. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/data/benchmarks/__init__.py +0 -0
  98. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/data/benchmarks/batadal.py +0 -0
  99. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/data/benchmarks/batadal_data.py +0 -0
  100. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/data/benchmarks/battledim.py +0 -0
  101. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/data/benchmarks/battledim_data.py +0 -0
  102. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/data/benchmarks/gecco_water_quality.py +0 -0
  103. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/data/benchmarks/leakdb_data.py +0 -0
  104. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/data/benchmarks/water_usage.py +0 -0
  105. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/data/networks.py +0 -0
  106. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/gym/__init__.py +0 -0
  107. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/gym/control_gyms.py +0 -0
  108. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/gym/scenario_control_env.py +0 -0
  109. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/metrics.py +0 -0
  110. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/models/__init__.py +0 -0
  111. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/models/event_detector.py +0 -0
  112. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/models/sensor_interpolation_detector.py +0 -0
  113. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/__init__.py +0 -0
  114. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/base_handler.py +0 -0
  115. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/res_manager.py +0 -0
  116. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/scada_data/__init__.py +0 -0
  117. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/scada_data/data_handlers.py +0 -0
  118. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/scada_data/export_handlers.py +0 -0
  119. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/scada_data/handlers.py +0 -0
  120. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/scenario/__init__.py +0 -0
  121. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/scenario/event_handlers.py +0 -0
  122. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/scenario/handlers.py +0 -0
  123. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/scenario/simulation_handlers.py +0 -0
  124. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/scenario/uncertainty_handlers.py +0 -0
  125. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/rest_api/server.py +0 -0
  126. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/serialization.py +0 -0
  127. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/__init__.py +0 -0
  128. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/events/__init__.py +0 -0
  129. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/events/actuator_events.py +0 -0
  130. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/events/event.py +0 -0
  131. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/events/sensor_faults.py +0 -0
  132. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/events/sensor_reading_attack.py +0 -0
  133. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/events/sensor_reading_event.py +0 -0
  134. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/events/system_event.py +0 -0
  135. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/scada/__init__.py +0 -0
  136. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/scada/advanced_control.py +0 -0
  137. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/scada/scada_data.py +0 -0
  138. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/scenario_visualizer.py +0 -0
  139. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/simulation/sensor_config.py +0 -0
  140. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/uncertainty/__init__.py +0 -0
  141. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/uncertainty/sensor_noise.py +0 -0
  142. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/uncertainty/uncertainties.py +0 -0
  143. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/uncertainty/utils.py +0 -0
  144. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow/utils.py +1 -1
  145. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow.egg-info/SOURCES.txt +0 -0
  146. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow.egg-info/dependency_links.txt +0 -0
  147. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/epyt_flow.egg-info/top_level.txt +0 -0
  148. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/pyproject.toml +0 -0
  149. {epyt_flow-0.3.0 → epyt_flow-0.4.0}/setup.cfg +0 -0
  150. {epyt_flow-0.3.0 → epyt_flow-0.4.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.4.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.4.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)
@@ -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
@@ -7,6 +7,8 @@ from typing import Any
7
7
  import numpy as np
8
8
  import networkx as nx
9
9
  from scipy.sparse import bsr_array
10
+ from geopandas import GeoDataFrame
11
+ from shapely.geometry import Point, LineString
10
12
 
11
13
  from .serialization import serializable, JsonSerializable, NETWORK_TOPOLOGY_ID
12
14
 
@@ -55,9 +57,15 @@ class NetworkTopology(nx.Graph, JsonSerializable):
55
57
  Path to .inp file to which this topology belongs.
56
58
  nodes : `list[tuple[str, dict]]`
57
59
  List of all nodes -- i.e. node ID and node information such as type and elevation.
58
- links : `list[tuple[tuple[str, str], dict]]`
60
+ links : `list[tuple[str, tuple[str, str], dict]]`
59
61
  List of all links/pipes -- i.e. link ID, ID of connecting nodes, and link information
60
62
  such as pipe diameter, length, etc.
63
+ pumps : `dict`
64
+ List of all pumps -- i.e. valve ID, and information such as
65
+ pump type and connecting nodes.
66
+ valves : `dict`
67
+ List of all valves -- i.e. valve ID, and information such as
68
+ valve type and connecting nodes.
61
69
  units : `int`
62
70
  Measurement units category -- i.e. US Customary or SI Metric.
63
71
 
@@ -68,12 +76,16 @@ class NetworkTopology(nx.Graph, JsonSerializable):
68
76
  """
69
77
  def __init__(self, f_inp: str, nodes: list[tuple[str, dict]],
70
78
  links: list[tuple[str, tuple[str, str], dict]],
79
+ pumps: dict,
80
+ valves: dict,
71
81
  units: int = None,
72
82
  **kwds):
73
83
  super().__init__(name=f_inp, **kwds)
74
84
 
75
85
  self.__nodes = nodes
76
86
  self.__links = links
87
+ self.__pumps = pumps
88
+ self.__valves = valves
77
89
  self.__units = units
78
90
 
79
91
  if units is None:
@@ -87,11 +99,12 @@ class NetworkTopology(nx.Graph, JsonSerializable):
87
99
  self.add_node(node_id, info={"elevation": node_elevation, "type": node_type})
88
100
 
89
101
  for link_id, link, link_info in links:
102
+ link_type = link_info["type"]
90
103
  link_diameter = link_info["diameter"]
91
104
  link_length = link_info["length"]
92
105
  self.add_edge(link[0], link[1], length=link_length,
93
- info={"id": link_id, "nodes": link, "diameter": link_diameter,
94
- "length": link_length})
106
+ info={"id": link_id, "type": link_type, "nodes": link,
107
+ "diameter": link_diameter, "length": link_length})
95
108
 
96
109
  def convert_units(self, units: int) -> Any:
97
110
  """
@@ -161,7 +174,8 @@ class NetworkTopology(nx.Graph, JsonSerializable):
161
174
 
162
175
  links.append((link_id, link_nodes, link_info))
163
176
 
164
- return NetworkTopology(f_inp=self.name, nodes=nodes, links=links, units=units)
177
+ return NetworkTopology(f_inp=self.name, nodes=nodes, links=links, pumps=self.pumps,
178
+ valves=self.valves, units=units)
165
179
 
166
180
  def get_all_nodes(self) -> list[str]:
167
181
  """
@@ -185,6 +199,28 @@ class NetworkTopology(nx.Graph, JsonSerializable):
185
199
  """
186
200
  return [(link_id, end_points) for link_id, end_points, _ in self.__links]
187
201
 
202
+ def get_all_pumps(self) -> list[str]:
203
+ """
204
+ Gets the IDs of all pumps.
205
+
206
+ Returns
207
+ -------
208
+ `list[str]`
209
+ Pump IDs.
210
+ """
211
+ return self.__pumps.keys()
212
+
213
+ def get_all_valves(self) -> list[str]:
214
+ """
215
+ Gets the IDs of all valves.
216
+
217
+ Returns
218
+ -------
219
+ `list[str]`
220
+ Valve IDs.
221
+ """
222
+ return self.__valves.keys()
223
+
188
224
  def get_node_info(self, node_id: str) -> dict:
189
225
  """
190
226
  Gets all information (e.g. elevation, type, etc.) associated with a given node.
@@ -207,17 +243,19 @@ class NetworkTopology(nx.Graph, JsonSerializable):
207
243
 
208
244
  def get_link_info(self, link_id: str) -> dict:
209
245
  """
210
- Gets all information (e.g. diameter, length, etc.) associated with a given link/pipe.
246
+ Gets all information (e.g. diameter, length, etc.) associated with a given link.
247
+
248
+ Note that links can be pipes, pumps, or valves.
211
249
 
212
250
  Parameters
213
251
  ----------
214
252
  link_id : `str`
215
- ID of the link/pipe.
253
+ ID of the link.
216
254
 
217
255
  Returns
218
256
  -------
219
257
  `dict`
220
- Information associated with the given link/pipe.
258
+ Information associated with the given link.
221
259
  """
222
260
  for link_id_, link_nodes, link_info in self.__links:
223
261
  if link_id_ == link_id:
@@ -225,6 +263,68 @@ class NetworkTopology(nx.Graph, JsonSerializable):
225
263
 
226
264
  raise ValueError(f"Unknown link '{link_id}'")
227
265
 
266
+ def get_pump_info(self, pump_id: str) -> dict:
267
+ """
268
+ Gets all information associated with a given pump.
269
+
270
+ Parameters
271
+ ----------
272
+ pump_id : `str`
273
+ ID of the pump.
274
+
275
+ Returns
276
+ -------
277
+ `dict`
278
+ Pump information.
279
+ """
280
+ if pump_id in self.__pumps:
281
+ return self.__pumps[pump_id]
282
+ else:
283
+ raise ValueError(f"Unknown pump: '{pump_id}'")
284
+
285
+ def get_valve_info(self, valve_id: str) -> dict:
286
+ """
287
+ Gets all information associated with a given valve.
288
+
289
+ Parameters
290
+ ----------
291
+ valve_id : `str`
292
+ ID of the valve.
293
+
294
+ Returns
295
+ -------
296
+ `dict`
297
+ Valve information.
298
+ """
299
+ if valve_id in self.__valves:
300
+ return self.__valves[valve_id]
301
+ else:
302
+ raise ValueError(f"Unknown valve: '{valve_id}'")
303
+
304
+ @property
305
+ def pumps(self) -> dict:
306
+ """
307
+ Gets all pumps -- i.e. ID and associated information such as the pump type.
308
+
309
+ Returns
310
+ -------
311
+ `dict`
312
+ All pumps and their associated information.
313
+ """
314
+ return deepcopy(self.__pumps)
315
+
316
+ @property
317
+ def valves(self) -> dict:
318
+ """
319
+ Gets all valves -- i.e. ID and associated information such as the valve type.
320
+
321
+ Returns
322
+ -------
323
+ `dict`
324
+ All valves and their associated information.
325
+ """
326
+ return deepcopy(self.__valves)
327
+
228
328
  @property
229
329
  def units(self) -> int:
230
330
  """
@@ -251,18 +351,120 @@ class NetworkTopology(nx.Graph, JsonSerializable):
251
351
  self.get_all_nodes() == other.get_all_nodes() \
252
352
  and all(link_a[0] == link_b[0] and all(link_a[1] == link_b[1])
253
353
  for link_a, link_b in zip(self.get_all_links(), other.get_all_links())) \
254
- and self.__units == other.units
354
+ and self.__units == other.units \
355
+ and self.__pumps == other.pumps \
356
+ and self.__valves == other.valves
255
357
 
256
358
  def __str__(self) -> str:
257
359
  return f"f_inp: {self.name} nodes: {self.__nodes} links: {self.__links} " +\
360
+ f"pumps: {self.__pumps} valves: {self.__valves} " +\
258
361
  f"units: {unitscategoryid_to_str(self.__units)}"
259
362
 
260
363
  def get_attributes(self) -> dict:
261
364
  return super().get_attributes() | {"f_inp": self.name,
262
365
  "nodes": self.__nodes,
263
366
  "links": self.__links,
367
+ "pumps": self.__pumps,
368
+ "valves": self.__valves,
264
369
  "units": self.__units}
265
370
 
371
+ def to_gis(self, coord_reference_system: str = None, pumps_as_points: bool = False,
372
+ valves_as_points: bool = False) -> dict:
373
+ """
374
+ Gets the network topology as a dictionary of `geopandas.GeoDataFrames` instances --
375
+ i.e. each quantity (nodes, links/pipes, valves, etc.) is represented by a
376
+ `geopandas.GeoDataFrames` instance.
377
+
378
+ Parameters
379
+ ----------
380
+ coord_reference_system : `str`, optional
381
+ Coordinate reference system.
382
+
383
+ The default is None.
384
+ pumps_as_points : `bool`, optional
385
+ If True, pumps are represented by points, otherwise by lines.
386
+
387
+ The default is False.
388
+
389
+ valves_as_points : `bool`, optional
390
+ If True, valves are represented by points, otherwise by lines.
391
+
392
+ The default is False.
393
+
394
+ Returns
395
+ -------
396
+ `dict`
397
+ Network topology as a dictionary of `geopandas.GeoDataFrames` instances.
398
+ If a quantity does not exist, the data frame will be None.
399
+ """
400
+ gis = {"nodes": None, "links": None,
401
+ "tanks": None, "reservoirs": None,
402
+ "valves": None, "pumps": None}
403
+
404
+ # Nodes
405
+ node_data = {"id": [], "type": [], "elevation": [], "geometry": []}
406
+ tank_data = {"id": [], "elevation": [], "diameter": [], "geometry": []}
407
+ reservoir_data = {"id": [], "elevation": [], "geometry": []}
408
+ for node_id in self.get_all_nodes():
409
+ node_info = self.get_node_info(node_id)
410
+
411
+ node_data["id"].append(node_id)
412
+ node_data["type"].append(node_info["type"])
413
+ node_data["elevation"].append(node_info["elevation"])
414
+ node_data["geometry"].append(Point(node_info["coord"]))
415
+
416
+ if node_info["type"] == "TANK":
417
+ tank_data["id"].append(node_id)
418
+ tank_data["elevation"].append(node_info["elevation"])
419
+ tank_data["diameter"].append(node_info["diameter"])
420
+ tank_data["geometry"].append(Point(node_info["coord"]))
421
+ elif node_info["type"] == "RESERVOIR":
422
+ reservoir_data["id"].append(node_id)
423
+ reservoir_data["elevation"].append(node_info["elevation"])
424
+ reservoir_data["geometry"].append(Point(node_info["coord"]))
425
+
426
+ gis["nodes"] = GeoDataFrame(node_data, crs=coord_reference_system)
427
+ gis["tanks"] = GeoDataFrame(tank_data, crs=coord_reference_system)
428
+ gis["reservoirs"] = GeoDataFrame(reservoir_data, crs=coord_reference_system)
429
+
430
+ # Links
431
+ pipe_data = {"id": [], "type": [], "end_point_a": [], "end_point_b": [],
432
+ "length": [], "diameter": [], "geometry": []}
433
+ valve_data = {"id": [], "type": [], "geometry": []}
434
+ pump_data = {"id": [], "type": [], "geometry": []}
435
+ for link_id, link_nodes in self.get_all_links():
436
+ link_info = self.get_link_info(link_id)
437
+ end_points_coord = [self.get_node_info(n)["coord"] for n in link_nodes]
438
+
439
+ if link_info["type"] == "PIPE":
440
+ pipe_data["id"].append(link_id)
441
+ pipe_data["type"].append(link_info["type"])
442
+ pipe_data["end_point_a"].append(link_nodes[0])
443
+ pipe_data["end_point_b"].append(link_nodes[1])
444
+ pipe_data["length"].append(link_info["length"])
445
+ pipe_data["diameter"].append(link_info["diameter"])
446
+ pipe_data["geometry"].append(LineString(end_points_coord))
447
+ elif link_info["type"] == "PUMP":
448
+ pump_data["id"].append(link_id)
449
+ pump_data["type"].append(self.get_pump_info(link_id)["type"])
450
+ if pumps_as_points is True:
451
+ pump_data["geometry"].append(Point(end_points_coord[0]))
452
+ else:
453
+ pump_data["geometry"].append(LineString(end_points_coord))
454
+ else: # Valve
455
+ valve_data["id"].append(link_id)
456
+ valve_data["type"].append(self.get_valve_info[link_id]["type"])
457
+ if valves_as_points is True:
458
+ valve_data["geometry"].append(Point(end_points_coord[0]))
459
+ else:
460
+ valve_data["geometry"].append(LineString(end_points_coord))
461
+
462
+ gis["pipes"] = GeoDataFrame(pipe_data, crs=coord_reference_system)
463
+ gis["valves"] = GeoDataFrame(valve_data, crs=coord_reference_system)
464
+ gis["pumps"] = GeoDataFrame(pump_data, crs=coord_reference_system)
465
+
466
+ return gis
467
+
266
468
  def get_adj_matrix(self) -> bsr_array:
267
469
  """
268
470
  Gets the adjacency matrix of this graph.