Skip to content

Fixes handling of size/shape parameter in ak.random.poisson - #4916

Merged
ajpotts merged 2 commits into
Bears-R-Us:mainfrom
drculhane:Closes-4220
Sep 19, 2025
Merged

ajpotts merged 2 commits into
Bears-R-Us:mainfrom
drculhane:Closes-4220

Conversation

@drculhane

@drculhane drculhane commented Sep 17, 2025 •

Copy link
Copy Markdown
Contributor

Closes #4220

This fixes the handling of the size parameter in ak.random.poisson, so that (e.g.) ak.random.poisson(lam=lam,size=(m,n)) will produce an mxn pdarray.

The very simple fix is to generate 1D values, and reshape if needed.

Analyzing this bug report uncovered other issues in the random number generation, so I'll be adding additional issues.

@1RyanK 1RyanK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

Comment thread arkouda/numpy/random/generator.py Resolved

@jaketrookman jaketrookman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good

@ajpotts ajpotts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is great as a bug fix and we can optimize for performance later. I created a ticket: #4926

@ajpotts
ajpotts added this pull request to the merge queue Sep 19, 2025
Merged via the queue into Bears-R-Us:main with commit 04b89f6 Sep 19, 2025
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

Successfully merging this pull request may close these issues.

Poisson Random Sampling, Shape Given as tuple[int, ...] Cannot Cast to int(64)

4 participants