Skip to content

Commit

Permalink
Merge branch 'main' into cliclap
Browse files Browse the repository at this point in the history
  • Loading branch information
visr authored Apr 23, 2024
2 parents 09b746b + 4ddbb05 commit 233483f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
17 changes: 12 additions & 5 deletions core/src/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,19 @@ function Model(config::Config)::Model
end

# tell the solver to stop when new data comes in
# TODO add all time tables here
time_flow_boundary = load_structvector(db, config, FlowBoundaryTimeV1)
tstops = Vector{Float64}[]
push!(tstops, get_tstops(time_flow_boundary.time, config.starttime))
time_user_demand = load_structvector(db, config, UserDemandTimeV1)
push!(tstops, get_tstops(time_user_demand.time, config.starttime))
for schema_version in [
FlowBoundaryTimeV1,
LevelBoundaryTimeV1,
UserDemandTimeV1,
LevelDemandTimeV1,
FlowDemandTimeV1,
TabulatedRatingCurveTimeV1,
PidControlTimeV1,
]
time_schema = load_structvector(db, config, schema_version)
push!(tstops, get_tstops(time_schema.time, config.starttime))
end

# use state
state = load_structvector(db, config, BasinStateV1)
Expand Down
12 changes: 4 additions & 8 deletions docs/contribute/ci.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,18 @@ We have the following pipeline to generate artifects for releasing:

* Generate Testmodels: produces generated_testmodels artifact which is part of the release.
* Make GitHub Release: uses artifacts and makes the release. TeamCity constantly monitors the GitHub repository. When a tag starts with `v20` is added, it triggers the release process.
* Build libribasim: builds library of Ribasim on Linux and Windows. The artifact is tested in `Test ribasim_api` and used by iMOD Coupler
* Build ribasim_cli: builds CLI application on Linux and Windows, its artifact is tested in `Test ribasim_cli` and used by release
* Test ribasim_api: tests libribasim artifact on Linux and Windows
* Test ribasim_cli: tests ribasim_cli artifact on Linux and Windows
* Build Ribasim: builds library and executable of Ribasim on Linux and Windows. The artifacts are tested in `Test Ribasim Binaries` and used by iMOD Coupler.
* Test Ribasim Binaries: tests libribasim artifact and ribasim_cli artifact on Linux and Windows

::: {.callout-note}
Make GitHub Release does not publish artifacts of "Test libribasim" and "Test ribasim_cli". It only publishes artifacts of "Build libribasim" and "Build ribasim_cli" if the beforementioned tests pass.
Make GitHub Release does not publish artifacts of "Test Ribasim Binaries". It only publishes artifacts of "Build Ribasim" if the beforementioned tests pass.
:::

```{mermaid}
graph LR
A[Make GitHub Release]-->B(Release)
F[Generate Testmodels]-->A
G[Make QGIS plugin]-->A
H[Build libribasim]---D[Test libribasim]
H[Build Ribasim]---D[Test Ribasim Binaries]
D-->A
C[Build ribasim_cli] --- E[Test ribasim_cli]
E-->A
```
3 changes: 1 addition & 2 deletions python/ribasim_testmodels/ribasim_testmodels/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,14 @@ def outlet_model():
starttime="2020-01-01",
endtime="2021-01-01",
crs="EPSG:28992",
solver=ribasim.Solver(saveat=0),
)

# Set up the basins
model.basin.add(
Node(3, Point(2.0, 0.0)),
[
basin.Profile(area=[1000.0, 1000.0], level=[0.0, 1.0]),
basin.State(level=[1e-3]),
basin.State(level=[0.0]),
],
)

Expand Down

0 comments on commit 233483f

Please sign in to comment.