pysolver_view.roots.backends.custom module#

Connect packaged root drivers to NonlinearSystemSolver observations and callbacks.

class pysolver_view.roots.backends.custom.RootRunContext(residual: Callable, jacobian: Callable | None, method: str, requested_method: str, options: StepControlOptions | NewtonOptions, update_on: str, active: bool, evaluation: object, iteration_history: list, record: Callable, set_iteration: Callable, callback: Callable | None)[source]#

Bases: object

The model, counters and event sinks required by one custom root run.

active: bool#
callback: Callable | None#
evaluation: object#
classmethod from_solver(solver)[source]#

Bind the public interface once, keeping it out of numerical adaptation.

iteration_history: list#
jacobian: Callable | None#
method: str#
options: StepControlOptions | NewtonOptions#
record: Callable#
requested_method: str#
residual: Callable#
set_iteration: Callable#
update_on: str#
class pysolver_view.roots.backends.custom.RootSolverAdapter(context)[source]#

Bases: object

Translate numerical observations without evaluating the model or derivatives.

accepted(record)[source]#

Record actual accepted iterations and forward detached cancellable callbacks.

observe(record)[source]#

Publish only the selected valid model/Jacobian stream, never probe rows.

solve(x0)[source]#

Run the packaged driver and return its authoritative result and options.

update_counts(record)[source]#

Synchronize physical work, retaining probes as a subset of total calls.

pysolver_view.roots.backends.custom.resolve_root_options(method, options, tolerance, max_iterations, derivative_method, derivative_abs_step)[source]#

Resolve custom options, giving explicit dictionary/dataclass values precedence.

Constructor tolerance/max_iterations fill missing residual/trial settings. Numerical derivatives belong to the numerical core. Explicit finite_diff_step uses scaled probes; otherwise the constructor’s physical absolute step applies.