Skip to content

feat(par-pht): migrate aoe/lq partition scripts to the multi-parameter params schema - #164

Merged
ggmarshall merged 4 commits into
fable-updatesfrom
psd-multiparam
Aug 16, 2026
Merged

feat(par-pht): migrate aoe/lq partition scripts to the multi-parameter params schema#164
ggmarshall merged 4 commits into
fable-updatesfrom
psd-multiparam

Conversation

@ggmarshall

Copy link
Copy Markdown
Collaborator

Summary

Migrates par-geds-pht-aoe, par-geds-pht-lq, and the aoe/lq sections of par-geds-pht-fast to the multi-parameter params config schema (top-level cal_energy_param/cut_field plus a params mapping with one entry per PSD parameter, each with its own current_param/lq_param, energy_param, and optional dt_param/dt_cut/suffix). The scripts build their DSP column lists from all entries and validate the new required keys up front.

This is the legend-dataflow side of the multi-parameter A/E + LQ calibration:

Stacked on #161 (fable-updates) — only the top commit is new. Note the production metadata aoecal/lqcal configs still use the flat schema and need restructuring to params form before these scripts run in production.

Test plan

Skimmed-data pht integration chain (per-run ecal → partcal → aoe → lq → fast, two runs) passes locally with params-schema configs — the LQ config exercises an unsuffixed primary plus a suffixed duplicate entry; full local suite 127 passed. (The integration suite itself is part of the in-progress testing work and not yet committed.)

Per AI_POLICY.md: developed with AI assistance (Claude); reviewed by the submitter.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 29, 2026 21:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the HPGe partition calibration console scripts in workflow/src/legenddataflow/scripts/par/geds/pht/ to consume the new multi-parameter params configuration schema for A/E and LQ, aligning this repository with the corresponding multi-parameter calibration work in legend-dataflow-scripts and pygama.

Changes:

  • Migrate par-geds-pht-aoe and par-geds-pht-lq to build DSP column requirements from the new per-PSD-parameter params mapping.
  • Update the A/E and LQ portions of par-geds-pht-fast to use the same params mapping and include any per-parameter dt_param / dt_cut outputs in the loaded column list.
  • Tighten top-level config key requirements for the new schema (cal_energy_param, cut_field, params, etc.).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
workflow/src/legenddataflow/scripts/par/geds/pht/aoe.py Switch A/E partition script to the multi-parameter params schema and build required columns from all configured parameters.
workflow/src/legenddataflow/scripts/par/geds/pht/lq.py Switch LQ partition script to the multi-parameter params schema and build required columns from all configured parameters.
workflow/src/legenddataflow/scripts/par/geds/pht/fast.py Update the combined fast partition script’s A/E + LQ sections to use the multi-parameter params schema when constructing the load-data column list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread workflow/src/legenddataflow/scripts/par/geds/pht/lq.py Outdated
Comment thread workflow/src/legenddataflow/scripts/par/geds/pht/aoe.py Outdated
Comment thread workflow/src/legenddataflow/scripts/par/geds/pht/fast.py Outdated
Comment thread workflow/src/legenddataflow/scripts/par/geds/pht/fast.py Outdated
@ggmarshall

Copy link
Copy Markdown
Collaborator Author

Note on CI: the unit-test job failures here are inherited from the base branch — fable-updates (#161) fails identically, because the released legenddataflowscripts on PyPI predates check_input_files in its utils (it lands with legend-exp/legend-dataflow-scripts#44/#41 lineage). Nothing in this PR's commits touches those imports; the failure will clear once a dataflow-scripts release containing them is pinned.

@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.41%. Comparing base (f87d49f) to head (3691134).

Files with missing lines Patch % Lines
...ow/src/legenddataflow/scripts/par/geds/pht/fast.py 0.00% 13 Missing ⚠️
...low/src/legenddataflow/scripts/par/geds/pht/aoe.py 0.00% 9 Missing ⚠️
...flow/src/legenddataflow/scripts/par/geds/pht/lq.py 0.00% 7 Missing ⚠️
...w/src/legenddataflow/scripts/par/geds/psp/dplms.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           fable-updates     #164      +/-   ##
=================================================
- Coverage          53.85%   53.41%   -0.45%     
=================================================
  Files                 34       34              
  Lines               2863     2887      +24     
=================================================
  Hits                1542     1542              
- Misses              1321     1345      +24     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ggmarshall and others added 4 commits August 15, 2026 22:56
…chema

par-geds-pht-aoe, par-geds-pht-lq and the aoe/lq sections of
par-geds-pht-fast now read the multi-parameter config schema (top-level
cal_energy_param/cut_field plus a params mapping with one entry per
PSD parameter), building their DSP column lists from all entries.
Matches the multi-parameter run_aoe_calibration/run_lq_calibration in
legend-dataflow-scripts (legend-exp/legend-dataflow-scripts#47).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Missing current_param/lq_param/energy_param in a params entry now
raises a clear error naming the channel and entry instead of a bare
KeyError.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A dt_cut mapping missing out_param now raises a clear error naming the
channel and params entry instead of a bare KeyError.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mirror the par-dsp dplms check in the psp variant: a peak may
legitimately be absent from an individual run's file, so validate the
dplms config's requested peaks against the union over all peak files
with require_peaks_present before reading waveforms, instead of
silently selecting zero events.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ggmarshall
ggmarshall merged commit 4b99d14 into main Aug 16, 2026
12 checks passed
@ggmarshall
ggmarshall deleted the psd-multiparam branch August 16, 2026 06:00
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