Skip to content

fix(linalg): Validate eps values in QuadprogProjector constructor - #818

Merged
ValerianRey merged 2 commits into
SimplexLab:mainfrom
SausageMan99:fix/810-quadprog-eps-validation
Oct 7, 2026
Merged

ValerianRey merged 2 commits into
SimplexLab:mainfrom
SausageMan99:fix/810-quadprog-eps-validation

Conversation

@SausageMan99

Copy link
Copy Markdown
Contributor

Fixes #810.

QuadprogProjector.__init__ assigned _norm_eps and _reg_eps directly, bypassing the validation done in the setters. The constructor now goes through the setters, so QuadprogProjector(norm_eps=-1.0) raises the same ValueError as p.norm_eps = -1.0.

Tested with two new tests in tests/unit/linalg/test_dual_cone.py.

This change was prepared with the help of an AI agent (Claude) and reviewed by me before opening.

__init__ assigned the private attributes directly, so negative norm_eps and
reg_eps were accepted at construction while the setters rejected them. The
constructor now goes through the validating setters.

Fixes SimplexLab#810

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ValerianRey ValerianRey added cc: fix Conventional commit type for bug fixes of the actual library (changes to src). package: linalg labels Oct 7, 2026

@ValerianRey ValerianRey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Again very minor so no need for changelog entry imo

@ValerianRey
ValerianRey enabled auto-merge (squash) October 7, 2026 16:27
@ValerianRey
ValerianRey merged commit 120633f into SimplexLab:main Oct 7, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: fix Conventional commit type for bug fixes of the actual library (changes to src). package: linalg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QuadprogProjector does not validate norm_eps and reg_eps at construction

2 participants