Repository navigation
Closes 4777, creating a global seed - #4848
Merged
Merged
Conversation
drculhane
force-pushed
the
Closes-4777
branch
from
September 3, 2025 17:36
0f23f6e to
306a9bc
Compare
ajpotts
reviewed
Sep 5, 2025
ajpotts
approved these changes
Sep 5, 2025
ajpotts
left a comment
Contributor
There was a problem hiding this comment.
Thanks for taking care of this one. Looks good!
drculhane
force-pushed
the
Closes-4777
branch
2 times, most recently
from
September 8, 2025 12:24
b58c912 to
823e962
Compare
ajpotts
reviewed
Sep 8, 2025
ajpotts
reviewed
Sep 8, 2025
drculhane
force-pushed
the
Closes-4777
branch
from
September 9, 2025 16:55
16100bc to
2b49b8a
Compare
drculhane
force-pushed
the
Closes-4777
branch
from
September 9, 2025 18:30
63ad550 to
1897e50
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addendum:
The mypy issue has been fixed, and the code simplified. Kudos to Amanda.
Update:
There's a bit of a challenge here.
(1) The file legacy.py, where I added the global seed code, already has functions rand, randint, standard_normal and uniform. All of these allow a seed parameter. The corresponding numpy functions don't have a seed parameter.
(2) The file generator.py, which creates the Generator class, also includes standard_normal and uniform functions, whose parameter lists don't 100% match the ones in legacy. The generator class lacks rand and randint.
I'd prefer to move all of these inside the Generator class, so that everything is aligned with numpy. But rand, randint, standard_normal and uniform have been working as they are now for some time, and even have unit tests that use the seed.
I am open to discussion.
Closes #4777
The code changes aren't substantial: