Skip to content

[RF] More pythonizations for RooAbsCollection and child classes (RooArgList and RooArgSet)#8179

Merged
guitargeek merged 5 commits intoroot-project:masterfrom
guitargeek:roofit_pythonizations_1
May 18, 2021
Merged

[RF] More pythonizations for RooAbsCollection and child classes (RooArgList and RooArgSet)#8179
guitargeek merged 5 commits intoroot-project:masterfrom
guitargeek:roofit_pythonizations_1

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

@guitargeek guitargeek commented May 16, 2021

@phsft-bot
Copy link
Copy Markdown

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

@ghost
Copy link
Copy Markdown

ghost commented May 16, 2021

DeepCode's analysis on #de2dd7 found:

  • ℹ️ 2 minor issues. 👇

Top issues

Description Example fixes
assertTrue cannot provide an informative message about the values in the comparison _ if it fails Occurrences: 🔧 Example fixes
The call to next should be guarded with a try/except block Occurrences: 🔧 Example fixes

👉 View analysis in DeepCode’s Dashboard | Configure the bot

The new `RooAbsCollection::canBeAdded` member function is used in
`RooAbsCollection::add`, `RooAbsCollection::addOwned`, and
`RooAbsCollection::addClone`.

Lke this, only `RooAbsCollection::canBeAdded` has to be overridden in
`RooArgList` and `RooArgSet`, instead of overriding the three adding
functions.

This is convenient for pythonizing the adding functions, because if they
are redefined in the child classes, one has to pythonize add
redefinitions.  After this PR, it is suficcient to pythonize only the
adding functions in the base class `RooAbsCollection`.
The python wrapper object needs to release the ownership of the C++
RooAbsArgs object after it has been added to a owning RooAbsCollection.

This fixes issue root-project#8120.
Also moves all unit tests of RooAbsCollection pythonizations into a
single file.
This tests the functionality recently introduced in root-project#8177 (commits
3819e27 and d8cd26a).
@guitargeek guitargeek force-pushed the roofit_pythonizations_1 branch from e3a098c to 21fbd34 Compare May 16, 2021 23:47
@phsft-bot
Copy link
Copy Markdown

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

@phsft-bot
Copy link
Copy Markdown

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

@guitargeek guitargeek changed the title [RF] Pythonize RooAbsCollection::addOwned and more pythonization unit tests [RF] More pythonizations for RooAbsCollection and child classes (RooArgList and RooArgSet) May 17, 2021
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented May 17, 2021

This pull request introduces 1 alert when merging 8307d6d into fdb7d15 - view on LGTM.com

new alerts:

  • 1 for Unused import

The bounds checking is now done in Python for cleaner error messages,
and negative indexing is now supported.
@guitargeek guitargeek force-pushed the roofit_pythonizations_1 branch from 8307d6d to de2dd71 Compare May 17, 2021 14:20
@phsft-bot
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

@etejedor etejedor left a comment

Choose a reason for hiding this comment

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

As discussed on mattermost, ok for me!

@guitargeek guitargeek merged commit 3062aaa into root-project:master May 18, 2021
@guitargeek guitargeek deleted the roofit_pythonizations_1 branch May 18, 2021 12:44
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] Implement a Pythonisation for RooAbsCollection.addOwned()

3 participants