Repository navigation
DOC: allclose doesn't require matching shapes - #9709
Conversation
|
|
||
| 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`.) |
There was a problem hiding this comment.
I think omitting the np. will make this link to equals in the docs, but I'm not sure.
There was a problem hiding this comment.
Ok, I'll omit the np.. Would it make sense to also add equals under See Also? Seems to me yes.
| @@ -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 | |||
There was a problem hiding this comment.
Hmm, should be double backticks around allclose(a, b), same for allclose(b, a). Not yours, but could you fix it?
| `allclose(a, b)` might be different from `allclose(b, a)` in | ||
| some rare cases. | ||
|
|
||
| The comparison of `a` and `b` includes standard broadcasting, |
|
|
||
| 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`.) |
There was a problem hiding this comment.
Double backticks around allclose(a, b). No parenthesis around the closing sentence.
|
If you put |
[ci skip]
|
@charris thanks for the review. Requests implemented. |
| 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``. |
There was a problem hiding this comment.
The equal and array_equal can use single backticks. The difference is that the single backticks denote links, whereas the double backticks denote code.
|
Fixed and merged. Thanks @spencerahill . |
|
My pleasure. Thank you @charris and @eric-wieser for your help. |
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.