Update Python docs for LinearSolver enum API#381
Open
bodono wants to merge 5 commits into
Open
Conversation
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>
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
linear_solver=scs.LinearSolver.<SOLVER>parameter inscs-python.use_indirect,mkl,apple_ldl,gpu) with the new enum-based API.AUTOdefault behavior: Apple Accelerate on macOS, MKL Pardiso on Linux/Windows, falling back to QDLDL.Companion PR: bodono/scs-python#189
🤖 Generated with Claude Code