Skip to content

ValueError with uproot.iterate over xrootd #1040

@matthewfeickert

Description

@matthewfeickert

Another issue is opening more than one file:

import uproot

xc='root://xcache.af.uchicago.edu:1094//'
fname_data = xc+"root://fax.mwt2.org:1094//pnfs/uchicago.edu/atlaslocalgroupdisk/rucio/data18_13TeV/df/a4/DAOD_PHYSLITE.34858087._000001.pool.root.1"
fname_dat1 = xc+"root://fax.mwt2.org:1094//pnfs/uchicago.edu/atlaslocalgroupdisk/rucio/data18_13TeV/6c/67/DAOD_PHYSLITE.34858087._000002.pool.root.1"

tree_data = uproot.iterate(
    {fname_data: "CollectionTree"}, {fname_dat1: "CollectionTree"}
)
next(tree_data)  # trigger error
ValueError: cannot produce Awkward Arrays for interpretation AsObjects(Unknown_xAOD_3a3a_MissingETAssociationMap_5f_v1) because

    xAOD::MissingETAssociationMap_v1

instead, try library="np" rather than library="ak" or globally set uproot.default_library

in file root://xcache.af.uchicago.edu:1094//root://fax.mwt2.org:1094//pnfs/uchicago.edu/atlaslocalgroupdisk/rucio/data18_13TeV/df/a4/DAOD_PHYSLITE.34858087._000001.pool.root.1
in object /CollectionTree;1:METAssoc_AnalysisMET

The same happens even if I try to open single file using iterator...

Originally posted by @ivukotic in #1038 (comment)

@lobis as you started looking at this I thought I would open up a seperate Issue as these seem distinct enough. As a second example, following the setup in Issue #1038, that follows the uproot.iterate docs example to some extent (for a single file)

# test.py
import uproot

xc = "root://xcache.af.uchicago.edu:1094//"
file_name = (
    xc
    + "root://fax.mwt2.org:1094//pnfs/uchicago.edu/atlaslocalgroupdisk/rucio/data18_13TeV/df/a4/DAOD_PHYSLITE.34858087._000001.pool.root.1"
)
tree_name = "CollectionTree"
branch_name = "AnalysisTrigMatch_HLT_e20_lhvloose"

with uproot.open(file_name) as read_file:
    print(read_file[tree_name])
    print(read_file[tree_name][branch_name])

    _tree = read_file[tree_name]
    tree_data = _tree.iterate([branch_name], step_size=100)
    next(tree_data)  # trigger error

when executed

python test.py

errors out with

<TTree 'CollectionTree' (864 branches) at 0x7fe67d753f10>
<TBranchElement 'AnalysisTrigMatch_HLT_e20_lhvloose' at 0x7fe67c13f3d0>
Traceback (most recent call last):
  File "/venv/lib/python3.9/site-packages/uproot/behaviors/TBranch.py", line 2478, in _awkward_check
    interpretation.awkward_form(self.file)
  File "/venv/lib/python3.9/site-packages/uproot/interpretation/objects.py", line 111, in awkward_form
    return self._model.awkward_form(self._branch.file, context)
  File "/venv/lib/python3.9/site-packages/uproot/model.py", line 684, in awkward_form
    raise uproot.interpretation.objects.CannotBeAwkward(
uproot.interpretation.objects.CannotBeAwkward: DataVector<xAOD::TrigComposite_v1>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/analysis/test.py", line 17, in <module>
    next(tree_data)  # trigger error
  File "/venv/lib/python3.9/site-packages/uproot/behaviors/TBranch.py", line 1076, in iterate
    _ranges_or_baskets_to_arrays(
  File "/venv/lib/python3.9/site-packages/uproot/behaviors/TBranch.py", line 3041, in _ranges_or_baskets_to_arrays
    branchid_to_branch[cache_key]._awkward_check(interpretation)
  File "/venv/lib/python3.9/site-packages/uproot/behaviors/TBranch.py", line 2480, in _awkward_check
    raise ValueError(
ValueError: cannot produce Awkward Arrays for interpretation AsObjects(Unknown_DataVector_3c_xAOD_3a3a_TrigComposite_5f_v1_3e_) because

    DataVector<xAOD::TrigComposite_v1>

instead, try library="np" rather than library="ak" or globally set uproot.default_library

in file root://xcache.af.uchicago.edu:1094//root://fax.mwt2.org:1094//pnfs/uchicago.edu/atlaslocalgroupdisk/rucio/data18_13TeV/df/a4/DAOD_PHYSLITE.34858087._000001.pool.root.1
in object /CollectionTree;1:AnalysisTrigMatch_HLT_e20_lhvloose

I'm not sure if we need to be using the xrootd_handler option here, but that seems like it shouldn't be needed for the single file case(?).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions