From: jniemasik <nie...@gm...> - 2011-10-26 01:19:13
|
Hi all, Google App Engine recently added an experimental Python 2.7 option, and along with it, support for numpy. App Engine only allows pure python code to be uploaded. But now that numpy is available on the server, I was hoping I could create a pure python build of matplotlib that I can run on App Engine. Any suggestions on how to do this (existing tutorial, or at least which backend to use, etc.)? Is it possible? Many thanks, Jamie -- View this message in context: http://old.nabble.com/Pure-python-matplotlib-for-Google-App-Engine-tp32721389p32721389.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Benjamin R. <ben...@ou...> - 2011-10-26 02:11:31
|
On Tuesday, October 25, 2011, jniemasik <nie...@gm...> wrote: > > Hi all, > > Google App Engine recently added an experimental Python 2.7 option, and > along with it, support for numpy. > > App Engine only allows pure python code to be uploaded. But now that numpy > is available on the server, I was hoping I could create a pure python build > of matplotlib that I can run on App Engine. > > Any suggestions on how to do this (existing tutorial, or at least which > backend to use, etc.)? Is it possible? > > Many thanks, > Jamie Thats neat. I hadn't heard that numpy was made available. The big obstacles are the compiled portions. That rules out the AGG backend and any others that uses it. This would also impact some important polish that makes mpl look good. There is - somewhere - an html5 backend, but I haven't tried it. The other obstacle are the other compiled parts that handle some of the critical parts. For example, there is src/cntr.c for contouring, _image.cpp for things like imshow(), nxutils.c, and _path.cpp, which provides the widely used path calculation support. There are others as well, and they all get wrapped by CXX. Would the app engine support cython code? Maybe that could be the way to minimize the cost of portting while not losing too much performance? Cheers! Ben Root |
From: Benjamin R. <ben...@ou...> - 2011-10-26 06:40:48
|
On Tuesday, October 25, 2011, jniemasik <nie...@gm...> wrote: > > Hi all, > > Google App Engine recently added an experimental Python 2.7 option, and > along with it, support for numpy. > > App Engine only allows pure python code to be uploaded. But now that numpy > is available on the server, I was hoping I could create a pure python build > of matplotlib that I can run on App Engine. > > Any suggestions on how to do this (existing tutorial, or at least which > backend to use, etc.)? Is it possible? > > Many thanks, > Jamie One thing I just noticed is that PIL is available.in the app engine I wonder if a PIL based backend might be suitable for replacing the compiled _png.so used for writing png images and maybe some other formats in the app engine? Ben Root |
From: Michael D. <md...@st...> - 2011-10-26 18:14:00
|
On 10/26/2011 02:40 AM, Benjamin Root wrote: > > > On Tuesday, October 25, 2011, jniemasik <nie...@gm... > <mailto:nie...@gm...>> wrote: > > > > Hi all, > > > > Google App Engine recently added an experimental Python 2.7 option, and > > along with it, support for numpy. > > > > App Engine only allows pure python code to be uploaded. But now > that numpy > > is available on the server, I was hoping I could create a pure > python build > > of matplotlib that I can run on App Engine. > > > > Any suggestions on how to do this (existing tutorial, or at least which > > backend to use, etc.)? Is it possible? > > > > Many thanks, > > Jamie > > One thing I just noticed is that PIL is available.in > <http://available.in> the app engine I wonder if a PIL based backend > might be suitable for replacing the compiled _png.so used for writing > png images and maybe some other formats in the app engine? With the pure Python backends (PS, PDF, SVG) you should be able to do most things, except actually rasterize an image... but since it's a webapp anyway, SVG should suffice and have it rendered in the client. Of course there are still pieces that would need to be rewritten in Python -- contouring, path simplification, geometry functions, font handling. I don't know if the PIL FontImage support would suffice as a replacement for the freetype wrapper we currently have -- otherwise reimplementing freetype in Python (even to just get the font metrics) is probably considerable work. In other words, it's possible, but not as it stands without rewriting a lot of C++ code in Python. Mike |
From: Jamie N. <nie...@gm...> - 2011-10-29 22:47:10
|
Thanks Michael and Benjamin — this answers all my questions. On Wednesday, October 26, 2011 at 11:11 AM, Michael Droettboom wrote: > On 10/26/2011 02:40 AM, Benjamin Root wrote: > > > > > > On Tuesday, October 25, 2011, jniemasik <nie...@gm... (mailto:nie...@gm...)> wrote: > > > > > > Hi all, > > > > > > Google App Engine recently added an experimental Python 2.7 option, and > > > along with it, support for numpy. > > > > > > App Engine only allows pure python code to be uploaded. But now that numpy > > > is available on the server, I was hoping I could create a pure python build > > > of matplotlib that I can run on App Engine. > > > > > > Any suggestions on how to do this (existing tutorial, or at least which > > > backend to use, etc.)? Is it possible? > > > > > > Many thanks, > > > Jamie > > > > One thing I just noticed is that PIL is available.in (http://available.in) the app engine I wonder if a PIL based backend might be suitable for replacing the compiled _png.so used for writing png images and maybe some other formats in the app engine? > With the pure Python backends (PS, PDF, SVG) you should be able to do most things, except actually rasterize an image... but since it's a webapp anyway, SVG should suffice and have it rendered in the client. Of course there are still pieces that would need to be rewritten in Python -- contouring, path simplification, geometry functions, font handling. I don't know if the PIL FontImage support would suffice as a replacement for the freetype wrapper we currently have -- otherwise reimplementing freetype in Python (even to just get the font metrics) is probably considerable work. > > In other words, it's possible, but not as it stands without rewriting a lot of C++ code in Python. > > Mike > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Cisco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... (mailto:Mat...@li...) > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |