epyt-flow 0.14.0__py3-none-any.whl → 0.14.1__py3-none-any.whl
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.
- epyt_flow/EPANET/EPANET/SRC_engines/AUTHORS +40 -8
- epyt_flow/EPANET/EPANET/SRC_engines/LICENSE +3 -3
- epyt_flow/EPANET/EPANET/SRC_engines/enumstxt.h +24 -7
- epyt_flow/EPANET/EPANET/SRC_engines/epanet.c +726 -374
- epyt_flow/EPANET/EPANET/SRC_engines/epanet2.c +128 -32
- epyt_flow/EPANET/EPANET/SRC_engines/errors.dat +7 -1
- epyt_flow/EPANET/EPANET/SRC_engines/flowbalance.c +186 -0
- epyt_flow/EPANET/EPANET/SRC_engines/funcs.h +40 -14
- epyt_flow/EPANET/EPANET/SRC_engines/hash.c +177 -177
- epyt_flow/EPANET/EPANET/SRC_engines/hash.h +28 -28
- epyt_flow/EPANET/EPANET/SRC_engines/hydcoeffs.c +192 -40
- epyt_flow/EPANET/EPANET/SRC_engines/hydraul.c +101 -46
- epyt_flow/EPANET/EPANET/SRC_engines/hydsolver.c +85 -24
- epyt_flow/EPANET/EPANET/SRC_engines/hydstatus.c +29 -63
- epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2.h +70 -37
- epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_2.h +408 -234
- epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_enums.h +87 -37
- epyt_flow/EPANET/EPANET/SRC_engines/inpfile.c +153 -79
- epyt_flow/EPANET/EPANET/SRC_engines/input1.c +59 -94
- epyt_flow/EPANET/EPANET/SRC_engines/input2.c +73 -202
- epyt_flow/EPANET/EPANET/SRC_engines/input3.c +446 -351
- epyt_flow/EPANET/EPANET/SRC_engines/leakage.c +527 -0
- epyt_flow/EPANET/EPANET/SRC_engines/mempool.c +8 -4
- epyt_flow/EPANET/EPANET/SRC_engines/mempool.h +23 -23
- epyt_flow/EPANET/EPANET/SRC_engines/output.c +5 -4
- epyt_flow/EPANET/EPANET/SRC_engines/project.c +407 -75
- epyt_flow/EPANET/EPANET/SRC_engines/quality.c +12 -2
- epyt_flow/EPANET/EPANET/SRC_engines/qualreact.c +70 -13
- epyt_flow/EPANET/EPANET/SRC_engines/qualroute.c +7 -5
- epyt_flow/EPANET/EPANET/SRC_engines/report.c +88 -20
- epyt_flow/EPANET/EPANET/SRC_engines/rules.c +144 -6
- epyt_flow/EPANET/EPANET/SRC_engines/smatrix.c +19 -19
- epyt_flow/EPANET/EPANET/SRC_engines/text.h +16 -5
- epyt_flow/EPANET/EPANET/SRC_engines/types.h +73 -19
- epyt_flow/EPANET/EPANET/SRC_engines/util/cstr_helper.c +59 -0
- epyt_flow/EPANET/EPANET/SRC_engines/util/cstr_helper.h +38 -0
- epyt_flow/EPANET/EPANET/SRC_engines/util/errormanager.c +92 -0
- epyt_flow/EPANET/EPANET/SRC_engines/util/errormanager.h +39 -0
- epyt_flow/EPANET/EPANET/SRC_engines/util/filemanager.c +212 -0
- epyt_flow/EPANET/EPANET/SRC_engines/util/filemanager.h +81 -0
- epyt_flow/EPANET/EPANET/SRC_engines/validate.c +408 -0
- epyt_flow/EPANET/compile_linux.sh +1 -1
- epyt_flow/EPANET/compile_macos.sh +1 -1
- epyt_flow/VERSION +1 -1
- epyt_flow/gym/scenario_control_env.py +26 -3
- epyt_flow/simulation/events/quality_events.py +6 -6
- epyt_flow/simulation/events/sensor_faults.py +24 -24
- epyt_flow/simulation/events/system_event.py +3 -3
- epyt_flow/simulation/scada/scada_data.py +1 -1
- epyt_flow/simulation/scenario_simulator.py +14 -11
- epyt_flow/topology.py +8 -1
- epyt_flow/uncertainty/model_uncertainty.py +292 -150
- {epyt_flow-0.14.0.dist-info → epyt_flow-0.14.1.dist-info}/METADATA +2 -2
- {epyt_flow-0.14.0.dist-info → epyt_flow-0.14.1.dist-info}/RECORD +57 -51
- epyt_flow/EPANET/EPANET/SRC_engines/Readme_SRC_Engines.txt +0 -18
- epyt_flow/EPANET/EPANET/SRC_engines/epanet2.def +0 -131
- epyt_flow/EPANET/EPANET/SRC_engines/main.c +0 -93
- {epyt_flow-0.14.0.dist-info → epyt_flow-0.14.1.dist-info}/WHEEL +0 -0
- {epyt_flow-0.14.0.dist-info → epyt_flow-0.14.1.dist-info}/licenses/LICENSE +0 -0
- {epyt_flow-0.14.0.dist-info → epyt_flow-0.14.1.dist-info}/top_level.txt +0 -0
|
@@ -13,7 +13,7 @@ class SystemEvent(Event):
|
|
|
13
13
|
"""
|
|
14
14
|
def __init__(self, **kwds):
|
|
15
15
|
self._epanet_api = None
|
|
16
|
-
self.
|
|
16
|
+
self._exit_called = False
|
|
17
17
|
|
|
18
18
|
super().__init__(**kwds)
|
|
19
19
|
|
|
@@ -52,9 +52,9 @@ class SystemEvent(Event):
|
|
|
52
52
|
if self.start_time <= cur_time < self.end_time:
|
|
53
53
|
self.apply(cur_time)
|
|
54
54
|
elif cur_time > self.end_time:
|
|
55
|
-
if self.
|
|
55
|
+
if self._exit_called is False:
|
|
56
56
|
self.exit(cur_time)
|
|
57
|
-
self.
|
|
57
|
+
self._exit_called = True
|
|
58
58
|
|
|
59
59
|
def reset(self) -> None:
|
|
60
60
|
"""
|
|
@@ -1713,7 +1713,7 @@ class ScadaData(Serializable):
|
|
|
1713
1713
|
self.__sensor_reading_events = sensor_reading_events
|
|
1714
1714
|
self.__init()
|
|
1715
1715
|
|
|
1716
|
-
def extract_time_window(self, start_time: int, end_time: int):
|
|
1716
|
+
def extract_time_window(self, start_time: int, end_time: int = None):
|
|
1717
1717
|
"""
|
|
1718
1718
|
Extracts a time window of SCADA data from this SCADA data instance --
|
|
1719
1719
|
i.e. creating a new SCADA data instance containing data from the requested
|
|
@@ -1966,9 +1966,12 @@ class ScenarioSimulator():
|
|
|
1966
1966
|
self._adapt_to_network_changes()
|
|
1967
1967
|
|
|
1968
1968
|
if self._model_uncertainty is not None:
|
|
1969
|
-
if self.__uncertainties_applied is
|
|
1969
|
+
if self.__uncertainties_applied is False:
|
|
1970
1970
|
self._model_uncertainty.apply(self.epanet_api)
|
|
1971
1971
|
self.__uncertainties_applied = True
|
|
1972
|
+
elif self.__uncertainties_applied is True and reapply_uncertainties is True:
|
|
1973
|
+
self._model_uncertainty.undo(self.epanet_api)
|
|
1974
|
+
self._model_uncertainty.apply(self.epanet_api)
|
|
1972
1975
|
|
|
1973
1976
|
for event in self._system_events:
|
|
1974
1977
|
event.reset()
|
|
@@ -2006,8 +2009,8 @@ class ScenarioSimulator():
|
|
|
2006
2009
|
with the hydraulic simulation.
|
|
2007
2010
|
|
|
2008
2011
|
The default is False.
|
|
2009
|
-
reapply_uncertainties:
|
|
2010
|
-
If True, the uncertainties are re-applied.
|
|
2012
|
+
reapply_uncertainties: `bool`, optional
|
|
2013
|
+
If True, the uncertainties are re-applied on the original properties.
|
|
2011
2014
|
|
|
2012
2015
|
The default is False.
|
|
2013
2016
|
|
|
@@ -2089,8 +2092,8 @@ class ScenarioSimulator():
|
|
|
2089
2092
|
with the hydraulic simulation.
|
|
2090
2093
|
|
|
2091
2094
|
The default is False.
|
|
2092
|
-
reapply_uncertainties
|
|
2093
|
-
If True, the uncertainties are re-applied.
|
|
2095
|
+
reapply_uncertainties : `bool`, optional
|
|
2096
|
+
If True, the uncertainties are re-applied on the original properties.
|
|
2094
2097
|
|
|
2095
2098
|
The default is False.
|
|
2096
2099
|
|
|
@@ -2511,8 +2514,8 @@ class ScenarioSimulator():
|
|
|
2511
2514
|
will be stored -- this usually leads to a significant reduction in memory consumption.
|
|
2512
2515
|
|
|
2513
2516
|
The default is False.
|
|
2514
|
-
reapply_uncertainties
|
|
2515
|
-
If True, the uncertainties are re-applied.
|
|
2517
|
+
reapply_uncertainties : `bool`, optional
|
|
2518
|
+
If True, the uncertainties are re-applied on the original properties.
|
|
2516
2519
|
|
|
2517
2520
|
The default is False.
|
|
2518
2521
|
|
|
@@ -2596,8 +2599,8 @@ class ScenarioSimulator():
|
|
|
2596
2599
|
will be stored -- this usually leads to a significant reduction in memory consumption.
|
|
2597
2600
|
|
|
2598
2601
|
The default is False.
|
|
2599
|
-
reapply_uncertainties
|
|
2600
|
-
If True, the uncertainties are re-applied.
|
|
2602
|
+
reapply_uncertainties : `bool`, optional
|
|
2603
|
+
If True, the uncertainties are re-applied on the original properties.
|
|
2601
2604
|
|
|
2602
2605
|
The default is False.
|
|
2603
2606
|
|
|
@@ -2778,8 +2781,8 @@ class ScenarioSimulator():
|
|
|
2778
2781
|
will be stored -- this usually leads to a significant reduction in memory consumption.
|
|
2779
2782
|
|
|
2780
2783
|
The default is False.
|
|
2781
|
-
reapply_uncertainties:
|
|
2782
|
-
If True, the uncertainties are re-applied.
|
|
2784
|
+
reapply_uncertainties: `bool`, optional
|
|
2785
|
+
If True, the uncertainties are re-applied on the original properties.
|
|
2783
2786
|
|
|
2784
2787
|
The default is False.
|
|
2785
2788
|
|
epyt_flow/topology.py
CHANGED
|
@@ -500,8 +500,15 @@ class NetworkTopology(nx.Graph, JsonSerializable):
|
|
|
500
500
|
raise TypeError("Can not compare 'NetworkTopology' instance to " +
|
|
501
501
|
f"'{type(other)}' instance")
|
|
502
502
|
|
|
503
|
+
adj_matrix = self.get_adj_matrix()
|
|
504
|
+
other_adj_matrix = other.get_adj_matrix()
|
|
505
|
+
|
|
503
506
|
return super().__eq__(other) and \
|
|
504
|
-
self.
|
|
507
|
+
self.name == other.name \
|
|
508
|
+
and not np.any(adj_matrix.data != other_adj_matrix.data) \
|
|
509
|
+
and not np.any(adj_matrix.indices != other_adj_matrix.indices) \
|
|
510
|
+
and not np.any(adj_matrix.indptr != other_adj_matrix.indptr) \
|
|
511
|
+
and self.get_all_nodes() == other.get_all_nodes() \
|
|
505
512
|
and all(link_a[0] == link_b[0] and link_a[1] == link_b[1]
|
|
506
513
|
for link_a, link_b in zip(self.get_all_links(), other.get_all_links())) \
|
|
507
514
|
and self.__units == other.units \
|