[Numpy-discussion] deprecations for 1.6; assert_almost_equal

josef.pktd@gmai... josef.pktd@gmai...
Mon Mar 7 07:30:11 CST 2011

On Mon, Mar 7, 2011 at 6:53 AM, Pauli Virtanen <pav@iki.fi> wrote:
> Mon, 07 Mar 2011 06:39:20 -0500, josef.pktd wrote:
> [clip]
>> Why does assert_allclose have atol=0, while np.allclose has rtol=1.e-5,
>> atol=1.e-8 ?
> Probably no reason, it should be fixed.
>> What's the status on np.testing.assert_approx_equal, I would have liked
>> to use it more often, except it doesn't work on arrays.
> It's probably going to stay as well. The test routines have a common
> framework for working with arrays, but maybe that routine dates from way
> back, and wasn't ported to use it.
> Both the assert_approx_equal and assert_almost_equal also have the
> built-in ugliness of specifying precision via decimals= which is somewhat
> clumsy for numerical work.

assert_approx_equal  checks for signigicant digits in decimal system,
which looks like it's easy to interpret. I don't have much idea what a
nulp is, and whether it's machine dependent.

>>> np.testing.assert_array_max_ulp(x, np.ones(10))
Traceback (most recent call last):
  File "<pyshell#21>", line 1, in <module>
    np.testing.assert_array_max_ulp(x, np.ones(10))
  File "C:\Programs\Python25\Lib\site-packages\numpy\testing\utils.py",
line 1231, in assert_array_max_ulp
    ret = nulp_diff(a, b, dtype)
  File "C:\Programs\Python25\Lib\site-packages\numpy\testing\utils.py",
line 1271, in nulp_diff
    raise NotImplementedError("_nulp not implemented for complex array")
NotImplementedError: _nulp not implemented for complex array


> --
> Pauli Virtanen
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

More information about the NumPy-Discussion mailing list