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: Don't specify a default POI name #2328

Merged
merged 5 commits into from
Sep 18, 2023

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Sep 13, 2023

Description

Resolves #2327

To avoid making assumptions for users about model behavior set the default POI name to None.

To avoid making behavior changes for pyhf.simplemodels add the default poi_name to the returned model.

This then requires explicilty setting poi_name="mu" in the tests for all explicity pyhf.pdf.Model constrcution.

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
* Set the default model poi_name to None to avoid making assumptions
  for users.
* To maintain the pyhf.simplemodels users experience add poi_name="mu"
  as a default argument to be passed to the returned pyhf.pdf.Model
  object.
* Add poi_name="mu" to all pyhf.Model construction in the tests.

@matthewfeickert matthewfeickert added feat/enhancement New feature or request tests pytest API Changes the public API labels Sep 13, 2023
@matthewfeickert matthewfeickert self-assigned this Sep 13, 2023
@@ -79,7 +79,7 @@ def correlated_background(
}
]
}
return Model(spec, batch_size=batch_size, validate=validate)
return Model(spec, batch_size=batch_size, validate=validate, poi_name="mu")
Copy link
Member Author

Choose a reason for hiding this comment

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

If we're going to be changing the default behaivor of pyhf.pdf.Model should we just go all in and make sure that pyhf.simplemodel also requires users to set things? Or should we keep the pyhf.simplemodel experience the same?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's fair to automatically set the POI for the simplemodels case. There is no ambiguity there for what else the POI should be.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could elevate this to a user accesible argument that defaults to mu and pass that through here, but as you said, the POI for these models is meant to be mu.

@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.13% 🎉

Comparison is base (10b17dd) 98.14% compared to head (951ad7a) 98.28%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2328      +/-   ##
==========================================
+ Coverage   98.14%   98.28%   +0.13%     
==========================================
  Files          69       69              
  Lines        4538     4538              
  Branches      803      803              
==========================================
+ Hits         4454     4460       +6     
+ Misses         48       45       -3     
+ Partials       36       33       -3     
Flag Coverage Δ
contrib 97.86% <100.00%> (ø)
doctest 60.99% <100.00%> (ø)
unittests-3.10 96.29% <100.00%> (ø)
unittests-3.11 96.29% <100.00%> (ø)
unittests-3.8 96.31% <100.00%> (?)
unittests-3.9 96.34% <100.00%> (ø)

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

Files Changed Coverage Δ
src/pyhf/pdf.py 98.03% <100.00%> (ø)
src/pyhf/simplemodels.py 92.30% <100.00%> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matthewfeickert matthewfeickert added the docs Documentation related label Sep 16, 2023
@matthewfeickert
Copy link
Member Author

@matthewfeickert matthewfeickert merged commit 87b84f7 into main Sep 18, 2023
19 checks passed
@matthewfeickert matthewfeickert deleted the feat/remove-default-poi-name branch September 18, 2023 18:04
matthewfeickert added a commit that referenced this pull request Sep 20, 2023
* Ensure all pyhf.Model calls in the example notebooks that don't
  already have a poi_name definied have `poi_name="mu"` set.
* Amends PR #2328
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes the public API docs Documentation related feat/enhancement New feature or request tests pytest
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Default POI name for model construction
3 participants