Skip to content

Commit 68ba28a

Browse files
committed
Merge branch 'master' of github.com:root-mirror/root into GenVector-AddTemplates
2 parents 6cac16a + 092ca9f commit 68ba28a

File tree

11 files changed

+34
-24
lines changed

11 files changed

+34
-24
lines changed

bindings/pyroot/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@ endif()
3636
file(GLOB pyfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py)
3737
foreach(pyfile ${pyfiles})
3838
install(FILES ${pyfile} DESTINATION ${runtimedir})
39-
install(CODE "execute_process(COMMAND python -m py_compile \$ENV{DESTDIR}${runtimedir}/${pyfile})")
40-
install(CODE "execute_process(COMMAND python -O -m py_compile \$ENV{DESTDIR}${runtimedir}/${pyfile})")
39+
if(IS_ABSOLUTE ${runtimedir})
40+
set(absruntimedir ${runtimedir})
41+
else()
42+
set(absruntimedir ${CMAKE_INSTALL_PREFIX}/${runtimedir})
43+
endif()
44+
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile \$ENV{DESTDIR}${absruntimedir}/${pyfile})")
45+
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile \$ENV{DESTDIR}${absruntimedir}/${pyfile})")
4146
file(COPY ${pyfile} DESTINATION ${localruntimedir})
4247
endforeach()
4348

main/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,13 @@ if(python)
4343
endforeach()
4444

4545
install(FILES python/cmdLineUtils.py DESTINATION ${runtimedir})
46-
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile \$ENV{DESTDIR}${runtimedir}/cmdLineUtils.py)")
47-
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile \$ENV{DESTDIR}${runtimedir}/cmdLineUtils.py)")
46+
if(IS_ABSOLUTE ${runtimedir})
47+
set(absruntimedir ${runtimedir})
48+
else()
49+
set(absruntimedir ${CMAKE_INSTALL_PREFIX}/${runtimedir})
50+
endif()
51+
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile \$ENV{DESTDIR}${absruntimedir}/cmdLineUtils.py)")
52+
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile \$ENV{DESTDIR}${absruntimedir}/cmdLineUtils.py)")
4853
configure_file(python/cmdLineUtils.py ${localruntimedir}/cmdLineUtils.py @ONLY)
4954
endif()
5055

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#---Custom CTest settings---------------------------------------------------
22

3-
if (CTEST_BUILD_NAME MATCHES arm64 AND CTEST_BUILD_NAME MATCHES dbg)
3+
if (CTEST_BUILD_NAME MATCHES aarch64 AND CTEST_BUILD_NAME MATCHES dbg)
44
# these tests are disabled as they timeout
55
list(APPEND CTEST_CUSTOM_TESTS_IGNORE mathcore-testMathRandom)
66
endif()

test/CTestCustom.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if(CTEST_BUILD_NAME MATCHES icc) # sse tests of vc fail for icc compiler
1515
elseif(CTEST_BUILD_NAME MATCHES clang7)
1616
set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE}
1717
vc-swizzles_avx)
18-
elseif (CTEST_BUILD_NAME MATCHES arm64 AND CTEST_BUILD_NAME MATCHES dbg)
18+
elseif (CTEST_BUILD_NAME MATCHES aarch64 AND CTEST_BUILD_NAME MATCHES dbg)
1919
# these tests are disabled as they timeout
2020
list(APPEND CTEST_CUSTOM_TESTS_IGNORE test-stressroostats test-stresstmva test-stressroostats-interpreted test-stresshistogram-interpreted test-stresshistogram test-stressgeometry test-tcollbm test-bench test-stressgeometry-interpreted)
2121
endif()

