-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
ENH: Expand Argument Range of random_integers #6885
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
Conversation
I believe it is currently |
Ah, yes, in light of the underlying code, semantically that is correct. However, it seems that |
@charris: Updated with the wording fixes. Travis is still happy. |
Yes, it turns out that 'int' is the same as old python 2 'int', which was a long. The c int is 'intc'. |
Fair enough, though I agree with your point that we should use |
rv = lo + <long>rk_interval(diff, self. internal_state) | ||
array_data[i] = rv | ||
return array | ||
return self.random_integers(low, high-1, size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space around -
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing.
LGTM modulo a couple of nits. |
Made changes, and Travis is happy. From your comments above, should be good to merge. |
Did you intend to include the This looks independent of your other PR, so will be good to go. |
Yikes! No, did not intend to! Let me remove that. |
Redistributes the code between the randint and random_integers methods so that we can generate integers up to and including np.iinfo('l').max with random_integers, which previously would have caused an OverflowError.
I think I must have accidentally did |
I find it safer to do |
BTW the bar for adding things to .gitignore is pretty low -- if there's On Mon, Dec 28, 2015 at 1:50 PM, gfyoung notifications@github.com wrote:
Nathaniel J. Smith -- http://vorpus.org |
Travis gives a green light, so now the PR should be good to go. |
ENH: Expand Argument Range of random_integers
In it goes. Thanks @gfyoung . |
Redistributes the code between the
randint
andrandom_integers
methods so that we can generate integers up to and includingnp.iinfo('l').max
withrandom_integers
, which previously would have caused anOverflowError
.Previous behavior:
New behavior:
(Optional, But Recommended) Depends on #6824
While the PR currently allows for the generation of up to and including
np.iinfo('l').max
, if #6824 is merged in, the PR will be revised to being able to generate random integers up to and includingnp.iinfo('ll').max
.