[RF] Translated rf_408_RDataFrameToRooFit.C to python#8705
[RF] Translated rf_408_RDataFrameToRooFit.C to python#8705guitargeek merged 3 commits intoroot-project:masterfrom harshal0815:roofit-gsoc21-7
Conversation
|
Can one of the admins verify this patch? |
|
@phsft-bot build |
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests: |
|
Build failed on ROOT-debian10-i386/cxx14. Errors:
Failing tests: |
|
Build failed on mac11.0/cxx17. Failing tests: |
There was a problem hiding this comment.
Hi Harshal, thanks for the PR! I requested some changes to fix the crashes.
The problem was that cppyy translated the 0 literal to a nullptr, and not to a 0.0 double as you intended in your translation. That's not good that this can get confused!
Can you do me a favor so I don't need to apply the fix myself on the C++ side? In RooAbsCollection.h, there is this RooAbsArgPtrOrDouble that can either be constructed from RooAbsArg pointer or a double, which is how the implicit call to RooConst is achieved. Can you make an additional commit in this PR to change the signature of the first constructor to take the RooAbsArg by reference, with a meaningful commit message? It would look like this:
RooAbsArgPtrOrDouble(RooAbsArg & arg) : ptr{&arg}, hasPtr{true} {}It doesn't matter for pyROOT if the take the argument by pointer or by reference, and by taking a reference we avoid the problem with the nullptr. Thanks!
Also, please split up the existing commit into two commits: one commit for the new RDataFrame tutorial translation, and one the the RooArgList migration. Not mixing different developments in the same commit is a good habit, as it makes reviewing much easier.
|
@phsft-bot build |
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests: |
|
Build failed on mac11.0/cxx17. Failing tests: |
|
Build failed on ROOT-debian10-i386/cxx14. Errors:
Failing tests: |
|
@phsft-bot build |
|
Starting build on |
|
Build failed on ROOT-debian10-i386/cxx14. Failing tests: |
|
Build failed on mac11.0/cxx17. Failing tests: |
guitargeek
left a comment
There was a problem hiding this comment.
Thanks for the contribution! This PR:
- fixes a problem with the implicit creation of RooFit collections from python collections, where the integer zero is now interpreted as a RooConst and not as a
nullptr - migrates the RooFit pyROOT tutorials to use python lists instead of RooArgList
- adds a translation of the rf408_RDataFrameToRooFit tutorial to pyROOT, meaning we have now all RooFit tutorials translated and the corresponding GitHub issues can be closed
- the failures in the CI are unrelated to this PR
This Pull request:
Changes or fixes:
Checklist:
This PR fixes #