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

uproot.iterate does not like multiple files #274

Closed
kratsg opened this issue May 9, 2019 · 1 comment
Closed

uproot.iterate does not like multiple files #274

kratsg opened this issue May 9, 2019 · 1 comment

Comments

@kratsg
Copy link

kratsg commented May 9, 2019

The following code snippet works perfectly:

for fname in args.files:
    with uproot.open(fname) as f:
        tree = f[args.treename]
        for start, stop, events in tree.iterate(branches, reportentries=True):
            pass

the following code snippet fails

for start, stop, events in uproot.iterate(
    args.files, args.treename, branches, reportentries=True
):
    pass

with this error:

Traceback (most recent call last):
  File "lund2hdf5.py", line 101, in <module>
    args.files, args.treename, branches, reportentries=True
  File "/usr/local/lib/python3.7/site-packages/uproot/tree.py", line 89, in iterate
    for tree, newbranches, globalentrystart, thispath, thisfile in _iterate(path, treepath, branches, awkward, localsource, xrootdsource, httpsource, **options):
  File "/usr/local/lib/python3.7/site-packages/uproot/tree.py", line 150, in _iterate
    elif not newbranches[key].compatible(oldbranches[key]):
  File "/usr/local/lib/python3.7/site-packages/uproot/interp/objects.py", line 306, in compatible
    return isinstance(other, asgenobj) and self.cls.__name__ == other.cls.__name__
AttributeError: 'asgenobj' object has no attribute 'cls'
@jpivarski
Copy link
Member

See PR #275.

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

2 participants