epyt-flow 0.1.1__tar.gz → 0.3.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 (153) hide show
  1. epyt_flow-0.3.0/CITATION.cff +37 -0
  2. {epyt_flow-0.1.1/epyt_flow.egg-info → epyt_flow-0.3.0}/PKG-INFO +33 -5
  3. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/README.md +32 -4
  4. epyt_flow-0.3.0/epyt_flow/EPANET/compile_linux.sh +4 -0
  5. epyt_flow-0.3.0/epyt_flow/EPANET/compile_macos.sh +4 -0
  6. epyt_flow-0.3.0/epyt_flow/VERSION +1 -0
  7. epyt_flow-0.3.0/epyt_flow/__init__.py +41 -0
  8. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/data/benchmarks/leakdb.py +7 -12
  9. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/data/networks.py +404 -40
  10. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/rest_api/base_handler.py +14 -0
  11. epyt_flow-0.3.0/epyt_flow/rest_api/scada_data/__init__.py +0 -0
  12. epyt_flow-0.1.1/epyt_flow/rest_api/scada_data_handler.py → epyt_flow-0.3.0/epyt_flow/rest_api/scada_data/data_handlers.py +3 -162
  13. epyt_flow-0.3.0/epyt_flow/rest_api/scada_data/export_handlers.py +140 -0
  14. epyt_flow-0.3.0/epyt_flow/rest_api/scada_data/handlers.py +209 -0
  15. epyt_flow-0.3.0/epyt_flow/rest_api/scenario/__init__.py +0 -0
  16. epyt_flow-0.3.0/epyt_flow/rest_api/scenario/event_handlers.py +118 -0
  17. epyt_flow-0.1.1/epyt_flow/rest_api/scenario_handler.py → epyt_flow-0.3.0/epyt_flow/rest_api/scenario/handlers.py +86 -67
  18. epyt_flow-0.3.0/epyt_flow/rest_api/scenario/simulation_handlers.py +174 -0
  19. epyt_flow-0.3.0/epyt_flow/rest_api/scenario/uncertainty_handlers.py +118 -0
  20. epyt_flow-0.3.0/epyt_flow/rest_api/server.py +143 -0
  21. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/events/leakages.py +27 -17
  22. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/scada/scada_data.py +545 -14
  23. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/scada/scada_data_export.py +39 -12
  24. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/scenario_config.py +14 -20
  25. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/scenario_simulator.py +358 -114
  26. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/sensor_config.py +693 -37
  27. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/topology.py +149 -8
  28. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/utils.py +75 -18
  29. {epyt_flow-0.1.1 → epyt_flow-0.3.0/epyt_flow.egg-info}/PKG-INFO +33 -5
  30. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow.egg-info/SOURCES.txt +12 -3
  31. epyt_flow-0.1.1/epyt_flow/EPANET/compile.sh +0 -4
  32. epyt_flow-0.1.1/epyt_flow/VERSION +0 -1
  33. epyt_flow-0.1.1/epyt_flow/__init__.py +0 -30
  34. epyt_flow-0.1.1/epyt_flow/rest_api/server.py +0 -106
  35. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/CODE_OF_CONDUCT.md +0 -0
  36. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/LICENSE +0 -0
  37. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/MANIFEST.in +0 -0
  38. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/REQUIREMENTS.txt +0 -0
  39. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/AUTHORS +0 -0
  40. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/LICENSE +0 -0
  41. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/Readme_SRC_Engines.txt +0 -0
  42. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/enumstxt.h +0 -0
  43. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/epanet.c +0 -0
  44. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/epanet2.c +0 -0
  45. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/epanet2.def +0 -0
  46. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/errors.dat +0 -0
  47. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/funcs.h +0 -0
  48. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/genmmd.c +0 -0
  49. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/hash.c +0 -0
  50. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/hash.h +0 -0
  51. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/hydcoeffs.c +0 -0
  52. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/hydraul.c +0 -0
  53. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/hydsolver.c +0 -0
  54. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/hydstatus.c +0 -0
  55. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2.h +0 -0
  56. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_2.h +0 -0
  57. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_enums.h +0 -0
  58. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/inpfile.c +0 -0
  59. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/input1.c +0 -0
  60. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/input2.c +0 -0
  61. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/input3.c +0 -0
  62. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/main.c +0 -0
  63. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/mempool.c +0 -0
  64. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/mempool.h +0 -0
  65. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/output.c +0 -0
  66. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/project.c +0 -0
  67. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/quality.c +0 -0
  68. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/qualreact.c +0 -0
  69. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/qualroute.c +0 -0
  70. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/report.c +0 -0
  71. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/rules.c +0 -0
  72. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/smatrix.c +0 -0
  73. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/text.h +0 -0
  74. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET/SRC_engines/types.h +0 -0
  75. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/MSX_Updates.txt +0 -0
  76. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/dispersion.h +0 -0
  77. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/hash.c +0 -0
  78. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/hash.h +0 -0
  79. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx.h +0 -0
  80. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx_export.h +0 -0
  81. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.c +0 -0
  82. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.h +0 -0
  83. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/mempool.c +0 -0
  84. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/mempool.h +0 -0
  85. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxchem.c +0 -0
  86. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxcompiler.c +0 -0
  87. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxdict.h +0 -0
  88. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxdispersion.c +0 -0
  89. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxerr.c +0 -0
  90. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxfile.c +0 -0
  91. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.c +0 -0
  92. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.h +0 -0
  93. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxinp.c +0 -0
  94. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxout.c +0 -0
  95. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxproj.c +0 -0
  96. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxqual.c +0 -0
  97. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxrpt.c +0 -0
  98. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxtank.c +0 -0
  99. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxtoolkit.c +0 -0
  100. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxtypes.h +0 -0
  101. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxutils.c +0 -0
  102. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/msxutils.h +0 -0
  103. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/newton.c +0 -0
  104. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/newton.h +0 -0
  105. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/rk5.c +0 -0
  106. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/rk5.h +0 -0
  107. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/ros2.c +0 -0
  108. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/ros2.h +0 -0
  109. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/smatrix.c +0 -0
  110. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/Src/smatrix.h +0 -0
  111. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/EPANET/EPANET-MSX/readme.txt +0 -0
  112. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/data/__init__.py +0 -0
  113. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/data/benchmarks/__init__.py +0 -0
  114. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/data/benchmarks/batadal.py +0 -0
  115. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/data/benchmarks/batadal_data.py +0 -0
  116. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/data/benchmarks/battledim.py +0 -0
  117. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/data/benchmarks/battledim_data.py +0 -0
  118. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/data/benchmarks/gecco_water_quality.py +0 -0
  119. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/data/benchmarks/leakdb_data.py +0 -0
  120. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/data/benchmarks/water_usage.py +0 -0
  121. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/gym/__init__.py +0 -0
  122. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/gym/control_gyms.py +0 -0
  123. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/gym/scenario_control_env.py +0 -0
  124. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/metrics.py +0 -0
  125. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/models/__init__.py +0 -0
  126. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/models/event_detector.py +0 -0
  127. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/models/sensor_interpolation_detector.py +0 -0
  128. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/rest_api/__init__.py +0 -0
  129. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/rest_api/res_manager.py +0 -0
  130. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/serialization.py +0 -0
  131. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/__init__.py +0 -0
  132. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/events/__init__.py +0 -0
  133. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/events/actuator_events.py +0 -0
  134. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/events/event.py +0 -0
  135. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/events/sensor_faults.py +0 -0
  136. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/events/sensor_reading_attack.py +0 -0
  137. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/events/sensor_reading_event.py +0 -0
  138. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/events/system_event.py +0 -0
  139. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/parallel_simulation.py +0 -0
  140. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/scada/__init__.py +0 -0
  141. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/scada/advanced_control.py +0 -0
  142. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/simulation/scenario_visualizer.py +0 -0
  143. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/uncertainty/__init__.py +0 -0
  144. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/uncertainty/model_uncertainty.py +0 -0
  145. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/uncertainty/sensor_noise.py +0 -0
  146. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/uncertainty/uncertainties.py +0 -0
  147. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow/uncertainty/utils.py +0 -0
  148. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow.egg-info/dependency_links.txt +0 -0
  149. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow.egg-info/requires.txt +0 -0
  150. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/epyt_flow.egg-info/top_level.txt +0 -0
  151. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/pyproject.toml +0 -0
  152. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/setup.cfg +0 -0
  153. {epyt_flow-0.1.1 → epyt_flow-0.3.0}/setup.py +0 -0
