Skip to content

feat(reverse-engineer): add DESY OnlineXML source for PETRA III device topology#423

Merged
xmap merged 1 commit into
mainfrom
worktree-petra-onlinexml-extractor
Jun 29, 2026
Merged

feat(reverse-engineer): add DESY OnlineXML source for PETRA III device topology#423
xmap merged 1 commit into
mainfrom
worktree-petra-onlinexml-extractor

Conversation

@xmap

@xmap xmap commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Teaches scripts/reverse_engineer/ a second source format, DESY OnlineXML, alongside the existing EPICS *-bits path, so PETRA III's Tango/Sardana device topology can be extracted the same way APS/ESRF beamlines are.
  • A parallel parse+map pair converges on the existing control-system-agnostic CandidateDevice, leaving the EPICS path untouched: parse_online_xml + a Tango host-to-enclosure grammar (parse.py), conservative Tango family rules + a modellable-device filter (mapping.py), a --source {bits,onlinexml} switch that dedups shared upstream devices across per-endstation files (cli.py), and a source_desc/filtered-count line in facts.md (emit.py).
  • Validated against the live DESY GitLab: all 18 nxstools-extras-pNN packages run; 17 produce candidates that pass the descriptor loader (~2,800 modellable devices), P62 is correctly empty (stub package, no xml/).

Context

PETRA III publishes per-endstation device registries (online_*.xml) publicly on gitlab.desy.de. The extractor previously only understood EPICS (Guarneri devices.yml + ophyd ASTs), so this topology was out of reach and would have to be transcribed by hand across 17 beamlines. Research brief and extracted candidates live under the gitignored research/ tree (staging artifacts, not in this PR).

Test plan

  • pytest tests/unit/deployments/test_reverse_engineer.py — 19 pass (12 existing + 7 new OnlineXML cases incl. the descriptor self-validation round-trip)
  • ruff + pyright clean on changed files
  • P01 smoke run, then full 17-beamline sweep, all candidates valid
  • APS regression: --source bits on BCDA-APS/tomo-bits unchanged

🤖 Generated with Claude Code

…e topology

The extractor only understood EPICS sources (Guarneri devices.yml + ophyd
ASTs). PETRA III runs Tango/Sardana and publishes per-endstation device
registries (online_*.xml) on gitlab.desy.de, so its topology was out of reach
and would have to be transcribed by hand across 17 beamlines.

Add a parallel parse+map pair that converges on the existing control-system
-agnostic CandidateDevice, leaving the EPICS path untouched: parse_online_xml
+ a Tango host-to-enclosure grammar in parse.py, conservative Tango family
rules + a modellable-device filter in mapping.py, and a --source {bits,onlinexml}
switch in cli.py that dedups shared upstream devices across per-endstation files.
emit.py gains a source_desc so facts.md attributes the right origin and reports
the filtered bookkeeping count rather than hiding it.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

@xmap xmap merged commit 0946257 into main Jun 29, 2026
16 checks passed
@xmap xmap deleted the worktree-petra-onlinexml-extractor branch June 29, 2026 09:19
xmap added a commit that referenced this pull request Jun 29, 2026
…ine, reverse-engineered (#426)

P01 is CORA's first PETRA III (DESY) beamline and its second Tango / Sardana
control floor after MAX IV. It is reverse-engineered from P01's own public
OnlineXML device registry (the online_haspp01eh{1,2,3}.xml Tango device list on
gitlab.desy.de), extracted with the scripts/reverse_engineer/ --source onlinexml
path landed in #423, then curated: the registry's 141 per-axis devices grouped
into Assets at stage granularity across the five hutches (two optics, three
experiment), every value carried confirm until DESY staff verify it.

Two things are genuinely new: the control plane (Tango + Sardana, the seam
"EPICS is the floor" generalizes to "Tango / Sardana is the floor", a sibling of
the ESRF BLISS floor), and the technique branch (nuclear resonant scattering +
RIXS, which earn no catalog Method and are carried pending on the Site reusing
the IXS / RIXS slugs the fleet already shares). P01 coins no new Family: the EH2
sample circle binds Goniometer (not the composed Diffractometer Assembly) since
the registry exposes only theta / two-theta, per the catalog's own guidance.

557 deployment unit tests pass; mkdocs build --strict is clean.

Co-authored-by: Claude <noreply@anthropic.com>
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