Skip to content

Fix three expressions that always failed (v_loop, EC power, summary beta_tor) - #327

Merged
tomneiser merged 2 commits into
masterfrom
fix/init-expressions
Nov 16, 2026
Merged

tomneiser merged 2 commits into
masterfrom
fix/init-expressions

Conversation

@tomneiser

Copy link
Copy Markdown
Member

Three dynamic expressions threw every time they were evaluated, so their fields were always missing.

Expression Problem Now
core_profiles.global_quantities.v_loop used core_profiles without binding it, and called v_loop, which does not exist vloop(cp1d, eqt) for each profiles_1d
pulse_schedule.ec.power_launched.reference summed over ec.unit; the beams are in ec.beam sums over ec.beam
summary.global_quantities.beta_tor.value called beta_tor(eqt, cp1d) without its required keywords beta_tor(eqt, cp1d; norm=false, thermal=false): toroidal beta of the total pressure, not normalized

Also a line in the polygon_rays docstring: the k-th ray radiates from vertex k+1.

Effect

Checked with FUSE.init on 12 cases (D3D, ITER from scalars and from ODS, ARC, EXCITE, KSTAR, FPP, KDEMO, baby MANTA, ...): the stored data is identical bit for bit, and IMAS.freeze now also gives these three fields (pulse_schedule.ec.power_launched.reference where there are EC beams).

Tests

New test/runtests_expressions.jl (7 tests, in runtests.jl): the three expressions on the sample data, against the functions they call.

🤖 Generated with Claude Code

tomneiser and others added 2 commits November 15, 2026 14:58
…EC power, summary beta_tor

- core_profiles.global_quantities.v_loop used `core_profiles` without binding it and called `v_loop`, which
  does not exist: it is now `vloop(cp1d, eqt)` for each profiles_1d
- pulse_schedule.ec.power_launched.reference summed over `ec.unit`; the beams are in `ec.beam`
- summary.global_quantities.beta_tor.value called `beta_tor(eqt, cp1d)` without its keywords: it is the
  toroidal beta of the total pressure, not normalized (`norm=false, thermal=false`)

Each of them threw when evaluated, so the three fields were always missing. Tests in runtests_expressions.jl.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@tomneiser
tomneiser merged commit d7ae3cf into master Nov 16, 2026
2 checks passed
@tomneiser
tomneiser deleted the fix/init-expressions branch November 16, 2026 21:57
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