# HG changeset patch # User Tuomo Valkonen # Date 1781402327 18000 # Node ID 0c9e1902021783aa504e1d3f9cf4300caec1a359 # Parent a5e6fac0801519f94427dfaa65c18a604a6e3d9e Update to pointsource_algs 3-part curvature_bound_components diff -r a5e6fac08015 -r 0c9e19020217 experiments/laser_and_mirrors.py --- a/experiments/laser_and_mirrors.py Sun May 17 19:40:50 2026 -0500 +++ b/experiments/laser_and_mirrors.py Sat Jun 13 20:58:47 2026 -0500 @@ -27,7 +27,7 @@ reg = RegTerm.NonnegRadon(1.5e-6) dat_simple = ComposeFnWithOperator(dat, InjectSecond(auxtrue)) - dat_simple.curvature_bound_components = lambda: (None, None) + print("Initial data term value:", dat_simple.apply(μ0)) print("Data term value at true μ:", dat_simple.apply(μ_true)) diff -r a5e6fac08015 -r 0c9e19020217 experiments/laser_and_mirrors_aux.py --- a/experiments/laser_and_mirrors_aux.py Sun May 17 19:40:50 2026 -0500 +++ b/experiments/laser_and_mirrors_aux.py Sat Jun 13 20:58:47 2026 -0500 @@ -152,6 +152,7 @@ ), pde, ) + dat.curvature_bound_components = lambda: (None, None, None) # Save true and initial data plot_factory = PlotFactory(pde) @@ -209,7 +210,4 @@ print("Initial data term value:", inival + ax) print("Data term value at true μ:", dat.apply((μ_true, auxtrue)) + ax) - # No curvature bound given: θ is aboslute. - dat.curvature_bound_components = lambda: (None, None) - return Problem(dat, reg, aux, aux0, μ0, plot_factory=plot_factory) diff -r a5e6fac08015 -r 0c9e19020217 experiments/laser_and_mirrors_aux2.py --- a/experiments/laser_and_mirrors_aux2.py Sun May 17 19:40:50 2026 -0500 +++ b/experiments/laser_and_mirrors_aux2.py Sat Jun 13 20:58:47 2026 -0500 @@ -54,7 +54,4 @@ print("Initial data term value:", inival + ax) print("Data term value at true μ:", dat.apply((μ_true, auxtrue)) + ax) - # No curvature bound given: θ is aboslute. - dat.curvature_bound_components = lambda: (None, None) - return Problem(dat, reg, aux, aux0, μ0, plot_factory=plot_factory) diff -r a5e6fac08015 -r 0c9e19020217 src/main.rs --- a/src/main.rs Sun May 17 19:40:50 2026 -0500 +++ b/src/main.rs Sat Jun 13 20:58:47 2026 -0500 @@ -8,6 +8,7 @@ #![allow(uncommon_codepoints)] #![allow(mixed_script_confusables)] #![allow(confusable_idents)] +#![allow(non_snake_case)] use alg_tools::error::DynResult; use log::debug; diff -r a5e6fac08015 -r 0c9e19020217 src/python_access/diff_mapping.rs --- a/src/python_access/diff_mapping.rs Sun May 17 19:40:50 2026 -0500 +++ b/src/python_access/diff_mapping.rs Sat Jun 13 20:58:47 2026 -0500 @@ -171,22 +171,20 @@ fn curvature_bound_components( &self, _guess: BoundedCurvatureGuess, - ) -> (DynResult, DynResult) { + ) -> (DynResult, DynResult, DynResult) { let m = intern!(self.obj.py(), "curvature_bound_components"); - match process_error::<(Option, Option)>( - "curvature_bound_components", - self.obj.py(), - self.obj.call_method0(m).and_then(|r| r.extract()), - ) { - Ok((l, θ2)) => ( - l.ok_or_else(|| anyhow!("l is None")), - θ2.ok_or_else(|| anyhow!("θ2 is None")), - ), - Err(e) => ( - Err(anyhow!("(same error as second component)")), - Err(e.into()), - ), - } + let (ℓ_F, ℓ_gradv_est, transport_lip): (Option, Option, Option) = + process_error( + "curvature_bound_components", + self.obj.py(), + self.obj.call_method0(m).and_then(|r| r.extract()), + ) + .unwrap(); + ( + ℓ_F.ok_or_else(|| anyhow!("ℓ_F is None")), + ℓ_gradv_est.ok_or_else(|| anyhow!("ℓ_gradv_est is None")), + transport_lip.ok_or_else(|| anyhow!("transport_lip is None")), + ) } }