From: Perry G. <pe...@st...> - 2004-05-14 13:37:25
|
John Hunter wrote: > Is there a clever workaround for this problem? It doesn't affect any > of the agg or PS backends. GTK and GD both need to convert their > arrays to ints before passing them on to their respective renderers. > One solution is to do the conversion in list comps [...] > Another question is win32, where the user doesn't have the choice at > compile time. If we compile in numpy for win32, the user's numarrays > will be transformed into numpys at render time, but this won't affect > the user arrays (unlike in scipy where the user is getting the return > values) so I don't see it as a big deal. I think trying to compile in > both or supplying alternate binaries is doable but may not be worth > the maintenance and complexity. [...] > > In any case, there are a couple of readers here who know a bit more > about numarray and numeric than I do <wink> ; any thoughts? > Perhaps there is a clever workaround, but I wonder if the best solution isn't to build dual versions of the extensions, one for Numeric and one for numarray if both are present (and this would also solve the win32 issue by distributing both). I think setup.py could be setup to do this, and a mechanism for a module that uses these to use whichever is selected by the user to pick up the right sharable (e.g., _numarray_mycext.so vs _Numeric_mycext.so). It's not elegant, but it should be robust. Todd and I did talk about if there was a way to make numarray arrays compatable at the binary level; perhaps, but I suspect it involves a lot work and I'm not sure it will eliminate all issues. So do you want us to try to come up with a an example setup.py to do this? Perhaps Todd will have some other ideas. Perry |