Repository navigation
Use the agg backend in all plotting par scripts - #62
Merged
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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), ashit/ecal.pyalready does.If an X11
DISPLAYis forwarded into the job (e.g. running a production from anssh -Xsession), matplotlib in the container picks TkAgg. The jobs then die with exit status 1 and no traceback (X connection ... brokenon stderr only) when the connection drops, which looks like an OOM kill. Production withoutDISPLAYis unaffected.Checked inside the production container with a live forwarded display: before the fix
matplotlib.get_backend()givestkagg, after itagg.pytestpasses (83).Independent of the plot-data PRs (#60, #61).
This PR was prepared with AI assistance.