1
1
from pathlib import Path
2
- from typing import Dict , List
2
+ from typing import Dict , List , Any
3
3
4
4
import pytest
5
-
5
+ from hydrolib .core .dflowfm .bc .models import \
6
+ TimeInterpolation , QuantityUnitPair , VerticalInterpolation ,VerticalPositionType
6
7
7
8
@pytest .fixture
8
9
def input_files_dir () -> Path :
@@ -209,3 +210,48 @@ def parameter_quantities() -> List[str]:
209
210
"advectiontype" ,
210
211
"infiltrationcapacity" ,
211
212
]
213
+
214
+
215
+ def quantityunitpair (quantity , unit , verticalpositionindex = None ):
216
+ return QuantityUnitPair (
217
+ quantity = quantity , unit = unit , vertpositionindex = verticalpositionindex
218
+ )
219
+
220
+ @pytest .fixture
221
+ def time_series_values () -> Dict [str , Any ]:
222
+ return dict (
223
+ name = "boundary_timeseries" ,
224
+ function = "timeseries" ,
225
+ timeinterpolation = TimeInterpolation .block_to ,
226
+ offset = "1.23" ,
227
+ factor = "2.34" ,
228
+ quantityunitpair = [
229
+ quantityunitpair ("time" , "minutes since 2015-01-01 00:00:00" ),
230
+ quantityunitpair ("dischargebnd" , "m³/s" ),
231
+ ],
232
+ datablock = [["0" , "1.23" ], ["60" , "2.34" ], ["120" , "3.45" ]],
233
+ )
234
+
235
+ @pytest .fixture
236
+ def t3d_values ():
237
+ return dict (
238
+ name = "boundary_t3d" ,
239
+ function = "t3d" ,
240
+ offset = "1.23" ,
241
+ factor = "2.34" ,
242
+ vertpositions = "3.45 4.56 5.67" ,
243
+ vertinterpolation = VerticalInterpolation .log ,
244
+ vertpositiontype = VerticalPositionType .percentage_bed ,
245
+ timeinterpolation = TimeInterpolation .linear ,
246
+ quantityunitpair = [
247
+ quantityunitpair ("time" , "minutes since 2015-01-01 00:00:00" ),
248
+ quantityunitpair ("salinitybnd" , "ppt" , 1 ),
249
+ quantityunitpair ("salinitybnd" , "ppt" , 2 ),
250
+ quantityunitpair ("salinitybnd" , "ppt" , 3 ),
251
+ ],
252
+ datablock = [
253
+ ["0" , "1" , "2" , "3" ],
254
+ ["60" , "4" , "5" , "6" ],
255
+ ["120" , "7" , "8" , "9" ],
256
+ ],
257
+ )
0 commit comments