Python support using converter nodes#45
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (50.09%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. @@ Coverage Diff @@
## main #45 +/- ##
==========================================
- Coverage 82.17% 76.09% -6.09%
==========================================
Files 120 124 +4
Lines 2177 2719 +542
Branches 348 469 +121
==========================================
+ Hits 1789 2069 +280
- Misses 250 453 +203
- Partials 138 197 +59
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 14 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…ion from annotations
beojan
left a comment
There was a problem hiding this comment.
There's one change that I think is a blocker for merging this, which is that the new kind member on the configuration should have a name that makes it clear that it is not for external use.
…n of queries exists
…neration (Framework-R-D#211) * Catch exceptions in main to ensure graceful exit and coverage data generation --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
The blocking issue was to rename configuration::kind(...) to something that signified it was intended to be an internal function. Wim renamed it to configuration::prototype_internal_kind(...).
greenc-FNAL
left a comment
There was a problem hiding this comment.
I have a WIP addressing some of the remaining test coverage issues, but I believe this PR is good to go as is.
There's also the minor issue that all Python APIs have error reporting, but many errors are unlikely/impossible to set up (e.g. only fail if out-of-memory). I'm not saying that coverage is at that point yet. :) But certainly some error paths take quite some thinking/setup to trigger. Edit: additionally, for C++, when you provide a template that's supposed to be used for all builtin type, coverage will not ding you for not testing all said builtin types. In the current Python implementation, since they're all explicitly instantiated, they do need to be individually tested. I'll get to that once I have a |
This PR adds Python support through input/output converter nodes to solve the combinatorical problem. This approach makes all template instantiations compile-time only, thus cutting down on startup and memory overhead compared to using a JIT. They do add a per-algorithm run-time overhead.
Current support is for builtin types and
std::vectorof builtin types. Full support of all types requires some code generation from the eventual IDL. Life-times are managed using "lifelines", tying input underlying to output views, as Phlex can not track through converter nodes.This PR adds support for registration that mimics C++ in naming, while remaining Pythonic and using reflection to cut down on boilerplate code where possible. It also adds a basic Pythonic representation of the configuration, with the actual remaining in C++. Error reporting translates Python tracebacks into C++
std::runtime_errorexceptions, for handling and printing bye the C++ main.The main open question is on interpreter finalization, which this PR punts on. This awaits resolution for when Phlex supports tokens.
This PR is ready to merge: the final failing checks are on code coverage of error reporting paths. These are in fact exercised: the tool is wrong.