Skip to content
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

deprecate randn((1,2)) #29653

Open
cossio opened this issue Oct 15, 2018 · 3 comments
Open

deprecate randn((1,2)) #29653

cossio opened this issue Oct 15, 2018 · 3 comments
Labels
breaking This change will break code deprecation This change introduces or involves a deprecation randomness Random number generation and the Random stdlib speculative Whether the change will be implemented is speculative
Milestone

Comments

@cossio
Copy link
Contributor

cossio commented Oct 15, 2018

Since rand((1,2)) was deprecated, it seems that randn((1,2)) should be deprecated too.

See https://discourse.julialang.org/t/rand-1-2-vs-rand-1-2/16254

@ExpandingMan
Copy link
Contributor

ExpandingMan commented Oct 15, 2018

I was thinking about this a little bit and I realized that it's not completely clear that this should be deprecated since randn only supports samples in continuous (or pseudo-continuous) spaces. For example, randn(Float64, (1,2)) makes sense but randn([1,2]) does not. I think the possibility that rand((1,2)) could be interpreted (by a user) as rand([1,2]) was the primary reason that rand((m,n)) was deprecated.

Still, the inconsistency is confusing, and after all randn does indeed support type arguments such as randn(Float32, (1,2)). My vote would be for deprecating rand((m,n)), but in light of the above, it might be a long time before we're actually allowed to do that under the constraints of semantic versioning.

@fredrikekre fredrikekre added the randomness Random number generation and the Random stdlib label Oct 16, 2018
@JeffBezanson JeffBezanson added the deprecation This change introduces or involves a deprecation label Nov 4, 2018
@rfourquet
Copy link
Member

I think the possibility that rand((1,2)) could be interpreted (by a user) as rand([1,2]) was the primary reason that rand((m,n)) was deprecated.

Correct, see #25278.

@ViralBShah
Copy link
Member

Now, we have:

julia> rand((1,2))
2

julia> randn((1,2))
1×2 Matrix{Float64}:
 -0.937521  -0.590051

@rfourquet rfourquet added this to the 2.0 milestone Oct 3, 2022
@brenhinkeller brenhinkeller added breaking This change will break code speculative Whether the change will be implemented is speculative labels Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This change will break code deprecation This change introduces or involves a deprecation randomness Random number generation and the Random stdlib speculative Whether the change will be implemented is speculative
Projects
None yet
Development

No branches or pull requests

7 participants