-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
randomkit.h is not included in NumPy 1.17 builds #14517
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
Comments
Hmm, I suspect it got lost. Looks like in 1.16.x it was added in
And that is missing in 1.17.x. |
@MSeifert04 That said, I don't think the random internals were meant to be used downstream, which seems to be the case with the StackOverflow user. Perhaps the best solution to his problem would be to copy the relevant files. |
The recommended use of cython, numba and cffi with numpy.random is now documented, and we even have some examples. The examples should be somehow linked to the documentation, suggestions welcome. |
(I am that SO user.) |
Thanks for the feedback. That seems like an oversight. |
@bashtage should we be including more |
I do not believe that randomkit is used any more. C and h should be removed from 1.17. |
The question about including the pxd comes does to whether the low level api side of things is to be supported. These simplify using the numpy random infrastructure in cython. |
Should you decide not to officially support these interfaces, you probably want to mention this in the docs/examples referenced above. |
It would be nice to revisit the API here even if we do keep it, there's things like
The |
Probably |
Certainly could use a clean-up.
I think |
Then let's not restore it ....
This seems to be the algorithm that implements In general, the Python and Cython API should match unless there's a good reason to deviate. And imho that should apply to function/method names and namespaces alike. |
I'm not 100% on how name resolution works in Cython. Probably OK , at least if we use a module,
Having though a bit harder I don't think it is possible to go down that path. See #14531 (comment) |
There was no API before. There was a long-standing issue asking for an official API that got closed when randomgen was merged. |
I just meant |
I not sure it is that easy. Unless the feature of charing a common source of randomness between the legacy methods and the new methods is abandoned. The code in randomkit would need to be ported to the new structure. |
Quick cleanup PR till we're ready to add a complete C/Cython API opened: gh-14562 |
Good point. In the community call on Wednesday there was anyway a preference to fix issues as they arise, and not restore all the legacy code to its 1.16.x status. |
Summarizing: @MSeifert04 said
conclusion: @paul-the-noob said
Could you describe your use case? It seems we would prefer not to export |
Vendored code vs self-written code is irrelevant. What matters is: does it look like a public API or not. If not, change it or rip it out any time. If it does (or is ambiguous), it needs to be treated as such. In this case, the only headers that are public are those you'll find through |
I just assumed from the name that it is the "backend" to |
|
All of the univariate bounded integer generators are available
distributions. Bounded integers adds error handling and broadcasting
…On Sun, Oct 13, 2019, 11:21 Matti Picus ***@***.***> wrote:
rand_int is now supplied by _bounded_integers, but you need to choose
your exact int type. @paul-the-noob <https://github.com/paul-the-noob>
could you describe your use case in a little more detail so we can make
sure to include it as part of gh-14604
<#14604>? Are you building a
BitGenerator to reuse in NumPy's Generator, or sampling uniform integers of
a specific C type to be used directly by your code, or creating your own
distributions?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14517?email_source=notifications&email_token=ABKTSRLEAA54B6BMPR3V2WDQOLZBLA5CNFSM4IW3HBEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCTEOI#issuecomment-541405753>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKTSRNE7OYVUS2BXG52RF3QOLZBLANCNFSM4IW3HBEA>
.
|
I'm essentially creating permutations or shuffling vectors subject to certain constraints. IIRC, one reason I decided to use Cython was that at the time To summarize I need to draw random ints of a given C type from continually changing ranges, either one-by-one or small batch-by-small batch. |
@mattip What was the decision on this for the random C-API? |
I think we can close it, we have an alternative for users who needed this and #14778 widens the use cases for this and other ways to call into the numpy.random C-API |
OK, will close. This does introduce an discontinuity from 1.16 to 1.18, correct? If so, it would be good to mention it somewhere in the release notes where it will be noticed, highlights maybe. Do we have a way to add highlights? |
According to the |
There has been a recent StackOverflow question what happened to the
randomkit.h
that was included in thenumpy/random
directory of the binary distributions of NumPy < 1.17 and isn't included in NumPy 1.17+.The removal of the header file wasn't mentioned in the changelog so I wonder if that was accidental or intentional and if it should have been mentioned in the changes.
The text was updated successfully, but these errors were encountered: