Skip to content

Use the agg backend in all plotting par scripts - #62

Merged
ggmarshall merged 1 commit into
mainfrom
fix/agg-backend
Oct 4, 2026
Merged

ggmarshall merged 1 commit into
mainfrom
fix/agg-backend

Conversation

@ggmarshall

@ggmarshall ggmarshall commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor
  • I have reviewed all the code in this pull request and deem it of the
    standard expected for this project.

Sets mpl.use("agg") in the plotting par scripts (dsp/{dplms,eopt,nopt,pz}.py, hit/{aoe,lq,qc}.py), as hit/ecal.py already does.

If an X11 DISPLAY is forwarded into the job (e.g. running a production from an ssh -X session), matplotlib in the container picks TkAgg. The jobs then die with exit status 1 and no traceback (X connection ... broken on stderr only) when the connection drops, which looks like an OOM kill. Production without DISPLAY is unaffected.

Checked inside the production container with a live forwarded display: before the fix matplotlib.get_backend() gives tkagg, after it agg. pytest passes (83).

Independent of the plot-data PRs (#60, #61).

This PR was prepared with AI assistance.

Only ecal.py set it. With an X11 DISPLAY in the environment (e.g. ssh -X)
the other scripts picked TkAgg inside the container and died with exit 1
and no traceback when the X connection dropped.

Assisted-by: Generative AI
Copilot AI balanced review requested due to automatic review settings October 2, 2026 00:37

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.

Copilot review overview

🟢 Approval recommended

The focused changes consistently follow the existing ecal.py backend pattern and address the documented X11 failure mode.

Review effort: Balanced
Findings: None

What changed in this PR

Forces plotting parameter scripts to use Matplotlib’s noninteractive Agg backend, preventing failures when forwarded X11 connections close.

Changes:

  • Configures Agg for DSP plotting scripts.
  • Configures Agg for HIT plotting scripts.
File Description
dsp/​dplms.py Enables Agg rendering.
dsp/​eopt.py Enables Agg rendering.
dsp/​nopt.py Enables Agg rendering.
dsp/​pz.py Enables Agg rendering.
hit/​aoe.py Enables Agg rendering.
hit/​lq.py Enables Agg rendering.
hit/​qc.py Enables Agg rendering.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ggmarshall
ggmarshall merged commit 1301192 into main Oct 4, 2026
11 checks passed
@ggmarshall
ggmarshall deleted the fix/agg-backend branch October 4, 2026 19:41
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