Skip to content

Merge the restructured XBeach notebooks into wp5-1 - #3

Merged
tomdurrant merged 17 commits into
wp5-1from
wp5-1-xbeach
Sep 28, 2026
Merged

tomdurrant merged 17 commits into
wp5-1from
wp5-1-xbeach

Conversation

@rafa-guedes

@rafa-guedes rafa-guedes commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

This PR merges the restructured XBeach notebooks (now on xbeach) into wp5-1. It keeps all of the wp5-1 site, tooling, SWAN and SCHISM work, and replaces the XBeach part.

What changes for XBeach

  • The XBeach tutorial_01–07 lessons and the old components/, data-interface/ and example-* notebooks are replaced by:
    • notebooks/xbeach/tutorial/: 7 ordered lessons, from a first model to a complete storm-impact setup and its YAML/CLI version;
    • notebooks/xbeach/examples/: 17 focused notebooks.
  • The notebooks are committed with their outputs, including XBeach runs made with the public Docker image ghcr.io/rom-py/xbeach.
  • The data they use is committed in notebooks/xbeach/data/ (2.5 MB), so they run from a clone with no acquisition step.
  • notebooks/xbeach/README.md maps every previous notebook to where its content now lives.

We agreed to restructure the SWAN and SCHISM notebooks the same way next, so this layout is written up as the shared target in docs/tutorial-conventions.md.

Fitting into the wp5-1 site

  • Metadata: every XBeach notebook has rompy_notebooks metadata. execution_eligible is false for all of them, because their outputs are committed. Five are runtime-dependent: they run XBeach, and those cells are skipped when Docker is not available.
  • New example kind for focused, non-sequential notebooks, alongside tutorial and reference.
  • Audit: the XBeach checks now use the XBeach lesson template: each notebook opens with What this shows / Prerequisites / You will learn / Data used, and tutorial lessons link to the previous and next lesson. They no longer look for the Learning goals / Checkpoint / Without Rompy markers. The SWAN and SCHISM checks are unchanged.
  • Link rewriting: notebooks keep .ipynb links, which work in Jupyter and on GitHub. The MkDocs hook now translates them for the site:
    • notebook links go to their pages, with Jupyter heading anchors converted;
    • images go to their staged copies;
    • a model's README.md goes to its learning tutorial page;
    • data and YAML files go to GitHub.
  • Docs pages: xbeach-tutorial.md, models/xbeach.md, the gallery, the coverage matrix and the concept-page links are updated. The home and catalogue pages now link all three learning tutorials.
  • Data manifest: data/example-data.json lists the committed XBeach data.

