Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in untested AwkwardForth case #833

Closed
jpivarski opened this issue Feb 17, 2023 Discussed in #826 · 0 comments · Fixed by #838 or #1202
Closed

Error in untested AwkwardForth case #833

jpivarski opened this issue Feb 17, 2023 Discussed in #826 · 0 comments · Fixed by #838 or #1202
Assignees
Labels
bug The problem described is something that must be fixed

Comments

@jpivarski
Copy link
Member

Discussed in #826

Originally posted by renyhp February 16, 2023
Hi, I have just installed uproot, but I can't get it to read a tree.

My code is very simple:

import uproot
f = uproot.reading.open("myfile.root")
t = f.get("aTree")
t['TheOnlyBranch'].array()

This just crashes with this stacktrace:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/venv/lib/python3.10/site-packages/uproot/behaviors/TBranch.py", line 834, in arrays
    _ranges_or_baskets_to_arrays(
  File "/tmp/venv/lib/python3.10/site-packages/uproot/behaviors/TBranch.py", line 3124, in _ranges_or_baskets_to_arrays
    uproot.source.futures.delayed_raise(*obj)
  File "/tmp/venv/lib/python3.10/site-packages/uproot/source/futures.py", line 36, in delayed_raise
    raise exception_value.with_traceback(traceback)
  File "/tmp/venv/lib/python3.10/site-packages/uproot/behaviors/TBranch.py", line 3066, in basket_to_array
    basket_arrays[basket.basket_num] = interpretation.basket_array(
  File "/tmp/venv/lib/python3.10/site-packages/uproot/interpretation/objects.py", line 139, in basket_array
    output = self.basket_array_forth(
  File "/tmp/venv/lib/python3.10/site-packages/uproot/interpretation/objects.py", line 206, in basket_array_forth
    output = self._discover_forth(
  File "/tmp/venv/lib/python3.10/site-packages/uproot/interpretation/objects.py", line 286, in _discover_forth
    output[i] = self._model.read(
  File "/tmp/venv/lib/python3.10/site-packages/uproot/containers.py", line 609, in read
    return uproot.deserialization.read_object_any(
  File "/tmp/venv/lib/python3.10/site-packages/uproot/deserialization.py", line 274, in read_object_any
    obj = cls.read(chunk, cursor, context, file, selffile, parent)
  File "/tmp/venv/lib/python3.10/site-packages/uproot/model.py", line 1372, in read
    versioned_cls.read(
  File "/tmp/venv/lib/python3.10/site-packages/uproot/model.py", line 867, in read
    self.read_members(chunk, cursor, context, file)
  File "<dynamic>", line 567, in read_members
KeyError: dtype('int8')

The branch does contain subbranches, some of them are of type int8 and uint8.

Am I doing anything wrong or is this a bug to be reported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The problem described is something that must be fixed
Projects
None yet
1 participant