Repo - REFACTOR - Write every run and replay output into one gpec.h5 file

未关闭
#643 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
领域
data

调研方向

Start in src/Rerun.jl at build_inputs_from_h5, which writes the _forcing.h5, _tolerances.toml, _kinetic.h5 and _wall.dat side files, then trace preloaded_coil_sets to see how in-memory data is passed to a run. The Grad-Shafranov side files come from src/Equilibrium/Axisymmetric/GradShafranovResidual.jl, and src/Analysis/Equilibrium.jl reads them back. Done when a test runs a deck and its replay, each into an empty directory, and each leaves exactly one file behind; docs/src/workflow.md should also stop listing side files.

由索引模型根据 Issue 内容生成。

描述

A deck run should write exactly one file, gpec.h5, and a replay of a gpec.h5 should write exactly one file, <stem>_rerun.h5. Two code paths still write extra files:

Replay side files. build_inputs_from_h5 (src/Rerun.jl) turns the stored snapshot back into a deck that reads its inputs from files. So, for each input the source run had, it writes a file next to the rerun output:

  • <stem>_forcing.h5 (the forcing spectrum, Input/RawInputs/ForcingTerms);
  • <stem>_tolerances.toml (Input/RawInputs/ErrorFields/tolerance_toml_raw);
  • <stem>_kinetic.h5 (Input/RawInputs/Kinetic);
  • <stem>_wall.dat (Input/RawInputs/Wall/wall_file_raw).

Grad-Shafranov residual diagnostics. With [Equilibrium] diagnose_src = true, src/Equilibrium/Axisymmetric/GradShafranovResidual.jl writes gsec.h5, gse.h5 and gsei.h5 into the directory of the equilibrium file (dirname(eq_filename)). That is the user's input directory, not the run directory. src/Analysis/Equilibrium.jl reads gse.h5 and gsei.h5 from next to the output file, so the plot works only when the two directories are the same.

Proposed approach

  • Kinetic profiles: no side file is needed. The deck already accepts kinetic_group, so the replay can point kinetic_file at the source gpec.h5 with kinetic_group = "Input/RawInputs/Kinetic".
  • Forcing, tolerances and wall: hand the snapshot data to the run in memory, as preloaded_coil_sets already does for coil geometry.
  • Grad-Shafranov residual: write it into gpec.h5, under the Equilibrium/ group, following the HDF5 conventions. Point Analysis.Equilibrium at the new datasets.

Done when

  • A test runs a deck and replays its output, and checks that each wrote exactly one file into an otherwise empty directory.
  • diagnose_src = true writes nothing outside gpec.h5, and its plot reads from gpec.h5.
  • The "Replaying a run" section of docs/src/workflow.md no longer lists side files.
主要语言
Julia
星标
11
派生
7
平均合并
4 天 1 小时
30 天内合并 PR
68

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

OpenFUSIONToolkit/GPEC 的其他 Issue

查看 OpenFUSIONToolkit/GPEC 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。