tree/treeplayer/inc/ROOT/TDataFrame.hxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ TVBVec_t BuildReaderValues(TTreeReader &r, const BranchNames &bl, const BranchNa
187187
TDFTraitsUtils::TStaticSeq<S...>)
188188
{
189189
// isTmpBranch has length bl.size(). Elements are true if the corresponding
190-
// branch is a temporary branch created with AddCol, false if they are
190+
// branch is a temporary branch created with AddColumn, false if they are
191191
// actual branches present in the TTree.
192192
std::array<bool, sizeof...(S)> isTmpBranch;
193193
for (unsigned int i = 0; i < isTmpBranch.size(); ++i)
@@ -196,7 +196,7 @@ TVBVec_t BuildReaderValues(TTreeReader &r, const BranchNames &bl, const BranchNa
196196
// Build vector of pointers to TTreeReaderValueBase.
197197
// tvb[i] points to a TTreeReader{Value,Array} specialized for the i-th BranchType,
198198
// corresponding to the i-th branch in bl
199-
// For temporary branches (declared with AddCol) a nullptr is created instead
199+
// For temporary branches (declared with AddColumn) a nullptr is created instead
200200
// S is expected to be a sequence of sizeof...(BranchTypes) integers
201201
// Note that here TTypeList only contains one single type
202202
TVBVec_t tvb{isTmpBranch[S] ? nullptr : ReaderValueOrArray(r, bl.at(S), TDFTraitsUtils::TTypeList<BranchTypes>())
@@ -445,7 +445,7 @@ public:
445445
/// for another branch in the TTree.
446446
template <typename F>
447447
TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>
448-
AddCol(const std::string &name, F expression, const BranchNames &bl = {})
448+
AddColumn(const std::string &name, F expression, const BranchNames &bl = {})
449449
{
450450
auto df = GetDataFrameChecked();
451451
ROOT::Internal::CheckTmpBranch(name, df->GetTree());

tree/treeplayer/src/TDataFrame.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,18 @@ std::cout << *c << std::endl;
154154
155155
### Creating a temporary branch
156156
Let's now consider the case in which "myTree" contains two quantities "x" and "y", but our analysis relies on a derived quantity `z = sqrt(x*x + y*y)`.
157-
Using the `AddCol` transformation, we can create a new column in the data-set containing the variable "z":
157+
Using the `AddColumn` transformation, we can create a new column in the data-set containing the variable "z":
158158
~~~{.cpp}
159159
auto sqrtSum = [](double x, double y) { return sqrt(x*x + y*y); };
160160
auto zCut = [](double z) { return z > 0.; }
161161
162162
ROOT::Experimental::TDataFrame d(treeName, filePtr);
163-
auto zMean = d.AddCol("z", sqrtSum, {"x","y"})
163+
auto zMean = d.AddColumn("z", sqrtSum, {"x","y"})
164164
.Filter(zCut, {"z"})
165165
.Mean("z");
166166
std::cout << *zMean << std::endl;
167167
~~~
168-
`AddCol` creates the variable "z" by applying `sqrtSum` to "x" and "y". Later in the chain of calls we refer to variables created with `AddCol` as if they were actual tree branches, but they are evaluated on the fly, once per event. As with filters, `AddCol` calls can be chained with other transformations to create multiple temporary branches.
168+
`AddColumn` creates the variable "z" by applying `sqrtSum` to "x" and "y". Later in the chain of calls we refer to variables created with `AddColumn` as if they were actual tree branches, but they are evaluated on the fly, once per event. As with filters, `AddColumn` calls can be chained with other transformations to create multiple temporary branches.
169169
170170
### Executing multiple actions
171171
As a final example let us apply two different cuts on branch "MET" and fill two different histograms with the "pt\_v" of the filtered events.
@@ -197,7 +197,7 @@ You don't need to read all these to start using `TDataFrame`, but they are usefu
197197
### Default branch lists
198198
When constructing a `TDataFrame` object, it is possible to specify a **default branch list** for your analysis, in the usual form of a list of strings representing branch names. The default branch list will be used as fallback whenever one specific to the transformation/action is not present.
199199
~~~{.cpp}
200-
// use "b1" and "b2" as default branches for `Filter`, `AddCol` and actions
200+
// use "b1" and "b2" as default branches for `Filter`, `AddColumn` and actions
201201
ROOT::Experimental::TDataFrame d1(treeName, &file, {"b1","b2"});
202202
// filter acts on default branch list, no need to specify it
203203
auto h = d1.Filter([](int b1, int b2) { return b1 > b2; }).Histo1D("otherVar");
@@ -275,7 +275,7 @@ auto h1 = filtered.Histo1D("var1");
275275
276276
// create a new branch "vec" with a vector extracted from a complex object (only for filtered entries)
277277
// and save the state of the chain
278-
auto newBranchFiltered = filtered.AddCol("vec", [](const Obj& o) { return o.getVector(); }, {"obj"});
278+
auto newBranchFiltered = filtered.AddColumn("vec", [](const Obj& o) { return o.getVector(); }, {"obj"});
279279
280280
// apply a cut and fill a histogram with "vec"
281281
auto h2 = newBranchFiltered.Filter(cut1).Histo1D("vec");
@@ -308,7 +308,7 @@ Statistics are retrieved through a call to the `Report` method:
308308
Stats are printed in the same order as named filters have been added to the graph, and *refer to the latest event-loop* that has been run using the relevant `TDataFrame`. If `Report` is called before the event-loop has been run at least once, a run is triggered.
309309
310310
### Temporary branches
311-
Temporary branches are created by invoking `AddCol(name, f, branchList)`. As usual, `f` can be any callable object (function, lambda expression, functor class...); it takes the values of the branches listed in `branchList` (a list of strings) as parameters, in the same order as they are listed in `branchList`. `f` must return the value that will be assigned to the temporary branch.
311+
Temporary branches are created by invoking `AddColumn(name, f, branchList)`. As usual, `f` can be any callable object (function, lambda expression, functor class...); it takes the values of the branches listed in `branchList` (a list of strings) as parameters, in the same order as they are listed in `branchList`. `f` must return the value that will be assigned to the temporary branch.
312312
313313
A new variable is created called `name`, accessible as if it was contained in the dataset from subsequent transformations/actions.
314314
@@ -351,8 +351,8 @@ In the following, whenever we say an action "returns" something, we always mean
351351
As pointed out before in this document, `TDataFrame` can transparently perform multi-threaded event loops to speed up the execution of its actions. Users only have to call `ROOT::EnableImplicitMT()` *before* constructing the `TDataFrame` object to indicate that it should take advantage of a pool of worker threads. **Each worker thread processes a distinct subset of entries**, and their partial results are merged before returning the final values to the user.
352352
353353
### Thread safety
354-
`Filter` and `AddCol` transformations should be inherently thread-safe: they have no side-effects and are not dependent on global state.
355-
Most `Filter`/`AddCol` functions will in fact be pure in the functional programming sense.
354+
`Filter` and `AddColumn` transformations should be inherently thread-safe: they have no side-effects and are not dependent on global state.
355+
Most `Filter`/`AddColumn` functions will in fact be pure in the functional programming sense.
356356
All actions are built to be thread-safe with the exception of `Foreach`, in which case users are responsible of thread-safety, see [here](#generic-actions).
357357
358358
*/

tutorials/CTestCustom.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if("$ENV{COMPILER}" STREQUAL "classic") # TTreeProcessorM{T,P} are not availabl
66
list(APPEND CTEST_CUSTOM_TESTS_IGNORE tutorial-multicore-mp102_readNtuplesFillHistosAndFit)
77
endif()
88

9-
if (CTEST_BUILD_NAME MATCHES arm64 AND CTEST_BUILD_NAME MATCHES dbg)
9+
if (CTEST_BUILD_NAME MATCHES aarch64 AND CTEST_BUILD_NAME MATCHES dbg)
1010
# these tutorials are disabled as they timeout
1111
list(APPEND CTEST_CUSTOM_TESTS_IGNORE tutorial-roostats-StandardBayesianNumericalDemo tutorial-roostats-OneSidedFrequentistUpperLimitWithBands tutorial-tmva-TMVAClassification tutorial-tmva-TMVARegression tutorial-tmva-TMVAMulticlass tutorial-roostats-TwoSidedFrequentistUpperLimitWithBands)
1212
endif()

tutorials/dataframe/tdf001_introduction.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ int tdf001_introduction() {
150150
// this is like having a general container at disposal able to accommodate
151151
// any value of any type.
152152
// Let's dive in an example:
153-
auto entries_sum = d.AddCol("sum", [](double b1, int b2) { return b2 + b1; }, {"b1", "b2"})
153+
auto entries_sum = d.AddColumn("sum", [](double b1, int b2) { return b2 + b1; }, {"b1", "b2"})
154154
.Filter([](double sum) { return sum > 4.2; }, {"sum"})
155155
.Count();
156156
std::cout << *entries_sum << std::endl;

tutorials/dataframe/tdf002_dataModel.C

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ int tdf002_dataModel() {
106106
return ptsw;
107107
};
108108

109-
auto augmented_d = d.AddCol("tracks_n", [](const FourVectors& tracks){return (int)tracks.size();})
109+
auto augmented_d = d.AddColumn("tracks_n", [](const FourVectors& tracks){return (int)tracks.size();})
110110
.Filter([](int tracks_n){return tracks_n > 2;}, {"tracks_n"})
111-
.AddCol("tracks_pts", getPt)
112-
.AddCol("tracks_pts_weights", getPtWeights);
111+
.AddColumn("tracks_pts", getPt)
112+
.AddColumn("tracks_pts_weights", getPtWeights);
113113

114114
auto trN = augmented_d.Histo1D("tracks_n",40,-.5,39.5);
115115
auto trPts = augmented_d.Histo1D("tracks_pts");

tutorials/dataframe/tdf004_cutFlowReport.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void tdf004_cutFlowReport() {
6363
auto filtered1 = d.Filter(cut1, {"b1"}, "Cut1");
6464
auto filtered2 = d.Filter(cut2, {"b2"}, "Cut2");
6565

66-
auto augmented1 = filtered2.AddCol("b3", [](double b1, int b2){ return b1/b2;});
66+
auto augmented1 = filtered2.AddColumn("b3", [](double b1, int b2){ return b1/b2;});
6767
auto cut3 = [](double x) { return x < .5; };
6868
auto filtered3 = augmented1.Filter(cut3, {"b3"}, "Cut3");
6969

0 commit comments

Comments
 (0)