Skip to content

feat: a device template, with vessel layers and conductors as shapes - #15

Merged
icyspirit merged 1 commit into
mainfrom
feat/device-template
Sep 29, 2026
Merged

icyspirit merged 1 commit into
mainfrom
feat/device-template

Conversation

@icyspirit

Copy link
Copy Markdown
Owner

Summary

A device template for a machine. -T autofrd is the same template: autofrd, in tbd-fusion, writes a machine it drew as these IDSs.

  • Poloidal cross-section:
    • the vacuum vessel (its layers);
    • the wall (limiter units, including a port, which is only at some toroidal angles);
    • the passive conductors (pf_passive);
    • the PF coils and the central solenoid (pf_active);
    • the center line of the conductor of the TF coils (tf).
  • Other panels: coil currents and passive currents (bars at the selected time), the TF coil current, and the vacuum toroidal field (b_field_phi_vacuum_r in DD 4, b_field_tor_vacuum_r in DD 3). A machine description has only the geometry, so these panels note in gray that they are not filled.
  • Several sources, e.g. autofrd runs for two coil placements: each machine has a line style of its own.

Two new shape kinds, general to the Data Dictionary:

  • Vessel layers (wall/description_2d[0]/vessel/unit[:]/annular):
    • filled between the inner and outer contours;
    • or around the centreline, as thick as thickness (per segment, or one value for all), mitred at corners;
    • open contours make the band between them.
    • The template falls back to block vessels (vessel/unit[:]/element[:]/outline).
  • Conductors (tf/coil[:]/conductor[:]/elements, and any conductor/elements): line segments, arcs of circle through their intermediate point, and full circles.
    • Their points are in three dimensions (r, phi, z). They are drawn at their distance from the axis and their height: a line across toroidal angles curves in R, and a ring around the axis is a point.
    • An arc without its intermediate point goes the shorter way about its centre.
    • Elements that do not meet are drawn apart. Unknown types are left out.
  • The IDS browser lists a vessel layer and a conductor each as one shape, not as their contours or points.

Naming: when every level of a path with wildcards has one element, the member is named after the last level that has a name. The TF coil is "TF", not "conductor[0]".

Demo machine:

  • a vacuum vessel (annular unit);
  • two passive plates, with the currents the ramp-up and vertical motion induce;
  • 16 TF coils, drawn as a D of four lines and four arcs, with their current and vacuum field.
  • The PF coils and the first wall are unchanged.

Notes

  • Checked on real converter output. tbd-fusion's test helper draws a reactor (reactor_written), and tbd-fusion's own pf_active_to_ids, pf_passive_to_ids, wall_to_ids and tf_to_ids convert it (DD 3.39.0). -T autofrd then shows:
    • the VV vessel;
    • the Blanket and Divertor units;
    • OH 1–6 and PF 1–6;
    • the TF conductor, offset from the inner face as autofrd's reader writes it (lines, arcs, corner arcs, and empty values where a point does not apply).
    • That reactor has no TF part beside the coil, so it has no passive loops, and this is noted in gray.
  • docs/template-device.png shows the demo with two sources. The other screenshots are unchanged: their panels do not show the new IDSs.

Test plan

  • QT_QPA_PLATFORM=offscreen pytest: 195 passed in the dev environment, a clean PySide6 6.11 environment and a PyQt5 5.15 environment.
  • New tests:
    • the demo machine: the vessel ring (two closed contours), the passive plates and their currents, and the TF conductor (closed, its arcs on their circles, named "TF");
    • conductor elements: a line, a three-quarter arc through its intermediate point, and a full circle that starts elsewhere (a gap before it); an arc about its centre only; an unknown type; a ring around the axis; a line across toroidal angles;
    • vessel layers: a centreline with thickness per segment or one value for all (mitred), too few thicknesses, and open contours in either direction;
    • the template:
      • on an autofrd-like machine description (DD 3.39.0, no currents, no time base): every shape, filled vessel, names, notes and no errors;
      • on the demo with two sources: passive current bars, and the same color with different line styles per source;
    • the browser items, the alias, and the CLI template list.
  • Screenshots checked: the demo, and tbd-fusion's real conversion.
  • pyflakes src tests reports nothing.

🤖 Generated with Claude Code

https://claude.ai/code/session_018aVekYzCRLPE71Mm6UH8Zp


Generated by Claude Code

A template for a machine: the vacuum vessel, the wall, the passive conductors,
the PF coils and the central solenoid, and the conductor of the TF coils, in the
poloidal plane; with the currents of the coils and the passive conductors and
the vacuum toroidal field when the source has them. "-T autofrd" is this
template: autofrd, in tbd-fusion, writes a machine it drew as these IDSs.

Two kinds of shapes are new, general to the Data Dictionary:
- The layers of a vessel (wall/description_2d/vessel/unit/annular), filled
  between their inner and outer contours, or around their centreline as thick
  as their thickness (per segment or one for all, mitred at corners). Open
  contours make the band between them.
- Conductors made of line segments, arcs of circle through an intermediate
  point and full circles (e.g. tf/coil/conductor/elements). Their points are in
  three dimensions (r, phi, z); they are drawn at their distance from the axis
  and their height, so a line across toroidal angles curves in R and a ring
  around the axis is a point. An arc without its intermediate point goes the
  shorter way about its centre. Elements that do not meet are drawn apart.

A member of a path with wildcards whose levels all have one element is named
after the last level that has a name: the coil "TF" rather than its conductor.

The demo machine gains a vacuum vessel, two passive plates with induced
currents, and 16 TF coils drawn as a D of lines and arcs, with their current and
vacuum field. The IDS browser lists a vessel layer and a conductor as shapes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018aVekYzCRLPE71Mm6UH8Zp
@icyspirit
icyspirit merged commit 5d59a58 into main Sep 29, 2026
2 checks passed
@icyspirit
icyspirit deleted the feat/device-template branch September 29, 2026 22:26
icyspirit pushed a commit that referenced this pull request Sep 29, 2026
Main now has the crosshair (#14) and the device template (#15). The
crosshair gives the value of the image through Panel._image_value_at,
so it also says the value of the cell of an unstructured grid under it,
and the status bar keeps the coordinates rounded to the view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018aVekYzCRLPE71Mm6UH8Zp
icyspirit pushed a commit that referenced this pull request Sep 29, 2026
Main now has the crosshair (#14) and the device template (#15). The
crosshair reads the curves a panel draws, so with sources relative to
the first it gives B − A or B / A; a test checks it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018aVekYzCRLPE71Mm6UH8Zp
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.

2 participants