[SciPy-dev] All but two tests passing for me

Arnd Baecker arnd.baecker at web.de
Fri Oct 28 13:54:17 EDT 2005


On Fri, 28 Oct 2005, Arnd Baecker wrote:

[...]

> No compile error anymore, but does not quite work yet:
>
> ======================================================================
> ERROR: check_integer
> (scipy.io.array_import.test_array_import.test_read_array)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/home/abaecker/BUILDS2/Build_53/inst_scipy_newcore/lib/python2.4/site-packages/scipy/io/tests/test_array_import.py",
> line 62, in check_integer
>     b = io.read_array(fname,atype=N.Int)
>   File
> "/home/abaecker/BUILDS2/Build_53//inst_scipy_newcore/lib/python2.4/site-packages/scipy/io/array_import.py",
> line 359, in read_array
>     raise ValueError, "One of the array types is invalid, k=%d" % k
> ValueError: One of the array types is invalid, k=0
>
> In [2]: scipy.__core_version__
> Out[2]: '0.4.3.1376'
> In [3]: scipy.__scipy_version__
> Out[3]: '0.4.2_1398'
>
> Sorry, have to rush now - will be back later,

Looking at the corresponding test:

    def check_integer(self):
        from scipy import stats
        a = stats.randint.rvs(1,20,size=(3,4))
        fname = tempfile.mktemp('.dat')
        io.write_array(fname,a)
        b = io.read_array(fname,atype=N.Int)
        assert_array_equal(a,b)
        os.remove(fname)

and executing this line by line shows the error for
  b = io.read_array(fname,atype=N.Int)

Doing
  b = io.read_array(fname)
reads in the array, but it gives floats.

However,
  b = io.read_array(fname,atype=N.Int32)
works.

If this is the intended behaviour (also on 32Bit),
the unit test should be changed accordingly...

Best, Arnd







More information about the SciPy-Dev mailing list