Skip to content

Expose acceleration_trust_factor in Python bindings#214

Open
bodono wants to merge 2 commits into
masterfrom
expose-aa-trust-factor
Open

Expose acceleration_trust_factor in Python bindings#214
bodono wants to merge 2 commits into
masterfrom
expose-aa-trust-factor

Conversation

@bodono

@bodono bodono commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

Plumbs the new acceleration_trust_factor setting (added in cvxgrp/scs#396) through the scs Python kwargs interface.

  • Adds acceleration_trust_factor to the kwlist and argparse format in scs/scsobject.h
  • Adds Python-side validation (rejects NaN / non-positive values)
  • Bumps scs_source submodule to the corresponding scs branch
  • Adds coverage tests for the default (math.inf = no cap, current HEAD behavior), a sweep of positive finite values, and rejection of bad inputs

The default is math.inf which preserves the current HEAD behavior bit-for-bit. Positive finite values turn on the trust-region + adaptive-r mode from the underlying aa library (PR #54 there), enabling parameter sweeps for further tuning.

Test plan

  • python -m pytest test/test_scs_coverage.py — 286/286 pass
  • python -m pytest test/test_scs_basic.py test/test_scs_object.py — 26/26 pass
  • New trust_factor tests all pass (default, sweep, rejection)
  • Smoke-tested in REPL: default + explicit inf + finite values solve; 0 / -1 / NaN rejected

Depends on cvxgrp/scs#396 being merged before this can land cleanly.

Plumbs the new ScsSettings.acceleration_trust_factor field through the
Cython kwargs interface. Defaults to math.inf (no cap, matches current
SCS master behavior); positive finite values activate the trust-region
+ adaptive-r mode from the underlying aa library.

Bumps the scs_source submodule to pick up the C-side change.

Validation rejects NaN and non-positive values. Adds coverage tests for
the default, finite/inf sweep, and rejection cases.
@bodono bodono force-pushed the expose-aa-trust-factor branch from 0fa6c92 to c787251 Compare June 17, 2026 23:50
Pulls in the cvxgrp/scs PR #396 follow-up that re-allows +inf as the
"disable" sentinel for eps_abs/eps_rel/eps_infeas and time_limit_secs.
This restores the behavior that test_posinf_setting_accepted asserts
and that the Python wrapper has always documented.
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