-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove default value of p from TH1::GetQuantiles() as is the case with TF1::GetQuantiles #16784
Comments
The wording is not strictly correct:
|
Maybe someone is using this second variant (p=null) for something, so changing this would break backward compatibility. What is exactly your use case / what you want to achieve? If what you want is to have a new method to get F(x), then that method already exists, it is TH1::GetCumulative, so not sure if it's useful to add a new function name for this. Or what bothers you is that it is a default argument? |
Oh. Missed GetCumulative. The thing that probably bothers me is the description of GetQuantiles or rather what is the use case of GetQuantiles with p==nullptr. When you say "If p is null, it calculates F-1(F(bin_edges)) = bin_edges", the bin_edges are already known (if it really calculates them inside, that is quite surprising). The really new thing (although maybe not a product, but side-effect) is the p. I understand that removing the default would break backward compatibility, so I am not advocating just removing the thing in the next release. It's just that if there is a default argument, normally it represents a frequent use case, so it brings attention while learning about a given method. Here it brings confusion (to me and to my student at least). |
Given what you wrote and what I wrote, I no longer have a firm opinion on what should be done with it unfortunately... |
But p stays null. F(x) is stored to a temporary variable, p is not set to F(x).
It does. It's a technical workaround to have both paths to follow the same code.
I agree with you. So I would suggest to remove from your title "add new method to handle this case". |
Side note, the default value for p is there since 23y: |
I missed that p stays null. You showed it in the comment to the other MR... In this case I don't understand what was the idea 23 years ago. I can't imagine the use case for this. I think the current title for the issue is good. |
We need @lmoneta for clarifying this... |
…with TF1::GetQuantiles Fixes root-project#16784 The currently default parameter of p = nullptr is a very weird use case, which calculates F-1(F(bin_edges)), ie it just returns the bin edges. So force user to really decide if he wants to pass that nullptr as argument.
Explain what you would like to see improved and how.
This is a follow-up to #16736, see #16782 (comment)
The default parameter of p = nullptr brings the method to return just the bin edges, so it is not very useful.
ROOT version
master, although notation matches what #16782 brings
Installation method
irrelevant
Operating system
irrelevant
Additional context
No response
The text was updated successfully, but these errors were encountered: