Custom invalid value handling for functors in FunTuple
Prelude
When no MC association exists, FunTuple tuples an invalid value for the candidate e.g.
-
MAP_INPUT(PT, P2MCP)
-> tuplesnan
invalid value. -
MAP_INPUT(PARTICLEID,P2MCP)
-> tuples0
invalid value.
In case of integers, 0
is not always an invalid value e.g. for F.BKGCAT(Table)
signal is represented by 0
. As a result, the invalid value handling for BKGCAT
was tied with functor definition to give -1
.
Proposed change:
After discussions (with @chasse , @graven, @tfulghes), on invalid values for functor composition. The result was that, we move the custom invalid value handling out of functor definition and into FunTuple. This means users who used to do {'BKGCAT' : F.BKGCAT(Table)}
, will have to instead do:
Opt1:
{'BKGCAT' : NewWapper(F.BKGCAT(Table), invalid_value = -1)}
Opt2:
{'BKGCAT' : F.BKGCAT(Table, invalid_value = -1)}
Questions:
Which option should we go for?
Opt1 begs few questions:
- In DV, need to identify special functors like
BKGCAT
and force users to specify invalid value. This is fine. - When a new functor becomes available, DV needs to warn the users about invalid value handling, asking them to check if this is a special case or not (new functors might be common occurrence due to composition).
- It makes sense that the
NewWrapper
needs to be used with special functors only, however for uniformity do we want all the functors in DV to be wrapped?
Opt2 is perhaps simpler? Here you allow for an invalid_value
on the python side then FunTuple can check if this property exists or not and eventually using the value if it exists.
@pkoppenb and @erodrigu , your inputs would be very helpful.
Developments related to DPA task https://gitlab.cern.ch/lhcb-dpa/project/-/issues/121.