wafo-project / pywafo

Wave Analysis for Fatigue and Oceanography
http://www.maths.lth.se/matstat/wafo/
Other
94 stars 42 forks source link

Test failure #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. See issue 2
2.
3.

What is the expected output? What do you see instead?
 python -i test_misc.py 
wafo.wafodata: plotbackend is set to matplotlib.pyplot
/home/nwagner/local/lib64/python2.6/site-packages/scikits/__init__.py:1: 
UserWarning: Module pkg_resources was already imported from 
/home/nwagner/local/lib64/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/pkg
_resources.py, but 
/home/nwagner/local/lib64/python2.6/site-packages/distribute-0.6.4-py2.6.egg is 
being added to sys.path
  __import__('pkg_resources').declare_namespace(__name__)
/home/nwagner/local/lib64/python2.6/site-packages/scikits/__init__.py:1: 
UserWarning: Module site was already imported from 
/usr/lib64/python2.6/site.pyc, but 
/home/nwagner/local/lib64/python2.6/site-packages/distribute-0.6.4-py2.6.egg is 
being added to sys.path
  __import__('pkg_resources').declare_namespace(__name__)
Warning: divide by zero encountered in log
Warning: divide by zero encountered in log
**********************************************************************
File "test_misc.py", line 349, in __main__.test_betaloge
Failed example:
    betaloge(3, arange(4))
Expected:
    array([        Inf, -1.09861229, -2.48490665, -3.40119738])
Got:
    array([        inf, -1.09861229, -2.48490665, -3.40119738])
**********************************************************************
File "test_misc.py", line 148, in __main__.test_findcross_and_ecross
Failed example:
    findcross([0, 0, 1, -1, 1],0)
Expected:
    array([1, 2, 3])
Got:
    array([1, 2, 3], dtype=int32)

File "test_misc.py", line 323, in __main__.test_stirlerr
Failed example:
    stirlerr(range(5))
Expected:
    array([        Inf,  0.08106147,  0.0413407 ,  0.02767793,  0.02079067])
Got:
    array([        inf,  0.08106147,  0.0413407 ,  0.02767793,  0.02079067])
**********************************************************************
8 items had failures:
   1 of   1 in __main__.test_betaloge
   3 of   8 in __main__.test_findcross_and_ecross
   1 of   4 in __main__.test_findextrema
   2 of   8 in __main__.test_findrfc
   1 of   5 in __main__.test_findtc
   2 of   6 in __main__.test_findtp
   1 of  12 in __main__.test_rfcfilter
   1 of   1 in __main__.test_stirlerr
***Test Failed*** 12 failures.

What version of the product are you using? On what operating system?

Original issue reported on code.google.com by nils...@googlemail.com on 8 Feb 2011 at 7:19

GoogleCodeExporter commented 9 years ago
Resolved in r81

Original comment by Per.Andreas.Brodtkorb@gmail.com on 8 Feb 2011 at 9:32

GoogleCodeExporter commented 9 years ago
I am using r82. There are still some failures.
>>> numpy.__version__
'1.6.0.dev-5d06dca'

**********************************************************************
File "test_misc.py", line 148, in __main__.test_findcross_and_ecross
Failed example:
    findcross([0, 0, 1, -1, 1],0)
Expected:
    array([1, 2, 3])
Got:
    array([1, 2, 3], dtype=int32)
**********************************************************************
File "test_misc.py", line 150, in __main__.test_findcross_and_ecross
Failed example:
    findcross([0, 1, -1, 1],0)
Expected:
    array([0, 1, 2])
Got:
    array([0, 1, 2], dtype=int32)
**********************************************************************
File "test_misc.py", line 156, in __main__.test_findcross_and_ecross
Failed example:
    ind
Expected:
    array([  9,  25,  80,  97, 151, 168, 223, 239])
Got:
    array([  9,  25,  80,  97, 151, 168, 223, 239], dtype=int32)
**********************************************************************
File "test_misc.py", line 169, in __main__.test_findextrema
Failed example:
    ind
