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

DOC: add note about isinstance for frozen rvs #8808

Merged
merged 4 commits into from
May 24, 2018

Conversation

stsievert
Copy link
Contributor

This addresses #8807

@@ -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
Copy link
Member

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.

@stsievert
Copy link
Contributor Author

Changes made. Thanks for those, this is more useful and what I was looking for.

Copy link
Contributor

@andyfaff andyfaff left a 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...

@stsievert
Copy link
Contributor Author

Like that?

@@ -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,
Copy link
Contributor

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.

Copy link
Contributor Author

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 ...

@pv pv merged commit 67e9c67 into scipy:master May 24, 2018
@pv pv added this to the 1.2.0 milestone May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants