Skip to content

Commit

Permalink
handle custom modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-held committed May 11, 2023
1 parent 1a7aee0 commit a34efec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pyhf/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,9 @@ 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":
if dict(self.modifiers).get(name, "") == "shapefactor":
# in the case of custom modifiers, the desired POI is in self.parameters but
# not in self.modifiers
raise exceptions.InvalidModel(
f"The parameter '{name:s}' is of type 'shapefactor' and thus cannot be used as parameter of interest."
)
Expand Down

0 comments on commit a34efec

Please sign in to comment.