Expected:
    array([ 18,  53,  89, 125, 160, 196, 231])
Got:
    array([ 18,  53,  89, 125, 160, 196, 231], dtype=int32)
**********************************************************************
File "test_misc.py", line 179, in __main__.test_findrfc
Failed example:
    ind
Expected:
    array([  1,   3,   4,   6,   7,   9,  11,  13,  14,  16,  18,  19,  21,
            23,  25,  26,  28,  29,  31,  33,  35,  36,  38,  39,  41,  43,
            45,  46,  48,  50,  51,  53,  55,  56,  58,  60,  61,  63,  65,
            67,  68,  70,  71,  73,  75,  77,  78,  80,  81,  83,  85,  87,
            88,  90,  92,  93,  95,  97,  99, 100, 102, 103, 105, 107, 109,
           110, 112, 113, 115, 117, 119, 120, 122, 124, 125, 127, 129, 131,
           132, 134, 135, 137, 139, 141, 142, 144, 145, 147, 149, 151, 152,
           154, 156, 157, 159, 161, 162, 164, 166, 167, 169, 171, 173, 174,
           176, 177, 179, 181, 183, 184, 186, 187, 189, 191, 193, 194, 196,
           198, 199, 201, 203, 205, 206, 208, 209, 211, 213, 215, 216, 218,
           219, 221, 223, 225, 226, 228, 230, 231, 233, 235, 237, 238, 240,
           241, 243, 245, 247, 248])
Got:
    array([  1,   3,   4,   6,   7,   9,  11,  13,  14,  16,  18,  19,  21,
            23,  25,  26,  28,  29,  31,  33,  35,  36,  38,  39,  41,  43,
            45,  46,  48,  50,  51,  53,  55,  56,  58,  60,  61,  63,  65,
            67,  68,  70,  71,  73,  75,  77,  78,  80,  81,  83,  85,  87,
            88,  90,  92,  93,  95,  97,  99, 100, 102, 103, 105, 107, 109,
           110, 112, 113, 115, 117, 119, 120, 122, 124, 125, 127, 129, 131,
           132, 134, 135, 137, 139, 141, 142, 144, 145, 147, 149, 151, 152,
           154, 156, 157, 159, 161, 162, 164, 166, 167, 169, 171, 173, 174,
           176, 177, 179, 181, 183, 184, 186, 187, 189, 191, 193, 194, 196,
           198, 199, 201, 203, 205, 206, 208, 209, 211, 213, 215, 216, 218,
           219, 221, 223, 225, 226, 228, 230, 231, 233, 235, 237, 238, 240,
           241, 243, 245, 247, 248], dtype=int32)
**********************************************************************
File "test_misc.py", line 194, in __main__.test_findrfc
Failed example:
    ind1
Expected:
    array([  0,   9,  32,  53,  74,  95, 116, 137])
Got:
    array([  0,   9,  32,  53,  74,  95, 116, 137], dtype=int32)
**********************************************************************
File "test_misc.py", line 259, in __main__.test_findtc
Failed example:
    iv
Expected:
    array([ 19,  29,  34,  53,  60,  67,  76,  81,  82,  84,  90,  99, 103,
           112, 127, 137, 143, 154, 166, 180, 185])
Got:
    array([ 19,  29,  34,  53,  60,  67,  76,  81,  82,  84,  90,  99, 103,
           112, 127, 137, 143, 154, 166, 180, 185], dtype=int32)
**********************************************************************
File "test_misc.py", line 243, in __main__.test_findtp
Failed example:
    itp
Expected:
    array([ 11,  21,  22,  24,  26,  28,  31,  39,  43,  45,  47,  51,  56,
            64,  70,  78,  82,  84,  89,  94, 101, 108, 119, 131, 141, 148,
           149, 150, 159, 173, 184, 190, 199])
Got:
    array([ 11,  21,  22,  24,  26,  28,  31,  39,  43,  45,  47,  51,  56,
            64,  70,  78,  82,  84,  89,  94, 101, 108, 119, 131, 141, 148,
           149, 150, 159, 173, 184, 190, 199], dtype=int32)
