-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
MAINT: stats: remove support for _rvs
without size
parameter
#15917
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from making the linter happy, this LGTM! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Matt! Just one nit for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Matt! Just one nit for me. (Sorry for the double comment, GH mobile is buggy)
* master: (632 commits) Update _dual_annealing.py (scipy#15939) TST: stats: make `check_sample_var` two-sided (scipy#15723) DOC: sparse.linalg: add citations for COLAMD DOC: fix missing comma in conf ENH/MAINT: Version switcher from the sphinx theme (scipy#15380) MAINT: stats: remove support for `_rvs` without `size` parameter (scipy#15917) BUG: Handle base case for scipy.integrate.simpson when span along the axis is 0 (scipy#15824) MAINT: stats: adjust tolerance for failing test only MAINT: stats: adjust tolerance of failing TestTruncnorm MAINT: special: Clean up C style in ndtr.c CI: remove pin on Jinja2 (scipy#15895) STY: Remove white spaces MAINT: stats: exempt gilbrat from refguide_check MAINT: stats: rename continuous_gilbrat->continuous_gibrat MAINT: stats: correct name Gilbrat -> Gibrat [ENH] circvar calculated simply as 1-R (scipy#5747) DEP: deal with deprecation of ndim >1 in bspline MAINT: stats: more specific error type from `rv_continuous.fit` (scipy#15778) DOC: fix import in example in _morestats (scipy#15900) [BUG] make p-values consistent with the literature (scipy#15894) ...
Reference issue
Closes gh-15747
gh-11394
What does this implement/fix?
gh-11394 deprecated the ability to implement
_rvs
without asize
parameter._rvs
is a private method, but it's in a public class, so immediate removal of support for_rvs
without asize
parameter had backward-compatibility concerns. The authors added special treatment for_rvs
methods without asize
parameter, but this can be removed now that a deprecation warning has been raised for years. This PR now always passessize
whenrvs
calls_rvs
, and it tests that there is an error (rather than deprecation warning) when an_rvs
method that does not acceptsize
gets passedsize
.Additional information
gh-11394 suggested that it was supposed to do something similar w.r.t.
random_state
: remove reliance of_rvs
methods on a_random_state
attribute and instead require that they accept arandom_state
parameter. However, it did not raise a deprecation warning for_rvs
methods that don't acceptrandom_state
, and_random_state
is still used throughout the distribution infrastructure, so I didn't touch that.