<div dir="ltr"><br><br><div class="gmail_quote">On Sat, Aug 16, 2008 at 11:39 AM, Charles R Harris <span dir="ltr"><<a href="mailto:charlesr.harris@gmail.com">charlesr.harris@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr"><br><br><div class="gmail_quote"><div class="Ih2E3d">On Sat, Aug 16, 2008 at 11:24 AM, David Cournapeau <span dir="ltr"><<a href="mailto:cournape@gmail.com" target="_blank">cournape@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Sat, Aug 16, 2008 at 12:15 PM, Charles R Harris<br>
<div><<a href="mailto:charlesr.harris@gmail.com" target="_blank">charlesr.harris@gmail.com</a>> wrote:<br>
><br>
</div><div>> I was just going to look at that; it's nice to have the ticket mailing list<br>
> working again. Is there an easy way to force the SIZEOF_LONG_DOUBLE to 8 so<br>
> I can test this on linux?<br>
<br>
</div>Changing this line in numpy¥core¥setup.py:<br>
<br>
-                  ('SIZEOF_LONG_DOUBLE', 'long double'),<br>
+                  ('SIZEOF_LONG_DOUBLE', 'double'),<br>
<br>
is what I did to get the result on windows. But it only "works"<br>
because I know the C runtime really has long double of 8 bytes. On<br>
platforms where it is not true, it is likely to break things.<br>
</blockquote></div><div><br>Hmm. ISTM that numpy should be set up so that the change works on all platforms. However, making it so might be something else.<br></div></div></div></blockquote><div><br>Almost works, I get the same two failures as you plus a failure in test_precisions_consistent.<br>
<br><span style="font-family: courier new,monospace;">ERROR: Test generic loops.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">----------------------------------------------------------------------</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Traceback (most recent call last):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File "/usr/lib/python2.5/site-packages/numpy/core/tests/test_ufunc.py", line 79, in test_generic_loops</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    assert_almost_equal(fone(x), fone_val, err_msg=msg)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File "/usr/lib/python2.5/site-packages/numpy/testing/utils.py", line 205, in assert_almost_equal</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    return assert_array_almost_equal(actual, desired, decimal, err_msg)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File "/usr/lib/python2.5/site-packages/numpy/testing/utils.py", line 304, in assert_array_almost_equal</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    header='Arrays are not almost equal')</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File "/usr/lib/python2.5/site-packages/numpy/testing/utils.py", line 272, in assert_array_compare</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    val = comparison(x[~xnanid], y[~ynanid])</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">IndexError: 0-d arrays can't be indexed</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">======================================================================</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">FAIL: test_large_types (test_scalarmath.TestPower)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">----------------------------------------------------------------------</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Traceback (most recent call last):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File "/usr/lib/python2.5/site-packages/numpy/core/tests/test_scalarmath.py", line 54, in test_large_types</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    assert_almost_equal(b, 6765201, err_msg=msg)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File "/usr/lib/python2.5/site-packages/numpy/testing/utils.py", line 207, in assert_almost_equal</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    assert round(abs(desired - actual),decimal) == 0, msg</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">AssertionError: </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Items are not equal: error with <type 'numpy.float64'>: got inf</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> ACTUAL: inf</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> DESIRED: 6765201</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">======================================================================</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">FAIL: test_umath.TestComplexFunctions.test_precisions_consistent</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">----------------------------------------------------------------------</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Traceback (most recent call last):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File "/usr/lib/python2.5/site-packages/nose/case.py", line 203, in runTest</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    self.test(*self.arg)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File "/usr/lib/python2.5/site-packages/numpy/core/tests/test_umath.py", line 206, in test_precisions_consistent</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    assert_almost_equal(fcl, fcd, decimal=15, err_msg='fch-fcl %s'%f)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File "/usr/lib/python2.5/site-packages/numpy/testing/utils.py", line 207, in assert_almost_equal</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    assert round(abs(desired - actual),decimal) == 0, msg</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">AssertionError: </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Items are not equal: fch-fcl <ufunc 'arcsin'></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> ACTUAL: (0.66623943249251527+1.0612750619050355j)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> DESIRED: (0.66623943249251527+1.0612750619050355j)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">======================================================================</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">SKIP: test_umath.TestComplexFunctions.test_branch_cuts_failing</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">----------------------------------------------------------------------</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Traceback (most recent call last):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File "/usr/lib/python2.5/site-packages/nose/case.py", line 203, in runTest</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    self.test(*self.arg)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File "/usr/lib/python2.5/site-packages/numpy/testing/decorators.py", line 93, in skipper</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    raise nose.SkipTest, 'This test is known to fail'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">SkipTest: This test is known to fail</span><br style="font-family: courier new,monospace;">
<br><br>There is seems to be a problem in defining the functions called for the different types.<br><br><span style="font-family: courier new,monospace;">In [3]: x = np.zeros(10, dtype=np.longdouble)[0::2]</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">In [4]: x.dtype.itemsize</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Out[4]: 8</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">In [5]: x</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Out[5]: array([0.0, 0.0, 0.0, 0.0, 0.0], dtype=float64)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">In [6]: np.exp(x)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Out[6]: array([NaN, NaN, NaN, NaN, NaN], dtype=float64)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">In [7]: np.sin(x)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Out[7]: array([NaN, NaN, NaN, NaN, NaN], dtype=float64)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">In [8]: x.dtype.char</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Out[8]: 'g'</span><br>
<br><br>If I force the function to the double version this bit works fine. The odd error message is a bug in numpy.testing where assert_array_compare fails for arrays that contain only nan's. They all get masked out.<br>
<br> Chuck<br></div><br></div><br></div>