add fault heatmap to CLI infrastructure - #291
Conversation
🟢 PR size: 19 lines — within target
Target is 400 lines excluding tests, hard stop around 800 — see |
There was a problem hiding this comment.
🟡 Changes recommended
The new sc-fheatmap console script is not added to the all_script_names fixture used to verify entrypoint registration/imports, leaving the new entrypoint untested.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR integrates the existing fault heatmap PyDM display into the unified CLI launcher framework so it appears in sc-linac list and can be launched via sc-linac fault-heatmap, with a direct shortcut console script sc-fheatmap.
Changes:
- Added a new
@displaylauncherlaunch_fault_heatmapto the CLI launcher registry. - Updated
FaultHeatmapDisplayto auto-create aBackendMachinewhen instantiated via PyDM/CLI without an injected machine. - Added/updated tests to cover the new launcher path and the “no machine” dialog behavior.
File summaries
| File | Description |
|---|---|
src/sc_linac_physics/cli/launchers.py |
Registers launch_fault_heatmap under the display launcher discovery mechanism. |
src/sc_linac_physics/displays/cavity_display/frontend/heatmap/fault_heatmap_display.py |
Ensures the heatmap display can be instantiated from the CLI by creating a default BackendMachine. |
pyproject.toml |
Adds the sc-fheatmap console script entrypoint. |
tests/cli/test_launchers.py |
Adds a unit test verifying the new launcher calls launch_python_display with the correct display class. |
tests/displays/cavity_display/frontend/heatmap/test_fault_heatmap_display.py |
Adjusts tests to explicitly set _machine = None to exercise the “no machine” dialog paths. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
What this changes
Wires up the fault heatmap display to the CLI so it shows up in sc-linac list and can be launched with sc-linac fault-heatmap or sc-fheatmap.
Operator-visible
New command: sc-linac fault-heatmap (and shortcut sc-fheatmap) launches the fault heatmap display.
Scope
Under target
Testing
pytestpassesPYDM_DEFAULT_PROTOCOL=fake/sc-sim) where applicablesc-linac listshowsfault-heatmapandsc-linac fault-heatmaplaunches successfully