Conversation
|
It was good that this adds Lines 350 to 359 in e007c98 At first I thought |
SouthEndMusic
left a comment
There was a problem hiding this comment.
Looks good, added some nits
|
|
||
| function BMI.update(model::Model)::Nothing | ||
| step!(model.integrator) | ||
| SciMLBase.step!(model.integrator) |
There was a problem hiding this comment.
Why? Was there a name conflict?
There was a problem hiding this comment.
Before this PR we overloaded SciMLBase.solve! and SciMLBase.step!, and now they are just Ribasim.solve! and Ribasim.solve!, so internally solve! is Ribasim.solve and we qualify the SciMLBase methods.
The overloading was not really useful and potentially confusing. And with some bad luck they can lead to more invalidations.
| function display_error(io::Union{IOStream, Nothing} = nothing)::Nothing | ||
| stack = current_exceptions() | ||
| Base.invokelatest(Base.display_error, stack) | ||
| if io !== nothing |
There was a problem hiding this comment.
| if io !== nothing | |
| if !isnothing(io) |
There was a problem hiding this comment.
I'm a bit hesitant because I believe the io !== nothing can be easier on the compiler. We use === and !== in many places, more than isnothing. See for instance JuliaLang/julia#35585. It might be better in more recent julia versions though.
| if config.allocation.use_allocation | ||
| (; tspan) = integrator.sol.prob | ||
| (; timestep) = config.allocation | ||
| allocation_times = 0:timestep:(tspan[end] - timestep) |
There was a problem hiding this comment.
It looks like allocation_times is only used to determine n_allocation_times, so maybe this can be simply
n_allocation_times = int(floor(tspan[end]/timestep))| endtime = BMI.get_end_time(model) | ||
| @test endtime ≈ 3.16224e7 |
There was a problem hiding this comment.
Why? The value is the same. I just need the variable for an extra test of the time at the end through BMI.
## [v2025.3.0] - 2025-04-14 The only breaking change in this release is to disallow connecting a single FlowBoundary to multiple Basins. There are large improvements in the ability to visualize results on the map in QGIS. We also welcome the Junction node to the family, which will help laying out networks in a recognizable manner. ### Added - Add spatio-temporal results layers to QGIS. [#2208](#2208) - Add topological (straight line) link view toggle to QGIS. [#2208](#2208) - Added [Junction](https://ribasim.org/reference/node/junction.html) node type. [#2175](#2175) - Write results and log bottlenecks also on an interrupt or crash. [#2191](#2191) [#2200](#2200) - Log computation time and save it to `solver_stats.arrow`. [#2209](https://github.com/Deltares/Ribasim/pull/) - Experimental support for writing the model network and results into files used by Delft-FEWS, [`model.to_fews`](`https://ribasim.org/reference/python/Model.html#ribasim.Model.to_fews`). [#2161](#2161) - Document [`results/concentration.arrow`](https://ribasim.org/reference/usage.html#concentration---concentration.arrow). [#2165](#2165) ### Changed - Allow max 1 outflow neighbour for FlowBoundary. [#2192](#2192) - Automatic differentiation is enabled by default again, `autodiff = true`, leading to better performance. [#2137](#2137) [#2183](#2183)
This is a follow-up of #2191. An issue with that is that it logged a warning about crashing simulations also when it succeeded. Also it didn't log the bottlenecks when you interrupt a (hanging) simulation.
Now it does both, this is what is shown when interrupting a simulation, stacktrace is clipped off:
This implements
Base.success(::Model)::Bool. Before we checked the SciML retcode. I noticed that the retcode of an ongoing simulation that gets interrupted is also successfull. So now we check both the retcode and if itis_finished.