Skip to content

[RF] Translated rf_408_RDataFrameToRooFit.C to python#8705

Merged
guitargeek merged 3 commits intoroot-project:masterfrom
harshal0815:roofit-gsoc21-7
Jul 26, 2021
Merged

[RF] Translated rf_408_RDataFrameToRooFit.C to python#8705
guitargeek merged 3 commits intoroot-project:masterfrom
harshal0815:roofit-gsoc21-7

Conversation

@harshal0815
Copy link
Copy Markdown
Contributor

@harshal0815 harshal0815 commented Jul 20, 2021

This Pull request:

  • Translated rf_408_RDataFrameToRooFit.C
  • Changed signature of constructor to take RooAbsArg by reference.
  • Changed ROOT.RooArgList in args to accept a simple Python list.

Changes or fixes:

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

This PR fixes #

@harshal0815 harshal0815 requested a review from couet as a code owner July 20, 2021 21:14
@phsft-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@guitargeek
Copy link
Copy Markdown
Contributor

@phsft-bot build

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-performance-centos8-multicore/default.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-debian10-i386/cxx14.
Running on pcepsft10.dyndns.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-07-21T07:00:28.045Z] stderr: error: could not read '.git/rebase-apply/head-name': No such file or directory

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on mac11.0/cxx17.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

Copy link
Copy Markdown
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@guitargeek
Copy link
Copy Markdown
Contributor

@phsft-bot build

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-performance-centos8-multicore/default.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on mac11.0/cxx17.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-debian10-i386/cxx14.
Running on pcepsft10.dyndns.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-07-21T15:49:21.514Z] stderr: error: could not read '.git/rebase-apply/head-name': No such file or directory

Failing tests:

@guitargeek
Copy link
Copy Markdown
Contributor

@phsft-bot build

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-debian10-i386/cxx14.
Running on pcepsft11.dyndns.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@guitargeek guitargeek merged commit 28c826d into root-project:master Jul 26, 2021
@guitargeek guitargeek linked an issue Jul 26, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RF] Translate all RooFit tutorials to Python

3 participants