NX endorses spec7 - Seeding Pseudo-Random Number Generation#356
NX endorses spec7 - Seeding Pseudo-Random Number Generation#356bsipocz merged 3 commits intoscientific-python:mainfrom
Conversation
|
I approved this PR for NetworkX endorsement of SPEC7 understanding that it applies only to the API for NumPy random number generators (as stated in the "Scope" part of the SPEC. The first paragraph of the SPEC seems to be much broader in scope than NumPy rngs, but the Scope section does reduce attention to NumPy which is what most of this ecosystem will be using. I don't think the NetworkX will exactly follow the recommended API because of our use of Python's random.random as well as numpy.random and our tooling to provide a unified RNG interface for both. But I think the project endorses the ideas in this SPEC and will work toward them within our other constraints. |
|
We got approvals here, so I think we should go ahead with the merge. Note that netlify is unhappiness is unrelated, so we should just roll with it and fix separately if it's an issue on |
rossbar
left a comment
There was a problem hiding this comment.
Thanks for looking at this @MridulS and @bsipocz - it reminded me that this has been on my list to comment on for a while!
I'll just start of by saying that I too endorse SPEC 7 and think it's the right path forward for handling numpy-generated random numbers in the ecosystem.
NetworkX differs from the other libraries in that the infrastructure for supporting random numbers is designed to support both the Python builtin random and numpy.random. The user-facing bits of the machinery (i.e. the "seed" kwarg) doesn't indicate which random implementation is used, and in practice the Python random is more commonly used than numpy. Given the state of things, I feel the recommended API changes in SPEC 7 don't necessarily map cleanly onto NetworkX specifically.
Regardless - I agree that NetworkX endorses SPEC 7 but would expect that there would be more discussion within the NX community about whether the policies (particularly the API parts) would be adopted.
Yeah, I agree it does and the use of Python's rng is fine. I suppose it would be nice if:
|
|
Oh, I'm sorry @rossbar for merging this prematurely.
Yes, I saw that in Dan's comment above, and that nevertheless there is a will to endorse the SPEC. I believe we are saying it from the beginning that endorsing doesn't mean to exactly do what the spec says. |
No worries at all, the merge definitely wasn't premature on your end, the comment was extremely delayed on my end 🙃
Yes this is my understanding of the SPEC process as well - communities can endorse without necessarily adopting, or perhaps modifying adoption as best fits the need of the individual package. I'm very much +1 on endorsing SPEC 7! |
We are still discussing this SPEC and decided to open this PR to have a place where we can make comments and vote. We will leave this PR open for a week or two.