**********************************************************************
File "test_misc.py", line 247, in __main__.test_findtp
Failed example:
    itph
Expected:
    array([ 11,  28,  31,  39,  47,  51,  56,  64,  70,  78,  89,  94, 101,
           108, 119, 131, 141, 148, 159, 173, 184, 190, 199])
Got:
    array([ 11,  28,  31,  39,  47,  51,  56,  64,  70,  78,  89,  94, 101,
           108, 119, 131, 141, 148, 159, 173, 184, 190, 199], dtype=int32)
**********************************************************************
File "test_misc.py", line 217, in __main__.test_rfcfilter
Failed example:
    ind
Expected:
    array([  1,   3,   4,   6,   7,   9,  11,  13,  14,  16,  18,  19,  21,
            23,  25,  26,  28,  29,  31,  33,  35,  36,  38,  39,  41,  43,
            45,  46,  48,  50,  51,  53,  55,  56,  58,  60,  61,  63,  65,
            67,  68,  70,  71,  73,  75,  77,  78,  80,  81,  83,  85,  87,
            88,  90,  92,  93,  95,  97,  99, 100, 102, 103, 105, 107, 109,
           110, 112, 113, 115, 117, 119, 120, 122, 124, 125, 127, 129, 131,
           132, 134, 135, 137, 139, 141, 142, 144, 145, 147, 149, 151, 152,
           154, 156, 157, 159, 161, 162, 164, 166, 167, 169, 171, 173, 174,
           176, 177, 179, 181, 183, 184, 186, 187, 189, 191, 193, 194, 196,
           198, 199, 201, 203, 205, 206, 208, 209, 211, 213, 215, 216, 218,
           219, 221, 223, 225, 226, 228, 230, 231, 233, 235, 237, 238, 240,
           241, 243, 245, 247, 248])
Got:
    array([  1,   3,   4,   6,   7,   9,  11,  13,  14,  16,  18,  19,  21,
            23,  25,  26,  28,  29,  31,  33,  35,  36,  38,  39,  41,  43,
            45,  46,  48,  50,  51,  53,  55,  56,  58,  60,  61,  63,  65,
            67,  68,  70,  71,  73,  75,  77,  78,  80,  81,  83,  85,  87,
            88,  90,  92,  93,  95,  97,  99, 100, 102, 103, 105, 107, 109,
           110, 112, 113, 115, 117, 119, 120, 122, 124, 125, 127, 129, 131,
           132, 134, 135, 137, 139, 141, 142, 144, 145, 147, 149, 151, 152,
           154, 156, 157, 159, 161, 162, 164, 166, 167, 169, 171, 173, 174,
           176, 177, 179, 181, 183, 184, 186, 187, 189, 191, 193, 194, 196,
           198, 199, 201, 203, 205, 206, 208, 209, 211, 213, 215, 216, 218,
           219, 221, 223, 225, 226, 228, 230, 231, 233, 235, 237, 238, 240,
           241, 243, 245, 247, 248], dtype=int32)
Warning: divide by zero encountered in log
**********************************************************************
6 items had failures:
   3 of   8 in __main__.test_findcross_and_ecross
   1 of   4 in __main__.test_findextrema
   2 of   8 in __main__.test_findrfc
   1 of   5 in __main__.test_findtc
   2 of   7 in __main__.test_findtp
   1 of  12 in __main__.test_rfcfilter
***Test Failed*** 10 failures.

Original comment by nils...@googlemail.com on 9 Feb 2011 at 6:26

GoogleCodeExporter commented 9 years ago
The failure seems to stem from different __str__ representeation of ndarray. 
The Only difference is that the ndarray on Nils computer has dtype written to 
stdout while mine has not. The actual number are identical. Not sure how to 
deal with this. 

Original comment by Per.Andreas.Brodtkorb@gmail.com on 13 Feb 2011 at 11:37

pbrod commented 8 years ago

Fixed in current version