-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Made public TH1::CheckConsistency (2) #14077
Made public TH1::CheckConsistency (2) #14077
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is an interface that is being made public for the first time, I would take the chance to promote better code practices, e.g. by making the return type an enum class
I can do that, but all the other
will not work. If that's ok, I'll change the Edit: also, all instances of code like
will become a lot more verbose:
|
That's both valid. Indeed, when introducing this enum, I didn't make it an enum class mostly to be consistent with the other TH1 enums. The fact that it's less verbose is a nice extra here. |
Test Results 18 files 18 suites 3d 22h 38m 53s ⏱️ For more details on these failures, see this check. Results for commit 840f3d8. ♻️ This comment has been updated with latest results. |
I'm not sure if I am supposed to say this, but it seems that test that fails is checking for changes on the list of the public data members of TH1F [1], which is intended here. [1] https://github.com/root-project/roottest/blob/e7c9a5cbc969fa99b668684cbebc59d554ceebc8/root/meta/runMemberComments.C#L34-L35 |
@amecca This is correct. Can you propose a PR for the roottest repository that includes the required update to the test. |
@pcanal, I opened root-project/roottest#1038 |
In order for the roottest branch to be picked-up by the automated test you need to use the same branch name in both repository (so |
My bad, I renamed the branch and opened a new PR root-project/roottest#1040 |
It seems that either my roottest branch did not update correctly the reference file or it was not picked up by the automated test. |
6bf0674
to
840f3d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much! The tests pass now.
This Pull request:
This is a follow up of #13748, which was modified by
@guitargeek to fix the unnecessary use of exceptions.
Associated roottest PR:
Changes or fixes:
Made the static function
TH1::CheckConsistency
public, and changed its return type toInt_t
.Since the meaning of the returned integer is actually part of
EInconsistencyBits
, I made theenum
public as well (but left the return value type toInt_t
). This is done in a separate commit in case it is decided to keep theenum
itself as an implementation detail.Motivation
At the moment
TH1::CheckConsistency
is called internally byTH1::Add
, and error messages are print in case of failure, but continues the execution. Making it public allows user code to manually check the consistency to catch errors and stop the program. This is especially useful for programs that make hundreds ofAdd
s, out of which only a few fail, and the error messages may be lost in logs and go unnoticed.Checklist: