epyt-flow 0.13.1__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.
Files changed (63) hide show
  1. epyt_flow/EPANET/EPANET/SRC_engines/AUTHORS +40 -8
  2. epyt_flow/EPANET/EPANET/SRC_engines/LICENSE +3 -3
  3. epyt_flow/EPANET/EPANET/SRC_engines/enumstxt.h +24 -7
  4. epyt_flow/EPANET/EPANET/SRC_engines/epanet.c +726 -374
  5. epyt_flow/EPANET/EPANET/SRC_engines/epanet2.c +128 -32
  6. epyt_flow/EPANET/EPANET/SRC_engines/errors.dat +7 -1
  7. epyt_flow/EPANET/EPANET/SRC_engines/flowbalance.c +186 -0
  8. epyt_flow/EPANET/EPANET/SRC_engines/funcs.h +40 -14
  9. epyt_flow/EPANET/EPANET/SRC_engines/hash.c +177 -177
  10. epyt_flow/EPANET/EPANET/SRC_engines/hash.h +28 -28
  11. epyt_flow/EPANET/EPANET/SRC_engines/hydcoeffs.c +192 -40
  12. epyt_flow/EPANET/EPANET/SRC_engines/hydraul.c +101 -46
  13. epyt_flow/EPANET/EPANET/SRC_engines/hydsolver.c +85 -24
  14. epyt_flow/EPANET/EPANET/SRC_engines/hydstatus.c +29 -63
  15. epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2.h +70 -37
  16. epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_2.h +408 -234
  17. epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_enums.h +87 -37
  18. epyt_flow/EPANET/EPANET/SRC_engines/inpfile.c +153 -79
  19. epyt_flow/EPANET/EPANET/SRC_engines/input1.c +59 -94
  20. epyt_flow/EPANET/EPANET/SRC_engines/input2.c +73 -202
  21. epyt_flow/EPANET/EPANET/SRC_engines/input3.c +446 -351
  22. epyt_flow/EPANET/EPANET/SRC_engines/leakage.c +527 -0
  23. epyt_flow/EPANET/EPANET/SRC_engines/mempool.c +8 -4
  24. epyt_flow/EPANET/EPANET/SRC_engines/mempool.h +23 -23
  25. epyt_flow/EPANET/EPANET/SRC_engines/output.c +5 -4
  26. epyt_flow/EPANET/EPANET/SRC_engines/project.c +407 -75
  27. epyt_flow/EPANET/EPANET/SRC_engines/quality.c +12 -2
  28. epyt_flow/EPANET/EPANET/SRC_engines/qualreact.c +70 -13
  29. epyt_flow/EPANET/EPANET/SRC_engines/qualroute.c +7 -5
  30. epyt_flow/EPANET/EPANET/SRC_engines/report.c +88 -20
  31. epyt_flow/EPANET/EPANET/SRC_engines/rules.c +144 -6
  32. epyt_flow/EPANET/EPANET/SRC_engines/smatrix.c +19 -19
  33. epyt_flow/EPANET/EPANET/SRC_engines/text.h +16 -5
  34. epyt_flow/EPANET/EPANET/SRC_engines/types.h +73 -19
  35. epyt_flow/EPANET/EPANET/SRC_engines/util/cstr_helper.c +59 -0
  36. epyt_flow/EPANET/EPANET/SRC_engines/util/cstr_helper.h +38 -0
  37. epyt_flow/EPANET/EPANET/SRC_engines/util/errormanager.c +92 -0
  38. epyt_flow/EPANET/EPANET/SRC_engines/util/errormanager.h +39 -0
  39. epyt_flow/EPANET/EPANET/SRC_engines/util/filemanager.c +212 -0
  40. epyt_flow/EPANET/EPANET/SRC_engines/util/filemanager.h +81 -0
  41. epyt_flow/EPANET/EPANET/SRC_engines/validate.c +408 -0
  42. epyt_flow/EPANET/compile_linux.sh +1 -1
  43. epyt_flow/EPANET/compile_macos.sh +2 -2
  44. epyt_flow/VERSION +1 -1
  45. epyt_flow/__init__.py +1 -1
  46. epyt_flow/gym/scenario_control_env.py +26 -3
  47. epyt_flow/simulation/backend/my_epyt.py +58 -13
  48. epyt_flow/simulation/events/quality_events.py +6 -6
  49. epyt_flow/simulation/events/sensor_faults.py +24 -24
  50. epyt_flow/simulation/events/system_event.py +3 -3
  51. epyt_flow/simulation/scada/scada_data.py +10 -14
  52. epyt_flow/simulation/scenario_simulator.py +100 -20
  53. epyt_flow/topology.py +8 -1
  54. epyt_flow/uncertainty/model_uncertainty.py +292 -150
  55. epyt_flow/uncertainty/uncertainties.py +2 -2
  56. {epyt_flow-0.13.1.dist-info → epyt_flow-0.14.1.dist-info}/METADATA +4 -4
  57. {epyt_flow-0.13.1.dist-info → epyt_flow-0.14.1.dist-info}/RECORD +60 -54
  58. {epyt_flow-0.13.1.dist-info → epyt_flow-0.14.1.dist-info}/WHEEL +1 -1
  59. epyt_flow/EPANET/EPANET/SRC_engines/Readme_SRC_Engines.txt +0 -18
  60. epyt_flow/EPANET/EPANET/SRC_engines/epanet2.def +0 -131
  61. epyt_flow/EPANET/EPANET/SRC_engines/main.c +0 -93
  62. {epyt_flow-0.13.1.dist-info → epyt_flow-0.14.1.dist-info}/licenses/LICENSE +0 -0
  63. {epyt_flow-0.13.1.dist-info → epyt_flow-0.14.1.dist-info}/top_level.txt +0 -0
