Skip to content

Analysis UX: make gpec.h5 self-describing (units/description attrs + describe()) #328

Description

@matt-pharr

Motivation

Users currently reach for an external application (HDFView, silx, ...) to browse gpec.h5, because the file is opaque: group and dataset names carry no inline documentation, so there is no way to learn what a quantity is or its units without reading source or docs.

The h5 already has a sensible group structure (input/, info/, equil/, splines/, locstab/, integration/, singular/, vacuum/, perturbed_equilibrium/, ...). It just doesn't document itself.

Proposed change

  1. Attach units and description HDF5 attributes at the write sites. Wherever datasets are written (src/Equilibrium/Equilibrium.jl, src/PerturbedEquilibrium/Utils.jl, src/KineticForces/Output.jl, src/GeneralizedPerturbedEquilibrium.jl, the src/Analysis/* writers, etc.), add short units/description attributes. Source the wording from the same struct docstrings used elsewhere so it stays consistent.
  2. Add GPEC.describe("gpec.h5") that prints the group tree with, per dataset: shape, units, and the one-line description. This makes the file browsable directly in the REPL.

Together these make the external browser optional rather than required.

Notes

  • Consider a tiny helper to write a dataset together with its attributes so annotation is one call and hard to forget, and so new outputs are self-describing by default.
  • describe() pairs naturally with the GPECResult summary (companion issue): show(result) gives the high-level state, describe() gives the full annotated tree.
  • Longer-term ecosystem angle (out of scope here): we already integrate IMASdd.dd; leaning outputs toward the IMAS data dictionary where they map cleanly would let community tools (OMAS/OMFIT) browse results for free. Tracked separately if pursued.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions