Skip to content

Conversation

@ikabadzhov
Copy link
Contributor

This Pull request: Applied aliases in tutorials for RVec (int, float, double)

Changes or fixes: Use newer aliases

Checklist:

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

This PR fixes #9117

@ikabadzhov ikabadzhov requested a review from eguiraud October 28, 2021 14:20
@ikabadzhov ikabadzhov requested a review from couet as a code owner October 28, 2021 14:20
@phsft-bot
Copy link

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

@eguiraud eguiraud self-assigned this Oct 28, 2021
Copy link
Contributor

@eguiraud eguiraud left a comment

Choose a reason for hiding this comment

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

Thanks Ivan, looks great! Can merge after the spurious file tutorials/dataframe/RVecF is removed 😄

@phsft-bot
Copy link

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

Errors:

  • [2021-10-28T15:46:52.779Z] 695/2198 Test Add dependency. #417: tutorial-dataframe-df017_vecOpsHEP ................................................................***Failed Error regular expression found in output. Regex=[: error:] 0.54 sec
  • [2021-10-28T15:46:53.041Z] 697/2198 Test coverity bugfixes: 62314,61873,61615,61605,61599,61590,61554 #416: tutorial-dataframe-df016_vecOps ...................................................................***Failed Error regular expression found in output. Regex=[: error:] 0.70 sec
  • [2021-10-28T15:46:59.352Z] 723/2198 Test Update Enable If pattern in GenVector Vc test #431: tutorial-dataframe-df101_h1Analysis ...............................................................***Failed Error regular expression found in output. Regex=[: error:] 2.21 sec
  • [2021-10-28T15:47:55.489Z] 1256/2198 Test Cling get fully qualified name use clang tooling #999: tutorial-dataframe-df016_vecOps-py ................................................................***Failed Error regular expression found in output. Regex=[: error:] 1.97 sec
  • [2021-10-28T15:47:59.417Z] 1283/2198 Test Backporting LZ4 related changes to v6-08-00  #990: tutorial-dataframe-df002_dataModel-py .............................................................***Failed Error regular expression found in output. Regex=[: error:] 6.73 sec
  • [2021-10-28T15:49:51.737Z] 2167/2198 Test Revert #e089bc3 and ignore tmva tutorials on ARM #433: tutorial-dataframe-df103_NanoAODHiggsAnalysis .....................................................***Failed Error regular expression found in output. Regex=[: error:] 0.58 sec
  • [2021-10-28T15:52:45.771Z] 2182/2198 Test test PR for runtime_modules #1011: tutorial-dataframe-df103_NanoAODHiggsAnalysis-py ..................................................***Failed Error regular expression found in output. Regex=[: error:] 1.59 sec
  • [2021-10-28T15:52:48.292Z] 2183/2198 Test Fixing and backporting LZ4 related changes on v5-34-00 #1012: tutorial-dataframe-df104_HiggsToTwoPhotons-py .....................................................***Failed Error regular expression found in output. Regex=[: error:] 2.78 sec

Failing tests:

@phsft-bot
Copy link

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

Copy link
Contributor

@eguiraud eguiraud left a comment

Choose a reason for hiding this comment

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

looks like there are some errors to be fixed, mainly due to the fact that RVec<T> is available both in namespace ROOT::VecOps and in namespace ROOT, but the aliases are only available in namespace ROOT.

@phsft-bot
Copy link

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

Errors:

  • [2021-10-28T16:56:47.421Z] 695/2198 Test coverity bugfixes: 62314,61873,61615,61605,61599,61590,61554 #416: tutorial-dataframe-df016_vecOps ...................................................................***Failed Error regular expression found in output. Regex=[: error:] 0.57 sec
  • [2021-10-28T16:56:47.687Z] 699/2198 Test Add dependency. #417: tutorial-dataframe-df017_vecOpsHEP ................................................................***Failed Error regular expression found in output. Regex=[: error:] 0.58 sec
  • [2021-10-28T16:56:53.468Z] 719/2198 Test Update Enable If pattern in GenVector Vc test #431: tutorial-dataframe-df101_h1Analysis ...............................................................***Failed Error regular expression found in output. Regex=[: error:] 2.37 sec
  • [2021-10-28T16:57:49.644Z] 1258/2198 Test Cling get fully qualified name use clang tooling #999: tutorial-dataframe-df016_vecOps-py ................................................................***Failed Error regular expression found in output. Regex=[: error:] 1.84 sec
  • [2021-10-28T16:57:53.366Z] 1286/2198 Test Backporting LZ4 related changes to v6-08-00  #990: tutorial-dataframe-df002_dataModel-py .............................................................***Failed Error regular expression found in output. Regex=[: error:] 6.39 sec
  • [2021-10-28T16:59:42.271Z] 2165/2198 Test Revert #e089bc3 and ignore tmva tutorials on ARM #433: tutorial-dataframe-df103_NanoAODHiggsAnalysis .....................................................***Failed Error regular expression found in output. Regex=[: error:] 0.61 sec
  • [2021-10-28T17:02:41.072Z] 2182/2198 Test test PR for runtime_modules #1011: tutorial-dataframe-df103_NanoAODHiggsAnalysis-py ..................................................***Failed Error regular expression found in output. Regex=[: error:] 1.59 sec
  • [2021-10-28T17:02:43.598Z] 2183/2198 Test Fixing and backporting LZ4 related changes on v5-34-00 #1012: tutorial-dataframe-df104_HiggsToTwoPhotons-py .....................................................***Failed Error regular expression found in output. Regex=[: error:] 2.66 sec

