Skip to content

Feat: Class-based solvers#252

Draft
mrava87 wants to merge 25 commits into
PyLops:devfrom
mrava87:feat-classsolver
Draft

Feat: Class-based solvers#252
mrava87 wants to merge 25 commits into
PyLops:devfrom
mrava87:feat-classsolver

Conversation

@mrava87

@mrava87 mrava87 commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

This PR creates class-based solvers following PyLops' pylops.optimization.basesolver.Solver base class.

As part of this effort, all function-based solvers are modified to have the same set of tolerances exposed to the users:

  • tol: tolerance on objective function change between iterations (as (cost_previous - cost_current ) / cost_previous < too directly handled in the step method
  • rtol: relative tolerance on objective function vs initial value (handled as callback)
  • xtol: absolute tolerance on change of solution - this is currently parked as requires a new PyLops release that fixes https://github.com/PyLops/pylops/pull/762/changes. This will simply require adding
    if xtol is not None:
         callbacks.append(ModuleUpdateCallback(xtol))
    
    to each function based solver.

Note that as part of this, a breaking change is made on PPXA and ConsensusADMM which previously used tol to check for the solution change.

@codacy-production

codacy-production Bot commented Apr 18, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
ErrorProne 1 high

View in Codacy

🟢 Metrics -82 complexity · 5 duplication

Metric Results
Complexity -82
Duplication 5

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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