Skip to content

add fault heatmap to CLI infrastructure - #291

Merged
hmarts9 merged 3 commits into
slaclab:mainfrom
hmarts9:feat/heatmap-cli
Sep 10, 2026
Merged

hmarts9 merged 3 commits into
slaclab:mainfrom
hmarts9:feat/heatmap-cli

Conversation

@hmarts9

@hmarts9 hmarts9 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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

  • pytest passes
  • Coverage still clears 80%
  • Checked against simulation (PYDM_DEFAULT_PROTOCOL=fake / sc-sim) where applicable
  • sc-linac list shows fault-heatmap and sc-linac fault-heatmap launches successfully

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🟢 PR size: 19 lines — within target

+19 / -0 in production code.
3 test and asset files excluded.

Largest files Change
src/sc_linac_physics/cli/launchers.py +12/-0
src/sc_linac_physics/displays/cavity_display/frontend/heatmap/fault_heatmap_display.py +6/-0
pyproject.toml +1/-0

Target is 400 lines excluding tests, hard stop around 800 — see
"Scope and shipping" in CLAUDE.md. If this PR is over, the description
should say why it could not be split. Advisory only; this check never
fails the build.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 @display launcher launch_fault_heatmap to the CLI launcher registry.
  • Updated FaultHeatmapDisplay to auto-create a BackendMachine when 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.

Comment thread pyproject.toml
@hmarts9
hmarts9 merged commit c9fd339 into slaclab:main Sep 10, 2026
7 checks passed
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.

3 participants