From 90394f9295fb3bfc625d5f41a7b3d97f0ba2e7bc Mon Sep 17 00:00:00 2001 From: StuartBenjamin Date: Mon, 8 Jun 2026 19:47:18 -0400 Subject: [PATCH 1/2] kwarg support for bootstrap solve in fortran back end --- bouquet/TokaMaker_interface.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bouquet/TokaMaker_interface.py b/bouquet/TokaMaker_interface.py index 4d620b3..b1a361a 100644 --- a/bouquet/TokaMaker_interface.py +++ b/bouquet/TokaMaker_interface.py @@ -626,6 +626,7 @@ def perturb_kinetic_equilibrium( spike_profile_recon_cached=None, proxy_bias_warmstart=None, pin_jphi=False, + **kwargs ): r"""Perturb kinetic and current-density profiles and iterate to match :math:`I_p` and :math:`l_i` targets. @@ -990,6 +991,7 @@ def _probe(label): isolate_edge_jBS=isolate_edge_jBS, diagnostic_plots=False, verbose=False, + **kwargs ) finally: if _stashed_bounds is not None: @@ -1192,6 +1194,7 @@ def _probe(label): # SWB H-mode self-consistency iterations (default 3). Env # SWB_ITERS lets us trim for speed (2 is usually enough). iterations=int(os.environ.get('SWB_ITERS', '3')), + **kwargs ) if os.environ.get('PROFILE', '0') == '1': print(f" [profile] SWB call: {time.perf_counter()-_t_swb0:.1f}s") @@ -1871,6 +1874,7 @@ def generate_bouquet( jphi_baseline=True, seed=None, pin_jphi=False, + **kwargs ): r"""Generate a batch of perturbed equilibria and archive to HDF5. @@ -2978,6 +2982,7 @@ def _k2e(a): spike_profile_recon_cached=_diff_spike_recon, proxy_bias_warmstart=_proxy_bias_warmstart, pin_jphi=pin_jphi, + **kwargs ) except Exception as e: # Catch ANY exception during a perturbed solve -- ValueError @@ -3684,7 +3689,7 @@ def _build_bounds(drift_F, drift_VSC): def reconstruct_equilibrium(mygs, eqdsk, ne, te, ni, ti, Zeff, isoflux_pts, weights, psi_pad, guess_jinductive,n_k,psi_bridge,rescale_j_BS, - shelf_psi_N,initialize_psi=True): + shelf_psi_N,initialize_psi=True,**kwargs): r"""Reconstruct a single Grad-Shafranov equilibrium from a geqdsk reference and kinetic profiles, matching the EFIT :math:`l_i(1)`. @@ -3776,6 +3781,7 @@ def reconstruct_equilibrium(mygs, eqdsk, ne, te, ni, ti, Zeff, scale_jBS=1.0, isolate_edge_jBS=True, diagnostic_plots=False, + **kwargs ) j_BS_isolated = results['isolated_j_BS'] From 7a0a95591defb491de10fb449d1b7c01ad96fe9e Mon Sep 17 00:00:00 2001 From: StuartBenjamin Date: Mon, 8 Jun 2026 21:48:55 -0400 Subject: [PATCH 2/2] Missing solve_with_bootstrap kwarg --- bouquet/TokaMaker_interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bouquet/TokaMaker_interface.py b/bouquet/TokaMaker_interface.py index b1a361a..3e00def 100644 --- a/bouquet/TokaMaker_interface.py +++ b/bouquet/TokaMaker_interface.py @@ -2760,7 +2760,7 @@ def _k2e(a): initial_Ip_target, _swb_seed_cache, scale_jBS=1.0, isolate_edge_jBS=isolate_edge_jBS, - diagnostic_plots=False, verbose=False, + diagnostic_plots=False, verbose=False,**kwargs ) _diff_spike_recon = np.asarray( _cache_results["isolated_j_BS"]).copy()