Conversation
evetion
left a comment
There was a problem hiding this comment.
Looks good, some minor comments. Note that your test requires a model that has been run (as it needs arrow files), so it fails on our default Python tests.
| raise FileNotFoundError("Model must be written to disk.") | ||
| return FilePath(toml_path) | ||
|
|
||
| def _results_dir(self) -> DirectoryPath: |
There was a problem hiding this comment.
This could be a public method with @Property? And another property with has_run or has_results?
There was a problem hiding this comment.
We now have model.toml_path and model.results_path, which both error if they don't exist. model.results_dir returns the results_dir config entry, which is "results" by default.
I didn't add has_run or has_results yet as I don't think there's much of a need for it yet, but we could always consider it in another PR?
Co-authored-by: Maarten Pronk <git@evetion.nl>
Co-authored-by: Maarten Pronk <git@evetion.nl>
|
REGION_HOME is indeed and interval variable which is the root folder of the Fews-application. everything Fews is relative to this root. At what path exactly REGION_HOME resides is up to the user (could be c:\fews or burried deep insde your One Drive folder, but it should not be on a network drive given the high frequent IO |
|
Hi @visr , I my latest update (posted in my Bulletin) I now also expect a separate shape file for the Areas: |
|
Great. Does the config work if there are no areas? |
|
I guess it gives an error at that moment. |
|
@evetion maybe a quick check since I changed quite a lot? |
LGTM |
This adds a function `model.to_fews(region_dir)` that converts the network and results to files that Delft-FEWS can directly handle. It is marked as experimental for now. @gijsber is working on a Delft-FEWS configuration that can be used to visualize model results, to complement our existing tools. We'll likely add this configuration to this monorepo since it is generic. #2159 also pertains to this work. What is especially nice is the spatio-temporal support of Delft-FEWS, so we can make visualizations like this:  In theory we can support similar functionality with QGIS, but looking at the plots in #1369 this would likely need work in QGIS itself. So this is really a quick win to be able to inspect models better. --------- Co-authored-by: Maarten Pronk <git@evetion.nl>
## [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 adds a function
model.to_fews(region_dir)that converts the network and results to files that Delft-FEWS can directly handle. It is marked as experimental for now.@gijsber is working on a Delft-FEWS configuration that can be used to visualize model results, to complement our existing tools. We'll likely add this configuration to this monorepo since it is generic. #2159 also pertains to this work.
What is especially nice is the spatio-temporal support of Delft-FEWS, so we can make visualizations like this:
In theory we can support similar functionality with QGIS, but looking at the plots in #1369 this would likely need work in QGIS itself. So this is really a quick win to be able to inspect models better.