Equilibrium parameters: compute the stubbed flux bookkeeping fields, and collapse the duplicate psi-on-axis variables
メンテナーはふだん 3 日以内に返信
@jhalpern30 がすでに取り組んでいます。
2026年8月15日 から。
評価
この issue はまだ評価されていません。
説明
Fallout from the gpec.h5 schema overhaul (#226, PR #364). While giving the Equilibrium/ scalars literature names I audited every field of Equilibrium.EquilibriumParameters against its assignment site, and two related problems turned up. Neither is a regression — both predate the schema work — but the rename made them visible, so they are worth fixing deliberately rather than carrying forward.
1. Several flux-bookkeeping fields are hardcoded constants, not computed
src/Equilibrium/Equilibrium.jl:370-381 is the sole assignment site for the whole flux-bookkeeping family, and most of it is literals:
pe.params.psi0 = psio
pe.params.psi_axis = pe.psio
pe.params.psi_boundary = 1.0
pe.params.psi_boundary_norm = 1.0
pe.params.psi_axis_norm = 0.0
pe.params.psi_norm = 0.0
pe.params.psi_axis_offset = 0.0
pe.params.psi_boundary_offset = 0.0
pe.params.psi_axis_sign = 1
pe.params.psi_boundary_sign = -1
pe.params.psi_boundary_zero = false
Everything from psi_boundary down is a constant independent of the equilibrium being loaded. In normalized-flux terms psi_axis_norm = 0 and psi_boundary_norm = 1 are true by definition of psi_N, so those two are honest tautologies — but psi_boundary = 1.0 is written with units Wb/rad in the schema and is not the boundary poloidal flux of any real equilibrium, and the offsets/signs/psi_boundary_zero look like they were meant to record what the ingest actually did (Fortran GPEC derived the equivalent quantities from the g-file simag/sibry pair and the COCOS handling). The likely story is that the Julia port stubbed them and nothing downstream noticed.
Separately, four fields of the struct are never assigned anywhere in src/ — ro, zo, psio, b_norm. The HDF5 writer works around the first three by pulling them off PlasmaEquilibrium directly (equil.ro, equil.zo, equil.psio) and b_norm is silently skipped because it stays nothing.
Ask: compute these from the ingest rather than hardcoding them — real psi_axis/psi_boundary in Wb/rad, real offsets/signs reflecting the COCOS/normalization actually applied, a decision on b_norm (compute it or delete the field), and either populate params.ro/zo/psio or delete them in favour of the PlasmaEquilibrium fields so there is one source of truth.
2. Three variables are the same number for psi on axis
psi0, psi_axis, and psio all end up holding the total poloidal flux difference. psi_axis in particular is misnamed: it is assigned pe.psio, i.e. the total flux, not the flux at the axis. psi_axis_norm is likewise an exact duplicate of psi_norm (both 0.0).
For the schema overhaul I took the conservative route: Equilibrium/psi_total is written once (from equil.psio) and the duplicates psi0, psi_axis, psi_axis_norm are dropped from the HDF5 output via EQUIL_H5_SKIP in src/HDF5Schema.jl. That fixes the file, not the struct.
Ask: collapse the redundancy in EquilibriumParameters itself — either delete the duplicate fields, or, if each was intended to mean something distinct (axis flux vs. total flux vs. normalization constant), define those meanings and make the assignments match the names. Whatever survives should have a docstring entry stating which of the three it is; today a reader of the struct cannot tell them apart.
Notes
- Fixing (1) will move numbers only if a downstream consumer reads the stubbed values; a regression-harness run (
regress --cases diiid_n1,solovev_n1 --refs develop,local) should confirm the blast radius before merging. - Any change to which fields exist must be mirrored in
EQUIL_H5_NAMES/EQUIL_H5_SKIP(src/HDF5Schema.jl) and the naming rules indocs/development/hdf5-conventions.md.
- 主要言語
- Julia
- スター
- 11
- フォーク
- 7
- 平均マージ
- 4日 3時間
- マージ済み PR(30日)
- 70
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenFUSIONToolkit/GPEC のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
OpenFUSIONToolkit/GPEC#644 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
OpenFUSIONToolkit/GPEC#643 ·
メンテナーはふだん 3 日以内に返信
-
PerturbedEquilibrium - FEATURE - Complete the resistive perturbed-equilibrium workflow from Galerkin and matched results対応中かも @matt-pharr が 1 日前に担当しました。 オープンfeature
OpenFUSIONToolkit/GPEC#635 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
test
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
OpenFUSIONToolkit/GPEC#633 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
-
Tearing - FEATURE - Add a general modified Rutherford equation for island evolution対応中かも @StuartBenjamin が 1 日前に担当しました。 オープンfeature
OpenFUSIONToolkit/GPEC#630 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
OpenFUSIONToolkit/GPEC の issue をすべて見る
似ている issue
-
`ShallowWaterModel` allocates ~9 KiB per grid point per RK3 stage on the CPU対応中かも @ali-ramadhan が今日担当しました。 オープンperformance 🏍️
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
CliMA/Oceananigans.jl#6421 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
NCAR/musica#1118 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
`AMSGrad` state starts at `epsilon` instead of zero, so zero gradients move parameters and small gradients are damped対応中かも @parth-patel010 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
FluxML/Optimisers.jl#247 · コメント 1 件 ·
-
README should say that row and column order must match対応中かも @SAUMYARSH が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信