Skip to content

Update Python docs for LinearSolver enum API#381

Open
bodono wants to merge 5 commits into
masterfrom
linear-solver-enum-docs
Open

Update Python docs for LinearSolver enum API#381
bodono wants to merge 5 commits into
masterfrom
linear-solver-enum-docs

Conversation

@bodono

@bodono bodono commented Apr 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Updates the Python API docs, install docs, and linear solver docs to reflect the new linear_solver=scs.LinearSolver.<SOLVER> parameter in scs-python.
  • Replaces references to the old boolean flags (use_indirect, mkl, apple_ldl, gpu) with the new enum-based API.
  • Documents the AUTO default behavior: Apple Accelerate on macOS, MKL Pardiso on Linux/Windows, falling back to QDLDL.

Companion PR: bodono/scs-python#189

🤖 Generated with Claude Code

Replace old boolean flags (use_indirect, mkl, apple_ldl, gpu) with the
new linear_solver=scs.LinearSolver.<SOLVER> parameter. Document AUTO
default behavior per platform.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bodono added a commit to bodono/scs-python that referenced this pull request Apr 11, 2026
The docs changes are in a separate PR (cvxgrp/scs#381).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bodono added a commit to bodono/scs-python that referenced this pull request Apr 11, 2026
* Add LinearSolver enum to replace boolean solver-selection flags

Introduces a `linear_solver=scs.LinearSolver.<SOLVER>` parameter as the
single way to select the linear system solver backend. The default is
`AUTO`, which picks the best available solver for the platform:
- macOS: Apple Accelerate if available, otherwise QDLDL
- Linux/Windows: MKL Pardiso if available, otherwise QDLDL

The old boolean flags (gpu, mkl, apple_ldl, dense, cudss, use_indirect)
still work but now emit a DeprecationWarning. Combining old flags with
the new `linear_solver` parameter raises a ValueError.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add LinearSolver enum, remove boolean solver-selection flags

Replaces the boolean flags (gpu, mkl, apple_ldl, dense, cudss,
use_indirect) with a single `linear_solver=scs.LinearSolver.<SOLVER>`
parameter using dict dispatch.

Available solvers: AUTO, QDLDL, INDIRECT, MKL, ACCELERATE, DENSE, GPU,
CUDSS. The default is AUTO, which picks the best available solver for
the platform:
- macOS: Apple Accelerate if available, otherwise QDLDL
- Linux/Windows: MKL Pardiso if available, otherwise QDLDL

Also accepts string values, e.g. linear_solver="mkl".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add AUTO to parametrized tests and test _resolve_auto fallback logic

- Add LinearSolver.AUTO to all parametrized solver tests (tolerances,
  QP, exp cone, SDP)
- Add explicit tests for AUTO via enum and string
- Add mock-based unit tests for _resolve_auto: verifies macOS tries
  Accelerate, Linux/Windows try MKL, and all platforms fall back to
  QDLDL when the preferred module is missing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add AUTO to all test solver configs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update README and docs for LinearSolver enum API

- README: document linear_solver parameter, AUTO defaults, and
  available enum values
- scs_source docs: replace old boolean flags with LinearSolver enum,
  add table of all solver values with descriptions and examples,
  describe AUTO behavior for each platform

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Restore scs_source submodule pointer to master

The docs changes are in a separate PR (cvxgrp/scs#381).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Simplify README linear solver example to use enum only

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Clarify that pip wheels already include MKL and Accelerate

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
bodono and others added 4 commits April 11, 2026 17:29
- Remove string-based linear_solver examples, use enum only
- Change example from MKL to QDLDL
- Note that pre-built wheels include MKL on x86_64 Linux/Windows

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Companion to bodono/scs-python#206, which renamed
LinearSolver.{INDIRECT,GPU,DENSE} -> {CPU_INDIRECT,GPU_INDIRECT,CPU_DENSE}
to disambiguate location (CPU/GPU) and method (direct/indirect).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds a top-level overview noting QDLDL and CPU_INDIRECT are always
included, a new Dense direct (LAPACK) section documenting
-Duse_lapack=true and the CPU_DENSE runtime selector, and a
substantially expanded GPU direct (cuDSS) section that lists the
required prerequisites (CUDA-capable driver, CUDA Toolkit, cuDSS
library), shows a typical PKG_CONFIG_PATH / LD_LIBRARY_PATH
environment setup, and explains why int32=true is required.

Also flags the legacy --gpu installer as deprecated in favor of cuDSS.
Companion to bodono/scs-python#210, which switches the macOS branch of
_resolve_auto to prefer the bundled QDLDL over Apple Accelerate.
Accelerate remains available via LinearSolver.ACCELERATE.

Co-Authored-By: Claude Opus 4.7 <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

None yet

Development

Successfully merging this pull request may close these issues.

1 participant