openswmm 5.3.0.dev0__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.
@@ -0,0 +1,1012 @@
1
+ """
2
+ This type stub file was generated by cyright.
3
+ """
4
+
5
+ from enum import Enum
6
+ from typing import Any, Callable, List, Tuple, Union
7
+ from datetime import datetime
8
+
9
+ class SWMMObjects(Enum):
10
+ """
11
+ Enumeration of SWMM objects.
12
+
13
+ :ivar RAIN_GAGE: Raingage object
14
+ :type RAIN_GAGE: int
15
+ :ivar SUBCATCHMENT: Subcatchment object
16
+ :type SUBCATCHMENT: int
17
+ :ivar NODE: Node object
18
+ :type NODE: int
19
+ :ivar LINK: Link object
20
+ :type LINK: int
21
+ :ivar AQUIFER: Aquifer object
22
+ :type AQUIFER: int
23
+ :ivar SNOWPACK: Snowpack object
24
+ :type SNOWPACK: int
25
+ :ivar UNIT_HYDROGRAPH: Unit hydrograph object
26
+ :type UNIT_HYDROGRAPH: int
27
+ :ivar LID: LID object
28
+ :type LID: int
29
+ :ivar STREET: Street object
30
+ :type STREET: int
31
+ :ivar INLET: Inlet object
32
+ :type INLET: int
33
+ :ivar TRANSECT: Transect object
34
+ :type TRANSECT: int
35
+ :ivar XSECTION_SHAPE: Cross-section shape object
36
+ :type XSECTION_SHAPE: int
37
+ :ivar CONTROL_RULE: Control rule object
38
+ :type CONTROL_RULE: int
39
+ :ivar POLLUTANT: Pollutant object
40
+ :type POLLUTANT: int
41
+ :ivar LANDUSE: Land use object
42
+ :type LANDUSE: int
43
+ :ivar CURVE: Curve object
44
+ :type CURVE: int
45
+ :ivar TIMESERIES: Time series object
46
+ :type TIMESERIES: int
47
+ :ivar TIME_PATTERN: Time pattern object
48
+ :type TIME_PATTERN: int
49
+ :ivar SYSTEM: System object
50
+ :type SYSTEM: int
51
+ """
52
+ RAIN_GAGE = ...
53
+ SUBCATCHMENT = ...
54
+ NODE = ...
55
+ LINK = ...
56
+ AQUIFER = ...
57
+ SNOWPACK = ...
58
+ UNIT_HYDROGRAPH = ...
59
+ LID = ...
60
+ STREET = ...
61
+ INLET = ...
62
+ TRANSECT = ...
63
+ XSECTION_SHAPE = ...
64
+ CONTROL_RULE = ...
65
+ POLLUTANT = ...
66
+ LANDUSE = ...
67
+ CURVE = ...
68
+ TIMESERIES = ...
69
+ TIME_PATTERN = ...
70
+ SYSTEM = ...
71
+
72
+
73
+ class SWMMNodeTypes(Enum):
74
+ """
75
+ Enumeration of SWMM node types.
76
+
77
+ :ivar JUNCTION: Junction node
78
+ :type JUNCTION: int
79
+ :ivar OUTFALL: Outfall node
80
+ :type OUTFALL: int
81
+ :ivar STORAGE: Storage node
82
+ :type STORAGE: int
83
+ :ivar DIVIDER: Divider node
84
+ :type DIVIDER: int
85
+ """
86
+ JUNCTION = ...
87
+ OUTFALL = ...
88
+ STORAGE = ...
89
+ DIVIDER = ...
90
+
91
+
92
+ class SWMMRainGageProperties(Enum):
93
+ """
94
+ Enumeration of SWMM raingage properties.
95
+
96
+ :ivar GAGE_TOTAL_PRECIPITATION: Total precipitation
97
+ :type GAGE_TOTAL_PRECIPITATION: int
98
+ :ivar GAGE_RAINFALL: Rainfall
99
+ :type GAGE_RAINFALL: int
100
+ :ivar GAGE_SNOWFALL: Snowfall
101
+ :type GAGE_SNOWFALL: int
102
+ """
103
+ GAGE_TOTAL_PRECIPITATION = ...
104
+ GAGE_RAINFALL = ...
105
+ GAGE_SNOWFALL = ...
106
+
107
+
108
+ class SWMMSubcatchmentProperties(Enum):
109
+ """
110
+ Enumeration of SWMM subcatchment properties.
111
+
112
+ :ivar AREA: Area
113
+ :type AREA: int
114
+ :ivar RAINGAGE: Raingage
115
+ :type RAINGAGE: int
116
+ :ivar RAINFALL: Rainfall
117
+ :type RAINFALL: int
118
+ :ivar EVAPORATION: Evaporation
119
+ :type EVAPORATION: int
120
+ :ivar INFILTRATION: Infiltration
121
+ :type INFILTRATION: int
122
+ :ivar RUNOFF: Runoff
123
+ :type RUNOFF: int
124
+ :ivar REPORT_FLAG: Report flag
125
+ :type REPORT_FLAG: int
126
+ :ivar WIDTH: Width
127
+ :type WIDTH: int
128
+ :ivar SLOPE: Slope
129
+ :type SLOPE: int
130
+ :ivar CURB_LENGTH: Curb length
131
+ :type CURB_LENGTH: int
132
+ :ivar API_RAINFALL: API Rainfall
133
+ :type API_RAINFALL: int
134
+ :ivar API_SNOWFALL: API Snowfall
135
+ :type API_SNOWFALL: int
136
+ :ivar POLLUTANT_BUILDUP: Pollutant buildup
137
+ :type POLLUTANT_BUILDUP: int
138
+ :ivar EXTERNAL_POLLUTANT_BUILDUP: External pollutant buildup
139
+ :type EXTERNAL_POLLUTANT_BUILDUP: int
140
+ :ivar POLLUTANT_RUNOFF_CONCENTRATION: Pollutant runoff concentration
141
+ :type POLLUTANT_RUNOFF_CONCENTRATION: int
142
+ :ivar POLLUTANT_PONDED_CONCENTRATION: Pollutant ponded concentration
143
+ :type POLLUTANT_PONDED_CONCENTRATION: int
144
+ :ivar POLLUTANT_TOTAL_LOAD: Pollutant total load
145
+ :type POLLUTANT_TOTAL_LOAD: int
146
+ """
147
+ AREA = ...
148
+ RAINGAGE = ...
149
+ RAINFALL = ...
150
+ EVAPORATION = ...
151
+ INFILTRATION = ...
152
+ RUNOFF = ...
153
+ REPORT_FLAG = ...
154
+ WIDTH = ...
155
+ SLOPE = ...
156
+ CURB_LENGTH = ...
157
+ API_RAINFALL = ...
158
+ API_SNOWFALL = ...
159
+ POLLUTANT_BUILDUP = ...
160
+ EXTERNAL_POLLUTANT_BUILDUP = ...
161
+ POLLUTANT_RUNOFF_CONCENTRATION = ...
162
+ POLLUTANT_PONDED_CONCENTRATION = ...
163
+ POLLUTANT_TOTAL_LOAD = ...
164
+
165
+
166
+ class SWMMNodeProperties(Enum):
167
+ """
168
+ Enumeration of SWMM node properties.
169
+
170
+ :ivar TYPE: Node type
171
+ :type TYPE: int
172
+ :ivar INVERT_ELEVATION: Invert elevation
173
+ :type INVERT_ELEVATION: int
174
+ :ivar MAX_DEPTH: Maximum depth
175
+ :type MAX_DEPTH: int
176
+ :ivar DEPTH: Depth
177
+ :type DEPTH: int
178
+ :ivar HYDRAULIC_HEAD: Hydraulic head
179
+ :type HYDRAULIC_HEAD: int
180
+ :ivar VOLUME: Volume
181
+ :type VOLUME: int
182
+ :ivar LATERAL_INFLOW: Lateral inflow
183
+ :type LATERAL_INFLOW: int
184
+ :ivar TOTAL_INFLOW: Total inflow
185
+ :type TOTAL_INFLOW: int
186
+ :ivar FLOODING: Flooding
187
+ :type FLOODING: int
188
+ :ivar REPORT_FLAG: Report flag
189
+ :type REPORT_FLAG: int
190
+ :ivar SURCHARGE_DEPTH: Surcharge depth
191
+ :type SURCHARGE_DEPTH: int
192
+ :ivar PONDING_AREA: Ponding area
193
+ :type PONDING_AREA: int
194
+ :ivar INITIAL_DEPTH: Initial depth
195
+ :type INITIAL_DEPTH: int
196
+ :ivar POLLUTANT_CONCENTRATION: Pollutant concentration
197
+ :type POLLUTANT_CONCENTRATION: int
198
+ :ivar POLLUTANT_LATERAL_MASS_FLUX: Pollutant lateral mass flux
199
+ :type POLLUTANT_LATERAL_MASS_FLUX: int
200
+ """
201
+ TYPE = ...
202
+ INVERT_ELEVATION = ...
203
+ MAX_DEPTH = ...
204
+ DEPTH = ...
205
+ HYDRAULIC_HEAD = ...
206
+ VOLUME = ...
207
+ LATERAL_INFLOW = ...
208
+ TOTAL_INFLOW = ...
209
+ FLOODING = ...
210
+ REPORT_FLAG = ...
211
+ SURCHARGE_DEPTH = ...
212
+ PONDING_AREA = ...
213
+ INITIAL_DEPTH = ...
214
+ POLLUTANT_CONCENTRATION = ...
215
+ POLLUTANT_LATERAL_MASS_FLUX = ...
216
+
217
+
218
+ class SWMMLinkProperties(Enum):
219
+ """
220
+ Enumeration of SWMM link properties.
221
+
222
+ :ivar TYPE: Link type
223
+ :type TYPE: int
224
+ :ivar START_NODE: Start node
225
+ :type START_NODE: int
226
+ :ivar END_NODE: End node
227
+ :type END_NODE: int
228
+ :ivar LENGTH: Length
229
+ :type LENGTH: int
230
+ :ivar SLOPE: Slope
231
+ :type SLOPE: int
232
+ :ivar FULL_DEPTH: Full depth
233
+ :type FULL_DEPTH: int
234
+ :ivar FULL_FLOW: Full flow
235
+ :type FULL_FLOW: int
236
+ :ivar SETTING: Setting
237
+ :type SETTING: int
238
+ :ivar TIME_OPEN: Time open
239
+ :type TIME_OPEN: int
240
+ :ivar TIME_CLOSED: Time closed
241
+ :type TIME_CLOSED: int
242
+ :ivar FLOW: Flow
243
+ :type FLOW: int
244
+ :ivar DEPTH: Depth
245
+ :type DEPTH: int
246
+ :ivar VELOCITY: Velocity
247
+ :type VELOCITY: int
248
+ :ivar TOP_WIDTH: Top width
249
+ :type TOP_WIDTH: int
250
+ :ivar REPORT_FLAG: Report flag
251
+ :type REPORT_FLAG: int
252
+ :ivar START_NODE_OFFSET: Start node offset
253
+ :type START_NODE_OFFSET: int
254
+ :ivar END_NODE_OFFSET: End node offset
255
+ :type END_NODE_OFFSET: int
256
+ :ivar INITIAL_FLOW: Initial flow
257
+ :type INITIAL_FLOW: int
258
+ :ivar FLOW_LIMIT: Flow limit
259
+ :type FLOW_LIMIT: int
260
+ :ivar INLET_LOSS: Inlet loss
261
+ :type INLET_LOSS: int
262
+ :ivar OUTLET_LOSS: Outlet loss
263
+ :type OUTLET_LOSS: int
264
+ :ivar AVERAGE_LOSS: Average loss
265
+ :type AVERAGE_LOSS: int
266
+ :ivar SEEPAGE_RATE: Seepage rate
267
+ :type SEEPAGE_RATE: int
268
+ :ivar HAS_FLAPGATE: Has flapgate
269
+ :type HAS_FLAPGATE: int
270
+ :ivar POLLUTANT_CONCENTRATION: Pollutant concentration
271
+ :type POLLUTANT_CONCENTRATION: int
272
+ :ivar POLLUTANT_LOAD: Pollutant load
273
+ :type POLLUTANT_LOAD: int
274
+ :ivar POLLUTANT_LATERAL_MASS_FLUX: Pollutant lateral mass flux
275
+ :type POLLUTANT_LATERAL_MASS_FLUX: int
276
+ """
277
+ TYPE = ...
278
+ START_NODE = ...
279
+ END_NODE = ...
280
+ LENGTH = ...
281
+ SLOPE = ...
282
+ FULL_DEPTH = ...
283
+ FULL_FLOW = ...
284
+ SETTING = ...
285
+ TIME_OPEN = ...
286
+ TIME_CLOSED = ...
287
+ FLOW = ...
288
+ DEPTH = ...
289
+ VELOCITY = ...
290
+ TOP_WIDTH = ...
291
+ VOLUME = ...
292
+ CAPACITY = ...
293
+ REPORT_FLAG = ...
294
+ START_NODE_OFFSET = ...
295
+ END_NODE_OFFSET = ...
296
+ INITIAL_FLOW = ...
297
+ FLOW_LIMIT = ...
298
+ INLET_LOSS = ...
299
+ OUTLET_LOSS = ...
300
+ AVERAGE_LOSS = ...
301
+ SEEPAGE_RATE = ...
302
+ HAS_FLAPGATE = ...
303
+ POLLUTANT_CONCENTRATION = ...
304
+ POLLUTANT_LOAD = ...
305
+ POLLUTANT_LATERAL_MASS_FLUX = ...
306
+
307
+
308
+ class SWMMLinkTypes(Enum):
309
+ """
310
+ Enumeration of SWMM link types.
311
+
312
+ :ivar CONDUIT: Conduit link
313
+ :type CONDUIT: int
314
+ :ivar PUMP: Pump link
315
+ :type PUMP: int
316
+ :ivar ORIFICE: Orifice link
317
+ :type ORIFICE: int
318
+ :ivar WEIR: Weir link
319
+ :type WEIR: int
320
+ :ivar OUTLET: Outlet link
321
+ :type OUTLET: int
322
+ """
323
+ CONDUIT = ...
324
+ PUMP = ...
325
+ ORIFICE = ...
326
+ WEIR = ...
327
+ OUTLET = ...
328
+
329
+
330
+ class SWMMSystemProperties(Enum):
331
+ """
332
+ Enumeration of SWMM system properties.
333
+
334
+ :ivar START_DATE: Start date for the simulation
335
+ :type START_DATE: int
336
+ :ivar CURRENT_DATE: Current date for the simulation
337
+ :type CURRENT_DATE: int
338
+ :ivar ELAPSED_TIME: Elapsed time for the simulation
339
+ :type ELAPSED_TIME: int
340
+ :ivar ROUTING_STEP: Routing time step
341
+ :type ROUTING_STEP: int
342
+ :ivar MAX_ROUTING_STEP: Maximum routing time step
343
+ :type MAX_ROUTING_STEP: int
344
+ :ivar REPORT_STEP: Report time step
345
+ :type REPORT_STEP: int
346
+ :ivar TOTAL_STEPS: Total number of steps
347
+ :type TOTAL_STEPS: int
348
+ :ivar NO_REPORT_FLAG: No report flag
349
+ :type NO_REPORT_FLAG: int
350
+ :ivar FLOW_UNITS: Flow units
351
+ :type FLOW_UNITS: int
352
+ :ivar END_DATE: End date for the simulation
353
+ :type END_DATE: int
354
+ :ivar REPORT_START_DATE: Report start date
355
+ :type REPORT_START_DATE: int
356
+ :ivar UNIT_SYSTEM: Unit system
357
+ :type UNIT_SYSTEM: int
358
+ :ivar SURCHARGE_METHOD: Surcharge method
359
+ :type SURCHARGE_METHOD: int
360
+ :ivar ALLOW_PONDING: Allow ponding
361
+ :type ALLOW_PONDING: int
362
+ :ivar INTERTIAL_DAMPING: Inertial damping
363
+ :type INTERTIAL_DAMPING: int
364
+ :ivar NORMAL_FLOW_LIMITED: Normal flow limited
365
+ :type NORMAL_FLOW_LIMITED: int
366
+ :ivar SKIP_STEADY_STATE: Skip steady state
367
+ :type SKIP_STEADY_STATE: int
368
+ :ivar IGNORE_RAINFALL: Ignore rainfall
369
+ :type IGNORE_RAINFALL: int
370
+ :ivar IGNORE_RDII: Ignore RDII
371
+ :type IGNORE_RDII: int
372
+ :ivar IGNORE_SNOWMELT: Ignore snowmelt
373
+ :type IGNORE_SNOWMELT: int
374
+ :ivar IGNORE_GROUNDWATER: Ignore groundwater
375
+ :type IGNORE_GROUNDWATER: int
376
+ :ivar IGNORE_ROUTING: Ignore routing
377
+ :type IGNORE_ROUTING: int
378
+ :ivar IGNORE_QUALITY: Ignore quality
379
+ :type IGNORE_QUALITY: int
380
+ :ivar RULE_STEP: Rule step
381
+ :type RULE_STEP: int
382
+ :ivar SWEEP_START: Sweep start
383
+ :type SWEEP_START: int
384
+ :ivar SWEEP_END: Sweep end
385
+ :type SWEEP_END: int
386
+ :ivar MAX_TRIALS: Maximum trials
387
+ :type MAX_TRIALS: int
388
+ :ivar NUM_THREADS: Number of threads
389
+ :type NUM_THREADS: int
390
+ :ivar MIN_ROUTE_STEP: Minimum routing step
391
+ :type MIN_ROUTE_STEP: int
392
+ :ivar LENGTHENING_STEP: Lengthening step
393
+ :type LENGTHENING_STEP: int
394
+ :ivar START_DRY_DAYS: Start dry days
395
+ :type START_DRY_DAYS: int
396
+ :ivar COURANT_FACTOR: Courant factor
397
+ :type COURANT_FACTOR: int
398
+ :ivar MIN_SURF_AREA: Minimum surface area
399
+ :type MIN_SURF_AREA: int
400
+ :ivar MIN_SLOPE: Minimum slope
401
+ :type MIN_SLOPE: int
402
+ :ivar RUNOFF_ERROR: Runoff error
403
+ :type RUNOFF_ERROR: int
404
+ :ivar FLOW_ERROR: Flow error
405
+ :type FLOW_ERROR: int
406
+ :ivar QUAL_ERROR: Quality error
407
+ :type QUAL_ERROR: int
408
+ :ivar HEAD_TOL: Head tolerance
409
+ :type HEAD_TOL: int
410
+ :ivar SYS_FLOW_TOL: System flow tolerance
411
+ :type SYS_FLOW_TOL: int
412
+ :ivar LAT_FLOW_TOL: Lateral flow tolerance
413
+ :type LAT_FLOW_TOL: int
414
+
415
+ """
416
+ START_DATE = ...
417
+ CURRENT_DATE = ...
418
+ ELAPSED_TIME = ...
419
+ ROUTING_STEP = ...
420
+ MAX_ROUTING_STEP = ...
421
+ REPORT_STEP = ...
422
+ TOTAL_STEPS = ...
423
+ NO_REPORT_FLAG = ...
424
+ FLOW_UNITS = ...
425
+ END_DATE = ...
426
+ REPORT_START_DATE = ...
427
+ UNIT_SYSTEM = ...
428
+ SURCHARGE_METHOD = ...
429
+ ALLOW_PONDING = ...
430
+ INTERTIAL_DAMPING = ...
431
+ NORMAL_FLOW_LIMITED = ...
432
+ SKIP_STEADY_STATE = ...
433
+ IGNORE_RAINFALL = ...
434
+ IGNORE_RDII = ...
435
+ IGNORE_SNOWMELT = ...
436
+ IGNORE_GROUNDWATER = ...
437
+ IGNORE_ROUTING = ...
438
+ IGNORE_QUALITY = ...
439
+ ERROR_CODE = ...
440
+ RULE_STEP = ...
441
+ SWEEP_START = ...
442
+ SWEEP_END = ...
443
+ MAX_TRIALS = ...
444
+ NUM_THREADS = ...
445
+ MIN_ROUTE_STEP = ...
446
+ LENGTHENING_STEP = ...
447
+ START_DRY_DAYS = ...
448
+ COURANT_FACTOR = ...
449
+ MIN_SURF_AREA = ...
450
+ MIN_SLOPE = ...
451
+ RUNOFF_ERROR = ...
452
+ FLOW_ERROR = ...
453
+ QUAL_ERROR = ...
454
+ HEAD_TOL = ...
455
+ SYS_FLOW_TOL = ...
456
+ LAT_FLOW_TOL = ...
457
+
458
+
459
+ class SWMMFlowUnits(Enum):
460
+ """
461
+ Enumeration of SWMM flow units.
462
+
463
+ :ivar CFS: Cubic feet per second
464
+ :type CFS: int
465
+ :ivar GPM: Gallons per minute
466
+ :type GPM: int
467
+ :ivar MGD: Million gallons per day
468
+ :type MGD: int
469
+ :ivar CMS: Cubic meters per second
470
+ :type CMS: int
471
+ :ivar LPS: Liters per second
472
+ :type LPS: int
473
+ :ivar MLD: Million liters per day
474
+ :type MLD: int
475
+ """
476
+ CFS = ...
477
+ GPM = ...
478
+ MGD = ...
479
+ CMS = ...
480
+ LPS = ...
481
+ MLD = ...
482
+
483
+
484
+ class SWMMAPIErrors(Enum):
485
+ """
486
+ Enumeration of SWMM API errors.
487
+
488
+ :ivar PROJECT_NOT_OPENED: Project not opened
489
+ :type PROJECT_NOT_OPENED: int
490
+ :ivar SIMULATION_NOT_STARTED: Simulation not started
491
+ :type SIMULATION_NOT_STARTED: int
492
+ :ivar SIMULATION_NOT_ENDED: Simulation not ended
493
+ :type SIMULATION_NOT_ENDED: int
494
+ """
495
+ PROJECT_NOT_OPENED = ...
496
+ SIMULATION_NOT_STARTED = ...
497
+ SIMULATION_NOT_ENDED = ...
498
+ OBJECT_TYPE = ...
499
+ OBJECT_INDEX = ...
500
+ OBJECT_NAME = ...
501
+ PROPERTY_TYPE = ...
502
+ PROPERTY_VALUE = ...
503
+ TIME_PERIOD = ...
504
+ HOTSTART_FILE_OPEN = ...
505
+ HOTSTART_FILE_FORMAT = ...
506
+ SIMULATION_IS_RUNNING = ...
507
+
508
+
509
+ def run_solver(inp_file: str, rpt_file: str = None, out_file: str = None, swmm_progress_callback: Callable[[float], None] = ...) -> int:
510
+ """
511
+ Run a SWMM simulation with a progress callback.
512
+
513
+ :param inp_file: Input file name
514
+ :rtype inp_file: str
515
+ :param rpt_file: Report file name
516
+ :rtype rpt_file: str
517
+ :param out_file: Output file name
518
+ :rtype out_file: str
519
+ :param swmm_progress_callback: Progress callback function
520
+ :type swmm_progress_callback: callable
521
+ :return: Error code (0 if successful)
522
+ """
523
+ ...
524
+
525
+ def decode_swmm_datetime(swmm_datetime: float) -> Any:
526
+ """
527
+ Decode a SWMM datetime into a datetime object.
528
+
529
+ :param swmm_datetime: SWMM datetime float value
530
+ :type swmm_datetime: float
531
+
532
+ :return: datetime object
533
+ :rtype: datetime
534
+ """
535
+ ...
536
+
537
+ def encode_swmm_datetime(dt: Any) -> float:
538
+ """
539
+ Encode a datetime object into a SWMM datetime float value.
540
+
541
+ :param dt: datetime object
542
+ :type dt: datetime
543
+ :return: SWMM datetime float value
544
+ :rtype: float
545
+ """
546
+ ...
547
+
548
+ def version() -> int:
549
+ """
550
+ Get the SWMM version.
551
+
552
+ :return: SWMM version
553
+ :rtype: str
554
+ """
555
+ ...
556
+
557
+ def get_error_message(error_code: int) -> str:
558
+ """
559
+ Get the error message for a SWMM error code.
560
+
561
+ :param error_code: Error code
562
+ :type error_code: int
563
+ :return: Error message
564
+ :rtype: str
565
+ """
566
+ ...
567
+
568
+ class SolverState(Enum):
569
+ """
570
+ An enumeration to represent the state of the solver.
571
+ """
572
+ CREATED = ...
573
+ OPEN = ...
574
+ STARTED = ...
575
+ FINISHED = ...
576
+ ENDED = ...
577
+ REPORTED = ...
578
+ CLOSED = ...
579
+
580
+
581
+ class CallbackType(Enum):
582
+ """
583
+ An enumeration to represent the type of callback.
584
+ """
585
+ BEFORE_INITIALIZE = ...
586
+ BEFORE_OPEN = ...
587
+ AFTER_OPEN = ...
588
+ BEFORE_START = ...
589
+ AFTER_START = ...
590
+ BEFORE_STEP = ...
591
+ AFTER_STEP = ...
592
+ BEFORE_END = ...
593
+ AFTER_END = ...
594
+ BEFORE_REPORT = ...
595
+ AFTER_REPORT = ...
596
+ BEFORE_CLOSE = ...
597
+ AFTER_CLOSE = ...
598
+
599
+
600
+ class SWMMSolverException(Exception):
601
+ """
602
+ Exception class for SWMM output file processing errors.
603
+ """
604
+ def __init__(self, message: str) -> None:
605
+ """
606
+ Constructor to initialize the exception message.
607
+
608
+ :param message: Error message.
609
+ :type message: str
610
+ """
611
+ ...
612
+
613
+
614
+
615
+ class Solver:
616
+
617
+
618
+ def __init__(
619
+ self,
620
+ inp_file: str,
621
+ rpt_file: str = None,
622
+ out_file: str = None,
623
+ stride_step: int = 300,
624
+ save_results: bool =True
625
+ ):
626
+ """
627
+ Constructor to create a new SWMM solver.
628
+
629
+ :param inp_file: Input file name
630
+ :param rpt_file: Report file name
631
+ :param out_file: Output file name
632
+ """
633
+ ...
634
+
635
+ """
636
+ A class to represent a SWMM solver.
637
+ """
638
+ def __enter__(self): # -> Self@Solver:
639
+ """
640
+ Enter method for context manager.
641
+ """
642
+ ...
643
+
644
+ def __exit__(self, exc_type, exc_value, traceback): # -> None:
645
+ """
646
+ Exit method for context manager.
647
+ """
648
+ ...
649
+
650
+ def __iter__(self): # -> Self@Solver:
651
+ """
652
+ Iterator method for the solver.
653
+ """
654
+ ...
655
+
656
+ def __next__(self): # -> tuple:
657
+ """
658
+ Next method for the solver.
659
+ """
660
+ ...
661
+
662
+ @property
663
+ def start_datetime(self) -> datetime:
664
+ """
665
+ Get the start date of the simulation.
666
+
667
+ :return: Start date
668
+ :rtype: datetime
669
+ """
670
+ ...
671
+
672
+ @start_datetime.setter
673
+ def start_datetime(self, sim_start_datetime: datetime) -> None:
674
+ """
675
+ Initialize the solver.
676
+
677
+ :param sim_start_datetime: Start date of the simulation
678
+ :return: Error code (0 if successful)
679
+ """
680
+ ...
681
+
682
+ @property
683
+ def end_datetime(self) -> datetime:
684
+ """
685
+ Get the end date of the simulation.
686
+
687
+ :return: End date
688
+ :rtype: datetime
689
+ """
690
+ ...
691
+
692
+ @end_datetime.setter
693
+ def end_datetime(self, sim_end_datetime: datetime) -> None:
694
+ """
695
+ Set the end date of the simulation.
696
+
697
+ :param sim_end_datetime: End date of the simulation
698
+ :return: Error code (0 if successful)
699
+ """
700
+ ...
701
+
702
+ @property
703
+ def routing_step(self) -> float:
704
+ """
705
+ Get the routing time step of the simulation in seconds.
706
+
707
+ :return: Routing time step
708
+ :rtype: double
709
+ """
710
+ ...
711
+
712
+ @routing_step.setter
713
+ def routing_step(self, value: float) -> None:
714
+ """
715
+ Set the routing time step of the simulation in seconds.
716
+
717
+ :param value: Routing time step in seconds
718
+ :type value: float
719
+ """
720
+ ...
721
+
722
+ @property
723
+ def reporting_step(self) -> float:
724
+ """
725
+ Get the reporting time step of the simulation in seconds.
726
+
727
+ :return: Reporting time step
728
+ :rtype: double
729
+ """
730
+ ...
731
+
732
+ @reporting_step.setter
733
+ def reporting_step(self, value: float) -> None:
734
+ """
735
+ Set the reporting time step of the simulation in seconds.
736
+
737
+ :param value: Reporting time step in seconds
738
+ :type value: float
739
+ """
740
+ ...
741
+
742
+ @property
743
+ def report_start_datetime(self) -> datetime:
744
+ """
745
+ Get the report start date of the simulation.
746
+
747
+ :return: Report start date
748
+ :rtype: datetime
749
+ """
750
+ ...
751
+
752
+ @report_start_datetime.setter
753
+ def report_start_datetime(self, report_start_datetime: datetime) -> None:
754
+ """
755
+ Set the report start date of the simulation.
756
+
757
+ :param report_start_datetime: Report start date
758
+ :type report_start_datetime: datetime
759
+ """
760
+ ...
761
+
762
+ @property
763
+ def current_datetime(self) -> datetime:
764
+ """
765
+ Get the current date of the simulation.
766
+
767
+ :return: Current date
768
+ :rtype: datetime
769
+ """
770
+ ...
771
+
772
+ @property
773
+ def progress_callbacks_per_second(self) -> int:
774
+ """
775
+ Get the number of progress callbacks per second.
776
+
777
+ :return: Progress callbacks per second
778
+ :rtype: int
779
+ """
780
+ ...
781
+
782
+ @progress_callbacks_per_second.setter
783
+ def progress_callbacks_per_second(self, value: int) -> None:
784
+ """
785
+ Set the number of progress callbacks per second.
786
+
787
+ :param value: Progress callbacks per second
788
+ :type value: int
789
+ """
790
+ ...
791
+
792
+ def get_object_count(self, object_type: SWMMObjects) -> int:
793
+ """
794
+ Get the count of a SWMM object type.
795
+
796
+ :param object_type: SWMM object type
797
+ :type object_type: SWMMObjects
798
+ :return: Object count
799
+ :rtype: int
800
+ """
801
+ ...
802
+
803
+ def get_object_name(self, object_type: SWMMObjects, index: int) -> str:
804
+ """
805
+ Get the name of a SWMM object.
806
+
807
+ :param object_type: SWMM object type
808
+ :type object_type: SWMMObjects
809
+ :param index: Object index
810
+ :type index: int
811
+ :return: Object name
812
+ :rtype: str
813
+ """
814
+ ...
815
+
816
+ def get_object_names(self, object_type: SWMMObjects) -> List[str]:
817
+ """
818
+ Get the names of all SWMM objects of a given type.
819
+
820
+ :param object_type: SWMM object type
821
+ :type object_type: SWMMObjects
822
+ :return: Object names
823
+ :rtype: List[str]
824
+ """
825
+ ...
826
+
827
+ def get_object_index(self, object_type: SWMMObjects, object_name: str) -> int:
828
+ """
829
+ Get the index of a SWMM object.
830
+
831
+ :param object_type: SWMM object type
832
+ :type object_type: SWMMObjects
833
+ :param object_name: Object name
834
+ :type object_name: str
835
+ :return: Object index
836
+ :rtype: int
837
+ """
838
+ ...
839
+
840
+ def set_value(self, object_type: SWMMObjects, property_type: Union[SWMMRainGageProperties, SWMMSubcatchmentProperties, SWMMNodeProperties, SWMMLinkProperties, SWMMSystemProperties], index: Union[int, str], value: float, sub_index: int = ...) -> None:
841
+ """
842
+ Set a SWMM system property value.
843
+
844
+ :param object_type: SWMM object type (e.g., SWMMObjects.NODE)
845
+ :type object_type: SWMMObjects
846
+ :param property_type: SWMM system property type (e.g., SWMMSystemProperties.START_DATE)
847
+ :type property_type: Union[SWMMRainGageProperties, SWMMSubcatchmentProperties, SWMMNodeProperties, SWMMLinkProperties, SWMMSystemProperties]
848
+ :param index: Object index (e.g., 0, 'J1')
849
+ :type index: int or str
850
+ :param value: Property value (e.g., 10.0)
851
+ :type value: double
852
+ :param sub_index: Sub-index (e.g., 0) for properties with sub-indexes. For example pollutant index for POLLUTANT properties.
853
+ :type sub_index: int
854
+ """
855
+ ...
856
+
857
+ def get_value(self, object_type: SWMMObjects, property_type: Union[SWMMRainGageProperties, SWMMSubcatchmentProperties, SWMMNodeProperties, SWMMLinkProperties, SWMMSystemProperties], index: Union[int, str], sub_index: int = ...) -> float:
858
+ """
859
+ Get a SWMM system property value.
860
+
861
+ :param object_type: SWMM object type (e.g., SWMMObjects.NODE)
862
+ :type object_type: SWMMObjects
863
+ :param property_type: SWMM system property type (e.g., SWMMSystemProperties.START_DATE)
864
+ :type property_type: Union[SWMMRainGageProperties, SWMMSubcatchmentProperties, SWMMNodeProperties, SWMMLinkProperties, SWMMSystemProperties]
865
+ :param index: Object index (e.g., 0, 'J1')
866
+ :type index: int or str
867
+ :param sub_index: Sub-index (e.g., 0) for properties with sub-indexes. For example pollutant index for POLLUTANT properties.
868
+ :type sub_index: int
869
+ :return: Property value
870
+ :rtype: double
871
+ """
872
+ ...
873
+
874
+ @property
875
+ def stride_step(self) -> int:
876
+ """
877
+ Get the stride step of the simulation.
878
+
879
+ :return: Stride step
880
+ :rtype: int
881
+ """
882
+ ...
883
+
884
+ @stride_step.setter
885
+ def stride_step(self, value: int): # -> None:
886
+ """
887
+ Set the stride time step of the simulation.
888
+
889
+ :param value: Stride step in seconds
890
+ :type value: int
891
+ """
892
+ ...
893
+
894
+ @property
895
+ def solver_state(self) -> SolverState:
896
+ """
897
+ Get the state of the solver.
898
+
899
+ :return: Solver state
900
+ :rtype: SolverState
901
+ """
902
+ ...
903
+
904
+ def add_callback(self, callback_type: CallbackType, callback: Callable[[Solver], None]) -> None:
905
+ """
906
+ Add a callback to the solver.
907
+
908
+ :param callback_type: Type of callback
909
+ :type callback_type: CallbackType
910
+ :param callback: Callback function
911
+ :type callback: callable
912
+ """
913
+ ...
914
+
915
+ def add_progress_callback(self, callback: Callable[[double], None]) -> None:
916
+ """
917
+ Add a progress callback to the solver.
918
+
919
+ :param callback: Progress callback function
920
+ :type callback: callable
921
+ """
922
+ ...
923
+
924
+ def open(self) -> Any:
925
+ """
926
+ Opens the SWMM solver by calling the open method in the SWMM API.
927
+ """
928
+ ...
929
+
930
+ def start(self) -> Any:
931
+ """
932
+ Starts the SWMM solver.
933
+ """
934
+ ...
935
+
936
+ def initialize(self) -> Any:
937
+ """
938
+ Initializes the solver and starts the simulation. Calls the open and start methods in
939
+ the SWMM API.
940
+ """
941
+ ...
942
+
943
+ def step(self, steps: int = ...) -> tuple:
944
+ """
945
+ Step a SWMM simulation.
946
+
947
+ :param steps: Number of steps to run. Overrides internal stride step if greater than 0.
948
+ :type steps: int
949
+ :return: elapsed_time, current_date
950
+ :rtype: Tuple[float, datetime]
951
+ """
952
+ ...
953
+
954
+ def end(self) -> Any:
955
+ """
956
+ Ends the SWMM simulation.
957
+ """
958
+ ...
959
+
960
+ def report(self) -> Any:
961
+ """
962
+ Reports the results of the SWMM simulation.
963
+ """
964
+ ...
965
+
966
+ def close(self) -> Any:
967
+ """
968
+ Close the solver.
969
+ """
970
+ ...
971
+
972
+ def finalize(self) -> Any:
973
+ """
974
+ Finalize the solver. Ends simulation, reports the results, and dispose objects.
975
+ """
976
+ ...
977
+
978
+ def execute(self) -> Any:
979
+ """
980
+ Run the solver to completion.
981
+
982
+ :return: Error code (0 if successful)
983
+ """
984
+ ...
985
+
986
+ def use_hotstart(self, hotstart_file: str) -> Any:
987
+ """
988
+ Use a hotstart file.
989
+
990
+ :param hotstart_file: Hotstart file name
991
+ """
992
+ ...
993
+
994
+ def save_hotstart(self, hotstart_file: str) -> Any:
995
+ """
996
+ Save a hotstart file.
997
+
998
+ :param hotstart_file: Hotstart file name
999
+ """
1000
+ ...
1001
+
1002
+ def get_mass_balance_error(self) -> Tuple[float, float, float]:
1003
+ """
1004
+ Get the mass balance error.
1005
+
1006
+ :return: Mass balance error
1007
+ :rtype: Tuple[float, float, float]
1008
+ """
1009
+ ...
1010
+
1011
+
1012
+