Skip to content

Commit 52a6e82

Browse files
committed
EPyT: Add functions for pattern time step
1 parent defda29 commit 52a6e82

1 file changed

Lines changed: 46 additions & 2 deletions

File tree

epanet_plus/epanet_toolkit.py

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,50 @@ def set_hydraulic_time_step(self, time_step: int) -> None:
10931093
"""
10941094
self.settimeparam(EpanetConstants.EN_HYDSTEP, time_step)
10951095

1096+
def get_pattern_time_step(self) -> int:
1097+
"""
1098+
Returns the pattern time step in seconds.
1099+
1100+
Returns
1101+
-------
1102+
`int`
1103+
Pattern time step.
1104+
"""
1105+
return self.gettimeparam(EpanetConstants.EN_PATTERNSTEP)
1106+
1107+
def set_pattern_time_step(self, time_step: int) -> None:
1108+
"""
1109+
Specifies the pattern time step.
1110+
1111+
Parameters
1112+
----------
1113+
time_step : `int`
1114+
Pattern time step in seconds.
1115+
"""
1116+
self.settimeparam(EpanetConstants.EN_PATTERNSTEP, time_step)
1117+
1118+
def get_pattern_start_time(self) -> int:
1119+
"""
1120+
Returns the pattern offset in seconds, which will start to be applied at simulation start.
1121+
1122+
Returns
1123+
-------
1124+
`int`
1125+
Pattern offset time.
1126+
"""
1127+
return self.gettimeparam(EpanetConstants.EN_PATTERNSTART)
1128+
1129+
def set_pattern_start_time(self, start_time: int) -> None:
1130+
"""
1131+
Specifies the pattern offset in seconds, which will start to be applied at simulation start.
1132+
1133+
Parameters
1134+
----------
1135+
start_time : `int`
1136+
Pattern offset time step in seconds since simulation start.
1137+
"""
1138+
self.settimeparam(EpanetConstants.EN_PATTERNSTART, start_time)
1139+
10961140
def get_quality_time_step(self) -> int:
10971141
"""
10981142
Returns the quality time step in seconds.
@@ -1154,7 +1198,7 @@ def set_reporting_start_time(self, start_time: int) -> None:
11541198
11551199
Parameters
11561200
----------
1157-
time_step : `int`
1201+
start_time : `int`
11581202
Reporting start time step in seconds since simulation start.
11591203
"""
11601204
self.settimeparam(EpanetConstants.EN_REPORTSTART, start_time)
@@ -1969,7 +2013,7 @@ def set_node_data(self, node_idx: int, elev: float, base_demand: float,
19692013
node_idx : `int`
19702014
Index of the node.
19712015
elev : `float`
1972-
Eleveation of the node.
2016+
Elevation of the node.
19732017
base_demand : `float`
19742018
Base demand of the node.
19752019
demand_pattern_id : `str`

0 commit comments

Comments
 (0)