Skip to content

Return type from a complex call with an index after it is Any. Should probably not be. #164

@gordonwatts

Description

@gordonwatts

This code:

from typing import Iterable
from func_adl_servicex_xaodr22 import FuncADLQueryPHYSLITE
from func_adl_servicex_xaodr22.type_support import cpp_type
from func_adl_servicex_xaodr22.vector_elementlink_datavector_xaod_muon_v1___ import (
    vector_ElementLink_DataVector_xAOD_Muon_v1___,
)
from func_adl_servicex_xaodr22.elementlink_datavector_xaod_muon_v1__ import (
    ElementLink_DataVector_xAOD_Muon_v1__,
)

# Define the type for std::vector<ElementLink<xAOD::MuonContainer>>
# cpp_vfloat = cpp_type[Iterable[float]]("float", float, "std::vector<float>")
cpp_muon_links = cpp_type[vector_ElementLink_DataVector_xAOD_Muon_v1___](
    "ElementLink<DataVector<xAOD::Muon_v1>>",
    ElementLink_DataVector_xAOD_Muon_v1__,
    "vector<ElementLink<DataVector<xAOD::Muon_v1>>>",
)


query = (
    FuncADLQueryPHYSLITE()
    .Select(lambda e: e.Vertices("BPHY4Quads"))
    .Select(
        lambda vtxs: {
            "x": vtxs.Select(lambda v: v.x()),
            "QUAD_Muon0": vtxs.Select(
                lambda v: v.auxdataConst[cpp_muon_links]("MuonLinks")[0].pt()
            ),
        }
    )
)

Has the v.auxdataConst[cpp_muon_links]("MuonLinks") returning a type of Any rather than the cpp_muon_links.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions