Skip to content

Make the README's python fences runnable in document order - #242

Merged
bodono merged 1 commit into
bodono:masterfrom
tschm:fix/239-readme-fences
Sep 7, 2026
Merged

bodono merged 1 commit into
bodono:masterfrom
tschm:fix/239-readme-fences

Conversation

@tschm

@tschm tschm commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Closes #239

The "Linear solver backends" snippet used scs, data and cone about 45 lines before anything defined them, so running the README's python fences in order failed:

README.md: python fences exited 1 — NameError: name 'scs' is not defined

It now sets up a minimal LP first, so the section stands on its own.

Second change in the same spirit: the Usage fence built A with an unseeded sp.random while its comment asserted the printed status would be 'solved'. Seeded so the documented output is actually reproducible.

Verified with the doc-example checker (executed in a venv with the package built and installed, so this isn't a missing-dependency artefact) — exits 0, no violations.

🤖 Generated with Claude Code

The "Linear solver backends" snippet used `scs`, `data` and `cone` roughly 45
lines before anything defined them, so running the README's python fences in
order failed with `NameError: name 'scs' is not defined`. It now sets up a
minimal LP first.

The Usage fence built `A` with an unseeded `sp.random` while its comment
asserted the status would be 'solved'; seeded so the documented output is
actually reproducible.

Closes bodono#239

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@bodono
bodono merged commit 55483e5 into bodono:master Sep 7, 2026
21 checks passed
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.

README backend-selection snippet at README.md:39 is not runnable as shown

2 participants