root icon indicating copy to clipboard operation
root copied to clipboard

[RF] Warning message on repeated named RooCmdArgs in RooCmdConfig

Open guitargeek opened this issue 4 years ago • 3 comments

More detailed description of main commit (1st commit)

This commit addresses Jira issue ROOT-2784 (from 2010, oldest open RooFit "bug"!).

Emit warning message in RooCmdConfig when multiple named arguments of the same type are encountered, for which no chaining behavior is defined.

To make the warning message more clear, a map is implemeted to look up the name of the function in the RooFit namespace that is used to create the repeated RooCmdArg. Usually, the names of the argument and the name of the function that created it are identical, but there are exceptions that are hardcoded in this map.

Furthermore, a warning message is also emitted for the commands that have a defined chaining behavior (Import, Link, and Slice), where the alternatives that take a std::map with the multiple commands is suggested. This is done to encourage RooFit code that can be easily ported to Python if desired, because chainig command arguments with the same name is not possible in Python RooFit (commands are passed as keyword arguments, which can't be repeated).

Having such a warning message also helps users that try to chain more commands than RooAbsReal::plotOn can digest. They will get the solution in the warning message instead of having to ask in the forum, which happend for example in this forum post.

Quick description of other commits

  • commit 1:
    • main commit explianed above
  • commit 2 - 4:
    • update RooFit code to not trigger the warnings
  • commit 5:
    • update RooFit C tutorial files to not trigger the warnings
    • Python tutorials can only be updated after pythonizations for Import, Link, and Slice

guitargeek avatar Jun 14 '21 22:06 guitargeek

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac12/noimt, mac11/cxx14, windows10/cxx14 How to customize builds

phsft-bot avatar Nov 24 '22 11:11 phsft-bot

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac12/noimt, mac11/cxx14, windows10/cxx14 How to customize builds

phsft-bot avatar Feb 02 '23 11:02 phsft-bot

PR closed because the JIRA issue that motivated this PR was also closed (deemed not important enough).

guitargeek avatar Apr 07 '23 23:04 guitargeek