Skip to content

Allow for user-defined function for evaluating detector efficiency - #96

Merged
veliki-filozof merged 6 commits into
LIBRA-project:mainfrom
cdunn314:exp_efficiency
Oct 9, 2026
Merged

veliki-filozof merged 6 commits into
LIBRA-project:mainfrom
cdunn314:exp_efficiency

Conversation

@cdunn314

@cdunn314 cdunn314 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Previously, libra-toolbox only allowed polynomial coefficients to be passed through SampleMeasurement.get_gamma_emitted() in order to evaluate the detector efficiency at a particular energy.

However, with this PR, the user may define their own efficiency function and pass in that function with the keyword argument "efficiency_function", which will sidestep the required calibration_coeffs argument and use the provided function to evaluate detector efficiency instead. This setup also ensures that all repos that still use the calibration_coeffs will still work.

@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.92%. Comparing base (0439a89) to head (a9f60e2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #96      +/-   ##
==========================================
+ Coverage   87.90%   87.92%   +0.01%     
==========================================
  Files          19       19              
  Lines        1596     1598       +2     
==========================================
+ Hits         1403     1405       +2     
  Misses        193      193              

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

@cdunn314

cdunn314 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@SteSeg @veliki-filozof would you mind reviewing this so I can merge it and use the main branch for processing the flab runs?

@veliki-filozof

Copy link
Copy Markdown
Contributor

@cdunn314 Something about the changes you made to test_compass.py made it break after you added efficiency function kwargs. I looked into the failed CI run report and Copilot suggests that something about kwargs being expanded by ** when they are None makes it break. Could you please look into this and make a fix before I merge?

@RemDelaporteMathurin

Copy link
Copy Markdown
Member

@cdunn314 tests are now failing for another reason

@cdunn314

cdunn314 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@veliki-filozof @RemDelaporteMathurin I fixed the test and now this is ready for a merge I think!

@veliki-filozof
veliki-filozof merged commit d85e5d3 into LIBRA-project:main Oct 9, 2026
3 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