Open masonproffitt opened 4 years ago
This is what I get when I try to make an unsigned integer branch:
>>> import numpy as np >>> import uproot >>> file = uproot.recreate('test.root') >>> file['tree'] = uproot.newtree({'branch': np.uint32}) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.8/site-packages/uproot/write/TFile.py", line 84, in __setitem__ what = TTree(where, what, self) File "/usr/lib/python3.8/site-packages/uproot/write/objects/TTree.py", line 85, in __init__ self._branches[name] = TBranch(name, branch, compression, self, file) File "/usr/lib/python3.8/site-packages/uproot/write/objects/TTree.py", line 252, in __init__ self._branch = TBranchImpl(name, branchobj, compression, file) File "/usr/lib/python3.8/site-packages/uproot/write/objects/TTree.py", line 820, in __init__ raise NotImplementedError NotImplementedError
Yup:
https://github.com/scikit-hep/uproot/blob/634667fad826ec6c86e2df442887b1024c2cfee8/uproot/write/objects/TTree.py#L797-L820
Handling unsigned integers will involve setting fIsUnsigned, a TLeaf attribute.
fIsUnsigned
https://github.com/scikit-hep/uproot/blob/634667fad826ec6c86e2df442887b1024c2cfee8/uproot/write/objects/TTree.py#L898-L907
This is what I get when I try to make an unsigned integer branch: