Skip to content

Commit

Permalink
catch attempts of shapefactors being used as POI
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-held committed May 11, 2023
1 parent 5161749 commit d81c160
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pyhf/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ def set_poi(self, name):
raise exceptions.InvalidModel(
f"The parameter of interest '{name:s}' cannot be fit as it is not declared in the model specification."
)
if dict(self.modifiers)[name] == "shapefactor":
raise exceptions.InvalidModel(
f"The parameter '{name:s}' is of type 'shapefactor' and thus cannot be used as parameter of interest."
)
s = self.par_slice(name)
assert s.stop - s.start == 1
self._poi_name = name
Expand Down

0 comments on commit d81c160

Please sign in to comment.