Skip to content

calibrate_all: accept a read_ldata NamedTuple datastore#47

Open
jonasschlegel wants to merge 1 commit into
mainfrom
calibrate-all-read-ldata
Open

calibrate_all: accept a read_ldata NamedTuple datastore#47
jonasschlegel wants to merge 1 commit into
mainfrom
calibrate-all-read-ldata

Conversation

@jonasschlegel

Copy link
Copy Markdown
Contributor

What didn't work before

calibrate_all only accepted an AbstractDataStore (an open LH5 file). The phy
event builder now reads its DSP input with read_ldata(l200, :jldsp, fk), which
returns a NamedTuple (one entry per detector) — and there was no method for that,
so calibrate_all(l200, fk, dsp_data) failed to dispatch.

Why the change is necessary

Juleana's process_evt_phy.jl reads jldsp via read_ldata and feeds the result
straight into calibrate_all. To keep that single-call workflow, calibrate_all has
to accept the NamedTuple that read_ldata returns.

What works now

  • calibrate_all(data, sel, datastore::NamedTuple, tier=:jldsp) is supported; the
    core calibrate_all body is unchanged (existing AbstractDataStore callers keep
    working).
  • A tiny _NTDataStore adapter wraps the NamedTuple as a Dict{String,Any} keyed by
    detector and forwards getindex / haskey. The eager Dict conversion is
    deliberate: passing the ~120-field NamedTuple straight to calibrate_all would
    specialize it on that giant type and blow up LLVM compile time.

Dependencies

Consumes read_ldata (LegendDataManagement). Pairs with Juleana read-ldata-input,
which produces the NamedTuple (read_ldata(l200, :jldsp, fk)
calibrate_all). Independent of the other LEA PR (sipm-per-fiber-pe-sums).

Adds a thin _NTDataStore adapter so calibrate_all can be called directly
with the NamedTuple returned by read_ldata. The eager Dict{String,Any}
conversion is necessary to avoid massive LLVM compile-time blow-up from
specializing on the NamedTuple's huge typed signature (~120 fields).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jonasschlegel jonasschlegel requested a review from theHenks June 26, 2026 13:46
@jonasschlegel jonasschlegel added bug Something isn't working dependencies Pull requests that update a dependency file labels Jun 26, 2026
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 5.68%. Comparing base (52d9a5e) to head (68ba476).

Files with missing lines Patch % Lines
src/calibrate_all.jl 0.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main     #47      +/-   ##
========================================
- Coverage   5.77%   5.68%   -0.09%     
========================================
  Files          7       7              
  Lines        329     334       +5     
========================================
  Hits          19      19              
- Misses       310     315       +5     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant