Re: [Numpy-discussion] [ANN] Numpy 1.3.0rc2

2009-04-04 Thread David Cournapeau
Robert Pyle wrote:

 I should have been clearer:  I performed two installations, from the  
 source tarball for EPD, and from the OS X installer for the python.org  
 2.5 python.
   

ok.

Thanks for the report,

David
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute [patch]

2009-04-04 Thread Travis E. Oliphant
Thomas Heller wrote:
 Thomas Heller schrieb:
   
 Sturla Molden schrieb:
   
 On 3/26/2009 12:41 PM, Jens Rantil wrote:

 
 Wouldn't my code, or a tweak of it, be a nice feature in
 numpy.ctypeslib? Is this the wrong channel for proposing things like
 this?
   
 If you look at

 http://svn.scipy.org/svn/numpy/trunk/numpy/ctypeslib.py

 you will see that it does almost the same. I think it would be better to 
 work out why ndpointer fails as restype and patch that.
 
 Thomas Heller schrieb:

 
 ndpointer(...), which returns an _nptr instance, does not work as restype
 because neither it is a base class of one of the ctypes base types like
 ctypes.c_void_p, also it is not callable with one argument.

 There are two ways to fix this.  The first one is to make the _nptr callable
   
 [...]
 
 The other way is to make _nptr a subclass of ctypes.c_void_p,
 the result that the foreign function call returns will then be
 an instance of this class.  Unfortunately, ctypes will not call
 __new__() to create this instance; so a custom __new__() implementation
 cannot return a numpy array and we are left with the _nptr instance.
 The only way to create and access the numpy array is to construct
 and return one from a method call on the _nptr instance, or a property
 on the _nptr instance.
 Ok, .errcheck could call that method and return the result.

   
 Well, looking into the ctypes sources trying to invent a new protocol for
 the restype attribute I found out that THERE IS ALREADY a mechanism for it,
 but I had totally forgotten that it exists.

 When the .restype attribute of a function is set to a SUBCLASS of a
 ctypes type (c_void_p for example), an instance of this subclass is created.
 After that, if this instance has a _check_retval_ method, this method is 
 called
 and the result of this call is returned.  So, it is indeed possible to create
 a class that can be assigned to .restype, and which can convert the return 
 value
 of a function to whatever we like.

 I will prepare a patch for numpy.ctypeslib.

 

 It seems there isn't much interest in a patch - true?
   
No, I'm very interested in the patch.   Thanks for it.

-Travis

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Construct symmetric matrix

2009-04-04 Thread Pierre GM
All,
I'm trying to build a relatively complicated symmetric matrix. I can  
build the upper-right block without pb. What is the fastest way to get  
the LL corner from the UR one ?
Thanks a lot in advance for any idea.
P.
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] [ANN] Numpy 1.3.0rc2

2009-04-04 Thread Christopher Barker
 I am pleased to announce the release of the rc2 for numpy 1.3.0.

OS-X 10.4 Intel MacBook. Python.org Python 2.5:

Ran 2030 tests in 10.865s

OK (KNOWNFAIL=1, SKIP=1)


Looks good to me -- Thanks for all your work on this,

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion