The following code contains a type-related error:
from typing import Iterable
from func_adl_servicex_xaodr22 import FuncADLQueryPHYSLITE, cpp_vfloat
from func_adl_servicex_xaodr22.type_support import cpp_type
cpp_vfloat = cpp_type[Iterable[float]]("float", float, "std::vector<float>")
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_vfloat]("MuonLinks")[0].pt()
),
}
)
)
Specifically, the cpp_vloat correctly has trouble with accessing pt for a float. So pylance gives you a red squiggle. However, you can run this cell just fine. When you get around to deliver, then you get an actual exception that says you can't access pt. Shouldn't that exception happen here, near the line of code that caused it?
The following code contains a type-related error:
Specifically, the
cpp_vloatcorrectly has trouble with accessingptfor a float. Sopylancegives you a red squiggle. However, you can run this cell just fine. When you get around todeliver, then you get an actual exception that says you can't accesspt. Shouldn't that exception happen here, near the line of code that caused it?