[tmva] Check for existence of xml node before reading it#20735
[tmva] Check for existence of xml node before reading it#20735guitargeek merged 1 commit intoroot-project:masterfrom
Conversation
|
Thanks for the PR!
Absolutely welcome! The tests go to Maybe you can implement a new regression test, like |
|
There are some failures on the CI: /github/home/ROOT-CI/src/tmva/tmva/src/VariableNormalizeTransform.cxx: In member function ‘virtual void TMVA::VariableNormalizeTransform::ReadFromXML(void*)’:
##[error]/github/home/ROOT-CI/src/tmva/tmva/src/VariableNormalizeTransform.cxx:381:15: error: request for member ‘HasAttr’ in ‘TMVA::gTools’, which is of non-class type ‘TMVA::Tools&()’
if (gTools.HasAttr(trfnode, "UseOffsetOrNot")) {
|
Test Results 21 files 21 suites 3d 14h 1m 35s ⏱️ Results for commit 950956f. ♻️ This comment has been updated with latest results. |
4f783a5 to
2c59346
Compare
|
Fixed the small typo I introduced via the web editor and things should compile now. I have added a very minimal regression test that I confirmed to fail without the fixes. Let me know if you think this is enough, or if the tests should be adapted somehow. |
|
Thanks a lot! Squash and merge maybe, with the commit message of the second original commit? |
This avoids breaking the reading of pre-existing TMVA weight files that have been written without this tag. Add a regression test with a weights file that does not yet contain this tag.
950956f to
c3eca60
Compare
|
I think this needs to be backported to 6.38? |
|
You're right. Thanks! |
|
Here is the backport, which will make it into 6.38.02: |
This Pull request:
Adds a check for the existence of
UseOffsetOrNotfields in TMVA files before trying to read from it.Changes or fixes:
This avoids breaking the reading of pre-existing TMVA weight files that have been written without this tag. See also #4141 (comment)
Checklist:
I have a small-ish (13K) TMVA weight file that triggered the issue for me originally. Should I add that to some test to ensure that it remains readable? If yes, could you point me to where it should go?