Failing tests:

@phsft-bot
Copy link

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

Errors:

  • [2021-10-28T23:56:09.385Z] 573/2289 Test [cling] Keep deferred decls #456: tutorial-dataframe-df016_vecOps ...................................................................***Failed Error regular expression found in output. Regex=[: error:] 1.06 sec
  • [2021-10-28T23:56:09.691Z] 575/2289 Test Don't search default paths when looking for numpy #457: tutorial-dataframe-df017_vecOpsHEP ................................................................***Failed Error regular expression found in output. Regex=[: error:] 0.86 sec
  • [2021-10-28T23:56:16.554Z] 589/2289 Test Make TSeq iterator standard-compliant #471: tutorial-dataframe-df101_h1Analysis ...............................................................***Failed Error regular expression found in output. Regex=[: error:] 1.90 sec
  • [2021-10-28T23:59:29.282Z] 1166/2289 Test GetColumn method of the interface #1071: tutorial-dataframe-df002_dataModel-py .............................................................***Failed Error regular expression found in output. Regex=[: error:] 8.35 sec
  • [2021-10-28T23:59:33.990Z] 1173/2289 Test Fix for ROOT-9032 #1080: tutorial-dataframe-df016_vecOps-py ................................................................***Failed Error regular expression found in output. Regex=[: error:] 4.26 sec
  • [2021-10-29T00:10:14.970Z] 1839/2289 Test Make TSeq iterator standard-compliant (II) #473: tutorial-dataframe-df103_NanoAODHiggsAnalysis .....................................................***Failed Error regular expression found in output. Regex=[: error:] 0.45 sec
  • [2021-10-29T00:12:45.125Z] 1847/2289 Test Fix compilation errors on Windows #1092: tutorial-dataframe-df103_NanoAODHiggsAnalysis-py ..................................................***Failed Error regular expression found in output. Regex=[: error:] 2.68 sec
  • [2021-10-29T00:12:51.063Z] 1848/2289 Test Fix compilation errors in win32gdk (typos) and winnt (interface changes) #1093: tutorial-dataframe-df104_HiggsToTwoPhotons-py .....................................................***Failed Error regular expression found in output. Regex=[: error:] 6.42 sec

Failing tests:

@phsft-bot
Copy link

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

@phsft-bot
Copy link

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

Failing tests:

@phsft-bot
Copy link

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Failing tests:

Copy link
Contributor

@eguiraud eguiraud left a comment

Choose a reason for hiding this comment

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

Looks good, just needs a last pass


using ROOT::RDataFrame;
using namespace ROOT::VecOps;
//using ROOT::RDataFrame;
Copy link
Contributor

Choose a reason for hiding this comment

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

here and below, must remove commented code

