Skip to content

DOC: allclose doesn't require matching shapes - #9709

Merged
charris merged 4 commits into
numpy:masterfrom
spencerahill:spencerahill-allclose-docstring
Sep 23, 2017
Merged

charris merged 4 commits into
numpy:masterfrom
spencerahill:spencerahill-allclose-docstring

Conversation

@spencerahill

Copy link
Copy Markdown
Contributor

Closes #5654

Happy to iterate on this...first time numpy contributor but thought this was straightforward enough to take a first stab at myself. Thanks in advance.

Comment thread numpy/core/numeric.py Outdated

The comparison of `a` and `b` includes standard broadcasting,
which means that `a` and `b` need not have the same shape in order for
allclose(a, b) to evaluate to True. (The same is true for `np.equals`.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think omitting the np. will make this link to equals in the docs, but I'm not sure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll omit the np.. Would it make sense to also add equals under See Also? Seems to me yes.

@charris charris changed the title DOC allclose doesn't require matching shapes DOC: allclose doesn't require matching shapes Sep 19, 2017
Comment thread numpy/core/numeric.py Outdated
@@ -2448,6 +2448,10 @@ def allclose(a, b, rtol=1.e-5, atol=1.e-8, equal_nan=False):
The above equation is not symmetric in `a` and `b`, so that
`allclose(a, b)` might be different from `allclose(b, a)` in

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, should be double backticks around allclose(a, b), same for allclose(b, a). Not yours, but could you fix it?

Comment thread numpy/core/numeric.py Outdated
`allclose(a, b)` might be different from `allclose(b, a)` in
some rare cases.

The comparison of `a` and `b` includes standard broadcasting,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

includes <- uses

Comment thread numpy/core/numeric.py Outdated

The comparison of `a` and `b` includes standard broadcasting,
which means that `a` and `b` need not have the same shape in order for
allclose(a, b) to evaluate to True. (The same is true for `equals`.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Double backticks around allclose(a, b). No parenthesis around the closing sentence.

@charris

charris commented Sep 19, 2017 •

Copy link
Copy Markdown
Member

If you put [ci skip] in the commit message, tests won't be run. They are not needed for documentation.

@spencerahill

Copy link
Copy Markdown
Contributor Author

@charris thanks for the review. Requests implemented.

Comment thread numpy/core/numeric.py Outdated
The comparison of `a` and `b` uses standard broadcasting, which
means that `a` and `b` need not have the same shape in order for
``allclose(a, b)`` to evaluate to True. The same is true for
``equal`` but not ``array_equal``.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The equal and array_equal can use single backticks. The difference is that the single backticks denote links, whereas the double backticks denote code.

@charris
charris merged commit b1ea23b into numpy:master Sep 23, 2017
@charris

charris commented Sep 23, 2017

Copy link
Copy Markdown
Member

Fixed and merged. Thanks @spencerahill .

@spencerahill
spencerahill deleted the spencerahill-allclose-docstring branch September 23, 2017 19:46
@spencerahill

Copy link
Copy Markdown
Contributor Author

My pleasure. Thank you @charris and @eric-wieser for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants