Multiple staterror modifiers per sample and channel, round trips and duplicate modifiers #1830
Open
1 task done
Labels
bug
Something isn't working
needs-triage
Needs a maintainer to categorize and assign
user request
Request coming form a pyhf user
Summary
In the context of #760 I was wondering what would happen in a setup that exploits the fact that
pyhf
allows customizing parameter names forstaterror
modifiers to assign multiple such modifiers to the same sample in the same channel.Within just
pyhf
, this seems to work fine, and there will be multiple parameters in the fit. When converting to xml+ROOT, twoStatError
modifiers do show up in the xml. When converting back to JSON, thestaterror
modifier names get standardized, resulting in two fields with the same modifier name. Only one of them is used when building the model, so the roundtrip fails.OS / Environment
n/a
Steps to Reproduce
Default workspace:
This contains two parameters controlling the
staterror
modifiers (+mu_sig
, which is of no relevance here).Convert to xml+ROOT via
pyhf json2xml
, resulting in the followingconfig/FitConfig_ch.xml
:I do not know whether this is technically valid HistFactory, but it converts fine with
hist2workspace
. I did not check whether one of the modifiers gets dropped, or if they get merged.Convert back to JSON with
pyhf xml2json
:The modifiers are still both there, but since the name is now the same for both, the first one is dropped from the model and only the second modifier enters. See e.g.
pyhf inspect
, which will show a singlestaterror
modifier for this version, and two for the original.File Upload (optional)
No response
Expected Results
Unclear to me what the expected behavior should be:
This was example was written as a targeted setup to test behavior, and may not be all that relevant in practice.
shapesys
modifiers can be used for this effect to achieve the same behavior (assuming customizable constraint term, as in #1829). It may make sense to only allow a singlestaterror
modifier per sample and channel to avoid this issue altogether.Actual Results
see above, roundtrip fails
pyhf Version
pyhf, version 0.6.4
Code of Conduct
The text was updated successfully, but these errors were encountered: