Skip to content

Publish the marimo experiment notebooks in the book #540

Description

@tschm

Follow-up to #539, which removed five mkdocs.yml nav entries pointing at
notebooks/Experiment1.htmlExperiment5.html because those pages are never built.
This issue is about actually publishing them.

Why it isn't a one-liner

rhiza-task exports notebooks from marimo_folder, which this repo leaves unset, so it
resolves to the CLI default docs/notebooks — a folder that doesn't exist here. Hence:

[WARN] no marimo folder; skipping notebook export

Setting marimo-folder = "book/marimo/notebooks" fixes the export, but breaks the marimo
workflow:

  • The exporter globs folder.glob("*.py") and rhiza_marimo.yml's matrix globs
    find -maxdepth 1 -name "*.py". Neither filters for actual marimo notebooks.
  • That folder also holds optimize.py and preamble.py, which are plain modules with no
    PEP 723 header. The matrix runs uv run --script <file> per match, so it would go from
    0 jobs (currently skipped, empty matrix) to 7, with those 2 failing.

What a real fix has to touch

book/marimo/notebooks currently doubles as source_folder (the importable modules) and
the notebook folder. Splitting them means:

  • from preamble import … in all five Experiment*.py plus optimize.py — they reach it
    via sys.path.insert(0, str(Path(__file__).parent)), so preamble.py must stay a sibling
  • the [tool.ty.environment] extra-paths PEP 723 headers in the notebooks
  • the 1:1 mapping table in docs/development/TEST_LAYOUT.md
  • scripts/check_test_layout.py
  • source_folder, and the 100% coverage gate that points at it

Alternative

Leave the notebooks unpublished and keep them out of the nav (the state after #539). The
experiments are still exercised by tests/test_experiment1.py5 and
tests/test_notebook_sharpe.py, so nothing is unverified — they're just not on the site.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions