-
Notifications
You must be signed in to change notification settings - Fork 21
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: support models with custom modifiers #385
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #385 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 2093 2094 +1
Branches 344 344
=========================================
+ Hits 2093 2094 +1 ☔ View full report in Codecov by Sentry. |
|
||
Returns: | ||
Tuple[pyhf.pdf.Model, List[float]]: | ||
- a HistFactory-style model in ``pyhf`` format | ||
- the data (plus auxdata if requested) for the model | ||
""" | ||
workspace = pyhf.Workspace(spec) | ||
workspace = pyhf.Workspace(spec, validate=validate) | ||
poi_name_kwarg = {"poi_name": poi_name} if poi_name is not None else {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
poi_name=None
in pyhf.Model
means "no POI", while in model_and_data
it is now used as the default saying "use the workspace default". Should perhaps use an object()
sentinel instead of None
.
hey @alexander-held, would it be possible to merge the latest base branch into the feat/custom-modifier-models branch? |
811b537
to
c7b1303
Compare
Hi @rmnmllr, sure, this branch includes the changes from |
c7b1303
to
9a7c3f6
Compare
bd890a4
to
5dc0bef
Compare
5dc0bef
to
6883930
Compare
6883930
to
746684b
Compare
746684b
to
2decbe8
Compare
Add support for handling models with custom modifiers as introduced in scikit-hep/pyhf#1991. This means adding a
validate
kwarg tomodel_utils.model_and_data
to allow turning off workspace / model validation against the respective JSON schema (users could provide their own via thepyhf
API, seepyhf.schema.Schema
docs). Themodifier_set
kwarg can be used to inject custom modifiers.At the moment this also adds a
poi_name
kwarg to support the use case in #382, but that may be argued to be an invalid model specification to begin with, so it is not clear to me whether this would be generally needed. Thefit
API is meant to not rely on this option (to also more easily support multi-POI setups) so this may somewhat go against the design philosophy here.to-do:
cabinetry
config having custom modifier expressionsmay potentially resolve #382