Skip to content

Move TH1IntegrateWithPartialBins from C++ to Python#52

Merged
op3 merged 1 commit intohdtv-tool:masterfrom
heijligen:py_integrate
Jan 31, 2026
Merged

Move TH1IntegrateWithPartialBins from C++ to Python#52
op3 merged 1 commit intohdtv-tool:masterfrom
heijligen:py_integrate

Conversation

@heijligen
Copy link
Contributor

@heijligen heijligen commented Dec 25, 2025

ROOT.HDTV.TH1IntegrateWithPartialBins() is only used in histogram.py.
Since it is a small and easy function, it can be implemented directly in PyROOT and does not need to be compiled.


This patch isn't covered by the test suite. I'm also unsure how to trigger the function manually. Manual tested (#52 (comment))

ROOT.HDTV.TH1IntegrateWithPartialBins() is only used in histogram.py.
Since it is a small and easy function, it can be implemented directly in
PyROOT and does not need to be compiled.
@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

❌ Patch coverage is 25.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.80%. Comparing base (4374fa9) to head (262d3b3).
⚠️ Report is 33 commits behind head on master.

Files with missing lines Patch % Lines
src/hdtv/histogram.py 25.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #52      +/-   ##
==========================================
- Coverage   63.07%   62.80%   -0.28%     
==========================================
  Files          70       69       -1     
  Lines       10066     9880     -186     
==========================================
- Hits         6349     6205     -144     
+ Misses       3717     3675      -42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@heijligen
Copy link
Contributor Author

I've found the trace from the shell to the modified function
The new function is used in Histogram.Plus (src/hdtv/histogram.py), which is called from SpecInterface.SpectrumAdd (src/hdtv/plugins/specInterface.py), which get added to the cli via TvSpecInterface(same file asSpecInterface) as spectrum add` command.

I've done the following A/B test to see if the modification produces a different result.

hdtv> spectrum get o.mtx
hdtv> spectrum get o.tmtx
hdtv> spectrum add 0 1
hdtv> spectrum write o_add_test.mtx lc

now adding this patch and redoing the steps 1 .. 3. The 4th step is

hdtv> spectrum write p_add_test.mtx lc

So we have o_add_test.mtx as original spectrum without the patch and p_add_test.mtx as spectrum with this patch applied.

Both have the same md5 hash

bae3e49510f567e65f52f12cd55dc3b7  o.mtx
55f0b439b5704e6db910f6b4c3ef9aff  o.tmtx
c762f5f7cf7352a1ab965a203ddc9c40  o_add_test.mtx
c762f5f7cf7352a1ab965a203ddc9c40  p_add_test.mtx

@op3 op3 merged commit e470e0a into hdtv-tool:master Jan 31, 2026
19 of 20 checks passed
@heijligen heijligen deleted the py_integrate branch February 1, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants