Skip to content

Conversation

mdhaber
Copy link
Contributor

@mdhaber mdhaber commented Nov 13, 2024

Reference issue

Towards gh-21833

What does this implement/fix?

This allows for use of new keyword rng alongside random_state in scipy.stats.PermutationMethod to prepare for the deprecation and removal of random_state and its legacy behavior. This is a little trickier than other similar PRs because random_state was not only a keyword argument of the initializer but an attribute of the dataclass.

Additional information

Ready for review, but leaving as draft before comments. After making any corrections, I'll copy these ideas over to BootstrapMethod. We might be able to save a few lines by making a private superclass of the two, but it's probably not worth the complexity.

@mdhaber mdhaber added scipy.stats maintenance Items related to regular maintenance tasks labels Nov 13, 2024
@mdhaber mdhaber requested a review from j-bowhay November 13, 2024 21:27
@mdhaber mdhaber mentioned this pull request Nov 13, 2024
50 tasks
@lucascolley lucascolley changed the title MAINT: stats.PermutationMethod: transition to rng (SPEC 7) API: stats.PermutationMethod: transition to rng (SPEC 7) Nov 13, 2024
@lucascolley lucascolley added the needs-release-note a maintainer should add a release note written by a reviewer/author to the wiki label Nov 13, 2024
@mdhaber mdhaber marked this pull request as ready for review November 14, 2024 01:55
Copy link
Member

@j-bowhay j-bowhay left a comment

Choose a reason for hiding this comment

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

A couple of minor comments but otherwise looks good

Copy link
Member

@j-bowhay j-bowhay left a comment

Choose a reason for hiding this comment

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

The rest of the changes look good but I couldn't tell if the smoke docs failure is real

@mdhaber
Copy link
Contributor Author

mdhaber commented Nov 15, 2024

Probably not. I re-ran and now the failure is just the one that's in main.

Copy link
Member

@j-bowhay j-bowhay left a comment

Choose a reason for hiding this comment

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

Thanks, I went through the checklist in the linked issue and this looks good

@j-bowhay j-bowhay added this to the 1.15.0 milestone Nov 15, 2024
@j-bowhay j-bowhay merged commit 6e6ccc7 into scipy:main Nov 15, 2024
33 of 34 checks passed
@j-bowhay j-bowhay changed the title API: stats.PermutationMethod: transition to rng (SPEC 7) API: stats.{PermutationMethod,BootstrapMethod}: transition to rng (SPEC 7) Nov 15, 2024
@mdhaber mdhaber removed the needs-release-note a maintainer should add a release note written by a reviewer/author to the wiki label Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants