Repository navigation
fix(loop-interpolation): report failed solves, keep the chosen solver, NaN for NaN points - #413
Merged
Merged
Conversation
…in update - lsmr at the iteration limit (istop 7) now returns False and logs a warning. - admm with no inequality rows now falls back to lsmr (Q has 0 rows, not None). - solve_system stores the solver, tol and solver_kwargs; update() uses them and logs a warning when the new solve fails. - NaN input points give NaN values and gradients, not 0. - FDI builds the KD-tree weighting only when use_regularisation_weight_scale is on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The old fallback called solve_system again, so the scaling was applied twice and the field had the wrong size. ADMM keys also went to lsmr and raised TypeError. Now solve_system changes the solver to lsmr and removes the ADMM keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
update() now solves again only once after a change. If that solve fails, it logs one warning and keeps the field until the next solve or constraint change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…D supports work Co-Authored-By: Claude Opus 5.5 <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.
Fixes five problems found in a repo audit. Several of them meant a solve that did not converge, or that failed, was used as the result with no warning.
maxiter=2returned True andup_to_date=Truewith a field value of 0.229 where the data says 1.0.Q is None, but the matrix is(0, dof).solve_systemnow switches to lsmr up front, in one solve. The first version calledsolve_system("lsmr")recursively and scaled the result twice; review caught this. It also drops the admm-only kwargs, soadmm_abs_tolno longer raisesTypeError.update()re-solved with the defaultcgand default kwargs.solve_systemnow stores the requested solver and kwargs, andupdate()reuses them. A failed re-solve is not repeated on every evaluate: it runs again only after the constraints, the setup orup_to_datechange, and it logs one warning.use_regularisation_weight_scaleis on, as P1 already does.Behaviour change: an lsmr solve that hits a user-set
maxiternow reports failure andup_to_date=False, where before the field was kept silently. Default configs are not affected: the builder's default solver is cg, and lsmr's defaultmaxiterconverged on the claudius model.Overlap: #378 and #379 have the
Q is Noneline as context, so expect a one-line conflict there.Tests:
packages/loop_interpolation/tests/test_solver_status.pyadds 6 tests; each failed before its fix. Targeted package tests: 115 passed, 8 skipped.test_fault_restoration_uses_current_frame[FDI]passes, with the same number of solves as master (9). The full loop_interpolation and LoopStructural suites were not run locally because they are too slow; please rely on CI. Reviewed by a second agent; the review's two findings are fixed in 89723de and 0ff3dc0.🤖 Generated with Claude Code