Skip to content

Conversation

guitargeek
Copy link
Contributor

The TH1K class is deprecated and will be removed in 6.40. It did not implement the TH1 interface consistently, and limited the usability of the k-neighbors method it implemented by closely coupling the algorithm with the histogram class. Instead, one should use the new TMath::KNNDensity function that implements the same mathematical logic.

Closes #19761 and https://its.cern.ch/jira/browse/ROOT-5686.

TODO:

  • implement unit tests
  • build the documentation to check if it actually looks nice

Copy link
Collaborator

@ferdymercury ferdymercury left a comment

Choose a reason for hiding this comment

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

Thanks, I would suggest adding "\deprecated" to the doxygen docu of TH1K.

Maybe also remove the code in TWebCanvas.cxx, or add a pragma-diagnostic-ignore to prevent failure in debian125

Copy link

github-actions bot commented Aug 27, 2025

Test Results

    20 files      20 suites   3d 18h 16m 3s ⏱️
 3 644 tests  3 402 ✅   0 💤 242 ❌
71 202 runs  70 629 ✅ 330 💤 243 ❌

For more details on these failures, see this check.

Results for commit 0065e65.

♻️ This comment has been updated with latest results.

The `TH1K` class is deprecated and will be removed in 6.40. It did not
implement the `TH1` interface consistently, and limited the usability of
the k-neighbors method it implemented by closely coupling the algorithm
with the histogram class. Instead, one should use the new
`TMath::KNNDensity` function that implements the same mathematical
logic.
Copy link
Member

@dpiparo dpiparo left a comment

Choose a reason for hiding this comment

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

Thanks for this upgrade. Feel free to merge as soon as the tests pass.

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.

[hist] No clear TH1K use case?
3 participants