General introduction and concepts (from Tom's review comment)

Tom suggested keeping the high-level explanation of what rompy offers that the SWAN tutorial series gave (data, plugins, file generation). That series will be replaced when SWAN moves to the new layout, so this material now lives in the general, model-agnostic part of the site:

  • New "What rompy does" page, the first stop after Home:
    • the chores rompy takes on, and a "without and with rompy" table;
    • the describe → generate → run picture, with a short real example;
    • four key ideas, each linking to its concept page;
    • how the ideas appear in SWAN, XBeach and SCHISM;
    • what stays with the modeller.
  • Concepts section: configuration and validation, data, run lifecycle, and plugins, in that order. They keep the existing content and add:
    • the Python/YAML comparison from SWAN tutorial 3, on the configuration page;
    • variants, experiments and chained runs (from SWAN tutorial 7), in the run lifecycle;
    • "See it in the notebooks" links for each model.
  • Start here: the home page is now a guide through the site. The installation page covers the notebook environment and model runtimes; "Using the notebooks" covers how the collections are organised, data, stored outputs and using your own data. Documentation tooling is in the Contributing section (renamed from Guides).
  • XBeach entry points: the first XBeach tutorial and the XBeach README point new users to "What rompy does".

When SWAN and SCHISM are restructured, their first lessons can point to the same page instead of repeating the concepts.

Fixes to existing wp5-1 code (please check)

  • Generated catalogue links: every link in generated/all-notebooks, by-model and by-topic pointed one level too shallow and returned 404 for all models. They now link to the notebook sources, which MkDocs resolves and checks in strict mode.
  • Previous/next lesson footer: it rendered as literal markdown text, with paths one level too shallow. It is now HTML and shows lesson titles instead of ids.
  • Duplicated role in tutorial-conventions.md: after "rename journeys as tutorials", both roles were called "Tutorial", and kind listed tutorial twice. The focused role is now "Example".
  • Duplicate nav entries in mkdocs.yml: index.md (Home and Getting started) and tutorial-conventions.md (Tutorial conventions and Contributor conventions). The duplicates are removed.
  • Inventory test: it hard-coded 43 notebooks. It now compares the count with the tracked model notebooks.
  • Deploy trigger: docs-pages.yml no longer deploys from wp5-1. Re-add it if you use it for previews before merging to main.

Not changed here, for the SWAN and SCHISM restructure

  • These notebook links return 404 on the site:
    • ../../data-concepts/ in SWAN tutorials 01 and 04 and SCHISM tutorials 01 and 04;
    • boundary/boundnest1/ in SWAN tutorial 04;
    • components/output/ in SWAN tutorial 05.
  • SWAN and SCHISM notebooks find their data by searching upwards from the working directory for tests/data, which is only filled after the acquisition script has run. The XBeach approach (committed data next to the notebooks, read with paths relative to the notebook) would avoid both the search and the fetch step.
  • SWAN example_* notebooks are kind: tutorial with no tutorial number, so the footer hook sorts them into the ordered lesson sequence. They would fit the new example kind.
  • requirements.txt lists rompy-xbeach twice (PyPI and git+...@output).
  • environment.yml and setup.sh are out of date: Python 3.10, no rompy-swan or rompy-schism, and rompy-xbeach from main. The installation page uses requirements.txt.

Checks

  • make docs-build (quality gate plus mkdocs build --strict): passes with no warnings.
  • pytest tests: 37 passed, including new tests for the link rewriting.
  • Crawled every internal link on the built site: none broken on XBeach pages; the only 404s are the SWAN/SCHISM notebook links listed above.
  • The XBeach notebooks were run end to end against rompy-xbeach output before this merge; their outputs are unchanged here.

Copies the sample datasets used by the XBeach notebooks from the rompy-xbeach
test data, so the notebooks run from a clone of this repository without
relative paths to other repositories. Notebook outputs go to _output/ folders,
which are ignored.
Seven notebooks that take a new user from a first model to a complete,
running setup, and then to YAML configurations and the rompy CLI.
Seventeen self-contained examples covering grids and bathymetry, wave
boundaries, wind and water levels, model components, data selection,
hotstart, running XBeach and parameter sweeps.
Their content now lives in the tutorial and examples. The README maps each
previous notebook to its replacement, and the files remain in the history.
BoundaryStat and BoundaryBichrom were replaced by BoundaryParams in
rompy-xbeach, with an optional Tlong for bichromatic waves. The constant-waves
example is renamed from waves_parametric to waves_params, since parametric is
the XBeach name for JONSWAP boundaries, and shows the check that bichromatic
waves need the surfbeat wave model.
Tutorial 1 now uses BoundaryParams, which replaced BoundaryStat. The list of
next steps restarted at 1 while linking to tutorials 2 to 7, so the links now
carry the notebook numbers.
rompy-xbeach now uses the XBeach wbctype parametric as the id of the JONSWAP
boundary classes, so generated files are named parametric-*.txt.
The XBeach images are now tagged trunk-r<revision> for trunk builds, alongside
release tags such as 1.24.6057-halloween-beta. The running example explains the
tags.
Replace the XBeach tutorial series and the old XBeach component,
data-interface and example notebooks with the tutorial/ and examples/
notebooks from the xbeach branch.
- Add rompy_notebooks metadata to the XBeach tutorial and examples.
  Outputs are committed, so execution_eligible is false.
- Add an 'example' kind for focused, non-sequential notebooks.
- Audit the XBeach tutorial and examples against their lesson template
  (What this shows, Prerequisites, You will learn, Data used) instead of
  the Learning goals / Checkpoint / Without Rompy markers.
- Compare the inventory size with the tracked model notebooks instead of
  a fixed count.
- Translate relative links in notebook pages: .ipynb links to their
  pages (with Jupyter heading anchors converted to MkDocs ones), images
  to their staged copies, a model README to its learning tutorial page,
  and other repository files to GitHub. Notebooks keep links that work
  in Jupyter and on GitHub.
- Render the previous/next lesson footer as HTML with the lesson titles;
  it was literal markdown with links one level too shallow.
- Link the generated catalogue pages to the notebook sources; their
  links pointed one level too shallow for every model.
- Rewrite the XBeach learning tutorial page, overview and gallery
  section for the tutorial/ and examples/ notebooks, and update the
  coverage matrix and links from the concept pages.
- List the committed XBeach data in data/example-data.json and describe
  committed model data in the build guide and README.
- Describe the tutorial/examples/data layout and the lesson template in
  the conventions page, and rename the duplicated 'Tutorial' role for
  focused notebooks to 'Example'.
- Link all three learning tutorials from the home and catalogue pages.
- Remove duplicate navigation entries (index.md, tutorial-conventions.md)
  and stop deploying the site from the wp5-1 branch.
rafa-guedes and others added 4 commits September 28, 2026 22:33
Links from a notebook to a page in the repository's docs/ folder now go
to that page on the site instead of to GitHub.
- Add 'What rompy does': the chores rompy takes on, a without/with
  rompy comparison, the describe-generate-run picture with a short
  example, four key ideas linking to the concept pages, how the ideas map
  to SWAN, XBeach and SCHISM, and what stays with the modeller. This
  keeps the value-proposition material from the SWAN tutorial series in
  a place that does not depend on one model.
- Group the concept pages under a Concepts section and extend them: the
  Python/YAML comparison on the configuration page, variants and chained
  runs in the run lifecycle, and 'See it in the notebooks' links for
  each model.
- Rewrite the home page as a guide through the site, and split
  installation (notebook environment and model runtimes) from using the
  notebooks (organisation, data, outputs, own data).
- Rename the Guides section to Contributing.
- Point the first XBeach tutorial and the XBeach README to the new page.
The companion to 'What rompy does': a complete run with a toy wind
stress model that needs no model installation. It covers the run period
and grid, a data request cropped to them, a model plugin in a few lines,
validation, generating the workspace, running it with a local backend,
the run as YAML, and variants. The toy model and its ERA5 sample data
live in notebooks/common.
@tomdurrant
tomdurrant merged commit ea4e9ee into wp5-1 Sep 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants