epyt-flow 0.6.0__tar.gz → 0.7.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 (150) hide show
  1. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/PKG-INFO +50 -7
  2. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/README.md +47 -4
  3. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/REQUIREMENTS.txt +1 -1
  4. epyt_flow-0.7.1/epyt_flow/VERSION +1 -0
  5. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/data/benchmarks/leakdb.py +1 -0
  6. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/metrics.py +66 -4
  7. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/serialization.py +33 -0
  8. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/scada/scada_data.py +715 -16
  9. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/scada/scada_data_export.py +5 -1
  10. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/scenario_simulator.py +306 -99
  11. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/sensor_config.py +49 -2
  12. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/topology.py +3 -3
  13. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/uncertainty/model_uncertainty.py +11 -5
  14. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/uncertainty/uncertainties.py +8 -0
  15. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/utils.py +69 -2
  16. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow.egg-info/PKG-INFO +50 -7
  17. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow.egg-info/requires.txt +1 -1
  18. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/pyproject.toml +1 -1
  19. epyt_flow-0.6.0/epyt_flow/VERSION +0 -1
  20. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/CITATION.cff +0 -0
  21. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/CODE_OF_CONDUCT.md +0 -0
  22. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/LICENSE +0 -0
  23. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/MANIFEST.in +0 -0
  24. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/AUTHORS +0 -0
  25. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/LICENSE +0 -0
  26. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/Readme_SRC_Engines.txt +0 -0
  27. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/enumstxt.h +0 -0
  28. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/epanet.c +0 -0
  29. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/epanet2.c +0 -0
  30. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/epanet2.def +0 -0
  31. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/errors.dat +0 -0
  32. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/funcs.h +0 -0
  33. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/genmmd.c +0 -0
  34. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/hash.c +0 -0
  35. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/hash.h +0 -0
  36. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/hydcoeffs.c +0 -0
  37. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/hydraul.c +0 -0
  38. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/hydsolver.c +0 -0
  39. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/hydstatus.c +0 -0
  40. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2.h +0 -0
  41. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_2.h +0 -0
  42. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_enums.h +0 -0
  43. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/inpfile.c +0 -0
  44. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/input1.c +0 -0
  45. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/input2.c +0 -0
  46. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/input3.c +0 -0
  47. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/main.c +0 -0
  48. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/mempool.c +0 -0
  49. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/mempool.h +0 -0
  50. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/output.c +0 -0
  51. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/project.c +0 -0
  52. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/quality.c +0 -0
  53. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/qualreact.c +0 -0
  54. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/qualroute.c +0 -0
  55. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/report.c +0 -0
  56. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/rules.c +0 -0
  57. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/smatrix.c +0 -0
  58. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/text.h +0 -0
  59. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET/SRC_engines/types.h +0 -0
  60. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/MSX_Updates.txt +0 -0
  61. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/dispersion.h +0 -0
  62. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/hash.c +0 -0
  63. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/hash.h +0 -0
  64. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx.h +0 -0
  65. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx_export.h +0 -0
  66. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.c +0 -0
  67. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.h +0 -0
  68. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/mempool.c +0 -0
  69. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/mempool.h +0 -0
  70. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxchem.c +0 -0
  71. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxcompiler.c +0 -0
  72. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxdict.h +0 -0
  73. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxdispersion.c +0 -0
  74. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxerr.c +0 -0
  75. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxfile.c +0 -0
  76. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.c +0 -0
  77. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.h +0 -0
  78. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxinp.c +0 -0
  79. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxout.c +0 -0
  80. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxproj.c +0 -0
  81. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxqual.c +0 -0
  82. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxrpt.c +0 -0
  83. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxtank.c +0 -0
  84. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxtoolkit.c +0 -0
  85. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxtypes.h +0 -0
  86. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxutils.c +0 -0
  87. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/msxutils.h +0 -0
  88. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/newton.c +0 -0
  89. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/newton.h +0 -0
  90. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/rk5.c +0 -0
  91. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/rk5.h +0 -0
  92. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/ros2.c +0 -0
  93. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/ros2.h +0 -0
  94. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/smatrix.c +0 -0
  95. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/Src/smatrix.h +0 -0
  96. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/EPANET-MSX/readme.txt +0 -0
  97. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/compile_linux.sh +0 -0
  98. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/EPANET/compile_macos.sh +0 -0
  99. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/__init__.py +0 -0
  100. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/data/__init__.py +0 -0
  101. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/data/benchmarks/__init__.py +0 -0
  102. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/data/benchmarks/batadal.py +0 -0
  103. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/data/benchmarks/batadal_data.py +0 -0
  104. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/data/benchmarks/battledim.py +0 -0
  105. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/data/benchmarks/battledim_data.py +0 -0
  106. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/data/benchmarks/gecco_water_quality.py +0 -0
  107. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/data/benchmarks/leakdb_data.py +0 -0
  108. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/data/benchmarks/water_usage.py +0 -0
  109. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/data/networks.py +0 -0
  110. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/gym/__init__.py +0 -0
  111. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/gym/control_gyms.py +0 -0
  112. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/gym/scenario_control_env.py +0 -0
  113. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/models/__init__.py +0 -0
  114. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/models/event_detector.py +0 -0
  115. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/models/sensor_interpolation_detector.py +0 -0
  116. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/__init__.py +0 -0
  117. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/base_handler.py +0 -0
  118. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/res_manager.py +0 -0
  119. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/scada_data/__init__.py +0 -0
  120. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/scada_data/data_handlers.py +0 -0
  121. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/scada_data/export_handlers.py +0 -0
  122. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/scada_data/handlers.py +0 -0
  123. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/scenario/__init__.py +0 -0
  124. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/scenario/event_handlers.py +0 -0
  125. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/scenario/handlers.py +0 -0
  126. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/scenario/simulation_handlers.py +0 -0
  127. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/scenario/uncertainty_handlers.py +0 -0
  128. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/rest_api/server.py +0 -0
  129. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/__init__.py +0 -0
  130. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/events/__init__.py +0 -0
  131. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/events/actuator_events.py +0 -0
  132. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/events/event.py +0 -0
  133. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/events/leakages.py +0 -0
  134. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/events/sensor_faults.py +0 -0
  135. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/events/sensor_reading_attack.py +0 -0
  136. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/events/sensor_reading_event.py +0 -0
  137. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/events/system_event.py +0 -0
  138. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/parallel_simulation.py +0 -0
  139. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/scada/__init__.py +0 -0
  140. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/scada/advanced_control.py +0 -0
  141. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/scenario_config.py +0 -0
  142. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/simulation/scenario_visualizer.py +0 -0
  143. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/uncertainty/__init__.py +0 -0
  144. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/uncertainty/sensor_noise.py +0 -0
  145. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow/uncertainty/utils.py +0 -0
  146. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow.egg-info/SOURCES.txt +0 -0
  147. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow.egg-info/dependency_links.txt +0 -0
  148. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/epyt_flow.egg-info/top_level.txt +0 -0
  149. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/setup.cfg +0 -0
  150. {epyt_flow-0.6.0 → epyt_flow-0.7.1}/setup.py +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: epyt-flow
