Repository navigation
Add build_model_python.ipynb, update prepare_ldd.ipynb - #864
Open
PeterNelemans wants to merge 1 commit into
Open
PeterNelemans wants to merge 1 commit into
PeterNelemans wants to merge 1 commit into
Conversation
PeterNelemans
force-pushed
the
update_tutorials_and_docs
branch
from
October 21, 2026 21:00
ac975e3 to
febf215
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue addressed
Fixes #768 and #767
Explanation
I added another example notebook for building a Wflow model using Python, and improved the one for deriving some data from the DEM.
New:
build_model_python.ipynbThe existing build example builds a complete model with a single CLI command. That works, but if something goes wrong it is hard to tell what caused it, and users cannot inspect intermediate results. The new notebook builds a model step by step with the Python API, plotting or inspecting the result after each step:
get_basin_geometry)setup_config), basemaps (MERIT Hydro), rivers (hydro_rivers_lin) and river roughnesshydro_reservoirs,hydro_lakes) and glaciers (rgi)test_stations.csv, with subcatchmentsmodel.write()Renamed:
build_model.ipynb→build_model_cli.ipynbReworked:
prepare_ldd.ipynbOn
main, this notebook takes flow directions from MERIT Hydro, derives a river network from them and uses that to re-derive flow directions, which is a bit circular and not very helpful for most users. It now starts from a DEM only (GEBCO), which is the realistic case:hydromt.gis.flw.d8_from_demexamples/gebco_derived_hydrography/and load it again through a data catalogOutput folders
wflow_test_cli_fullandwflow_test_python_full, so they don't overwrite each other when the docs execute them. Updated.gitignoreand thebuild-example-model-fullpixi task to match.Docs
example_index.rst: renamed the dropdown to "Build model", linked both build notebooks and addedbuild_model_pythonto the toctree.user_guide/2_sbm_model/2_build.rst: updated the references tobuild_model_cliand added a link tobuild_model_python.Checklist
mainAdditional Notes (optional)
artifact_dataonly, so no extra data is needed.example-build_modelis nowexample-build_model_cli. All internal references are updated.Let me know what you think!