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

fix: Add guards against shared shapesys paramsets #1977

Merged
merged 11 commits into from
Sep 7, 2022

Conversation

kratsg
Copy link
Contributor

@kratsg kratsg commented Sep 1, 2022

Pull Request Description

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Add checks to determine if modifiers should be shared across channels when
  the modifier is being built. This guards against accidental correlations across
  channels. e.g. shared shapesys paramsets.
   - Amends PR #1625
* Add tests for raised pyhf.exceptions.InvalidModel in the event that a shared shapesys
  paramset is introduced in the model spec.

@kratsg kratsg added the fix A bug fix label Sep 1, 2022
@kratsg kratsg self-assigned this Sep 1, 2022
@codecov
Copy link

codecov bot commented Sep 1, 2022

Codecov Report

Base: 98.25% // Head: 98.26% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (39fe675) compared to base (6bbd9ff).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1977   +/-   ##
=======================================
  Coverage   98.25%   98.26%           
=======================================
  Files          68       68           
  Lines        4420     4430   +10     
  Branches      727      728    +1     
=======================================
+ Hits         4343     4353   +10     
  Misses         45       45           
  Partials       32       32           
Flag Coverage Δ
contrib 27.04% <43.75%> (+0.09%) ⬆️
doctest 60.88% <87.50%> (+0.04%) ⬆️
unittests-3.10 96.18% <100.00%> (+<0.01%) ⬆️
unittests-3.7 96.16% <100.00%> (+<0.01%) ⬆️
unittests-3.8 96.20% <100.00%> (+<0.01%) ⬆️
unittests-3.9 96.23% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pyhf/modifiers/histosys.py 100.00% <100.00%> (ø)
src/pyhf/modifiers/lumi.py 100.00% <100.00%> (ø)
src/pyhf/modifiers/normfactor.py 100.00% <100.00%> (ø)
src/pyhf/modifiers/normsys.py 100.00% <100.00%> (ø)
src/pyhf/modifiers/shapefactor.py 100.00% <100.00%> (ø)
src/pyhf/modifiers/shapesys.py 100.00% <100.00%> (ø)
src/pyhf/modifiers/staterror.py 98.05% <100.00%> (+0.01%) ⬆️
src/pyhf/pdf.py 98.02% <100.00%> (+0.01%) ⬆️

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@matthewfeickert matthewfeickert added the tests pytest label Sep 7, 2022
@matthewfeickert matthewfeickert changed the title fix: Shapesys shared paramset regression fix: Add guards against shared shapesys paramsets Sep 7, 2022
Copy link
Member

@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

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

LGTM. 👍 Thanks @kratsg!

@alexander-held both of the example problematic scripts in your excellent Issues #1908 and #1967 now properly raise pyhf.exceptions.InvalidModel. 👍

@matthewfeickert matthewfeickert merged commit b12c9dd into master Sep 7, 2022
@matthewfeickert matthewfeickert deleted the fix/isSharedRegression_Shapesys branch September 7, 2022 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A bug fix tests pytest
Projects
None yet
2 participants