Skip to content

[RF] Test schema evolution of RooDataHist from version 5 and 6#8090

Merged
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:issue-8037
May 4, 2021
Merged

[RF] Test schema evolution of RooDataHist from version 5 and 6#8090
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:issue-8037

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

Extend the RooDataHist tests to also validate the schema evolution
from version 5 and version 6.

Version 6 is the current version, so the dataHistv6_ref.root reference
file was produced with ROOT master. Version 5 was used in ROOT 6.24,
which was used to produce the dataHistv5_ref.root reference file.

The version 6 reference file is a little bit smaller than the version 5 file, as the _realVars member was removed with version 6.

A nice aspect of the version 6 update is also that it's backwards compatible. The initialize() function is called in the custom streamer of RooDataHist, so if the _realVars member is missing in the ROOT file it will still be initialized.

This fixes issue #8037.

@guitargeek guitargeek self-assigned this May 4, 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

@guitargeek guitargeek linked an issue May 4, 2021 that may be closed by this pull request
@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-fedora31/noimt.
Running on root-fedora-31-2.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on mac1014/python3.
Running on macphsft17.dyndns.cern.ch:/build/jenkins/workspace/root-pullrequests-build
See console output.

Failing tests:

Extend the RooDataHist tests to also validate the schema evolution
from version 5 and version 6.

Version 6 is the current version, so the `dataHistv6_ref.root` reference
file was produced with ROOT master. Version 5 was used in ROOT 6.24,
which was used to produce the `dataHistv5_ref.root` reference file.
@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

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

Errors:

  • [2021-05-04T15:03:47.682Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/rootCommon.cmake:330:
  • [2021-05-04T15:03:47.682Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:2 (include):
  • [2021-05-04T15:03:47.682Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1121 (file):
  • [2021-05-04T15:03:47.682Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1122 (ctest_start):

Copy link
Copy Markdown
Member

@hageboeck hageboeck left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@hageboeck
Copy link
Copy Markdown
Member

@guitargeek Maybe commit a comment on how to create the reference file above the test. Sorry that I didn't do that already.

@phsft-bot
Copy link
Copy Markdown

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

Errors:

  • [2021-05-04T15:13:25.952Z] CMake Error at /Users/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/rootCommon.cmake:134:
  • [2021-05-04T15:13:25.952Z] CMake Error at /Users/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:2 (include):
  • [2021-05-04T15:13:25.952Z] CMake Error at /Users/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1121 (file):
  • [2021-05-04T15:13:25.952Z] CMake Error at /Users/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1122 (ctest_start):

@guitargeek
Copy link
Copy Markdown
Contributor Author

@guitargeek Maybe commit a comment on how to create the reference file above the test. Sorry that I didn't do that already.

The way I did this was simply to open the v4 file with a newer ROOT version, use the copy constructor of RooDataHist and save the copied object. Is this the way that you would document, or is there an easier way?

@hageboeck
Copy link
Copy Markdown
Member

The way I did this was simply to open the v4 file with a newer ROOT version, use the copy constructor of RooDataHist and save the copied object. Is this the way that you would document, or is there an easier way?

Ah, right. That will work. I thought you re-engineered that RooDataHist to document it in the style of:

/* Test the reading of a simple mock category that has the states
* one = 0
* two = 1
* three = 2
* four = 3
* The ranges "evens" and "odds" for even and odd state names are defined.
* Now, we check that set ranges are read and written properly, and that
* sharing of those ranges works even after reading back.
* A mock file can be created as follows:
RooCategory cat("cat", "a category")
cat.defineType("one")
cat.defineType("two")
cat.defineType("three")
cat.defineType("four")
cat.addToRange("evens", "two,four")
cat.addToRange("odds", "one,three")
RooDataSet data("data", "a dataset with a category", RooArgSet(cat))
data.fill()
TFile outfile("/tmp/testCategories.root", "RECREATE")
outfile.WriteObject(&cat, "catOrig")
outfile.WriteObject(&data, "data")
*/

In this case, it was probably this, but I don't remember:

void fillHist(TH2D* histo, double content) {
for (int i=0; i < histo->GetNbinsX()+2; ++i) {
for (int j=0; j < histo->GetNbinsY()+2; ++j) {
histo->SetBinContent(i, j, content + (i-1)*100 + (j-1));
}
}
}

@phsft-bot
Copy link
Copy Markdown

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

Errors:

  • [2021-05-04T15:54:48.520Z] CMake Error at C:/build/workspace/root-pullrequests-build/rootspi/jenkins/rootCommon.cmake:134:
  • [2021-05-04T15:54:48.520Z] CMake Error at C:/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:2 (include):
  • [2021-05-04T15:54:48.520Z] CMake Error at C:/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1121 (file):
  • [2021-05-04T15:54:48.520Z] CMake Error at C:/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1122 (ctest_start):

@guitargeek guitargeek merged commit f05491e into root-project:master May 4, 2021
@guitargeek guitargeek deleted the issue-8037 branch May 4, 2021 17:07
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] Test schema evolution of RooDataHist

3 participants