Update how type information is passed from Phlex to FORM#252
Update how type information is passed from Phlex to FORM#252knoepfel merged 9 commits intoFramework-R-D:mainfrom
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (50.98%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. @@ Coverage Diff @@
## main #252 +/- ##
==========================================
- Coverage 76.66% 75.21% -1.45%
==========================================
Files 124 124
Lines 2725 2905 +180
Branches 475 510 +35
==========================================
+ Hits 2089 2185 +96
- Misses 442 501 +59
- Partials 194 219 +25
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 8 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@gemmeren @aolivier23 @barnaliy Could you review this PR ? Thanks. |
|
@pcanal : This is a clean improvement - eliminating the manual type map makes the API much simpler. I particularly like the use of DemangleName(). Thanks for doing all this work! |
gemmeren
left a comment
There was a problem hiding this comment.
Thanks Philippe,
no objections, nut FORM will have to support non-ROOT backends, w/o DemangleName...
|
@gemmeren @pcanal @barnaliy Boost has a name demangler that doesn't depend on ROOT. It comes for free with something else phlex is using and seems to work with ROOT. Here's some documentation I quickly found: https://www.boost.org/doc/libs/latest/libs/core/doc/html/core/demangle.html Will take a look at the PR tomorrow if it's not already merged. But sounds like great work! |
aolivier23
left a comment
There was a problem hiding this comment.
The interface update looks good.
I think this will work with an eventual RNTuple backend but makes that a little more difficult. We have been using ROOT::RFieldBase::Create() when writing in the prototype, and that doesn't work with std::type_info as of writing. I think I see how to go through two steps using TClass to get a type name string using std::type_info. Or I could fall back to TClassEdit (or Boost) like you do.
std::type_info looks like it will work fine in reading mode. RNTupleReader::GetView() already has a std::type_info interface in the ROOT 6.36 documentation.
This is the safest but you should also reach out to the RNTuple developer about the potentially missing interface (i.e. taking the |
…-D#252) * Switch product from type_index to type_info * Switch FORM from type_index to type_info * FORM: Remove type_map * FORM: Demangle type_info before printing name * FORM: Add more information to exception msg --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…-D#252) * Switch product from type_index to type_info * Switch FORM from type_index to type_info * FORM: Remove type_map * FORM: Demangle type_info before printing name * FORM: Add more information to exception msg --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Given that ROOT knows about the type via their
std::type_info(and their C++ names) and that we can not lookup astd::type_infofrom anstd::type_index(but the reverse is supported by the C++ standard), we need to pass around thetype_info(otherwise we need to build a map of supported types).This solves #199