floodmodeller-api 0.4.2__py3-none-any.whl → 0.4.3__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 (178) hide show
  1. floodmodeller_api/__init__.py +8 -9
  2. floodmodeller_api/_base.py +184 -176
  3. floodmodeller_api/backup.py +273 -273
  4. floodmodeller_api/dat.py +909 -838
  5. floodmodeller_api/diff.py +136 -119
  6. floodmodeller_api/ied.py +307 -311
  7. floodmodeller_api/ief.py +647 -646
  8. floodmodeller_api/ief_flags.py +253 -253
  9. floodmodeller_api/inp.py +266 -268
  10. floodmodeller_api/libs/libifcoremd.dll +0 -0
  11. floodmodeller_api/libs/libifcoremt.so.5 +0 -0
  12. floodmodeller_api/libs/libifport.so.5 +0 -0
  13. floodmodeller_api/{libmmd.dll → libs/libimf.so} +0 -0
  14. floodmodeller_api/libs/libintlc.so.5 +0 -0
  15. floodmodeller_api/libs/libmmd.dll +0 -0
  16. floodmodeller_api/libs/libsvml.so +0 -0
  17. floodmodeller_api/libs/libzzn_read.so +0 -0
  18. floodmodeller_api/libs/zzn_read.dll +0 -0
  19. floodmodeller_api/logs/__init__.py +2 -2
  20. floodmodeller_api/logs/lf.py +320 -314
  21. floodmodeller_api/logs/lf_helpers.py +354 -346
  22. floodmodeller_api/logs/lf_params.py +643 -529
  23. floodmodeller_api/mapping.py +84 -0
  24. floodmodeller_api/test/__init__.py +4 -4
  25. floodmodeller_api/test/conftest.py +9 -8
  26. floodmodeller_api/test/test_backup.py +117 -117
  27. floodmodeller_api/test/test_dat.py +221 -92
  28. floodmodeller_api/test/test_data/All Units 4_6.DAT +1081 -1081
  29. floodmodeller_api/test/test_data/All Units 4_6.feb +1081 -1081
  30. floodmodeller_api/test/test_data/BRIDGE.DAT +926 -926
  31. floodmodeller_api/test/test_data/Culvert_Inlet_Outlet.dat +36 -36
  32. floodmodeller_api/test/test_data/Culvert_Inlet_Outlet.feb +36 -36
  33. floodmodeller_api/test/test_data/DamBreakADI.xml +52 -52
  34. floodmodeller_api/test/test_data/DamBreakFAST.xml +58 -58
  35. floodmodeller_api/test/test_data/DamBreakFAST_dy.xml +53 -53
  36. floodmodeller_api/test/test_data/DamBreakTVD.xml +55 -55
  37. floodmodeller_api/test/test_data/DefenceBreach.xml +53 -53
  38. floodmodeller_api/test/test_data/DefenceBreachFAST.xml +60 -60
  39. floodmodeller_api/test/test_data/DefenceBreachFAST_dy.xml +55 -55
  40. floodmodeller_api/test/test_data/Domain1+2_QH.xml +76 -76
  41. floodmodeller_api/test/test_data/Domain1_H.xml +41 -41
  42. floodmodeller_api/test/test_data/Domain1_Q.xml +41 -41
  43. floodmodeller_api/test/test_data/Domain1_Q_FAST.xml +48 -48
  44. floodmodeller_api/test/test_data/Domain1_Q_FAST_dy.xml +48 -48
  45. floodmodeller_api/test/test_data/Domain1_Q_xml_expected.json +263 -0
  46. floodmodeller_api/test/test_data/Domain1_W.xml +41 -41
  47. floodmodeller_api/test/test_data/EX1.DAT +321 -321
  48. floodmodeller_api/test/test_data/EX1.ext +107 -107
  49. floodmodeller_api/test/test_data/EX1.feb +320 -320
  50. floodmodeller_api/test/test_data/EX1.gxy +107 -107
  51. floodmodeller_api/test/test_data/EX17.DAT +421 -422
  52. floodmodeller_api/test/test_data/EX17.ext +213 -213
  53. floodmodeller_api/test/test_data/EX17.feb +422 -422
  54. floodmodeller_api/test/test_data/EX18.DAT +375 -375
  55. floodmodeller_api/test/test_data/EX18_DAT_expected.json +3876 -0
  56. floodmodeller_api/test/test_data/EX2.DAT +302 -302
  57. floodmodeller_api/test/test_data/EX3.DAT +926 -926
  58. floodmodeller_api/test/test_data/EX3_DAT_expected.json +16235 -0
  59. floodmodeller_api/test/test_data/EX3_IEF_expected.json +61 -0
  60. floodmodeller_api/test/test_data/EX6.DAT +2084 -2084
  61. floodmodeller_api/test/test_data/EX6.ext +532 -532
  62. floodmodeller_api/test/test_data/EX6.feb +2084 -2084
  63. floodmodeller_api/test/test_data/EX6_DAT_expected.json +31647 -0
  64. floodmodeller_api/test/test_data/Event Data Example.DAT +336 -336
  65. floodmodeller_api/test/test_data/Event Data Example.ext +107 -107
  66. floodmodeller_api/test/test_data/Event Data Example.feb +336 -336
  67. floodmodeller_api/test/test_data/Linked1D2D.xml +52 -52
  68. floodmodeller_api/test/test_data/Linked1D2DFAST.xml +53 -53
  69. floodmodeller_api/test/test_data/Linked1D2DFAST_dy.xml +48 -48
  70. floodmodeller_api/test/test_data/Linked1D2D_xml_expected.json +313 -0
  71. floodmodeller_api/test/test_data/blockage.dat +50 -50
  72. floodmodeller_api/test/test_data/blockage.ext +45 -45
  73. floodmodeller_api/test/test_data/blockage.feb +9 -9
  74. floodmodeller_api/test/test_data/blockage.gxy +71 -71
  75. floodmodeller_api/test/test_data/defaultUnits.dat +127 -127
  76. floodmodeller_api/test/test_data/defaultUnits.ext +45 -45
  77. floodmodeller_api/test/test_data/defaultUnits.feb +9 -9
  78. floodmodeller_api/test/test_data/defaultUnits.fmpx +58 -58
  79. floodmodeller_api/test/test_data/defaultUnits.gxy +85 -85
  80. floodmodeller_api/test/test_data/ex3.ief +20 -20
  81. floodmodeller_api/test/test_data/ex3.lf1 +2800 -2800
  82. floodmodeller_api/test/test_data/ex4.DAT +1374 -1374
  83. floodmodeller_api/test/test_data/ex4_changed.DAT +1374 -1374
  84. floodmodeller_api/test/test_data/example1.inp +329 -329
  85. floodmodeller_api/test/test_data/example2.inp +158 -158
  86. floodmodeller_api/test/test_data/example3.inp +297 -297
  87. floodmodeller_api/test/test_data/example4.inp +388 -388
  88. floodmodeller_api/test/test_data/example5.inp +147 -147
  89. floodmodeller_api/test/test_data/example6.inp +154 -154
  90. floodmodeller_api/test/test_data/jump.dat +176 -176
  91. floodmodeller_api/test/test_data/network.dat +1374 -1374
  92. floodmodeller_api/test/test_data/network.ext +45 -45
  93. floodmodeller_api/test/test_data/network.exy +1 -1
  94. floodmodeller_api/test/test_data/network.feb +45 -45
  95. floodmodeller_api/test/test_data/network.ied +45 -45
  96. floodmodeller_api/test/test_data/network.ief +20 -20
  97. floodmodeller_api/test/test_data/network.inp +147 -147
  98. floodmodeller_api/test/test_data/network.pxy +57 -57
  99. floodmodeller_api/test/test_data/network.zzd +122 -122
  100. floodmodeller_api/test/test_data/network_dat_expected.json +21837 -0
  101. floodmodeller_api/test/test_data/network_from_tabularCSV.csv +87 -87
  102. floodmodeller_api/test/test_data/network_ied_expected.json +287 -0
  103. floodmodeller_api/test/test_data/rnweir.dat +9 -9
  104. floodmodeller_api/test/test_data/rnweir.ext +45 -45
  105. floodmodeller_api/test/test_data/rnweir.feb +9 -9
  106. floodmodeller_api/test/test_data/rnweir.gxy +45 -45
  107. floodmodeller_api/test/test_data/rnweir_default.dat +74 -74
  108. floodmodeller_api/test/test_data/rnweir_default.ext +45 -45
  109. floodmodeller_api/test/test_data/rnweir_default.feb +9 -9
  110. floodmodeller_api/test/test_data/rnweir_default.fmpx +58 -58
  111. floodmodeller_api/test/test_data/rnweir_default.gxy +53 -53
  112. floodmodeller_api/test/test_data/unit checks.dat +16 -16
  113. floodmodeller_api/test/test_ied.py +29 -29
  114. floodmodeller_api/test/test_ief.py +125 -24
  115. floodmodeller_api/test/test_inp.py +47 -48
  116. floodmodeller_api/test/test_json.py +114 -0
  117. floodmodeller_api/test/test_logs_lf.py +48 -51
  118. floodmodeller_api/test/test_tool.py +165 -154
  119. floodmodeller_api/test/test_toolbox_structure_log.py +234 -239
  120. floodmodeller_api/test/test_xml2d.py +151 -156
  121. floodmodeller_api/test/test_zzn.py +36 -34
  122. floodmodeller_api/to_from_json.py +218 -0
  123. floodmodeller_api/tool.py +332 -330
  124. floodmodeller_api/toolbox/__init__.py +5 -5
  125. floodmodeller_api/toolbox/example_tool.py +45 -45
  126. floodmodeller_api/toolbox/model_build/__init__.py +2 -2
  127. floodmodeller_api/toolbox/model_build/add_siltation_definition.py +100 -94
  128. floodmodeller_api/toolbox/model_build/structure_log/__init__.py +1 -1
  129. floodmodeller_api/toolbox/model_build/structure_log/structure_log.py +287 -289
  130. floodmodeller_api/toolbox/model_build/structure_log_definition.py +76 -72
  131. floodmodeller_api/units/__init__.py +10 -10
  132. floodmodeller_api/units/_base.py +214 -209
  133. floodmodeller_api/units/boundaries.py +467 -469
  134. floodmodeller_api/units/comment.py +52 -55
  135. floodmodeller_api/units/conduits.py +382 -403
  136. floodmodeller_api/units/helpers.py +123 -132
  137. floodmodeller_api/units/iic.py +107 -101
  138. floodmodeller_api/units/losses.py +305 -308
  139. floodmodeller_api/units/sections.py +444 -445
  140. floodmodeller_api/units/structures.py +1690 -1684
  141. floodmodeller_api/units/units.py +93 -102
  142. floodmodeller_api/units/unsupported.py +44 -44
  143. floodmodeller_api/units/variables.py +87 -89
  144. floodmodeller_api/urban1d/__init__.py +11 -11
  145. floodmodeller_api/urban1d/_base.py +188 -177
  146. floodmodeller_api/urban1d/conduits.py +93 -85
  147. floodmodeller_api/urban1d/general_parameters.py +58 -58
  148. floodmodeller_api/urban1d/junctions.py +81 -79
  149. floodmodeller_api/urban1d/losses.py +81 -74
  150. floodmodeller_api/urban1d/outfalls.py +114 -107
  151. floodmodeller_api/urban1d/raingauges.py +111 -108
  152. floodmodeller_api/urban1d/subsections.py +92 -93
  153. floodmodeller_api/urban1d/xsections.py +147 -141
  154. floodmodeller_api/util.py +77 -21
  155. floodmodeller_api/validation/parameters.py +660 -660
  156. floodmodeller_api/validation/urban_parameters.py +388 -404
  157. floodmodeller_api/validation/validation.py +110 -112
  158. floodmodeller_api/version.py +1 -1
  159. floodmodeller_api/xml2d.py +688 -684
  160. floodmodeller_api/xml2d_template.py +37 -37
  161. floodmodeller_api/zzn.py +387 -365
  162. {floodmodeller_api-0.4.2.dist-info → floodmodeller_api-0.4.3.dist-info}/LICENSE.txt +13 -13
  163. {floodmodeller_api-0.4.2.dist-info → floodmodeller_api-0.4.3.dist-info}/METADATA +82 -82
  164. floodmodeller_api-0.4.3.dist-info/RECORD +179 -0
  165. {floodmodeller_api-0.4.2.dist-info → floodmodeller_api-0.4.3.dist-info}/WHEEL +1 -1
  166. floodmodeller_api-0.4.3.dist-info/entry_points.txt +3 -0
  167. floodmodeller_api/libifcoremd.dll +0 -0
  168. floodmodeller_api/test/test_data/EX3.bmp +0 -0
  169. floodmodeller_api/test/test_data/test_output.csv +0 -87
  170. floodmodeller_api/zzn_read.dll +0 -0
  171. floodmodeller_api-0.4.2.data/scripts/fmapi-add_siltation.bat +0 -2
  172. floodmodeller_api-0.4.2.data/scripts/fmapi-add_siltation.py +0 -3
  173. floodmodeller_api-0.4.2.data/scripts/fmapi-structure_log.bat +0 -2
  174. floodmodeller_api-0.4.2.data/scripts/fmapi-structure_log.py +0 -3
  175. floodmodeller_api-0.4.2.data/scripts/fmapi-toolbox.bat +0 -2
  176. floodmodeller_api-0.4.2.data/scripts/fmapi-toolbox.py +0 -41
  177. floodmodeller_api-0.4.2.dist-info/RECORD +0 -169
  178. {floodmodeller_api-0.4.2.dist-info → floodmodeller_api-0.4.3.dist-info}/top_level.txt +0 -0
