Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Feb 26, 2024
1 parent d7fc006 commit 85b804a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ function main(ARGS::Vector{String})::Cint
logger =
Ribasim.setup_logger(; verbosity = config.logging.verbosity, stream = io)
with_logger(logger) do
ribasim_version = string(pkgversion(Ribasim))
cli = (; ribasim_version = string(pkgversion(Ribasim)))
(; starttime, endtime) = config
if string(ribasim_version) != config.ribasim_version
@warn "The Ribasim version in the TOML config file does not match the used Ribasim CLI version." config.ribasim_version ribasim_version
if config.ribasim_version != cli.ribasim_version
@warn "The Ribasim version in the TOML config file does not match the used Ribasim CLI version." config.ribasim_version cli.ribasim_version
end
@info "Starting a Ribasim simulation." ribasim_version starttime endtime
@info "Starting a Ribasim simulation." cli.ribasim_version starttime endtime
model = Ribasim.run(config)
if successful_retcode(model)
@info "The model finished successfully"
return 0
end

t = Ribasim.datetime_since(model.integrator.t, model.config.starttime)
t = Ribasim.datetime_since(model.integrator.t, starttime)

Check warning on line 72 in core/src/main.jl

View check run for this annotation

Codecov / codecov/patch

core/src/main.jl#L72

Added line #L72 was not covered by tests
retcode = model.integrator.sol.retcode
@error "The model exited at model time $t with return code $retcode.\nSee https://docs.sciml.ai/DiffEqDocs/stable/basics/solution/#retcodes"
return 1
Expand Down

0 comments on commit 85b804a

Please sign in to comment.