Comment on lines 18 to 19
coordDefineCode = '''using namespace ROOT;
RVecD {0}(len);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
coordDefineCode = '''using namespace ROOT;
RVecD {0}(len);
coordDefineCode = '''ROOT::RVecD {0}(len);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This and the other remark were resolved.

@phsft-bot
Copy link

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

@phsft-bot
Copy link

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

@phsft-bot
Copy link

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

Errors:

Failing tests:

@phsft-bot
Copy link

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

Errors:

  • [2021-11-02T11:16:04.536Z] 573/2289 Test [cling] Keep deferred decls #456: tutorial-dataframe-df016_vecOps ...................................................................***Failed Error regular expression found in output. Regex=[: error:] 0.66 sec

Failing tests:

@phsft-bot
Copy link

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link

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

@phsft-bot
Copy link

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

@phsft-bot
Copy link

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

Errors:

  • [2021-11-02T17:21:54.702Z] CMake Error at CMakeLists.txt:141 (message):
  • [2021-11-02T17:21:54.702Z] CMake Error at /Users/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1128 (message):

auto df_ge2el2mu = df.Filter("nElectron>=2 && nMuon>=2", "At least two electrons and two muons");
auto df_eta = df_ge2el2mu.Filter("All(abs(Electron_eta)<2.5) && All(abs(Muon_eta)<2.4)", "Eta cuts");
auto pt_cuts = [](rvec_f mu_pt, rvec_f el_pt) {
auto pt_cuts = [](RVecF mu_pt, RVecF el_pt) {
Copy link
Contributor

Choose a reason for hiding this comment

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

here and below, this is now copying a lot of arrays as they are being passed by value. it should be const RVecF & everywhere, or at least RVecF &

using VecI_t = const ROOT::RVec<int>&;
bool GoodElectronsAndMuons(VecI_t type, VecF_t pt, VecF_t eta, VecF_t phi, VecF_t e, VecF_t trackd0pv, VecF_t tracksigd0pv, VecF_t z0)
using namespace ROOT;
bool GoodElectronsAndMuons(RVecI type, RVecF pt, RVecF eta, RVecF phi, RVecF e, RVecF trackd0pv, RVecF tracksigd0pv, RVecF z0)
Copy link
Contributor

Choose a reason for hiding this comment

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

const RVec &, this needlessly copies a lot

# Compute invariant mass of the four lepton system and make a histogram
ROOT.gInterpreter.Declare("""
float ComputeInvariantMass(VecF_t pt, VecF_t eta, VecF_t phi, VecF_t e)
float ComputeInvariantMass(RVecF pt, RVecF eta, RVecF phi, RVecF e)
Copy link
Contributor

Choose a reason for hiding this comment

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

const RVecF &

using VecI_t = const ROOT::RVec<int>&;
int FindGoodLepton(VecI_t goodlep, VecI_t type, VecF_t lep_pt, VecF_t lep_eta, VecF_t lep_phi, VecF_t lep_e, VecF_t trackd0pv, VecF_t tracksigd0pv, VecF_t z0)
using namespace ROOT;
int FindGoodLepton(RVecI goodlep, RVecI type, RVecF lep_pt, RVecF lep_eta, RVecF lep_phi, RVecF lep_e, RVecF trackd0pv, RVecF tracksigd0pv, RVecF z0)
Copy link
Contributor

Choose a reason for hiding this comment

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

const RVecF &

@ikabadzhov
Copy link
Contributor Author

Looks good, just needs a last pass

Ah correct, I am realizing the const now. Updating in a tiny bit.

@phsft-bot
Copy link

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

1 similar comment
@phsft-bot
Copy link

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

@phsft-bot
Copy link

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

@ikabadzhov
Copy link
Contributor Author

Passing const RvecF/I & should be fixed now.

@phsft-bot
Copy link

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

Errors:

Failing tests:

@phsft-bot
Copy link

Build failed on ROOT-ubuntu16/nortcxxmod.
Running on sft-ubuntu-1604-1.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link

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

Errors:

  • [2021-11-04T13:04:53.678Z] 1839/2290 Test Test coverage compilation flag #474: tutorial-dataframe-df103_NanoAODHiggsAnalysis .....................................................***Failed Error regular expression found in output. Regex=[: error:] 0.52 sec
  • [2021-11-04T13:08:08.418Z] 1854/2290 Test [TDF] Fix ROOT-9037 #1096: tutorial-dataframe-df106_HiggsToFourLeptons-py ....................................................***Failed Error regular expression found in output. Regex=[: error:] 2.62 sec
  • [2021-11-04T13:08:11.197Z] 1856/2290 Test [TDF] Fix ctor with single filename as string. #1097: tutorial-dataframe-df107_SingleTopAnalysis-py .....................................................***Failed Error regular expression found in output. Regex=[: error:] 2.60 sec

Failing tests:

@phsft-bot
Copy link

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

@phsft-bot
Copy link

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

@phsft-bot
Copy link

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
Contributor

@eguiraud eguiraud left a comment

Choose a reason for hiding this comment

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

Alright, code indentation is weird in some places, you can run git clang-format to fix just the formatting of your patch (rather than of all the file), then we are good 🎉

@ikabadzhov
Copy link
Contributor Author

can you be more specific @eguiraud , git clang-format says no modified files to format. I cannot spot any extraordinary indents

@phsft-bot
Copy link

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

Make use of the aliases RVecI, RVecD, RVecF in the tutorials.
Note that these aliases are present in the ROOT namespace, i.e.
ROOT::RVecI.
@phsft-bot
Copy link

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

Copy link
Contributor

@eguiraud eguiraud left a comment

Choose a reason for hiding this comment

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

🎉 will merge when the CI run is done

@phsft-bot
Copy link

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

Failing tests:

@eguiraud eguiraud merged commit b83feef into root-project:master Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DF] Use RVecI, RVecD, RVecF aliases in tutorials

4 participants