diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-06-18 13:00:33 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2016-06-19 13:47:20 -0600 |
commit | 55002a5204240bfaabdc19bd670c50e47881247c (patch) | |
tree | 4dd6397925ce4a89639993f1b543ff2b4eb167fe /doc | |
parent | 812ca6fcb2461e2617a50c0c132a1a27ac134849 (diff) | |
download | numpy-55002a5204240bfaabdc19bd670c50e47881247c.tar.gz |
ENH: Make assert_almost_equal & assert_array_almost_equal consistent.
This changes the check for scalars in assert_almost_equal so that
abs(actual - desired) < 1.5 * 10**(-decimal)
Note that the previous documentation claimed that the functions were
equivalent to
abs(actual - desired) < .5 * 10**(-decimal)
but that was not how they behaved in practice.
Due to the change in implementation, some very delicate tests may fail
that did not fail before. No extra failures were noted in scipy.
Closes #5200.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/1.12.0-notes.rst | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/release/1.12.0-notes.rst b/doc/release/1.12.0-notes.rst index 15f22700c..1aa70738c 100644 --- a/doc/release/1.12.0-notes.rst +++ b/doc/release/1.12.0-notes.rst @@ -92,6 +92,18 @@ FutureWarning to changed behavior * np.average will emit a warning if the argument is a subclass of ndarray, as the subclass will be preserved starting in 1.13. (see Future Changes) +Greater consistancy in ``assert_almost_equal`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The precision check for scalars has been changed to match that for arrays. It +is now + + abs(actual - desired) < 1.5 * 10**(-decimal) + +Note that this is looser than previously documented, but agrees with the +previous implementation used in ``assert_array_almost_equal``. Due to the +change in implementation some very delicate tests may fail that did not +fail before. + C API ~~~~~ @@ -261,4 +273,5 @@ If a 'width' parameter is passed into ``binary_repr`` that is insufficient to represent the number in base 2 (positive) or 2's complement (negative) form, the function used to silently ignore the parameter and return a representation using the minimal number of bits needed for the form in question. Such behavior -is now considered unsafe from a user perspective and will raise an error in the future. +is now considered unsafe from a user perspective and will raise an error in the +future. |