Re: [pygame] Numpy slower than Numeric

2006-12-29 Thread Lenard Lindstrom
Brian Fisher wrote: On 12/28/06, Lenard Lindstrom <[EMAIL PROTECTED]> wrote: Well, pygame compiles with numpy, but not everything works right. So it is not a simple switch. What kind of problems are there? is it like crashing? bad (incorrect) behavior? deprecated numeric functionality that nee

Re: [pygame] Numpy slower than Numeric

2006-12-29 Thread Brian Fisher
On 12/28/06, Lenard Lindstrom <[EMAIL PROTECTED]> wrote: Well, pygame compiles with numpy, but not everything works right. So it is not a simple switch. What kind of problems are there? is it like crashing? bad (incorrect) behavior? deprecated numeric functionality that needs a new way to do th

Re: [pygame] Numpy slower than Numeric

2006-12-28 Thread Lenard Lindstrom
Brian Fisher wrote: On 12/28/06, Kamilche <[EMAIL PROTECTED]> wrote: So - what does this mean for Pygame? It appears to me there is no good reason to use numpy, if you have to convert to/from Numeric arrays to get it to work right anyway. what it means is that Pygame would need to be changed t

Re: [pygame] Numpy slower than Numeric

2006-12-28 Thread Rikard Bosnjakovic
On 12/28/06, Kamilche <[EMAIL PROTECTED]> wrote: Ok, version check - if I change it back to Int:I get an error 'AttributeError: 'module' object has no attribute 'Int'' error, the exact opposite of yours. Numeric version: 24.2 Numeric time: 0.954000 seconds numpy version: 1.0.1 numpy time: 2.

Re: [pygame] Numpy slower than Numeric

2006-12-28 Thread Brian Fisher
On 12/28/06, Kamilche <[EMAIL PROTECTED]> wrote: So - what does this mean for Pygame? It appears to me there is no good reason to use numpy, if you have to convert to/from Numeric arrays to get it to work right anyway. what it means is that Pygame would need to be changed to use numpy arrays fo

Re: [pygame] Numpy slower than Numeric

2006-12-28 Thread Kamilche
Lenard Lindstrom wrote: Check out the types of array and alphaarray in TestNumpy(). Very informative. They are both Numeric arrays. All that is accomplished is that numpy.clip is called on one. It probably just treats it as an iterable. Interesting. If I convert to numpy arrays specifically

Re: [pygame] Numpy slower than Numeric

2006-12-28 Thread Lenard Lindstrom
Kamilche wrote: Jakub Piotr Cłapa wrote: Kamilche wrote: I make heavy use of Numeric in my sprite engine. When I did the following, I was able to 'drop in' numpy as a replacement, but it took 3x longer to load my complex graphics! :-O Maybe you could offer a reduced test case so we could che

Re: [pygame] Numpy slower than Numeric

2006-12-28 Thread Kamilche
Rikard Bosnjakovic wrote: On 12/28/06, Kamilche <[EMAIL PROTECTED]> wrote: Sure, here it is. It's a total hack using global variables, but it works. Numeric takes 1 second, numpy takes 2.6, doing the same operations to the same picture. On line 30, array = pygame.surfarray.array3d(pic2).astyp

Re: [pygame] Numpy slower than Numeric

2006-12-28 Thread Rikard Bosnjakovic
On 12/28/06, Kamilche <[EMAIL PROTECTED]> wrote: Sure, here it is. It's a total hack using global variables, but it works. Numeric takes 1 second, numpy takes 2.6, doing the same operations to the same picture. On line 30, array = pygame.surfarray.array3d(pic2).astype(numpy.int), I need to cha

Re: [pygame] Numpy slower than Numeric

2006-12-27 Thread Kamilche
Jakub Piotr Cłapa wrote: Kamilche wrote: I make heavy use of Numeric in my sprite engine. When I did the following, I was able to 'drop in' numpy as a replacement, but it took 3x longer to load my complex graphics! :-O Maybe you could offer a reduced test case so we could check this? I'm sur

Re: [pygame] Numpy slower than Numeric

2006-12-27 Thread Jakub Piotr Cłapa
Kamilche wrote: I make heavy use of Numeric in my sprite engine. When I did the following, I was able to 'drop in' numpy as a replacement, but it took 3x longer to load my complex graphics! :-O Maybe you could offer a reduced test case so we could check this? I'm sure numpy developers would a

[pygame] Numpy slower than Numeric

2006-12-26 Thread Kamilche
I make heavy use of Numeric in my sprite engine. When I did the following, I was able to 'drop in' numpy as a replacement, but it took 3x longer to load my complex graphics! :-O try: import numpy as Numeric Numeric.Int = Numeric.int Numeric.Float = Numeric.float Numeric.UInt8 =