[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] PATCH: Numeric and not numpy by deafault
- To: pygame-users@xxxxxxxx
- Subject: [pygame] PATCH: Numeric and not numpy by deafault
- From: SAn <gringotumadre@xxxxxxxxx>
- Date: Sun, 9 Aug 2009 15:40:58 -0300
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sun, 09 Aug 2009 14:41:21 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=wDfK1TKC5T4ltCy8zGouGGSEUCwELBRZcsdsN5QFVTo=; b=uZ9eZVlOXVVkyp3irtn244L8mqXLZmqddChwKXnzjL8GDwJE60fudpw611qJrGeW7y FPiBj195JIotBS1kOmXXQZ0JCS35Fzie+e8BjZTNPcdfMjXHd30kLR8sRERGF93/bm9u 6KSiIm1P5zb8muZK9IdSnSBLbLF685t30L5BU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=UY9tmliuYcQAV0vhOn80kNw+xk7fuQT48vKRxvQCEyGwZSpRfm7RYk3AGozdH2kyFd SfEv4T0DYsXXBnRrEm9KFSRsNrZkC0Gz7BxexTEBZNc4JXpRvWsGaH6Dnz0TEKn0KvCN NRsW9wlOZQb69w+yiLWfYdeel2UDFENncVlsM=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi,
I've seen that in some platforms pygame is using Numeric and not numpy
as default for surfarray module (and probably sndarray, not checked).
pygame docs [0] says that:
"The default will be numpy, if installed. Otherwise, Numeric will be
set as default if installed. If neither numpy nor Numeric are
installed, the module will raise an ImportError. "
I see in What's New:
[SVN 1871-1879] Jan 25, 2009
Completing the process to actually have numpy be the default.
And efectively it seems that as pygame 1.9.x it is fixed, so i am only
adding a test case patch to make sure it is fixed:
class SurfarrayModuleTest2(unittest.TestCase):
def setUp(self):
pass
def test_default_numpy(self):
try:
import numpy
import Numeric
except ImportError:
return # If numpy or Numeric is not installed this test has no sense.
self.failIf(pygame.surfarray.get_arraytype() == 'numeric')
Note that its needed no add the function in another unittest class
because the setUp method of SurfarrayModuleTest "hardcodes" the
arraytype (just take a look at surfarray_test.py to get what i am
talking about).
Cheers,
SAn
[0] http://www.pygame.org/docs/ref/surfarray.html