Skip to content

Commit 195e083

Browse files
committed
reformat bc test files
1 parent 972d639 commit 195e083

File tree

2 files changed

+103
-376
lines changed

2 files changed

+103
-376
lines changed

tests/conftest.py

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from pathlib import Path
2-
from typing import Dict, List
2+
from typing import Dict, List, Any
33

44
import pytest
5-
5+
from hydrolib.core.dflowfm.bc.models import \
6+
TimeInterpolation, QuantityUnitPair, VerticalInterpolation,VerticalPositionType
67

78
@pytest.fixture
89
def input_files_dir() -> Path:
@@ -209,3 +210,48 @@ def parameter_quantities() -> List[str]:
209210
"advectiontype",
210211
"infiltrationcapacity",
211212
]
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

Comments
 (0)