Repository navigation
Include first value when computing automatic TTree::Draw histogram range - #427
Conversation
|
Thanks for the fix! Can you split your PR on two commits? |
Signed-off-by: Sebastian Turner <sebastiant3484@gmail.com>
Signed-off-by: Sebastian Turner <sebastiant3484@gmail.com>
1c5df6b to
e20c82f
Compare
|
Split into two commits: the fix first, then the test macro and its CI lines, both on top of current dev. About the failing tests_ubuntu jobs: the only diff is RNTuple/uint32.svg in jsroot-test, and it comes from this fix. rntupleDraw uses the same TDrawSelector range code. customerId runs 1000 to 1099, so before the fix the range was [1000, 1101] with no empty bin on the left. Now it is [999, 1101] with one empty bin on each side, as the integer padding intends. All 100 entries are in range in both cases, so only the axis and frame change. The reference can be regenerated with |
This Pull request:
Fixes automatic histogram range in
TDrawSelector.getMinMaxBins(). The loop which collects min and max values started from index 1, so the first drawn value was ignored. When that value was the smallest or largest one, it landed in the underflow or overflow bin. AffectstreeDraw()andrntupleDraw().Changes:
modules/tree.mjs: start min/max loop from index 0demo/node/tree_draw_range.js: new test, drawsDoubleFieldand5 - DoubleFieldfrom the existingrntuple_test.rootand checks that underflow and overflow are empty; exits with error otherwise.github/workflows/jsroot-ci.yml: run the new test in all three jobsNote for jsroot-test: with this change
RNTuple/uint32.svgchanges. There the firstcustomerIdis the minimum, so the histogram now gets the same one bin margin on the left side as on the right side. All otherTTreeandRNTuplereferences match.Fixes:
Values of the first entry lost in underflow or overflow bin when drawing with automatic range.
Fixes #426