Skip to content

documentation of limitations of random integer sampling #5908

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

Closed
argriffing opened this issue May 22, 2015 · 4 comments
Closed

documentation of limitations of random integer sampling #5908

argriffing opened this issue May 22, 2015 · 4 comments

Comments

@argriffing
Copy link
Contributor

According to #4085 numpy cannot sample integers larger than 32 bits on systems where long is 32 bits (64 bit Windows but not 64 bit Linux or Mac), causing complications like scipy/scipy#4552 which attempts to sample the sparsity structure of a large sparse matrix. This limitation could be documented more clearly on pages like http://docs.scipy.org/doc/numpy/reference/routines.random.html or http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.randint.html.

@njsmith
Copy link
Member

njsmith commented May 22, 2015

True. It could also just be fixed... Either by making np.random use
npy_intp internally or by making the randrange type functions switch to 64
bits when the input range is too large.
On May 22, 2015 8:20 AM, "argriffing" notifications@github.com wrote:

According to #4085 #4085 numpy
cannot sample integers larger than 32 bits on systems where long is 32
bits (64 bit Windows but not 64 bit Linux or Mac), causing complications
like scipy/scipy#4552 scipy/scipy#4552 which
attempts to sample the sparsity structure of a large sparse matrix. This
limitation could be documented more clearly on pages like
http://docs.scipy.org/doc/numpy/reference/routines.random.html or
http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.randint.html
.


Reply to this email directly or view it on GitHub
#5908.

@argriffing
Copy link
Contributor Author

@njsmith Would this fix be subject to the same constraints as the 'choice' and 'dirichlet' and 'normal' improvements as in #5851 (comment)?

@njsmith
Copy link
Member

njsmith commented May 22, 2015

Technically yes, but that doesn't necessarily cause a problem. E.g. letting
randrange accept a larger range won't break any existing streams.
.
(There is also an interesting problem where I bet right now you get
different streams from the same code depending on what platform you're
on... Oops.)
On May 22, 2015 10:12 AM, "argriffing" notifications@github.com wrote:

@njsmith https://github.com/njsmith Would this fix be subject to the
same constraints as the 'choice' and 'dirichlet' and 'normal' improvements
as in #5851 (comment)
#5851 (comment)?


Reply to this email directly or view it on GitHub
#5908 (comment).

@bashtage
Copy link
Contributor

bashtage commented Aug 8, 2017

@njsmith This can be closed.

@njsmith njsmith closed this as completed Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants