Skip to content

[RF] Deprecate removeRange() method#21548

Merged
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:issue-21542
Mar 10, 2026
Merged

[RF] Deprecate removeRange() method#21548
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:issue-21542

Conversation

@guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Mar 10, 2026

The method RooRealVar::removeRange() and the corresponding method in RooErrorVar have been deprecated because the name was misleading, and they will be removed in ROOT 6.42. Despite the name, the function did not actually remove a range, but only cleared its limits by setting them to −inf,+inf leaving the named range itself defined (so hasRange() would still return true). Users should now explicitly call removeMin() and removeMax() to remove the lower and upper limits of a range.

Internal RooFit code has been updated accordingly.

I deliberately didn't introduce an alternative function with a more descriptive name (like removeMinMax()), because using that would result in backwards incompatible code, and also removing the range limits it a niche feature. Even our own code doesn't do it much. So I think it's fair to suggest to replace usage with removeMin() and removeMax(), even if slightly more verbose.

Closes #21542

The method `RooRealVar::removeRange()` and the corresponding method in
`RooErrorVar` have been deprecated because the name was misleading, and
they will be removed in ROOT 6.42. Despite the name, the function did
not actually remove a range, but only cleared its limits by setting them
to  `−inf,+inf` leaving the named range itself defined (so `hasRange()`
would still return `true`). Users should now explicitly call
`removeMin()` and `removeMax()` to remove the lower and upper limits of
a range.

Internal RooFit code has been updated accordingly.

I deliberately didn't introduce an alternative function with a more
descriptive name (like `removeMinMax()`), because using that would
result in backwards incompatible code, and also removing the range
limits it a niche feature. Even our own code doesn't do it much. So I
think it's fair to suggest to replace usage with `removeMin()` and
`removeMax()`, even if slightly more verbose.
@github-actions
Copy link

Test Results

    22 files      22 suites   3d 8h 16m 18s ⏱️
 3 816 tests  3 815 ✅ 1 💤 0 ❌
75 556 runs  75 547 ✅ 9 💤 0 ❌

Results for commit 210f787.

@guitargeek guitargeek merged commit 57520d9 into root-project:master Mar 10, 2026
32 of 33 checks passed
@guitargeek guitargeek deleted the issue-21542 branch March 10, 2026 15:15
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.

[RF] Behavior of RooRealVar::removeRange

2 participants