-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[DO NOT MERGE] sprand sanity with rfn argument #30637
Conversation
Should this also follow the convention of taking the function as first argument? (I don't think |
I like it, also because |
Note that instead of the current
with
|
Don't we have a way to make breaking changes in stdlib without having to wait for Julia 2.0? |
Yes, taking |
@StefanKarpinski When can we merge this kind of thing? |
I don't know. I haven't really been following. Is it breaking? |
Yes, it is. Although I believe it would improve usability greatly (in the cases it addresses), I'm not sure if it's worth if to make a breaking change like this without going all the way to something in the spirit of #24912. |
Our general policy is not to make breaking changes unless they are so minor that no one is likely to be relying on them (and then only in minor releases, not point releases), so if that's possibly the case then we could run PkgEval on this to try to figure out if no package anywhere is using this signature. However, I suspect that not to be the case, in which case this would have to wait until we can release SparseArrays 2.0, which would require having the infrastructure to decouple stdlib versions from the Julia version, which we don't have yet. So my guess is that this can't happen yet. |
Understood. One possibility would be to add the new methods but keep the old ones (with or without deprecation warnings), that would not be breaking. If the horizon for a change in this area is so far away, then maybe it is worth it. |
I like the idea of adding the new signatures now, and deprecating the old ones whenever we can. |
And what about just removing this Also, it's not clear why |
(did you forget the density parameter here?) I think In my opinion, the question is what minimal interface should remain in |
So I'm wondering what is the real purpose of |
I agree about 1). About 2) I don't follow you fully, in the sense that [*] Except maybe for something like JuliaRandom/RandomExtensions.jl#3 (comment), what do you think about that? |
Two parameters can be passed to |
Wait, so the "type" [1] this is assuming that |
If needed, yes, it would align with
Indeed! So while you are at it, I would love that the opportunity is taken to increase sanity even more ;-)
Either via a package, or something is added to |
While I generally agree, I'm a bit lost about what do you suggest. Just removing the
Err... what do you mean by two different solutions? Setting |
No, I suggest to unify the APIs between the
For normal distribution, for both families, we added a new function: So, unless we add to base a means of passing normal/exponential distributions directly to |
I'm all for it.
Right, but the exponential distribution was just an example.
But In a sense, the difference is mostly semantic IMO. In your proposal, you'd pass a distribution to I keep pondering, but maybe is not so absurd that |
We have moved the SparseArrays stdlib to an external repository. Please open this PR against that repository: https://github.com/JuliaLang/SparseArrays.jl Thank you! |
This PR fixes inconsistencies in
sprand
when therfn
argument is specified (issue #30627). Breaks the current interface, so I think not to be merged during 1.x. I'm copying here from #30627 what this PR hopefully achieves: