[SciPy-dev] MCMC, Kalman Filtering, AI for SciPy?

Fernando Perez Fernando.Perez at colorado.edu
Thu Sep 30 15:35:52 CDT 2004


Travis Oliphant schrieb:

>>2. The matrixmultiply != bug I recently reported is _very_ serious for 
>>people working with large matrices.  I also reported it in the numpy 
>>list, but nobody replied.  Since scipy can trivially work around it 
>>with the one-liner I showed, I think this really should be done.
> 
> 
> I think you will see that I released a new version of Numeric that fixed 
> this problem.   See 23.5

Great!  But since you didn't mention anything on the list, and my telepathy 
link has been acting up lately, I missed it ;)

>>Code for #1 is here (but test it further), and I posted the one-liner 
>>for #2 yesterday, so these two (IMHO important) fixes should take no 
>>time for a committer.
> 
> 
> We could also fix it in SciPy too.

It's just a one-liner, and it will help users of numeric <= 23.4, so why not.

I'm glad to see these two go in, thanks a lot.

I also had this old patch lying around, which I sent to the list about a year 
ago.  It's far from critical, so feel free to drop it if you don't like 
it/disagree.  I'll just paste my old email and reattach the patch (I hope it 
still applies).

here's a simple patch for pilutil which adds a simple 'flatten' option to the
image reading functions imread.  Here are the resulting definition and docstrings:

In [2]: scipy.fromimage?
Definition:     scipy.fromimage(im, flatten=0)
Docstring:
      Takes a PIL image and returns a copy of the image in a Numeric container.
      If the image is RGB returns a 3-dimensional array:  arr[:,:,n] is each
channel

      Optional arguments:

       - flatten (0): if true, the image is flattened by calling convert('F') on
       the image object before extracting the numerical data.  This flattens the
       color layers into a single grayscale layer.  Note that the supplied image
       object is NOT modified.


In [3]: scipy.imread?
Definition:     scipy.imread(name, flatten=0)
Docstring:
      Read an image file from a filename.

      Optional arguments:

       - flatten (0): if true, the image is flattened by calling convert('F') on
       the resulting image object.  This flattens the color layers into a single
       grayscale layer.


This is useful in case you want to load straight from an image file (jpeg,
tiff, ...) but you want a single grayscale array to do numerics on.  The
change is fully backwards compatible.  I did it because we needed here to
easily read images for testing some numerical transformations without dealing
with the color channels.  It was easier to patch scipy than to tell my
coworkers to remember to convert every image first :)

Regards,

Fernando.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pilutil.diff
Url: http://projects.scipy.org/pipermail/scipy-dev/attachments/20040930/0903c490/attachment.pl 


More information about the Scipy-dev mailing list