@@ -0,0 +1,37 @@
1
+ cff-version: 1.2.0
2
+ authors:
3
+ - family-names: Artelt
4
+ given-names: André
5
+ orcid: "https://orcid.org/0000-0002-2426-3126"
6
+ - family-names: Kyriakou
7
+ given-names: Marios S.
8
+ orcid: "https://orcid.org/0000-0002-2324-8661"
9
+ - family-names: Demetriades
10
+ given-names: Marios
11
+ orcid: "https://orcid.org/0000-0001-7775-4319"
12
+ - family-names: Vrachimis
13
+ given-names: Stelios G.
14
+ orcid: "https://orcid.org/0000-0001-8862-5205"
15
+ - family-names: Eliades
16
+ given-names: Demetrios G.
17
+ orcid: "https://orcid.org/0000-0001-6184-6366"
18
+ - family-names: Hammer
19
+ given-names: Barbara
20
+ orcid: "https://orcid.org/0000-0002-0935-5591"
21
+ - family-names: Polycarpou
22
+ given-names: Marios M.
23
+ orcid: "https://orcid.org/0000-0001-6495-9171"
24
+ contact:
25
+ - family-names: Artelt
26
+ given-names: André
27
+ orcid: "https://orcid.org/0000-0002-2426-3126"
28
+ message: "If you use this software, please cite it using these metadata."
29
+ title: "EPyT-Flow -- EPANET Python Toolkit - Flow"
30
+ keywords:
31
+ - python
32
+ - simulation
33
+ - water
34
+ - epanet
35
+ - epanet-python-toolkit
36
+ license: MIT
37
+ repository-code: "https://github.com/WaterFutures/EPyT-Flow"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: epyt-flow
3
- Version: 0.1.1
3
+ Version: 0.3.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
@@ -32,8 +32,9 @@ Requires-Dist: falcon>=3.1.3
32
32
  Requires-Dist: multiprocess>=0.70.16
33
33
  Requires-Dist: psutil
34
34
 
35
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
36
35
  [![pypi](https://img.shields.io/pypi/v/epyt-flow.svg)](https://pypi.org/project/epyt-flow/)
36
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
37
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/epyt-flow)
37
38
  [![build](https://github.com/WaterFutures/EPyT-Flow/actions/workflows/build_tests.yml/badge.svg)](https://github.com/WaterFutures/EPyT-Flow/actions/workflows/build_tests.yml)
38
39
  [![Documentation Status](https://readthedocs.org/projects/epyt-flow/badge/?version=stable)](https://epyt-flow.readthedocs.io/en/stable/?badge=stable)
39
40
  [![Downloads](https://static.pepy.tech/badge/epyt-flow)](https://pepy.tech/project/epyt-flow)
@@ -41,6 +42,8 @@ Requires-Dist: psutil
41
42
 
42
43
  # EPyT-Flow -- EPANET Python Toolkit - Flow
43
44
 
45
+ <img src="https://github.com/WaterFutures/EPyT-Flow/blob/main/docs/_static/net1_plot.png?raw=true" align="right" height="230px"/>
46
+
44
47
  EPyT-Flow is a Python package building on top of [EPyT](https://github.com/OpenWaterAnalytics/EPyT)
45
48
  for providing easy access to water distribution network simulations.
46
49
  It aims to provide a high-level interface for the easy generation of hydraulic and water quality scenario data.
@@ -50,15 +53,40 @@ and [EPANET-MSX](https://github.com/USEPA/EPANETMSX/).
50
53
  EPyT-Flow provides easy access to popular benchmark data sets for event detection and localization.
51
54
  Furthermore, it also provides an environment for developing and testing control algorithms.
52
55
 
53
- ![](https://github.com/WaterFutures/EPyT-Flow/blob/main/docs/_static/net1_plot.png?raw=true)
56
+
57
+ ## Unique Features
58
+
59
+ Unique features of EPyT-Flow that make it superior to other (Python) toolboxes are the following:
60
+
61
+ - High-performance hydraulic and (advanced) water quality simulation
62
+ - High- and low-level interface
63
+ - Object-orientated design that is easy to extend and customize
64
+ - Sensor configurations
65
+ - Wide variety of pre-defined events (e.g. leakages, sensor faults, actuator events, cyber-attacks, etc.)
66
+ - Wide variety of pre-defined types of uncertainties (e.g. model uncertainties)
67
+ - Step-wise simulation and environment for training and evaluating control strategies
68
+ - Serialization module for easy exchange of data and (scenario) configurations
69
+ - REST API to make EPyT-Flow accessible in other applications
70
+ - Access to many WDNs and popular benchmarks (incl. their evaluation)
71
+
54
72
 
55
73
  ## Installation
56
74
 
57
75
  EPyT-Flow supports Python 3.9 - 3.12
58
76
 
59
77
  Note that [EPANET and EPANET-MSX sources](epyt_flow/EPANET/) are compiled and overwrite the binaries
60
- shipped by EPyT IF EPyT-Flow is installed on a Linux system. By this we not only aim to achieve
61
- a better performance of the simulations but also avoid any compatibility problems of pre-compiled binaries.
78
+ shipped by EPyT **IF** EPyT-Flow is installed on a Unix system and the *gcc* compiler is available.
79
+ By this, we not only aim to achieve a better performance of the simulations but also avoid any
80
+ compatibility issues of pre-compiled binaries.
81
+
82
+ #### Prerequisites for macOS users
83
+ The "true" *gcc* compiler (version 12) is needed which is not the
84
+ *clang* compiler that is shipped with Xcode and is linked to gcc!
85
+
86
+ The correct version of the "true" *gcc* can be installed via [brew](https://brew.sh/):
87
+ ```
88
+ brew install gcc@12
89
+ ```
62
90
 
63
91
  ### PyPI
64
92
 
@@ -1,5 +1,6 @@
1
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
2
1
  [![pypi](https://img.shields.io/pypi/v/epyt-flow.svg)](https://pypi.org/project/epyt-flow/)
2
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
3
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/epyt-flow)
3
4
  [![build](https://github.com/WaterFutures/EPyT-Flow/actions/workflows/build_tests.yml/badge.svg)](https://github.com/WaterFutures/EPyT-Flow/actions/workflows/build_tests.yml)
4
5
  [![Documentation Status](https://readthedocs.org/projects/epyt-flow/badge/?version=stable)](https://epyt-flow.readthedocs.io/en/stable/?badge=stable)
5
6
  [![Downloads](https://static.pepy.tech/badge/epyt-flow)](https://pepy.tech/project/epyt-flow)
@@ -7,6 +8,8 @@
7
8
 
8
9
  # EPyT-Flow -- EPANET Python Toolkit - Flow
9
10
 
11
+ <img src="https://github.com/WaterFutures/EPyT-Flow/blob/main/docs/_static/net1_plot.png?raw=true" align="right" height="230px"/>
12
+
10
13
  EPyT-Flow is a Python package building on top of [EPyT](https://github.com/OpenWaterAnalytics/EPyT)
11
14
  for providing easy access to water distribution network simulations.
12
15
  It aims to provide a high-level interface for the easy generation of hydraulic and water quality scenario data.
@@ -16,15 +19,40 @@ and [EPANET-MSX](https://github.com/USEPA/EPANETMSX/).
16
19
  EPyT-Flow provides easy access to popular benchmark data sets for event detection and localization.
17
20
  Furthermore, it also provides an environment for developing and testing control algorithms.
18
21
 
19
- ![](https://github.com/WaterFutures/EPyT-Flow/blob/main/docs/_static/net1_plot.png?raw=true)
22
+
23
+ ## Unique Features
24
+
25
+ Unique features of EPyT-Flow that make it superior to other (Python) toolboxes are the following:
26
+
27
+ - High-performance hydraulic and (advanced) water quality simulation
28
+ - High- and low-level interface
29
+ - Object-orientated design that is easy to extend and customize
30
+ - Sensor configurations
31
+ - Wide variety of pre-defined events (e.g. leakages, sensor faults, actuator events, cyber-attacks, etc.)
32
+ - Wide variety of pre-defined types of uncertainties (e.g. model uncertainties)
33
+ - Step-wise simulation and environment for training and evaluating control strategies
34
+ - Serialization module for easy exchange of data and (scenario) configurations
35
+ - REST API to make EPyT-Flow accessible in other applications
36
+ - Access to many WDNs and popular benchmarks (incl. their evaluation)
37
+
20
38
 
21
39
  ## Installation
22
40
 
23
41
  EPyT-Flow supports Python 3.9 - 3.12
24
42
 
25
43
  Note that [EPANET and EPANET-MSX sources](epyt_flow/EPANET/) are compiled and overwrite the binaries
26
- shipped by EPyT IF EPyT-Flow is installed on a Linux system. By this we not only aim to achieve
27
- a better performance of the simulations but also avoid any compatibility problems of pre-compiled binaries.
44
+ shipped by EPyT **IF** EPyT-Flow is installed on a Unix system and the *gcc* compiler is available.
45
+ By this, we not only aim to achieve a better performance of the simulations but also avoid any
46
+ compatibility issues of pre-compiled binaries.
47
+
48
+ #### Prerequisites for macOS users
49
+ The "true" *gcc* compiler (version 12) is needed which is not the
50
+ *clang* compiler that is shipped with Xcode and is linked to gcc!
51
+
52
+ The correct version of the "true" *gcc* can be installed via [brew](https://brew.sh/):
53
+ ```
54
+ brew install gcc@12
55
+ ```
28
56
 
29
57
  ### PyPI
30
58
 
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+ mkdir -p "../customlibs/"
3
+ gcc -w -O3 -march=native -shared -Wl,-soname,libepanet2_2.so -fPIC -o "../customlibs/libepanet2_2.so" EPANET/SRC_engines/*.c -IEPANET/SRC_engines/include -lc -lm -pthread
4
+ gcc -w -O3 -march=native -fPIC -shared -Wl,-soname,libepanetmsx2_2_0.so -o "../customlibs/libepanetmsx2_2_0.so" -fopenmp -Depanetmsx_EXPORTS -IEPANET-MSX/Src/include -IEPANET/SRC_engines/include EPANET-MSX/Src/*.c -Wl,-rpath=. "../customlibs/libepanet2_2.so" -lm -lgomp -lpthread
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+ mkdir -p "../customlibs/"
3
+ gcc-12 -w -O3 -march=native -dynamiclib -fPIC -install_name libepanet2_2.dylib -o "../customlibs/libepanet2_2.dylib" EPANET/SRC_engines/*.c -IEPANET/SRC_engines/include -lc -lm -pthread
4
+ gcc-12 -w -O3 -march=native -dynamiclib -fPIC -install_name libepanetmsx2_2_0.dylib -o "../customlibs/libepanetmsx2_2_0.dylib" -fopenmp -Depanetmsx_EXPORTS -IEPANET-MSX/Src/include -IEPANET/SRC_engines/include EPANET-MSX/Src/*.c -L'../customlibs' -lepanet2_2 -lm -lgomp -lpthread
@@ -0,0 +1 @@
1
+ 0.3.0
@@ -0,0 +1,41 @@
1
+ import subprocess
2
+ import warnings
3
+ import shutil
4
+ import sys
5
+ import os
6
+
7
+ with open(os.path.join(os.path.dirname(__file__), 'VERSION'), encoding="utf-8") as f:
8
+ VERSION = f.read().strip()
9
+
10
+
11
+ def compile_libraries_unix(lib_epanet_name: str, compile_script_name: str,
12
+ gcc_name: str = "gcc") -> None:
13
+ """Compile EPANET and EPANET-MSX libraries if needed."""
14
+ path_to_custom_libs = os.path.join(os.path.dirname(__file__), "customlibs")
15
+ path_to_lib_epanet = os.path.join(path_to_custom_libs, lib_epanet_name)
16
+ path_to_epanet = os.path.join(os.path.dirname(__file__), "EPANET")
17
+
18
+ update = False
19
+ if os.path.isfile(path_to_lib_epanet):
20
+ if os.path.getmtime(__file__) > os.path.getmtime(path_to_lib_epanet):
21
+ update = True
22
+
23
+ if not os.path.isfile(path_to_lib_epanet) or update:
24
+ if shutil.which(gcc_name) is not None:
25
+ print("Compiling EPANET and EPANET-MSX...")
26
+ try:
27
+ subprocess.check_call(f"cd \"{path_to_epanet}\"; bash {compile_script_name}",
28
+ shell=True)
29
+ print("Done")
30
+ except subprocess.CalledProcessError as ex:
31
+ print(f"Compilation failed\n{ex}")
32
+ warnings.warn("Falling back to pre-compiled library shipped by EPyT.")
33
+ else:
34
+ warnings.warn("GCC is not available to compile the required libraries.\n" +
35
+ "Falling back to pre-compiled library shipped by EPyT.")
36
+
37
+
38
+ if sys.platform.startswith("linux"):
39
+ compile_libraries_unix("libepanet2_2.so", "compile_linux.sh")
40
+ elif sys.platform.startswith("darwin"):
41
+ compile_libraries_unix("libepanet2_2.dylib", "compile_macos.sh", gcc_name="gcc-12")
@@ -475,12 +475,10 @@ def load_scenarios(scenarios_id: list[int], use_net1: bool = True,
475
475
  (int(week_year_pat.shape[0]), int(week_year_pat.shape[1])))
476
476
 
477
477
  # Create demand
478
- if use_net1 is True:
479
- base = 1
480
- else:
481
- base = 0.3 # Avoid negative pressure in Hanoi
478
+ base = 1
482
479
  variation = 0.75 + np.random.normal(0, 0.07) # from 0 to 1
483
480
  dem = base * (year_offset+1) * (week_year_pat*variation+1) * (random+1)
481
+
484
482
  dem = dem.tolist()
485
483
  dem_final = []
486
484
  for d in dem:
@@ -508,6 +506,7 @@ def load_scenarios(scenarios_id: list[int], use_net1: bool = True,
508
506
  wdn.epanet_api.setTimeHydraulicStep(general_params["hydraulic_time_step"])
509
507
  wdn.epanet_api.setTimeSimulationDuration(general_params["simulation_duration"])
510
508
  wdn.epanet_api.setTimePatternStep(general_params["hydraulic_time_step"])
509
+ wdn.epanet_api.setFlowUnitsCMH()
511
510
 
512
511
  wdn.epanet_api.deletePatternsAll()
513
512
 
@@ -542,14 +541,10 @@ def load_scenarios(scenarios_id: list[int], use_net1: bool = True,
542
541
  upper = data + z
543
542
  return lower + np.random.uniform() * (upper - lower)
544
543
 
545
- model_uncertainty = ModelUncertainty(pipe_length_uncertainty=MyUniformUncertainty(low=0,
546
- high=0.25),
547
- pipe_diameter_uncertainty=MyUniformUncertainty(low=0,
548
- high=0.25),
549
- pipe_roughness_uncertainty=MyUniformUncertainty(low=0,
550
- high=0.25),
551
- demand_base_uncertainty=MyUniformUncertainty(low=0,
552
- high=0.25))
544
+ my_uncertainties = {"pipe_length_uncertainty": MyUniformUncertainty(low=0, high=0.25),
545
+ "pipe_roughness_uncertainty": MyUniformUncertainty(low=0, high=0.25),
546
+ "demand_base_uncertainty": MyUniformUncertainty(low=0, high=0.25)}
547
+ model_uncertainty = ModelUncertainty(**my_uncertainties)
553
548
 
554
549
  # Create sensor config (place pressure and flow sensors everywhere)
555
550
  sensor_config = network_config.sensor_config