Skip to content

Commit ee64c2d

Browse files
committed
Allow setting boundary params in reuse and off classes
1 parent 7a04e62 commit ee64c2d

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

src/rompy_xbeach/data/boundary/special.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
from pathlib import Path
1010
from pydantic import Field
1111

12-
from rompy.core.types import RompyBaseModel
1312
from rompy.core.time import TimeRange
1413

1514
from rompy_xbeach.grid import RegularGrid
1615
from rompy_xbeach.types import XBeachDirectoryBlob
16+
from rompy_xbeach.data.boundary.base import (
17+
WaveBoundaryParams,
18+
SpectralWaveBoundaryParams,
19+
)
1720

1821

19-
class BoundaryOff(RompyBaseModel):
22+
class BoundaryOff(WaveBoundaryParams):
2023
"""No wave forcing.
2124
2225
Use this when you don't want any wave forcing in the model.
@@ -58,7 +61,7 @@ def get(
5861
return {"wbctype": self.id}
5962

6063

61-
class BoundaryReuse(RompyBaseModel):
64+
class BoundaryReuse(SpectralWaveBoundaryParams):
6265
"""Reuse previous boundary conditions.
6366
6467
Makes XBeach reuse wave time series from a previous simulation.
@@ -114,9 +117,16 @@ def get(
114117
Returns
115118
-------
116119
dict
117-
XBeach parameters with wbctype='reuse'.
120+
XBeach parameters with wbctype='reuse' and wave boundary settings.
118121
119122
"""
120123
# Fetch the required bcf files from previous run directory
121124
self.previous_run.get(destdir, patterns=["ebcflist.bcf", "qbcflist.bcf"])
122-
return {"wbctype": self.id}
125+
params = {"wbctype": self.id}
126+
params.update(
127+
self.model_dump(
128+
exclude={"model_type", "id", "previous_run"},
129+
exclude_none=True,
130+
)
131+
)
132+
return params

0 commit comments

Comments
 (0)