My last Bug of the Day, which is also triggered by the first test in
test_array_import.py, shows that numpyio.fwrite will not convert a real
array to shorts before writing them out. Note the last line succeeds in
writing ints. Is this new/old/desired behavior?
In [1]:import scipy
Importing io to scipy
Importing special to scipy
Importing utils to scipy
Importing interpolate to scipy
Importing optimize to scipy
Importing linalg to scipy
In [2]:import scipy.io.numpyio as numpyio
In [3]:a=255*scipy.rand(20)
In [4]:fid=open('foo','wb+')
In [5]:numpyio.fwrite(fid,20,a,'s')
---------------------------------------------------------------------------
exceptions.ValueError Traceback (most
recent call last)
/home/swalton/<console>
ValueError: Invalid type for array
In [10]:numpyio.fwrite(fid,20,a,'i')