@@ -3,13 +3,13 @@
3
3
  /*
4
4
  ******************************************************************************
5
5
  Project: OWA EPANET
6
- Version: 2.2
6
+ Version: 2.3
7
7
  Module: epanet2_enums.h
8
8
  Description: enumerations of symbolic constants used by the API functions
9
9
  Authors: see AUTHORS
10
10
  Copyright: see AUTHORS
11
11
  License: see LICENSE
12
- Last Updated: 11/06/2019
12
+ Last Updated: 04/23/2025
13
13
  ******************************************************************************
14
14
  */
15
15
 
@@ -17,13 +17,11 @@
17
17
  #ifndef EPANET2_ENUMS_H
18
18
  #define EPANET2_ENUMS_H
19
19
 
20
-
21
20
  // --- Define the EPANET toolkit constants
22
-
23
- /// Size Limts
24
- /**
25
- Limits on the size of character arrays used to store ID names
26
- and text messages.
21
+ /// Character array size limits
22
+ /*! \enum EN_SizeLimits
23
+ * Limits on the size of character arrays used to store ID names
24
+ * and text messages.
27
25
  */
28
26
  typedef enum {
29
27
  EN_MAXID = 31, //!< Max. # characters in ID name
@@ -31,11 +29,11 @@ typedef enum {
31
29
  } EN_SizeLimits;
32
30
 
33
31
  /// Node properties
34
- /**
35
- These node properties are used with @ref EN_getnodevalue and @ref EN_setnodevalue.
36
- Those marked as read only are computed values that can only be retrieved.
32
+ /*! \enum EN_NodeProperty
33
+ * These node properties are used with @ref EN_getnodevalue and @ref EN_setnodevalue.
34
+ * Those marked as read only are computed values that can only be retrieved.
37
35
  */
38
- typedef enum {
36
+ typedef enum {
39
37
  EN_ELEVATION = 0, //!< Elevation
40
38
  EN_BASEDEMAND = 1, //!< Primary demand baseline value
41
39
  EN_PATTERN = 2, //!< Primary demand time pattern index
@@ -62,8 +60,13 @@ typedef enum {
62
60
  EN_TANK_KBULK = 23, //!< Tank bulk decay coefficient
63
61
  EN_TANKVOLUME = 24, //!< Current computed tank volume (read only)
64
62
  EN_MAXVOLUME = 25, //!< Tank maximum volume (read only)
65
- EN_CANOVERFLOW = 26, //!< Tank can overflow (= 1) or not (= 0)
66
- EN_DEMANDDEFICIT = 27 //!< Amount that full demand is reduced under PDA (read only)
63
+ EN_CANOVERFLOW = 26, //!< `EN_TRUE` (= 1) if the Tank can overflow, `EN_FALSE` (= 0) if it cannot
64
+ EN_DEMANDDEFICIT = 27,//!< Amount that full demand is reduced under PDA (read only)
65
+ EN_NODE_INCONTROL = 28, //!< `EN_TRUE` (= 1) if the node appears in any control, `EN_FALSE` (= 0) if not
66
+ EN_EMITTERFLOW = 29, //!< Current emitter flow (read only)
67
+ EN_LEAKAGEFLOW = 30, //!< Current leakage flow (read only)
68
+ EN_DEMANDFLOW = 31, //!< Current consumer demand delivered (read only)
69
+ EN_FULLDEMAND = 32 //!< Current consumer demand requested (read only)
67
70
  } EN_NodeProperty;
68
71
 
69
72
  /// Link properties
@@ -78,7 +81,7 @@ typedef enum {
78
81
  EN_MINORLOSS = 3, //!< Pipe/valve minor loss coefficient
79
82
  EN_INITSTATUS = 4, //!< Initial status (see @ref EN_LinkStatusType)
80
83
  EN_INITSETTING = 5, //!< Initial pump speed or valve setting
81
- EN_KBULK = 6, //!< Bulk chemical reaction coefficient
84
+ EN_KBULK = 6, //!< Bulk flow chemical reaction coefficient
82
85
  EN_KWALL = 7, //!< Pipe wall chemical reaction coefficient
83
86
  EN_FLOW = 8, //!< Current computed flow rate (read only)
84
87
  EN_VELOCITY = 9, //!< Current computed flow velocity (read only)
@@ -94,7 +97,14 @@ typedef enum {
94
97
  EN_PUMP_HCURVE = 19, //!< Pump head v. flow curve index
95
98
  EN_PUMP_ECURVE = 20, //!< Pump efficiency v. flow curve index
96
99
  EN_PUMP_ECOST = 21, //!< Pump average energy price
97
- EN_PUMP_EPAT = 22 //!< Pump energy price time pattern index
100
+ EN_PUMP_EPAT = 22, //!< Pump energy price time pattern index
101
+ EN_LINK_INCONTROL = 23, //!< Is present in any simple or rule-based control (= 1) or not (= 0)
102
+ EN_GPV_CURVE = 24, //!< GPV head loss v. flow curve index
103
+ EN_PCV_CURVE = 25, //!< PCV characteristic curve index
104
+ EN_LEAK_AREA = 26, //!< Pipe leak area (sq mm per 100 length units)
105
+ EN_LEAK_EXPAN = 27, //!< Leak expansion rate (sq mm per unit of pressure head)
106
+ EN_LINK_LEAKAGE = 28, //!< Current leakage rate (read only)
107
+ EN_VALVE_TYPE = 29 //!< Type of valve (see @ref EN_LinkType)
98
108
  } EN_LinkProperty;
99
109
 
100
110
  /// Time parameters
@@ -122,6 +132,18 @@ typedef enum {
122
132
  EN_NEXTEVENTTANK = 15 //!< Index of tank with shortest time to become empty or full (read only)
123
133
  } EN_TimeParameter;
124
134
 
135
+ /// Time step events
136
+ /**
137
+ These are the types of events that can cause a new time step to be taken.
138
+ **/
139
+ typedef enum {
140
+ EN_STEP_REPORT = 0, //!< A reporting time step has ended
141
+ EN_STEP_HYD = 1, //!< A hydraulic time step has ended
142
+ EN_STEP_WQ = 2, //!< A water quality time step has ended
143
+ EN_STEP_TANKEVENT = 3, //!< A tank has become empty or full
144
+ EN_STEP_CONTROLEVENT = 4 //!< A link control needs to be activated
145
+ } EN_TimestepEvent;
146
+
125
147
  /// Analysis convergence statistics
126
148
  /**
127
149
  These statistics report the convergence criteria for the most current hydraulic analysis
@@ -135,7 +157,8 @@ typedef enum {
135
157
  EN_MAXFLOWCHANGE = 3, //!< Largest flow change in links
136
158
  EN_MASSBALANCE = 4, //!< Cumulative water quality mass balance ratio
137
159
  EN_DEFICIENTNODES = 5, //!< Number of pressure deficient nodes
138
- EN_DEMANDREDUCTION = 6 //!< % demand reduction at pressure deficient nodes
160
+ EN_DEMANDREDUCTION = 6, //!< % demand reduction at pressure deficient nodes
161
+ EN_LEAKAGELOSS = 7 //!< % flow lost to system leakage
139
162
  } EN_AnalysisStatistic;
140
163
 
141
164
  /// Types of network objects
@@ -188,25 +211,26 @@ typedef enum {
188
211
  EN_PBV = 5, //!< Pressure breaker valve
189
212
  EN_FCV = 6, //!< Flow control valve
190
213
  EN_TCV = 7, //!< Throttle control valve
191
- EN_GPV = 8 //!< General purpose valve
214
+ EN_GPV = 8, //!< General purpose valve
215
+ EN_PCV = 9 //!< Positional control valve
192
216
  } EN_LinkType;
193
217
 
194
218
  /// Link status
195
219
  /**
196
220
  One of these values is returned when @ref EN_getlinkvalue is used to retrieve a link's
197
- initial status ( \b EN_INITSTATUS ) or its current status ( \b EN_STATUS ). These options are
221
+ initial status (`EN_INITSTATUS`) or its current status (`EN_STATUS`). These options are
198
222
  also used with @ref EN_setlinkvalue to set values for these same properties.
199
223
  */
200
224
  typedef enum {
201
- EN_CLOSED = 0,
202
- EN_OPEN = 1
225
+ EN_CLOSED = 0, //!< Link is closed and cannot convey any flow
226
+ EN_OPEN = 1 //!< Link is open and is able to convey flow
203
227
  } EN_LinkStatusType;
204
228
 
205
229
  /// Pump states
206
230
  /**
207
231
  One of these codes is returned when @ref EN_getlinkvalue is used to retrieve a pump's
208
- current operating state ( \b EN_PUMP_STATE ). \b EN_PUMP_XHEAD indicates that the pump has been
209
- shut down because it is being asked to deliver more than its shutoff head. \b EN_PUMP_XFLOW
232
+ current operating state (`EN_PUMP_STATE`). `EN_PUMP_XHEAD` indicates that the pump has been
233
+ shut down because it is being asked to deliver more than its shutoff head. `EN_PUMP_XFLOW`
210
234
  indicates that the pump is being asked to deliver more than its maximum flow.
211
235
  */
212
236
  typedef enum {
@@ -231,7 +255,7 @@ typedef enum {
231
255
  /// Water quality source types
232
256
  /**
233
257
  These are the different types of external water quality sources that can be assigned
234
- to a node's \b EN_SOURCETYPE property as used by @ref EN_getnodevalue and @ref EN_setnodevalue.
258
+ to a node's `EN_SOURCETYPE` property as used by @ref EN_getnodevalue and @ref EN_setnodevalue.
235
259
  */
236
260
  typedef enum {
237
261
  EN_CONCEN = 0, //!< Sets the concentration of external inflow entering a node
@@ -242,9 +266,9 @@ typedef enum {
242
266
 
243
267
  /// Head loss formulas
244
268
  /**
245
- The available choices for the \b EN_HEADLOSSFORM option in @ref EN_getoption and
269
+ The available choices for the `EN_HEADLOSSFORM` option in @ref EN_getoption and
246
270
  @ref EN_setoption. They are also used for the head loss type argument in @ref EN_init.
247
- Each head loss formula uses a different type of roughness coefficient ( \b EN_ROUGHNESS )
271
+ Each head loss formula uses a different type of roughness coefficient (`EN_ROUGHNESS`)
248
272
  that can be set with @ref EN_setlinkvalue.
249
273
  */
250
274
  typedef enum {
@@ -257,7 +281,7 @@ typedef enum {
257
281
  /**
258
282
  These choices for flow units are used with @ref EN_getflowunits and @ref EN_setflowunits.
259
283
  They are also used for the flow units type argument in @ref EN_init. If flow units are
260
- expressed in US Customary units ( \b EN_CFS through \b EN_AFD ) then all other quantities are
284
+ expressed in US Customary units (`EN_CFS` through `EN_AFD`) then all other quantities are
261
285
  in US Customary units. Otherwise they are in metric units.
262
286
  */
263
287
  typedef enum {
@@ -270,9 +294,23 @@ typedef enum {
270
294
  EN_LPM = 6, //!< Liters per minute
271
295
  EN_MLD = 7, //!< Million liters per day
272
296
  EN_CMH = 8, //!< Cubic meters per hour
273
- EN_CMD = 9 //!< Cubic meters per day
297
+ EN_CMD = 9, //!< Cubic meters per day
298
+ EN_CMS = 10 //!< Cubic meters per second
274
299
  } EN_FlowUnits;
275
300
 
301
+ /// Pressure units
302
+ /**
303
+ The available choices for pressure units for the `EN_PRESS_UNITS` option in @ref EN_getoption
304
+ and @ref EN_setoption.
305
+ */
306
+ typedef enum {
307
+ EN_PSI = 0, //!< Pounds per square inch
308
+ EN_KPA = 1, //!< Kilopascals
309
+ EN_METERS = 2, //!< Meters
310
+ EN_BAR = 3, //!< Bar
311
+ EN_FEET = 4 //!< Feet
312
+ } EN_PressUnits;
313
+
276
314
  /// Demand models
277
315
  /**
278
316
  These choices for modeling consumer demands are used with @ref EN_getdemandmodel
@@ -317,7 +355,11 @@ typedef enum {
317
355
  EN_BULKORDER = 19, //!< Bulk water reaction order for pipes
318
356
  EN_WALLORDER = 20, //!< Wall reaction order for pipes (either 0 or 1)
319
357
  EN_TANKORDER = 21, //!< Bulk water reaction order for tanks
320
- EN_CONCENLIMIT = 22 //!< Limiting concentration for growth reactions
358
+ EN_CONCENLIMIT = 22, //!< Limiting concentration for growth reactions
359
+ EN_DEMANDPATTERN = 23, //!< Name of default demand pattern
360
+ EN_EMITBACKFLOW = 24, //!< `EN_TRUE` (= 1) if emitters can backflow, `EN_FALSE` (= 0) if not
361
+ EN_PRESS_UNITS = 25, //!< Pressure units (see @ref EN_PressUnits)
362
+ EN_STATUS_REPORT = 26 //!< Type of status report to produce (see @ref EN_StatusReport)
321
363
  } EN_Option;
322
364
 
323
365
  /// Simple control types
@@ -336,9 +378,10 @@ typedef enum {
336
378
  /// Reporting statistic choices
337
379
  /**
338
380
  These options determine what kind of statistical post-processing should be done on
339
- the time series of simulation results generated before they are reported using
340
- @ref EN_report. An option can be chosen by using \b STATISTIC _option_ as the argument
341
- to @ref EN_setreport.
381
+ the time series of simulation results before they are reported using @ref EN_report
382
+ or saved to the project's binary output file. These options are used in the
383
+ @ref EN_gettimeparam and @ref EN_settimeparam functions when `EN_STATISTIC` is the
384
+ time parameter being set or retrieved.
342
385
  */
343
386
  typedef enum {
344
387
  EN_SERIES = 0, //!< Report all time series points
@@ -351,7 +394,7 @@ typedef enum {
351
394
  /// Tank mixing models
352
395
  /**
353
396
  These are the different types of models that describe water quality mixing in storage tanks.
354
- The choice of model is accessed with the \b EN_MIXMODEL property of a Tank node using
397
+ The choice of model is accessed with the `EN_MIXMODEL` property of a Tank node using
355
398
  @ref EN_getnodevalue and @ref EN_setnodevalue.
356
399
  */
357
400
  typedef enum {
@@ -393,7 +436,8 @@ typedef enum {
393
436
  EN_PUMP_CURVE = 1, //!< Pump head v. flow curve
394
437
  EN_EFFIC_CURVE = 2, //!< Pump efficiency v. flow curve
395
438
  EN_HLOSS_CURVE = 3, //!< Valve head loss v. flow curve
396
- EN_GENERIC_CURVE = 4 //!< Generic curve
439
+ EN_GENERIC_CURVE = 4, //!< Generic curve
440
+ EN_VALVE_CURVE = 5 //!< % of fully open flow v. % open
397
441
  } EN_CurveType;
398
442
 
399
443
  /// Deletion action codes
@@ -403,14 +447,15 @@ should be taken if the node or link being deleted appears in any simple or rule-
403
447
  controls or if a deleted node has any links connected to it.
404
448
  */
405
449
  typedef enum {
406
- EN_UNCONDITIONAL = 0, //!< Delete all controls and connecing links
450
+ EN_UNCONDITIONAL = 0, //!< Delete all controls and connecting links
407
451
  EN_CONDITIONAL = 1 //!< Cancel object deletion if it appears in controls or has connecting links
408
452
  } EN_ActionCodeType;
409
453
 
410
454
  /// Status reporting levels
411
455
  /**
412
456
  These choices specify the level of status reporting written to a project's report
413
- file during a hydraulic analysis. The level is set using the @ref EN_setstatusreport function.
457
+ file during a hydraulic analysis. The level is set using the @ref EN_setstatusreport
458
+ or the @ref EN_setoption functions.
414
459
  */
415
460
  typedef enum {
416
461
  EN_NO_REPORT = 0, //!< No status reporting
@@ -463,6 +508,11 @@ typedef enum {
463
508
  EN_R_IS_ACTIVE = 3 //!< Control valve is active
464
509
  } EN_RuleStatus;
465
510
 
466
- #define EN_MISSING -1.E10 //!< Missing value indicator
511
+ #define EN_MISSING -1.E10 //!< Missing value indicator
512
+ #define EN_SET_CLOSED -1.E10 //!< Link set closed indicator
513
+ #define EN_SET_OPEN 1.E10 //!< Link set open indicator
514
+
515
+ #define EN_FALSE 0 //!< boolean false
516
+ #define EN_TRUE 1 //!< boolean true
467
517
 
468
518
  #endif //EPANET2_ENUMS_H