Re: Need more comments from scientific community on python-dev
![](https://secure.gravatar.com/avatar/ffe1135f7c2f133f28adcf8c76539693.jpg?s=120&d=mm&r=g)
On 11/31/06, Fernando Perez <fperez.net@gmail.com> wrote:
I've been working on the OSX port and extensions for OpenGL-ctypes. (now released as PyOpenGL-3.00a, please test!). What Mike has done is define setuptools plugins to interface to different kinds of array data. The default type is ctypes arrays, or numpy arrays if numpy is installed. The data types handled are ctypes sized arrays, ctypes pointers, strings (read-only), and Python lists. (and old Numeric/ numarray via a non-default build.) Summaries of development and usage, resp, are found: http://pyopengl.sourceforge.net/ctypes/development.html http://pyopengl.sourceforge.net/ctypes/using.html Notes on array handling from the above:
Mike, can you give us your opinion on how a standardised data type descriptor would be helpful for PyOpenGL? The PEP and some information about it can be found here: http://www.scipy.org/ArrayInterfacePEP Cheers, Josh ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
![](https://secure.gravatar.com/avatar/109faffbfba5325ae74b67c0e4fe3928.jpg?s=120&d=mm&r=g)
Josh Marshall wrote:
Yes, this is the purpose of the design, to allow users to write new format handlers that can be registered at run-time and act as first-class data-formats within the system. PIL images, custom vector objects, memory-mapped files, media buffers and the like are all contemplated as useful array storage formats.
A standardised data-type descriptor would be of some benefit for us, as it would allow a single handler to deal with larger numbers of storage formats (reducing the amount of coding required). That said, the spec as proposed has far more features than *most* OpenGL users will use (OpenGL being largely (though not exclusively) focused on simple, homogeneous data-types), and the handler mechanism largely abstracts away the problem for *us* at the moment. We wouldn't be able to get rid of the abstraction mechanism entirely, as we would still have data-types such as lists-of-lists-of-integers that wouldn't support the protocol. The likely efficiency of accessing the metadata (versus current implementation where in some cases we wind up producing a whole dictionary object with meta-data just to pull out a single value) would be attractive. We also need functionality to get at the data-pointer for the objects to make any description useful, though I suppose that's out of scope for this particular PEP. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
![](https://secure.gravatar.com/avatar/5f37aff3d274a0effbf20be82804d012.jpg?s=120&d=mm&r=g)
On 11/4/06, Mike C. Fletcher <mcfletch@vrplumber.com> wrote:
Perhaps this will sound stupid, but I was thinking about extending some builtin Python types to provide datatype info. A list/tuple is an array of Python objects, an int/float/complex could return a datatype upon query. This could be very efficient if some predefined datatypes were already defined in the C-side. MPI provides predefined datatypes (MPI_INT, MPI_FLOAT) and new user-defined datatypes are created from them. -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
![](https://secure.gravatar.com/avatar/109faffbfba5325ae74b67c0e4fe3928.jpg?s=120&d=mm&r=g)
Josh Marshall wrote:
Yes, this is the purpose of the design, to allow users to write new format handlers that can be registered at run-time and act as first-class data-formats within the system. PIL images, custom vector objects, memory-mapped files, media buffers and the like are all contemplated as useful array storage formats.
A standardised data-type descriptor would be of some benefit for us, as it would allow a single handler to deal with larger numbers of storage formats (reducing the amount of coding required). That said, the spec as proposed has far more features than *most* OpenGL users will use (OpenGL being largely (though not exclusively) focused on simple, homogeneous data-types), and the handler mechanism largely abstracts away the problem for *us* at the moment. We wouldn't be able to get rid of the abstraction mechanism entirely, as we would still have data-types such as lists-of-lists-of-integers that wouldn't support the protocol. The likely efficiency of accessing the metadata (versus current implementation where in some cases we wind up producing a whole dictionary object with meta-data just to pull out a single value) would be attractive. We also need functionality to get at the data-pointer for the objects to make any description useful, though I suppose that's out of scope for this particular PEP. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
![](https://secure.gravatar.com/avatar/5f37aff3d274a0effbf20be82804d012.jpg?s=120&d=mm&r=g)
On 11/4/06, Mike C. Fletcher <mcfletch@vrplumber.com> wrote:
Perhaps this will sound stupid, but I was thinking about extending some builtin Python types to provide datatype info. A list/tuple is an array of Python objects, an int/float/complex could return a datatype upon query. This could be very efficient if some predefined datatypes were already defined in the C-side. MPI provides predefined datatypes (MPI_INT, MPI_FLOAT) and new user-defined datatypes are created from them. -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
participants (3)
-
Josh Marshall
-
Lisandro Dalcin
-
Mike C. Fletcher