Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Unable to read vector<long long>/vector<Long64_t> branches #507

Open
masonproffitt opened this issue Jul 11, 2020 · 0 comments
Open

Unable to read vector<long long>/vector<Long64_t> branches #507

masonproffitt opened this issue Jul 11, 2020 · 0 comments

Comments

@masonproffitt
Copy link
Contributor

The type std::vector<long long> (or std::vector<Long64_t>) is missing from uproot's type interpretation:

>>> import uproot
>>> file = uproot.open('test_file.root')
>>> file['tree']['long64_t_vector_branch']
<TBranchElement b'long64_t_vector_branch' at 0x7f87add58250>
>>> file['tree']['long64_t_vector_branch'].array()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/site-packages/uproot/tree.py", line 1362, in array
    interpretation = self._normalize_interpretation(interpretation, awkward)
  File "/usr/lib/python3.8/site-packages/uproot/tree.py", line 1105, in _normalize_interpretation
    raise ValueError("cannot interpret branch {0} as a Python type\n   in file: {1}".format(repr(self.name), self._context.sourcepath))
ValueError: cannot interpret branch b'long64_t_vector_branch' as a Python type
   in file: /home/user/cern/iris/code/uproot_tree_utils/test_file.root

The type is missing in uproot/interp/auto.py. unsigned long long/ULong64_t works fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant