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: stats: A few tweaks to the linregress docstring. #8839

Merged
merged 1 commit into from
May 18, 2018

Conversation

WarrenWeckesser
Copy link
Member

The main reason for this change is to not print r_value**2 with
full precision in the docstring. There is no guarantee that the
value will be exactly the same as the code in scipy evolves,
and as it was, even a change of 1 ULP would cause a doctest to
fail.

I also added a line to print the slope and intercept of the
regression line in the docstring, and modified the sample
data to have a nontrivial slope.

The main reason for this change is to not print r_value**2 with
full precision in the docstring.  There is no guarantee that the
value will be *exactly* the same as the code in scipy evolves,
and as it was, even a change of 1 ULP would cause a doctest to
fail.

I also added a line to print the slope and intercept of the
regression line in the docstring, and modified the sample
data to have a nontrivial slope.
@WarrenWeckesser WarrenWeckesser added scipy.stats Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org labels May 18, 2018
@ev-br ev-br merged commit dfb0cc2 into scipy:master May 18, 2018
@ev-br
Copy link
Member

ev-br commented May 18, 2018

Merging straight away to unblock the CI. Thanks Warren.

Going forward, I'd note that the issue here was a print function with text. Without text at the same output line, the numeric values would have been compared via np.allclose.

@ev-br ev-br added this to the 1.2.0 milestone May 18, 2018
@WarrenWeckesser WarrenWeckesser deleted the linregress-docstring-prec branch May 19, 2018 00:19
@WarrenWeckesser
Copy link
Member Author

Without text at the same output line, the numeric values would have been compared via np.allclose.

Thanks, I didn't know that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants