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
If we make the arrays c-contiguous, the resulting dataset is correct:
for key, arr in data.items():
if not arr.flags.c_contiguous:
data[key] = np.ascontiguousarray(arr)
dataset = ROOT.RooDataSet.from_numpy(data, ROOT.RooArgSet(obs_1, obs_2))
It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.
Check duplicate issues.
Description
If the input numpy arrays to
RooDataSet.from_numpy
are not c-contiguous, then the resulting dataset will have messed up values.Reproducer
This gives (memory dependent):
The expected output should be
This happens because the arrays
data['obs_1']
anddata['obs_2']
are not c-contiguous:If we make the arrays c-contiguous, the resulting dataset is correct:
this gives
This issue arises because the copying of numpy data to std::vector assumes the numpy array to be c-contiguous:
https://github.com/root-project/root/blob/master/bindings/pyroot/pythonizations/python/ROOT/_pythonization/_roofit/_roodataset.py#L129-L132
ROOT version
ROOT 6.26/08+
Installation method
lxplus
Operating system
Linux
Additional context
No response
The text was updated successfully, but these errors were encountered: