[Numpy-discussion] PyArray_FromDimsAndData: Numeric interface to PyCObject data

Berthold Höllmann hoel at gl-group.com
Thu Sep 16 06:40:03 EDT 2004


Hello,

For integrating some codes I try to use PyCObjects with Numeric
interfaces. I have PyCObjects that contain several arrays. I want to
provide these arrays to Python as Numeric arrays using
PyArray_FromDimsAndData, the arrays could grow quite large, so I want
to handle arround references, not copies. Of course this is
dangerous. If I destroy the PyCObject and try to access the Numeric
array referencing its data later, who knows what happens. It would be
nice to have some callback function slot to allow to increase the
refcount of the PyCObject when a Numeric array with a reference is
created and to decrease it when the array is deleted. Is there a way
to achive this. 

Further after skimming over the numarray documentation it seems
PyArray_FromDimsAndData and similar functions for numarray are copiing
the data instead of using a reference. Is this true? If yes, is it
planned to provide a method for generating numarray arrays using
references only?

Kind regards

Berthold Höllmann
-- 
Germanischer Lloyd AG
CAE Development
Vorsetzen 35
20459 Hamburg
Phone: +49(0)40 36149-7374
Fax: +49(0)40 36149-7320
e-mail: hoel at gl-group.com
Internet: http://www.gl-group.com 
 
 
 
This e-mail contains confidential information for the exclusive attention of the intended addressee. Any access of third parties to this e-mail is unauthorised. Any use of this e-mail by unintended recipients such as copying, distribution, disclosure etc. is prohibited and may be unlawful. When addressed to our clients the content of this e-mail is subject to the General Terms and Conditions of GL's Group of Companies applicable at the date of this e-mail.  
 
GL's Group of Companies does not warrant and/or guarantee that this message at the moment of receipt is authentic, correct and its communication free of errors, interruption etc.  
 




More information about the NumPy-Discussion mailing list