Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: yield tables #159

Merged
merged 7 commits into from
Dec 7, 2020
Merged

feat: yield tables #159

merged 7 commits into from
Dec 7, 2020

Conversation

alexander-held
Copy link
Member

@alexander-held alexander-held commented Nov 30, 2020

see #158

This adds yield tables. The tables can be visualized with the tabulate package, which is now a core dependency.

The yield tables are currently printed when creating pre- and post-fit data/MC visualizations. Their creation requires the same calculation (in their current format), so it makes sense to include them there. This might be refactored in the future, so for now everything in the new tabulate module is treated as non-public API.

Other considerations:

  • could also do a table with yields per channel instead of per bin, this requires an additional calculation where all histograms in the model are concatenated (Summing bins per channel pyhf#1198) -> future PR
  • could also add per-sample uncertainties, which also requires an additional calculation (maybe could be integrated into model_utils.calculate_stdev without significant overhead) -> future PR

Small changes:

  • model_utils.calculate_stdev returns a list instead of an awkward array

@codecov
Copy link

codecov bot commented Nov 30, 2020

Codecov Report

Merging #159 (b723510) into master (fc984e4) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #159      +/-   ##
==========================================
+ Coverage   97.96%   98.00%   +0.04%     
==========================================
  Files          13       14       +1     
  Lines        1471     1507      +36     
  Branches      211      219       +8     
==========================================
+ Hits         1441     1477      +36     
  Misses         28       28              
  Partials        2        2              
Impacted Files Coverage Δ
src/cabinetry/__init__.py 100.00% <100.00%> (ø)
src/cabinetry/model_utils.py 100.00% <100.00%> (ø)
src/cabinetry/tabulate.py 100.00% <100.00%> (ø)
src/cabinetry/visualize.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc984e4...b723510. Read the comment docs.

@alexander-held alexander-held merged commit 36035e7 into master Dec 7, 2020
@alexander-held alexander-held deleted the feat/yield-tables branch December 7, 2020 21:08
@alexander-held alexander-held mentioned this pull request Dec 7, 2020
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.

1 participant