Skip to content
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

MAINT: use random Generator instead of RandomState #717

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

mdhaber
Copy link
Contributor

@mdhaber mdhaber commented Feb 20, 2024

It looks like the intent was to switch from use of RandomStates to Generators, but the transition is incomplete. I searched for occurences of random.rand (which also finds randn and randint) and replaced them.

@tupui would you check me here? Some things to look for:

  • rng is defined where it's used
  • rng is defined only once (i.e. I didn't add it a new one where it was unneeded)
  • random.rand with separate positional arguments has been replaced with rng.random with single positional argument
  • random.randn with a positional arguments has been changed to rng.normal with size keyword argument, etc.
  • random.randint has been replaced with rng.integers (signatures are compatible, right?)
  • I didn't miss anything obvious?

Copy link
Contributor

@tupui tupui left a comment

Choose a reason for hiding this comment

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

I did not see any obvious miss no 😃

@jarrodmillman jarrodmillman merged commit c909df5 into scipy-lectures:main Feb 22, 2024
9 checks passed
@jarrodmillman jarrodmillman added this to the 2024.1 release milestone Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants