scikit-hep / cabinetry

design and steer profile likelihood fits
https://cabinetry.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
26 stars 21 forks source link

feat: yield uncertainties per sample #356

Closed alexander-held closed 2 years ago

alexander-held commented 2 years ago

Adds per-sample yield uncertainty calculations and the propagation to yield tables.

The per-sample calculation is not implemented as an optional choice, but always performed. With everything already vectorized, the calculation is still fast with reasonably large models. If this becomes a bottleneck, it may make sense to allow making the per-sample calculation optional.

resolves #191

resolves #326 by switching to awkward._v2 for the summation where this matters

breaking changes:

* breaking change: model_utils.ModelPrediction uncertainty structure now supports per-sample uncertainties
* breaking change: model_utils.yield_stdev (and model_utils.prediction) returns this new structure
* switch to awkward v2 API for yield uncertainty calculations
* raise awkward version requirement to awkward>=1.8
* updated pre-commit
codecov[bot] commented 2 years ago

Codecov Report

Merging #356 (5c3fdf6) into master (aee8689) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #356   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines         1999      2001    +2     
  Branches       326       326           
=========================================
+ Hits          1999      2001    +2     
Impacted Files Coverage Δ
src/cabinetry/visualize/__init__.py 100.00% <ø> (ø)
src/cabinetry/model_utils.py 100.00% <100.00%> (ø)
src/cabinetry/tabulate.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.