-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
ENH/BUG: Allow multinomial to check pvals with other float types #16732
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
b6243eb
to
66ac658
Compare
The condition is kind of a mouthful, so may not be the best approach. The alternative would be to use a fused type for kahan_sum which would then be checked also using a fused type for the comparison value. |
66ac658
to
a8f6a0a
Compare
The two commits use different approaches.
Are either of these reasonable ways to handle it? The third option, which I haven't implemented would be
|
My first impression is that the last version looks slightly nicer than the previous. Does the |
No. It is just 1.0. Could use the value of np.nextafter(np.float32(1.0), np.float32(2.0)).
Is last here 3 or 2? |
Oh, yeah, I was thinking about option 3, which I wouldn't mind if there was some simple solution to give to the user running into the problem... |
2244453
to
bce9a67
Compare
I've not included the 3rd version in the 3rd commit. It is easily the simplest. |
bce9a67
to
95b0a34
Compare
Add additional check when original input is an array that does not have dtype double closes numpy#8317
Use a fused type and a kahan sum to check condition
Improve error message when the sum of pvals is larger than 1 when the input data is an ndarray
95b0a34
to
359d04f
Compare
Improve error message when the sum of pvals is larger than 1 when the input data is an ndarray closes numpy#8317 xref numpy#16732
Add additional check when original input is an array that does not have dtype double
closes #8317