@@ -1,404 +1,388 @@
1
- """
2
- Flood Modeller Python API
3
- Copyright (C) 2023 Jacobs U.K. Limited
4
-
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
6
- as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
7
-
8
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
9
- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
10
-
11
- You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
12
-
13
- If you have any query about this program or this License, please contact us at support@floodmodeller.com or write to the following
14
- address: Jacobs UK Limited, Flood Modeller, Cottons Centre, Cottons Lane, London, SE1 2QG, United Kingdom.
15
- """
16
-
17
- urban_parameter_options = {
18
- "name": {
19
- "type": "string-length",
20
- "max_length": 15, # Match nominal lenght imposed during _write (units). No column width defined by Flood Modeller ,
21
- },
22
- "elevation": {
23
- "type": "type-match",
24
- "options": (float, int),
25
- },
26
- "max_depth": {
27
- "type": "type-match",
28
- "options": (float, int),
29
- },
30
- "initial_depth": {
31
- "type": "type-match",
32
- "options": (float, int),
33
- },
34
- "surface_depth": {
35
- "type": "type-match",
36
- "options": (float, int),
37
- },
38
- "area_ponded": {
39
- "type": "type-match",
40
- "options": (float, int),
41
- },
42
- "format": {
43
- "type": "value-match",
44
- "options": ["INTENSITY", "VOLUME", "CUMULATIVE"],
45
- },
46
- "interval": {
47
- # TODO: UPDATE TO CONSIDER - decimal hours or hours:minutes format (e.g., 0:15 for 15-minute readings). search for presence of ";" during _read maybe?
48
- # try turing to float else keep as string
49
- # TODO: add new a type of match called RegEx match for example "[0-9]:[0-9]",
50
- "type": "type-match",
51
- "options": (float, int, str),
52
- },
53
- "snow_catch_factor": {
54
- "type": "type-match",
55
- "options": (float, int),
56
- },
57
- "data_option": {
58
- "type": "value-match",
59
- "options": ["TIMESERIES", "FILE"],
60
- },
61
- "timeseries": {
62
- "type": "type-match",
63
- "options": (str),
64
- },
65
- "filename": {
66
- "type": "type-match",
67
- "options": (str),
68
- },
69
- "station": {
70
- "type": "type-match",
71
- "options": (str),
72
- },
73
- # "station": {
74
- # "type": "type-match",
75
- # "options": (str),
76
- # },
77
- # "station": {
78
- # "type": "type-match",
79
- # "options": (str),
80
- # },
81
- # "station": {
82
- # "type": "type-match",
83
- # "options": (str),
84
- # },
85
- # "station": {
86
- # "type": "type-match",
87
- # "options": (str),
88
- # },
89
- "units": {
90
- "type": "value-match",
91
- "options": ["IN", "MM"],
92
- },
93
- "type": { # outfall type
94
- "type": "value-match",
95
- "options": ["FREE", "NORMAL", "FIXED", "TIDAL", "TIMESERIES"],
96
- },
97
- "stage": {
98
- "type": "type-match",
99
- "options": (float, int),
100
- },
101
- "tcurve": { # tidal curve name
102
- "type": "type-match",
103
- "options": (str),
104
- },
105
- "tseries": { # tidal curve name
106
- "type": "type-match",
107
- "options": (str),
108
- },
109
- "gated": { # outfall type
110
- "type": "value-match",
111
- "options": [None, "", "YES", "NO"],
112
- },
113
- "routeto": { # outfall type
114
- "type": "type-match",
115
- "options": (str),
116
- },
117
- "node1": {
118
- "type": "type-match",
119
- "options": (str),
120
- },
121
- "node2": {
122
- "type": "type-match",
123
- "options": (str),
124
- },
125
- "length": {
126
- "type": "type-match",
127
- "options": (float, int),
128
- },
129
- "n": {
130
- "type": "type-match",
131
- "options": (float, int),
132
- },
133
- "z1": {
134
- "type": "type-match",
135
- "options": (float, int),
136
- },
137
- "z2": {
138
- "type": "type-match",
139
- "options": (float, int),
140
- },
141
- "q0": {
142
- "type": "type-match",
143
- "options": (type(None), float, int),
144
- },
145
- "qmax": {
146
- "type": "type-match",
147
- "options": (type(None), float, int),
148
- },
149
- "kentry": {
150
- "type": "type-match",
151
- "options": (float, int),
152
- },
153
- "kexit": {
154
- "type": "type-match",
155
- "options": (float, int),
156
- },
157
- "kavg": {
158
- "type": "type-match",
159
- "options": (float, int),
160
- },
161
- "flap": { # outfall type
162
- "type": "value-match",
163
- "options": [None, "YES", "NO"],
164
- },
165
- "seepage": { # outfall type
166
- "type": "type-match",
167
- "options": (type(None), float, int),
168
- },
169
- "shape": { # xsection shape
170
- "type": "value-match",
171
- "options": [
172
- "CIRCULAR",
173
- "FORCE_MAIN",
174
- "FILLED_CIRCULAR2",
175
- "RECT_CLOSED",
176
- "RECT_OPEN",
177
- "TRAPEZOIDAL",
178
- "TRIANGULAR",
179
- "HORIZ_ELLIPSE",
180
- "VERT_ELLIPSE",
181
- "ARCH",
182
- "PARABOLIC",
183
- "POWER",
184
- "RECT_TRIANGULAR",
185
- "RECT_ROUND",
186
- "MODBASKETHANDLE",
187
- "EGG",
188
- "HORSESHOE",
189
- "GOTHIC",
190
- "CATENARY",
191
- "SEMIELLIPTICAL",
192
- "BASKETHANDLE",
193
- "SEMICIRCULAR",
194
- "CUSTOM",
195
- "IRREGULAR",
196
- ],
197
- },
198
- "geom1": {
199
- "type": "type-match",
200
- "options": (type(None), float, int, str),
201
- },
202
- "geom2": {
203
- "type": "type-match",
204
- "options": (type(None), float, int, str),
205
- },
206
- "geom3": {
207
- "type": "type-match",
208
- "options": (type(None), float, int, str),
209
- },
210
- "geom4": {
211
- "type": "type-match",
212
- "options": (type(None), float, int, str),
213
- },
214
- "barrels": {
215
- "type": "type-match",
216
- "options": (type(None), int),
217
- },
218
- "culvert": {
219
- # TODO: str added to allow case when optional parameter not provided (and so is ""). Update to improve handling,
220
- "type": "type-match",
221
- "options": (type(None), int, str),
222
- },
223
- "curve": { # curve name
224
- "type": "type-match",
225
- "options": (str),
226
- },
227
- "tsec": {
228
- "type": "type-match",
229
- "options": (str),
230
- },
231
- "options": {
232
- "type": "dict-match",
233
- "options": {
234
- "flow_units": {
235
- "type": "value-match",
236
- "options": [None, "CFS", "GPM", "MGD", "CMS", "LPS", "MLD"],
237
- },
238
- "infiltration": {
239
- "type": "value-match",
240
- "options": [
241
- None,
242
- "HORTON",
243
- "MODIFIED_HORTON",
244
- "GREEN_AMPT",
245
- "MODIFIED_GREEN_AMPT",
246
- "CURVE_NUMBER",
247
- ],
248
- },
249
- "flow_routing": {
250
- "type": "value-match",
251
- "options": [None, "STEADY", "KINWAVE", "DYNWAVE"],
252
- },
253
- "link_offsets": {
254
- "type": "value-match",
255
- "options": [None, "DEPTH", "ELEVATION"],
256
- },
257
- "force_main_equation": {
258
- "type": "value-match",
259
- "options": [None, "H-W", "D-W"],
260
- },
261
- "ignore_rainfall": {
262
- "type": "value-match",
263
- "options": [None, "YES", "NO"],
264
- },
265
- "ignore_snowmelt": {
266
- "type": "value-match",
267
- "options": [None, "YES", "NO"],
268
- },
269
- "ignore_groundwater": {
270
- "type": "value-match",
271
- "options": [None, "YES", "NO"],
272
- },
273
- "ignore_rdii": {
274
- "type": "value-match",
275
- "options": [None, "YES", "NO"],
276
- },
277
- "ignore_routing": {
278
- "type": "value-match",
279
- "options": [None, "YES", "NO"],
280
- },
281
- "ignore_quality": {
282
- "type": "value-match",
283
- "options": [None, "YES", "NO"],
284
- },
285
- "allow_ponding": {
286
- "type": "value-match",
287
- "options": [None, "YES", "NO"],
288
- },
289
- "skip_steady_state": {
290
- "type": "value-match",
291
- "options": [None, "YES", "NO"],
292
- },
293
- "sys_flow_tol": {
294
- "type": "type-match",
295
- "options": (type(None), float, int),
296
- },
297
- "lat_flow_tol": {
298
- "type": "type-match",
299
- "options": (type(None), float, int),
300
- },
301
- "start_date": {
302
- "type": "type-match",
303
- "options": (type(None), str),
304
- },
305
- "start_time": {
306
- "type": "type-match",
307
- "options": (type(None), str),
308
- },
309
- "end_date": {
310
- "type": "type-match",
311
- "options": (type(None), str),
312
- },
313
- "end_time": {
314
- "type": "type-match",
315
- "options": (type(None), str),
316
- },
317
- "report_start_date": {
318
- "type": "type-match",
319
- "options": (type(None), str),
320
- },
321
- "report_start_time": {
322
- "type": "type-match",
323
- "options": (type(None), str),
324
- },
325
- "sweep_start": {
326
- "type": "type-match",
327
- "options": (type(None), str),
328
- },
329
- "sweep_end": {
330
- "type": "type-match",
331
- "options": (type(None), str),
332
- },
333
- "dry_days": {
334
- "type": "type-match",
335
- "options": (type(None), float, int),
336
- },
337
- "report_step": {
338
- "type": "type-match",
339
- "options": (type(None), str),
340
- },
341
- "wet_step": {
342
- "type": "type-match",
343
- "options": (type(None), str),
344
- },
345
- "dry_step": {
346
- "type": "type-match",
347
- "options": (type(None), str),
348
- },
349
- "routing_step": {
350
- "type": "type-match",
351
- "options": (type(None), str),
352
- },
353
- "lengthening_step": { # in INT format
354
- "type": "type-match",
355
- "options": (type(None), float, int),
356
- },
357
- "variable_step": {
358
- "type": "type-match",
359
- "options": (type(None), float, int),
360
- },
361
- "minimum_step": {
362
- "type": "type-match",
363
- "options": (type(None), float, int),
364
- },
365
- "inertial_damping": {
366
- "type": "value-match",
367
- "options": [None, "NONE", "PARTIAL", "FULL"],
368
- },
369
- "normal_flow_limited": {
370
- "type": "value-match",
371
- "options": [None, "SLOPE", "FROUDE", "BOTH"],
372
- },
373
- "min_surfarea": {
374
- "type": "type-match",
375
- "options": (type(None), float, int),
376
- },
377
- "min_slope": {
378
- "type": "type-match",
379
- "options": (type(None), float, int),
380
- },
381
- "max_trials": {
382
- "type": "type-match",
383
- "options": (type(None), float, int),
384
- },
385
- "head_tolerance": {
386
- "type": "type-match",
387
- "options": (type(None), float, int),
388
- },
389
- "threads": {
390
- "type": "type-match",
391
- "options": (type(None), float, int),
392
- },
393
- "tempdir": {
394
- "type": "type-match",
395
- "options": (type(None), str),
396
- },
397
- # Rule step in software but not manual
398
- "rule_step": {
399
- "type": "type-match",
400
- "options": (type(None), str),
401
- },
402
- },
403
- },
404
- }
1
+ """
2
+ Flood Modeller Python API
3
+ Copyright (C) 2024 Jacobs U.K. Limited
4
+
5
+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
6
+ as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
7
+
8
+ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
9
+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
10
+
11
+ You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
12
+
13
+ If you have any query about this program or this License, please contact us at support@floodmodeller.com or write to the following
14
+ address: Jacobs UK Limited, Flood Modeller, Cottons Centre, Cottons Lane, London, SE1 2QG, United Kingdom.
15
+ """
16
+
17
+ urban_parameter_options = {
18
+ "name": {
19
+ "type": "string-length",
20
+ "max_length": 15, # Match nominal lenght imposed during _write (units). No column width defined by Flood Modeller ,
21
+ },
22
+ "elevation": {
23
+ "type": "type-match",
24
+ "options": (float, int),
25
+ },
26
+ "max_depth": {
27
+ "type": "type-match",
28
+ "options": (float, int),
29
+ },
30
+ "initial_depth": {
31
+ "type": "type-match",
32
+ "options": (float, int),
33
+ },
34
+ "surface_depth": {
35
+ "type": "type-match",
36
+ "options": (float, int),
37
+ },
38
+ "area_ponded": {
39
+ "type": "type-match",
40
+ "options": (float, int),
41
+ },
42
+ "format": {
43
+ "type": "value-match",
44
+ "options": ["INTENSITY", "VOLUME", "CUMULATIVE"],
45
+ },
46
+ "interval": {
47
+ # TODO: UPDATE TO CONSIDER - decimal hours or hours:minutes format (e.g., 0:15 for 15-minute readings). search for presence of ";" during _read maybe?
48
+ # try turing to float else keep as string
49
+ # TODO: add new a type of match called RegEx match for example "[0-9]:[0-9]",
50
+ "type": "type-match",
51
+ "options": (float, int, str),
52
+ },
53
+ "snow_catch_factor": {
54
+ "type": "type-match",
55
+ "options": (float, int),
56
+ },
57
+ "data_option": {
58
+ "type": "value-match",
59
+ "options": ["TIMESERIES", "FILE"],
60
+ },
61
+ "timeseries": {
62
+ "type": "type-match",
63
+ "options": (str),
64
+ },
65
+ "filename": {
66
+ "type": "type-match",
67
+ "options": (str),
68
+ },
69
+ "station": {
70
+ "type": "type-match",
71
+ "options": (str),
72
+ },
73
+ "units": {
74
+ "type": "value-match",
75
+ "options": ["IN", "MM"],
76
+ },
77
+ "type": { # outfall type
78
+ "type": "value-match",
79
+ "options": ["FREE", "NORMAL", "FIXED", "TIDAL", "TIMESERIES"],
80
+ },
81
+ "stage": {
82
+ "type": "type-match",
83
+ "options": (float, int),
84
+ },
85
+ "tcurve": { # tidal curve name
86
+ "type": "type-match",
87
+ "options": (str),
88
+ },
89
+ "tseries": { # tidal curve name
90
+ "type": "type-match",
91
+ "options": (str),
92
+ },
93
+ "gated": { # outfall type
94
+ "type": "value-match",
95
+ "options": [None, "", "YES", "NO"],
96
+ },
97
+ "routeto": { # outfall type
98
+ "type": "type-match",
99
+ "options": (str),
100
+ },
101
+ "node1": {
102
+ "type": "type-match",
103
+ "options": (str),
104
+ },
105
+ "node2": {
106
+ "type": "type-match",
107
+ "options": (str),
108
+ },
109
+ "length": {
110
+ "type": "type-match",
111
+ "options": (float, int),
112
+ },
113
+ "n": {
114
+ "type": "type-match",
115
+ "options": (float, int),
116
+ },
117
+ "z1": {
118
+ "type": "type-match",
119
+ "options": (float, int),
120
+ },
121
+ "z2": {
122
+ "type": "type-match",
123
+ "options": (float, int),
124
+ },
125
+ "q0": {
126
+ "type": "type-match",
127
+ "options": (type(None), float, int),
128
+ },
129
+ "qmax": {
130
+ "type": "type-match",
131
+ "options": (type(None), float, int),
132
+ },
133
+ "kentry": {
134
+ "type": "type-match",
135
+ "options": (float, int),
136
+ },
137
+ "kexit": {
138
+ "type": "type-match",
139
+ "options": (float, int),
140
+ },
141
+ "kavg": {
142
+ "type": "type-match",
143
+ "options": (float, int),
144
+ },
145
+ "flap": { # outfall type
146
+ "type": "value-match",
147
+ "options": [None, "YES", "NO"],
148
+ },
149
+ "seepage": { # outfall type
150
+ "type": "type-match",
151
+ "options": (type(None), float, int),
152
+ },
153
+ "shape": { # xsection shape
154
+ "type": "value-match",
155
+ "options": [
156
+ "CIRCULAR",
157
+ "FORCE_MAIN",
158
+ "FILLED_CIRCULAR2",
159
+ "RECT_CLOSED",
160
+ "RECT_OPEN",
161
+ "TRAPEZOIDAL",
162
+ "TRIANGULAR",
163
+ "HORIZ_ELLIPSE",
164
+ "VERT_ELLIPSE",
165
+ "ARCH",
166
+ "PARABOLIC",
167
+ "POWER",
168
+ "RECT_TRIANGULAR",
169
+ "RECT_ROUND",
170
+ "MODBASKETHANDLE",
171
+ "EGG",
172
+ "HORSESHOE",
173
+ "GOTHIC",
174
+ "CATENARY",
175
+ "SEMIELLIPTICAL",
176
+ "BASKETHANDLE",
177
+ "SEMICIRCULAR",
178
+ "CUSTOM",
179
+ "IRREGULAR",
180
+ ],
181
+ },
182
+ "geom1": {
183
+ "type": "type-match",
184
+ "options": (type(None), float, int, str),
185
+ },
186
+ "geom2": {
187
+ "type": "type-match",
188
+ "options": (type(None), float, int, str),
189
+ },
190
+ "geom3": {
191
+ "type": "type-match",
192
+ "options": (type(None), float, int, str),
193
+ },
194
+ "geom4": {
195
+ "type": "type-match",
196
+ "options": (type(None), float, int, str),
197
+ },
198
+ "barrels": {
199
+ "type": "type-match",
200
+ "options": (type(None), int),
201
+ },
202
+ "culvert": {
203
+ # TODO: str added to allow case when optional parameter not provided (and so is ""). Update to improve handling,
204
+ "type": "type-match",
205
+ "options": (type(None), int, str),
206
+ },
207
+ "curve": { # curve name
208
+ "type": "type-match",
209
+ "options": (str),
210
+ },
211
+ "tsec": {
212
+ "type": "type-match",
213
+ "options": (str),
214
+ },
215
+ "options": {
216
+ "type": "dict-match",
217
+ "options": {
218
+ "flow_units": {
219
+ "type": "value-match",
220
+ "options": [None, "CFS", "GPM", "MGD", "CMS", "LPS", "MLD"],
221
+ },
222
+ "infiltration": {
223
+ "type": "value-match",
224
+ "options": [
225
+ None,
226
+ "HORTON",
227
+ "MODIFIED_HORTON",
228
+ "GREEN_AMPT",
229
+ "MODIFIED_GREEN_AMPT",
230
+ "CURVE_NUMBER",
231
+ ],
232
+ },
233
+ "flow_routing": {
234
+ "type": "value-match",
235
+ "options": [None, "STEADY", "KINWAVE", "DYNWAVE"],
236
+ },
237
+ "link_offsets": {
238
+ "type": "value-match",
239
+ "options": [None, "DEPTH", "ELEVATION"],
240
+ },
241
+ "force_main_equation": {
242
+ "type": "value-match",
243
+ "options": [None, "H-W", "D-W"],
244
+ },
245
+ "ignore_rainfall": {
246
+ "type": "value-match",
247
+ "options": [None, "YES", "NO"],
248
+ },
249
+ "ignore_snowmelt": {
250
+ "type": "value-match",
251
+ "options": [None, "YES", "NO"],
252
+ },
253
+ "ignore_groundwater": {
254
+ "type": "value-match",
255
+ "options": [None, "YES", "NO"],
256
+ },
257
+ "ignore_rdii": {
258
+ "type": "value-match",
259
+ "options": [None, "YES", "NO"],
260
+ },
261
+ "ignore_routing": {
262
+ "type": "value-match",
263
+ "options": [None, "YES", "NO"],
264
+ },
265
+ "ignore_quality": {
266
+ "type": "value-match",
267
+ "options": [None, "YES", "NO"],
268
+ },
269
+ "allow_ponding": {
270
+ "type": "value-match",
271
+ "options": [None, "YES", "NO"],
272
+ },
273
+ "skip_steady_state": {
274
+ "type": "value-match",
275
+ "options": [None, "YES", "NO"],
276
+ },
277
+ "sys_flow_tol": {
278
+ "type": "type-match",
279
+ "options": (type(None), float, int),
280
+ },
281
+ "lat_flow_tol": {
282
+ "type": "type-match",
283
+ "options": (type(None), float, int),
284
+ },
285
+ "start_date": {
286
+ "type": "type-match",
287
+ "options": (type(None), str),
288
+ },
289
+ "start_time": {
290
+ "type": "type-match",
291
+ "options": (type(None), str),
292
+ },
293
+ "end_date": {
294
+ "type": "type-match",
295
+ "options": (type(None), str),
296
+ },
297
+ "end_time": {
298
+ "type": "type-match",
299
+ "options": (type(None), str),
300
+ },
301
+ "report_start_date": {
302
+ "type": "type-match",
303
+ "options": (type(None), str),
304
+ },
305
+ "report_start_time": {
306
+ "type": "type-match",
307
+ "options": (type(None), str),
308
+ },
309
+ "sweep_start": {
310
+ "type": "type-match",
311
+ "options": (type(None), str),
312
+ },
313
+ "sweep_end": {
314
+ "type": "type-match",
315
+ "options": (type(None), str),
316
+ },
317
+ "dry_days": {
318
+ "type": "type-match",
319
+ "options": (type(None), float, int),
320
+ },
321
+ "report_step": {
322
+ "type": "type-match",
323
+ "options": (type(None), str),
324
+ },
325
+ "wet_step": {
326
+ "type": "type-match",
327
+ "options": (type(None), str),
328
+ },
329
+ "dry_step": {
330
+ "type": "type-match",
331
+ "options": (type(None), str),
332
+ },
333
+ "routing_step": {
334
+ "type": "type-match",
335
+ "options": (type(None), str),
336
+ },
337
+ "lengthening_step": { # in INT format
338
+ "type": "type-match",
339
+ "options": (type(None), float, int),
340
+ },
341
+ "variable_step": {
342
+ "type": "type-match",
343
+ "options": (type(None), float, int),
344
+ },
345
+ "minimum_step": {
346
+ "type": "type-match",
347
+ "options": (type(None), float, int),
348
+ },
349
+ "inertial_damping": {
350
+ "type": "value-match",
351
+ "options": [None, "NONE", "PARTIAL", "FULL"],
352
+ },
353
+ "normal_flow_limited": {
354
+ "type": "value-match",
355
+ "options": [None, "SLOPE", "FROUDE", "BOTH"],
356
+ },
357
+ "min_surfarea": {
358
+ "type": "type-match",
359
+ "options": (type(None), float, int),
360
+ },
361
+ "min_slope": {
362
+ "type": "type-match",
363
+ "options": (type(None), float, int),
364
+ },
365
+ "max_trials": {
366
+ "type": "type-match",
367
+ "options": (type(None), float, int),
368
+ },
369
+ "head_tolerance": {
370
+ "type": "type-match",
371
+ "options": (type(None), float, int),
372
+ },
373
+ "threads": {
374
+ "type": "type-match",
375
+ "options": (type(None), float, int),
376
+ },
377
+ "tempdir": {
378
+ "type": "type-match",
379
+ "options": (type(None), str),
380
+ },
381
+ # Rule step in software but not manual
382
+ "rule_step": {
383
+ "type": "type-match",
384
+ "options": (type(None), str),
385
+ },
386
+ },
387
+ },
388
+ }