Skip to content

docs: PiWind end-to-end + step-by-step notebooks + intersphinx - #42

Open
sstruzik wants to merge 7 commits into
mainfrom
docs/migration
Open

docs: PiWind end-to-end + step-by-step notebooks + intersphinx#42
sstruzik wants to merge 7 commits into
mainfrom
docs/migration

Conversation

@sstruzik

@sstruzik sstruzik commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Adds executable, end-to-end model documentation to the repository that has the models and the CI to keep it honest.

Part of the cross-repo Oasis documentation restructure (Option B): each repository owns the docs for what it owns, and GenerateDocs aggregates them into the published site.

Why here

Worked examples that actually run a model belong in the model repository, not in the orchestrator (which has no engine) and not in OasisLMF (which has no model data). This repository has both, plus model-tests CI, so the examples are exercised rather than assumed.

What this adds

  • tutorials/run-piwind-analysis — the high-level path: oasislmf model run -C config, then analysis of the ORD outputs (SELT, OEP/AEP EP curves).
  • tutorials/pipeline-step-by-step — the same run decomposed into the kernel pipeline (evepygulmcfmpysummarypyeltpy/…), with the real commands and the intermediate stream data at each stage.
  • Both are myst-nb notebooks: the analysis cells execute at docs-build time, so the outputs and plots always reflect the current code. Each page carries a "Run this tutorial yourself" block with a downloadable .ipynb.
  • Shared Oasis branding and cross-component intersphinx links, matching the other five component sites.

The engine invocation itself is shown as a command rather than executed at build time, since running a model needs the model data and the loss engine; the analysis of its output is what executes.

Review-round changes

  • conf.py no longer aborts when OASIS_INTERSPHINX_MAP is exported empty: environ.get(NAME, "{}") only substitutes its default when the variable is unset, so an empty value reached json.loads("") and killed the build with a traceback. Now environ.get(NAME) or "{}", verified with the variable unset, set-but-empty and mapped.
  • style: split the one-line import in conf.py that autopep8 flagged as E401, so the cross-component block is lint-clean and identical to the other components'.

Build is 0 warnings standalone and in the aggregated build, with both notebooks executing and publishing their .ipynb.

Add executable PiWind tutorials — a high-level end-to-end analysis and a step-by-step kernel pipeline walkthrough — published as documentation.

sstruzik and others added 3 commits July 15, 2026 15:44
Stand up an executable docs project in OasisModels (Furo + myst-nb) and add the
high-level worked example tutorials/run-piwind-analysis.md: shows the single
'oasislmf model run -C config' command (full pytools pipeline modelpy->gulmc->fmpy->
summarypy->eltpy/pltpy/lecpy/aalpy) and analyses the ORD outputs it produces (SELT,
OEP/AEP EP curves for GUL & IL, losses at return periods) from a committed sample of
a real PiWind run. Engine shown as a command, not executed at build; analysis cells
execute (verified). ORD EPType/EPCalc semantics per ODS_OpenResultsData.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add tutorials/pipeline-step-by-step.md decomposing the generated run_kernel.sh
pipeline stage by stage: evepy -> gulmc -> fmpy -> summarypy -> eltpy/pltpy/lecpy/
aalpy. Each stage shows the real command (extracted from the script) and the
intermediary stream data (events, GUL item-level losses with the sidx statistics,
FM insured losses), produced by running each pytools tool once on a single event
and converted with bintocsv. Engine shown as commands, not executed at build;
sample-loading cells execute (verified by render).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the orchestrator-driven intersphinx block so the models docs can cross-reference
the other Oasis component sites in the aggregated build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sstruzik and others added 2 commits July 17, 2026 17:51
Add the Oasis logo (light/dark, always visible in the Furo sidebar), the maroon/red
Raleway palette matching oasislmf.github.io, and a persistent 'Oasis documentation home'
link (rewritten to page-relative by the aggregator) so you can return to the top of the
aggregated site from anywhere.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The sidebar logo now returns to the aggregated landing, so the redundant 'Oasis
documentation home' announcement bar is removed. Add the GitHub link in Furo's
conventional spot — the footer icons (bottom of every page).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sstruzik
sstruzik marked this pull request as ready for review August 11, 2026 08:58
@sstruzik
sstruzik requested a review from sambles August 11, 2026 14:06
sstruzik and others added 2 commits August 18, 2026 12:26
`environ.get(NAME, "{}")` only substitutes the default when the variable is UNSET, so
exporting it empty reached json.loads("") and aborted the build with a traceback instead
of falling back to no cross-component inventories. Now `environ.get(NAME) or "{}"`.

Latent rather than live: the GenerateDocs orchestrator always writes valid JSON via
json.dumps, so it triggers only when the variable is exported empty by hand or by a CI
step. Found while reworking the same block in ODS_Tools (#289, 10e38ba) and applied
across the remaining components for consistency.

Verified by executing conf.py with the variable unset, set-but-empty and mapped: all
three succeed, and any pre-existing intersphinx_mapping entries are preserved.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
autopep8 --diff --exit-code, which OasisLMF runs recursively over the repo, flagged
`import json as _ix_json, os as _ix_os` as E401. Pre-existing, and dormant only because
the code-quality workflow is not among the checks triggered on the docs PRs.

Same change ODS_Tools already took in eb349ea, so all six components now have an
identical, lint-clean cross-component block.

Verified: 0 autopep8 findings for this file (was 3), the CI flake8 selection is clean,
and conf.py still executes with OASIS_INTERSPHINX_MAP unset, set-but-empty and mapped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants