Skip to content

Conversation

@vepadulano
Copy link
Member

The signatures of HistoN[Sparse]D operations allow passing the column that will provide the weights as the last element in the list of input columns, practically allowing for a size which is one more than the number of dimensions of the histogram to be filled. This was done to align these signatures with the logic of THnBase::Fill that follows the same schema.

But these signatures are also different than all other Histo* signatures that accept weight columns as separate arguments. Thus, they are aligned to the other signatures by adding a new optional argument for the name of the column that will provide the weights.

The previous usage of the operations is deprecated with a warning.

Add tests.

Fixes #20816

The signatures of HistoN[Sparse]D operations allow passing the column
that will provide the weights as the last element in the list of input
columns, practically allowing for a size which is one more than the
number of dimensions of the histogram to be filled. This was done to
align these signatures with the logic of THnBase::Fill that follows the
same schema.

But these signatures are also different than all other Histo* signatures
that accept weight columns as separate arguments. Thus, they are aligned
to the other signatures by adding a new optional argument for the name
of the column that will provide the weights.

The previous usage of the operations is deprecated with a warning.

Add tests.
@github-actions
Copy link

github-actions bot commented Feb 8, 2026

Test Results

    22 files      22 suites   3d 19h 14m 4s ⏱️
 3 788 tests  3 788 ✅ 0 💤 0 ❌
76 132 runs  76 132 ✅ 0 💤 0 ❌

Results for commit ed3661d.

/// \param[in] columnList
/// A list containing the names of the columns that will be passed when calling `Fill`.
/// (N columns for unweighted filling, or N+1 columns for weighted filling)
/// \param[in] wName The name of the column that will provide the weights.
Copy link
Collaborator

@ferdymercury ferdymercury Feb 9, 2026

Choose a reason for hiding this comment

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

Suggested change
/// \param[in] wName The name of the column that will provide the weights.
/// \param[in] wName The name of the column that will provide the weights.
/// \deprecated Passing the column with the weights as the last column in the list is deprecated.
/// Instead, pass it as a separate argument, e.g. `HistoND(model, cols, weightCol)`.

same suggestions below

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also: potentially add mention in ReleaseNotes

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 quickly implementing what decided at the meeting last week.

@dpiparo
Copy link
Member

dpiparo commented Feb 9, 2026

A candidate for /backport to 6.38?

@vepadulano
Copy link
Member Author

A candidate for /backport to 6.38?

I'm not opposed to this per se. But I wanted to highlight that this would set a precedent that we need to be ready to confirm also for other similar situations in the future.

@hahnjo
Copy link
Member

hahnjo commented Feb 9, 2026

My two cents: If we are deprecating method overloads that have been there for a long time, this should be part of ROOT 6.40. My previous push to have this in ROOT 6.38.04 was based on the understanding that we want to remove an interface that was only introduced recently, which would be done better sooner than later.

@vepadulano
Copy link
Member Author

If we are deprecating method overloads that have been there for a long time, this should be part of ROOT 6.40.

I agree. Since the two methods are similar, I would propose to have both HistoND and HistoNSparseD deprecated in 6.40, would you agree?

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.

Improve RInterface::HistoND signature with an extra argument for weight

4 participants