-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
DOC: add note about isinstance for frozen rvs #8808
Conversation
scipy/stats/_distn_infrastructure.py
Outdated
@@ -1443,6 +1443,10 @@ class rv_continuous(rv_generic): | |||
frozen RV object with the same methods but holding the given shape, | |||
location, and scale fixed | |||
|
|||
This object obeys ``isinstance(rv, type(rv))``. This is especially useful if a |
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.
Every object obeys that. I'm not sure what you are trying to get at here. If you'd like to say that rv
is an instance of scipy.stats.distributions.rv_frozen
rather than the distribution object that it was created from, that'd probably be more helpful.
Changes made. Thanks for those, this is more useful and what I was looking for. |
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.
Hmm, still 50:50 on this.
How about line 1443 gets changed to rv_frozen object with...
Like that? |
scipy/stats/_distn_infrastructure.py
Outdated
@@ -1440,9 +1440,9 @@ class rv_continuous(rv_generic): | |||
location, and scale parameters returning a "frozen" continuous RV object: | |||
|
|||
rv = generic(<shape(s)>, loc=0, scale=1) | |||
frozen RV object with the same methods but holding the given shape, | |||
stats.distributions.rv_frozen object with the same methods but holding the given shape, |
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.
Better, I was thinking of:
`rv_frozen` object with
I think the class name needs to go in backticks.
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.
I think you're right.
At line 1316 there's
`rv_continuous` is a base class ...
In HTML we see
rv_continuous is a base class ...
This addresses #8807