3
- Version: 0.6.0
3
+ Version: 0.7.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: MIT License
7
7
  Project-URL: Homepage, https://github.com/WaterFutures/EPyT-Flow
8
- Project-URL: Documentation, https://epyt-flow.readthedocs.io/en/latest/
8
+ Project-URL: Documentation, https://epyt-flow.readthedocs.io/en/stable/
9
9
  Project-URL: Repository, https://github.com/WaterFutures/EPyT-Flow.git
10
10
  Project-URL: Issues, https://github.com/WaterFutures/EPyT-Flow/issues
11
11
  Keywords: epanet,water,networks,hydraulics,quality,simulations
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.12
20
20
  Requires-Python: >=3.9
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
- Requires-Dist: epyt>=1.1.9
23
+ Requires-Dist: epyt>=1.2.0
24
24
  Requires-Dist: requests>=2.31.0
25
25
  Requires-Dist: scipy>=1.11.4
26
26
  Requires-Dist: u-msgpack-python>=2.8.0
@@ -121,7 +121,7 @@ pip install .
121
121
  ```python
122
122
  from epyt_flow.data.benchmarks import load_leakdb_scenarios
123
123
  from epyt_flow.simulation import ScenarioSimulator
124
- from epyt_flow.utils import to_seconds
124
+ from epyt_flow.utils import to_seconds, plot_timeseries_data
125
125
 
126
126
 
127
127
  if __name__ == "__main__":
@@ -142,14 +142,49 @@ if __name__ == "__main__":
142
142
  # Run entire simulation
143
143
  scada_data = sim.run_simulation()
144
144
 
145
- # Show sensor readings over the entire simulation
145
+ # Print & plot sensor readings over the entire simulation
146
146
  print(f"Pressure readings: {scada_data.get_data_pressures()}")
147
+ plot_timeseries_data(scada_data.get_data_pressures().T,
148
+ labels=[f"Node {n_id}" for n_id in
149
+ scada_data.sensor_config.pressure_sensors],
150
+ x_axis_label="Time (30min steps)",
151
+ y_axis_label="Pressure in $m$")
152
+
147
153
  print(f"Flow readings: {scada_data.get_data_flows()}")
154
+ plot_timeseries_data(scada_data.get_data_flows().T,
155
+ x_axis_label="Time (30min steps)",
156
+ y_axis_label="Flow rate in $m^3/h$")
148
157
  ```
158
+ ### Generated plots
159
+
160
+ <div>
161
+ <img src="https://github.com/WaterFutures/EPyT-Flow/blob/dev/docs/_static/examples_basic_usage_pressure.png?raw=true" width="49%"/>
162
+ <img src="https://github.com/WaterFutures/EPyT-Flow/blob/dev/docs/_static/examples_basic_usage_flow.png?raw=true" width="49%"/>
163
+ </div>
149
164
 
150
165
  ## Documentation
151
166
 
152
- Documentation is available on readthedocs:[https://epyt-flow.readthedocs.io/en/latest/](https://epyt-flow.readthedocs.io/en/stable)
167
+ Documentation is available on readthedocs: [https://epyt-flow.readthedocs.io/en/latest/](https://epyt-flow.readthedocs.io/en/stable)
168
+
169
+ ## How to Get Started?
170
+
171
+ EPyT-Flow is accompanied by an extensive documentation
172
+ [https://epyt-flow.readthedocs.io/en/latest/](https://epyt-flow.readthedocs.io/en/stable)
173
+ (including many [examples](https://epyt-flow.readthedocs.io/en/stable/#examples)).
174
+
175
+ If you are new to water distribution networks, we recommend first to read the chapter on
176
+ [Modeling of Water Distribution Networks](https://epyt-flow.readthedocs.io/en/stable/tut.intro.html).
177
+ You might also want to check out some lecture notes on
178
+ [Smart Water Systems](https://github.com/KIOS-Research/ece808-smart-water-systems).
179
+
180
+ If you are already familiar with WDNs (and software such as EPANET), we recommend checking out
181
+ our [WDSA CCWI 2024 tutorial](https://github.com/WaterFutures/EPyT-and-EPyT-Flow-Tutorial) which
182
+ not only teaches you how to use EPyT and EPyT-Flow but also contains some examples of applying
183
+ Machine Learning in WDNs.
184
+ Besides that, you can read in-depth about the different functionalities of EPyT-Flow in the
185
+ [In-depth Tutorial](https://epyt-flow.readthedocs.io/en/stable/tutorial.html) of the documentation --
186
+ we recommend reading the chapters in the order in which they are presented;
187
+ you might decide to skip some of the last chapters if their content is not relevant to you.
153
188
 
154
189
  ## License
155
190
 
@@ -170,6 +205,14 @@ If you use this software, please cite it as follows:
170
205
  }
171
206
  ```
172
207
 
208
+ ## How to get Support?
209
+
210
+ If you come across any bug or need assistance please feel free to open a new
211
+ [issue](https://github.com/WaterFutures/EPyT-Flow/issues/)
212
+ if non of the existing issues answers your questions.
213
+
173
214
  ## How to Contribute?
174
215
 
175
- Contributions (e.g. creating issues, pull-requests, etc.) are welcome -- please make sure to read the [code of conduct](CODE_OF_CONDUCT.md) and follow the [developers' guidelines](DEVELOPERS.md).
216
+ Contributions (e.g. creating issues, pull-requests, etc.) are welcome --
217
+ please make sure to read the [code of conduct](CODE_OF_CONDUCT.md) and
218
+ follow the [developers' guidelines](DEVELOPERS.md).
@@ -86,7 +86,7 @@ pip install .
86
86
  ```python
87
87
  from epyt_flow.data.benchmarks import load_leakdb_scenarios
88
88
  from epyt_flow.simulation import ScenarioSimulator
89
- from epyt_flow.utils import to_seconds
89
+ from epyt_flow.utils import to_seconds, plot_timeseries_data
90
90
 
91
91
 
92
92
  if __name__ == "__main__":
@@ -107,14 +107,49 @@ if __name__ == "__main__":
107
107
  # Run entire simulation
108
108
  scada_data = sim.run_simulation()
109
109
 
110
- # Show sensor readings over the entire simulation
110
+ # Print & plot sensor readings over the entire simulation
111
111
  print(f"Pressure readings: {scada_data.get_data_pressures()}")
112
+ plot_timeseries_data(scada_data.get_data_pressures().T,
113
+ labels=[f"Node {n_id}" for n_id in
114
+ scada_data.sensor_config.pressure_sensors],
115
+ x_axis_label="Time (30min steps)",
116
+ y_axis_label="Pressure in $m$")
117
+
112
118
  print(f"Flow readings: {scada_data.get_data_flows()}")
119
+ plot_timeseries_data(scada_data.get_data_flows().T,
120
+ x_axis_label="Time (30min steps)",
121
+ y_axis_label="Flow rate in $m^3/h$")
113
122
  ```
123
+ ### Generated plots
124
+
125
+ <div>
126
+ <img src="https://github.com/WaterFutures/EPyT-Flow/blob/dev/docs/_static/examples_basic_usage_pressure.png?raw=true" width="49%"/>
127
+ <img src="https://github.com/WaterFutures/EPyT-Flow/blob/dev/docs/_static/examples_basic_usage_flow.png?raw=true" width="49%"/>
128
+ </div>
114
129
 
115
130
  ## Documentation
116
131
 
117
- Documentation is available on readthedocs:[https://epyt-flow.readthedocs.io/en/latest/](https://epyt-flow.readthedocs.io/en/stable)
132
+ Documentation is available on readthedocs: [https://epyt-flow.readthedocs.io/en/latest/](https://epyt-flow.readthedocs.io/en/stable)
133
+
134
+ ## How to Get Started?
135
+
136
+ EPyT-Flow is accompanied by an extensive documentation
137
+ [https://epyt-flow.readthedocs.io/en/latest/](https://epyt-flow.readthedocs.io/en/stable)
138
+ (including many [examples](https://epyt-flow.readthedocs.io/en/stable/#examples)).
139
+
140
+ If you are new to water distribution networks, we recommend first to read the chapter on
141
+ [Modeling of Water Distribution Networks](https://epyt-flow.readthedocs.io/en/stable/tut.intro.html).
142
+ You might also want to check out some lecture notes on
143
+ [Smart Water Systems](https://github.com/KIOS-Research/ece808-smart-water-systems).
144
+
145
+ If you are already familiar with WDNs (and software such as EPANET), we recommend checking out
146
+ our [WDSA CCWI 2024 tutorial](https://github.com/WaterFutures/EPyT-and-EPyT-Flow-Tutorial) which
147
+ not only teaches you how to use EPyT and EPyT-Flow but also contains some examples of applying
148
+ Machine Learning in WDNs.
149
+ Besides that, you can read in-depth about the different functionalities of EPyT-Flow in the
150
+ [In-depth Tutorial](https://epyt-flow.readthedocs.io/en/stable/tutorial.html) of the documentation --
151
+ we recommend reading the chapters in the order in which they are presented;
152
+ you might decide to skip some of the last chapters if their content is not relevant to you.
118
153
 
119
154
  ## License
120
155
 
@@ -135,6 +170,14 @@ If you use this software, please cite it as follows:
135
170
  }
136
171
  ```
137
172
 
173
+ ## How to get Support?
174
+
175
+ If you come across any bug or need assistance please feel free to open a new
176
+ [issue](https://github.com/WaterFutures/EPyT-Flow/issues/)
177
+ if non of the existing issues answers your questions.
178
+
138
179
  ## How to Contribute?
139
180
 
140
- Contributions (e.g. creating issues, pull-requests, etc.) are welcome -- please make sure to read the [code of conduct](CODE_OF_CONDUCT.md) and follow the [developers' guidelines](DEVELOPERS.md).
181
+ Contributions (e.g. creating issues, pull-requests, etc.) are welcome --
182
+ please make sure to read the [code of conduct](CODE_OF_CONDUCT.md) and
183
+ follow the [developers' guidelines](DEVELOPERS.md).
@@ -1,4 +1,4 @@
1
- epyt>=1.1.9
1
+ epyt>=1.2.0
2
2
  requests>=2.31.0
3
3
  scipy>=1.11.4
4
4
  u-msgpack-python>=2.8.0
@@ -0,0 +1 @@
1
+ 0.7.1
@@ -509,6 +509,7 @@ def load_scenarios(scenarios_id: list[int], use_net1: bool = True,
509
509
  if not os.path.exists(f_inp_in):
510
510
  with ScenarioSimulator(f_inp_in=network_config.f_inp_in) as wdn:
511
511
  wdn.set_general_parameters(**general_params)
512
+ wdn.epanet_api.setTimePatternStep(hydraulic_time_step)
512
513
 
513
514
  wdn.epanet_api.deletePatternsAll()
514
515
 
@@ -3,12 +3,74 @@ This module provides different metrics for evaluation.
3
3
  """
4
4
  import numpy as np
5
5
  from sklearn.metrics import roc_auc_score as skelarn_roc_auc_score, f1_score as skelarn_f1_scpre, \
6
- mean_absolute_error
6
+ mean_absolute_error, root_mean_squared_error, r2_score as sklearn_r2_score
7
7
 
8
8
 
9
- def running_mse(y_pred: np.ndarray, y: np.ndarray):
9
+ def r2_score(y_pred: np.ndarray, y: np.ndarray) -> float:
10
10
  """
11
- Computes the running Mean Squared Error (MSE).
11
+ Computes the R^2 score (also called the coefficient of determination).
12
+
13
+ Parameters
14
+ ----------
15
+ y_pred : `numpy.ndarray`
16
+ Predicted outputs.
17
+ y : `numpy.ndarray`
18
+ Ground truth outputs.
19
+
20
+ Returns
21
+ -------
22
+ `float`
23
+ R^2 score.
24
+ """
25
+ return sklearn_r2_score(y, y_pred)
26
+
27
+
28
+ def running_r2_score(y_pred: np.ndarray, y: np.ndarray) -> list[float]:
29
+ """
30
+ Computes and returns the running R^2 score -- i.e. the R^2 score for every point in time.
31
+
32
+ Parameters
33
+ ----------
34
+ y_pred : `numpy.ndarray`
35
+ Predicted outputs.
36
+ y : `numpy.ndarray`
37
+ Ground truth outputs.
38
+
39
+ Returns
40
+ -------
41
+ `list[float]`
42
+ The running R^2 score.
43
+ """
44
+ r = []
45
+
46
+ for t in range(2, len(y_pred)):
47
+ r.append(r2_score(y_pred[:t], y[:t]))
48
+
49
+ return r
50
+
51
+
52
+ def mean_squared_error(y_pred: np.ndarray, y: np.ndarray) -> float:
53
+ """
54
+ Computes the Mean Squared Error (MSE).
55
+
56
+ Parameters
57
+ ----------
58
+ y_pred : `numpy.ndarray`
59
+ Predicted outputs.
60
+ y : `numpy.ndarray`
61
+ Ground truth outputs.
62
+
63
+ Returns
64
+ -------
65
+ `float`
66
+ MSE.
67
+ """
68
+ return root_mean_squared_error(y, y_pred)**2
69
+
70
+
71
+ def running_mse(y_pred: np.ndarray, y: np.ndarray) -> list[float]:
72
+ """
73
+ Computes the running Mean Squared Error (MSE) -- i.e. the MSE for every point in time.
12
74
 
13
75
  Parameters
14
76
  ----------
@@ -39,7 +101,7 @@ def running_mse(y_pred: np.ndarray, y: np.ndarray):
39
101
  r_mse = list(esq for esq in e_sq)
40
102
 
41
103
  for i in range(1, len(y)):
42
- r_mse[i] = ((i * r_mse[i - 1]) / (i + 1)) + (r_mse[i] / (i + 1))
104
+ r_mse[i] = float((i * r_mse[i - 1]) / (i + 1)) + (r_mse[i] / (i + 1))
43
105
 
44
106
  return r_mse
45
107
 
@@ -309,6 +309,39 @@ class JsonSerializable(Serializable):
309
309
  """
310
310
  return my_load_from_json(data)
311
311
 
312
+ @staticmethod
313
+ def load_from_json_file(f_in: str) -> Any:
314
+ """
315
+ Deserializes an instance of this class from a JSON file.
316
+
317
+ Parameters
318
+ ----------
319
+ f_in : `str`
320
+ Path to the JSON file from which to deserialize the object.
321
+
322
+ Returns
323
+ -------
324
+ `Any`
325
+ Deserialized object.
326
+ """
327
+ with open(f_in, "r", encoding="utf-8") as f:
328
+ return my_load_from_json(f.read())
329
+
330
+ def save_to_json_file(self, f_out: str) -> None:
331
+ """
332
+ Serializes this instance and stores it in a JSON file.
333
+
334
+ Parameters
335
+ ----------
336
+ f_in : `str`
337
+ Path to the JSON file where this serialized object will be stored.
338
+ """
339
+ if not f_out.endswith(self.file_ext()):
340
+ f_out += self.file_ext()
341
+
342
+ with open(f_out, "w", encoding="utf-8") as f:
343
+ f.write(self.to_json())
344
+
312
345
 
313
346
  def load(data: Union[bytes, BufferedIOBase]) -> Any:
314
347
  """