Skip to content

BUG: handle non integer types for multinomial/dirichlet size #4348

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

Merged
merged 1 commit into from
Feb 22, 2014

Conversation

juliantaylor
Copy link
Contributor

Closes gh-3173

@juliantaylor
Copy link
Contributor Author

for review
cython 0.20.2 is due soon, so merge can be postponed until then to save a regen.

btw can we just add cython as dependency and remove the mtrand.c?
its a standard dependency in the scipy stack now.

if seed is None:
errcode = rk_randomseed(self.internal_state)
else:
rk_seed(operator.index(seed), self.internal_state)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does operator.index do here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get an integer, though I guess it could be skipped as the float cases is already handled below

@charris
Copy link
Member

charris commented Feb 22, 2014

LGTM.

@rgommers
Copy link
Member

+1 for Cython as dependency when building from git repo. Not from a source release.

charris added a commit that referenced this pull request Feb 22, 2014
BUG: handle non integer types for multinomial/dirichlet size
@charris charris merged commit b5c62f8 into numpy:master Feb 22, 2014
@charris
Copy link
Member

charris commented Feb 22, 2014

Thanks Julian.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault when 'size' argument to numpy.random.multinomial has type numpy.uint32.
3 participants