Skip to content

Uniform tracing, loss and optimizer keywords (tmax, n_save, rtol/atol, max_nfev, tol) - #231

Open
rogeriojorge wants to merge 8 commits into
tracing-defaultsfrom
api-uniform-renames
Open

rogeriojorge wants to merge 8 commits into
tracing-defaultsfrom
api-uniform-renames

Conversation

@rogeriojorge

@rogeriojorge rogeriojorge commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

One name per concept across Tracing, the loss functions, trace_boozer, trace_field_lines, connection_length and the optimizers. Breaking, no aliases; the old -> new table is in the README ("API changes").

Old New
Tracing(maxtime), loss functions maxtime tmax (attribute Tracing.tmax too)
Tracing(times_to_trace), loss functions num_steps, trace_field_lines(samples) n_save
tolerance in trace_boozer, trace_field_lines, connection_length; trace_tolerance in the loss functions rtol, with atol=None meaning atol = rtol
optimize_loss_function(maximum_function_evaluations) and the MultiObjectiveOptimizer option max_nfev
optimize_loss_function(tolerance_optimization) and the MultiObjectiveOptimizer option tol
loss_BdotN, loss_BdotN_constraint loss_bdotn, loss_bdotn_constraint
Tracing(condition=...) stopping_criteria (one callable or a list); condition was a second spelling of the same option

Other changes:

  • Tracing signature is now Tracing(field, particles, initial_conditions, *, ...): every option is keyword-only. timestep is annotated float | None.
  • The loss functions take keyword-only tracing options and also accept atol and max_steps.
  • trace_boozer adaptive error control: atol bounds the sqrt(s), theta and zeta error, rtol times the speed bounds v_par. With atol=None this is exactly the old tolerance behaviour.
  • trace_tolerance locals in the SIMSOPT comparison examples are now rtol_*.
  • essos/__main__.py was calling Tracing with timesteps and tol_step_size, which no longer exist; it now uses n_save and rtol.

Stacked on #207, so the base is tracing-defaults. Call sites in essos, tests, examples, docs and README are updated.

Tests (CPU, office): The only failures (8) are environment ones that do not touch these changes (old optimistix without LBFGS, missing f90nml); the rest pass. Ran the field-line, guiding-center, Boozer-vs-VMEC and coil-optimization examples.

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