iris-hep / func_adl_uproot

Uproot-based backend for FuncADL
MIT License
0 stars 0 forks source link

Failure on DAOD_PHYSLITE files #82

Closed masonproffitt closed 7 months ago

masonproffitt commented 2 years ago

Running on DAOD_PHYSLITE files (e.g., the DSID data15_13TeV:data15_13TeV.00282784.physics_Main.deriv.DAOD_PHYSLITE.r9264_p3083_p4165_tid21568807_00) fails because uproot.lazy() raises an error like:

---------------------------------------------------------------------------
CannotBeAwkward                           Traceback (most recent call last)
/tmp/ipykernel_13594/72621937.py in <module>
----> 1 uproot.lazy('/LLPData/mproffit/data15_13TeV/DAOD_PHYSLITE.21568807._000001.pool.root.1:CollectionTree')

~/miniconda3/envs/calratio/lib/python3.9/site-packages/uproot/behaviors/TBranch.py in lazy(files, filter_name, filter_typename, filter_branch, recursive, full_paths, step_size, decompression_executor, interpretation_executor, array_cache, library, custom_classes, allow_missing, **options)
    632 
    633                 interpretation = branchid_interpretation[branch.cache_key]
--> 634                 form = interpretation.awkward_form(obj.file, index_format="i64")
    635                 if isinstance(interpretation, uproot.interpretation.objects.AsObjects):
    636                     if not uproot.interpretation.objects.awkward_can_optimize(

~/miniconda3/envs/calratio/lib/python3.9/site-packages/uproot/interpretation/objects.py in awkward_form(self, file, index_format, header, tobject_header, breadcrumbs)
    115     ):
    116         if isinstance(self._model, type):
--> 117             return self._model.awkward_form(
    118                 self._branch.file, index_format, header, tobject_header, breadcrumbs
    119             )

~/miniconda3/envs/calratio/lib/python3.9/site-packages/uproot/model.py in awkward_form(cls, file, index_format, header, tobject_header, breadcrumbs)
   1024         """
   1025         versioned_cls = file.class_named(classname_decode(cls.__name__)[0], "max")
-> 1026         return versioned_cls.awkward_form(
   1027             file, index_format, header, tobject_header, breadcrumbs
   1028         )

<dynamic> in awkward_form(cls, file, index_format, header, tobject_header, breadcrumbs)

~/miniconda3/envs/calratio/lib/python3.9/site-packages/uproot/containers.py in awkward_form(self, file, index_format, header, tobject_header, breadcrumbs)
    776         return awkward.forms.ListOffsetForm(
    777             index_format,
--> 778             uproot._util.awkward_form(
    779                 self._values, file, index_format, header, tobject_header, breadcrumbs
    780             ),

~/miniconda3/envs/calratio/lib/python3.9/site-packages/uproot/_util.py in awkward_form(model, file, index_format, header, tobject_header, breadcrumbs)
    423 
    424     else:
--> 425         return model.awkward_form(
    426             file, index_format, header, tobject_header, breadcrumbs
    427         )

~/miniconda3/envs/calratio/lib/python3.9/site-packages/uproot/model.py in awkward_form(cls, file, index_format, header, tobject_header, breadcrumbs)
    652         Awkward Array.
    653         """
--> 654         raise uproot.interpretation.objects.CannotBeAwkward(
    655             classname_decode(cls.__name__)[0]
    656         )

CannotBeAwkward: pair<string,string>
masonproffitt commented 7 months ago

The best solution here would be an upstream resolution to https://github.com/scikit-hep/uproot5/issues/1046, but for now we could work around this with something like what Coffea does with _remove_not_interpretable().