You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When converting a workspace via pyhf json2xml, the model config seems to rely on the presence of parameter inits, even though the spec does not strictly require them.
...
File "[...]/pyhf/src/pyhf/cli/rootio.py", line 88, in json2xml
writexml.writexml(
File "[...]/pyhf/src/pyhf/writexml.py", line 292, in writexml
channel = build_channel(spec, channelspec, spec.get('observations'))
File "[...]/pyhf/src/pyhf/writexml.py", line 271, in build_channel
channel.append(build_sample(spec, samplespec, channelspec['name']))
File "[...]/pyhf/src/pyhf/writexml.py", line 245, in build_sample
modifier = build_modifier(
File "[...]/pyhf/src/pyhf/writexml.py", line 181, in build_modifier
val = p['inits'][0]
KeyError: 'inits'
A fit with pyhf fit works perfectly fine. The addition of "inits": [1.0] in the model config also fixes the crash, as does removing this parameter configuration completely.
File Upload (optional)
No response
Expected Results
I expect the conversion to not rely on the presence of inits. The default of 1.0 may not make sense if some custom bounds are specified, but I think this is on the user to fix. The same issue also appears when just setting a normfactor to constant without specifying the inits.
Actual Results
File "[...]/pyhf/src/pyhf/cli/rootio.py", line 88, in json2xml writexml.writexml( File "[...]/pyhf/src/pyhf/writexml.py", line 292, in writexml channel = build_channel(spec, channelspec, spec.get('observations')) File "[...]/pyhf/src/pyhf/writexml.py", line 271, in build_channel channel.append(build_sample(spec, samplespec, channelspec['name'])) File "[...]/pyhf/src/pyhf/writexml.py", line 245, in build_sample modifier = build_modifier( File "[...]/pyhf/src/pyhf/writexml.py", line 181, in build_modifier val = p['inits'][0]KeyError: 'inits'
pyhf Version
0.6.3
Code of Conduct
I agree to follow the Code of Conduct
The text was updated successfully, but these errors were encountered:
Summary
When converting a workspace via
pyhf json2xml
, the model config seems to rely on the presence of parameter inits, even though the spec does not strictly require them.OS / Environment
n/a
Steps to Reproduce
workspace:
convert with
pyhf json2xml
:A fit with
pyhf fit
works perfectly fine. The addition of"inits": [1.0]
in the model config also fixes the crash, as does removing this parameter configuration completely.File Upload (optional)
No response
Expected Results
I expect the conversion to not rely on the presence of
inits
. The default of1.0
may not make sense if some custom bounds are specified, but I think this is on the user to fix. The same issue also appears when just setting anormfactor
to constant without specifying theinits
.Actual Results
pyhf Version
0.6.3
Code of Conduct
The text was updated successfully, but these errors were encountered: