[Numpy-discussion] NumPy-Discussion Digest, Vol 84, Issue 18

Graeme B. Bell grb at skogoglandskap.no
Mon Sep 9 04:56:27 EDT 2013

> This is good stuff, but I can't help thinking that if I needed to do an
> any/all test on a number of arrays with common and/or combos --
> I'd probably write a Cython function to do it.

Hi Chris,

I agree, if you want the best performance and have no constraints on implementation, then using something like cython might be the way to do it.

However, not everyone has the option of using cython. I'm using a GIS program which accepts a single numpy expression and performs it across every cell. What I'm doing has to a) be compatible with the standard release b) should 'just work' for all users, not just me and preferably c) shouldn't be complicated to implement/test. 

I don't know if GDAL and SWIG will work out of the box with a hybrid numpy/Cython approach. From what I've read, I believe it probably won't be practical for most users, particularly on Windows. Whereas python based or core numpy improvements are drop-in upgrades to performance. 

I suppose this leads to a more general point that using cython instead of improving numpy performance during projects, is locally good, but globally bad, rather like the situation with idiomatic workarounds for performance as opposed to fixing the implementation. 


More information about the NumPy-Discussion mailing list