|
9 | 9 | from pathlib import Path |
10 | 10 | from pydantic import Field |
11 | 11 |
|
12 | | -from rompy.core.types import RompyBaseModel |
13 | 12 | from rompy.core.time import TimeRange |
14 | 13 |
|
15 | 14 | from rompy_xbeach.grid import RegularGrid |
16 | 15 | from rompy_xbeach.types import XBeachDirectoryBlob |
| 16 | +from rompy_xbeach.data.boundary.base import ( |
| 17 | + WaveBoundaryParams, |
| 18 | + SpectralWaveBoundaryParams, |
| 19 | +) |
17 | 20 |
|
18 | 21 |
|
19 | | -class BoundaryOff(RompyBaseModel): |
| 22 | +class BoundaryOff(WaveBoundaryParams): |
20 | 23 | """No wave forcing. |
21 | 24 |
|
22 | 25 | Use this when you don't want any wave forcing in the model. |
@@ -58,7 +61,7 @@ def get( |
58 | 61 | return {"wbctype": self.id} |
59 | 62 |
|
60 | 63 |
|
61 | | -class BoundaryReuse(RompyBaseModel): |
| 64 | +class BoundaryReuse(SpectralWaveBoundaryParams): |
62 | 65 | """Reuse previous boundary conditions. |
63 | 66 |
|
64 | 67 | Makes XBeach reuse wave time series from a previous simulation. |
@@ -114,9 +117,16 @@ def get( |
114 | 117 | Returns |
115 | 118 | ------- |
116 | 119 | dict |
117 | | - XBeach parameters with wbctype='reuse'. |
| 120 | + XBeach parameters with wbctype='reuse' and wave boundary settings. |
118 | 121 |
|
119 | 122 | """ |
120 | 123 | # Fetch the required bcf files from previous run directory |
121 | 124 | 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