Skip to content

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

Closed

Description

@tschm

Subcategory: executable documentation
Current → target: 6 → 8

Problem

The "Linear solver backends" snippet at README.md:39 is not self-contained:

# Auto-detect best backend (default)
solver = scs.SCS(data, cone)

# Explicitly select a solver
solver = scs.SCS(data, cone, linear_solver=scs.LinearSolver.QDLDL)

It uses scs, data and cone, none of which are defined until the Usage fence at
README.md:85. Running the README's python fences in order fails:

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

(reproduced with check_doc_examples.py --source-root scs --run, executed in a venv with
the package built and installed, so this is not a missing-dependency artefact).

The Usage quickstart at README.md:85 itself is correct — verified in the same environment,
it prints status: solved and a populated aa_stats dict, and both
LinearSolver.QDLDL and LinearSolver.ACCELERATE solve successfully. Only the earlier
snippet is unrunnable as shown.

Files / lines to change

README.md:39 — either add the three lines that define data and cone (plus import scs),
or move the backend-selection fence after the Usage section.

Done when

Running the README's python fences in document order exits 0.

Activity

  1. added a commit that references this issue on Sep 7, 2026
    cdcf902
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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