From: Venkat R. <ven...@gm...> - 2009-12-18 18:47:36
|
Hi all, First off, thanks for the great work. I've been dabbling with Python for a bit aiming to move away from Matlab. A few days ago, to do some NMR simulation, I started coding with vpython and the 3D-plots are incredible. Great experience for a newbie 3D programmer like me. Anyway, for developing python programs, I've found ipython very useful. The interactivity is just great and there are many more features. See here (http://ipython.scipy.org/) However, vpython and ipython don't interact very well. 1a. If we run the programs through ipython, when we close the vpython window it crashes the ipython as well. The prompt (terminal properties) is affected as well. Why? 1b. If we don't close the window we can run the program again in the ipython prompt. However it doesn't reuse the existing plot. It opens a new window and during a debugging session, a number of windows are opened. Is it possible to reuse the existing vpython window? 2. This is related to the vector() object used in vpython. Is it in anyway related to the numpy array() or matrix() object? I've been passing the pos/axis of arrows with numpy arrays and it seems to work. Is there a difference in using vector() as opposed to numpy.array? 3. Is there a matrix object similar to vector? I'm using the numpy array and matrix objects now to represent the rotation matrix. I'm using Ubuntu-9.10 64 bit, with the Boost fixes described previously in the list. Thanks, Venkat. |
From: James M. <mu...@pi...> - 2009-12-19 15:14:10
|
I haven't tried this, but people might want to look at this page. http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/example_mlab_visual.html The mlab package works with ipython, and this is an attempt to implement a Vpython-like api within it. Again, I haven't tried it, so I can't offer any review of it. -Jim On Dec 18, 2009, at 1:47 PM, Venkat Ramanan wrote: > Hi all, > > First off, thanks for the great work. > > I've been dabbling with Python for a bit aiming to move away from > Matlab. A few days ago, to do some NMR simulation, I started coding > with vpython and the 3D-plots are incredible. Great experience for a > newbie 3D programmer like me. > > Anyway, for developing python programs, I've found ipython very > useful. The interactivity is just great and there are many more > features. See here (http://ipython.scipy.org/) > > However, vpython and ipython don't interact very well. > > 1a. If we run the programs through ipython, when we close the vpython > window it crashes the ipython as well. The prompt (terminal > properties) is affected as well. Why? > > 1b. If we don't close the window we can run the program again in the > ipython prompt. However it doesn't reuse the existing plot. It opens a > new window and during a debugging session, a number of windows are > opened. Is it possible to reuse the existing vpython window? > > 2. This is related to the vector() object used in vpython. Is it in > anyway related to the numpy array() or matrix() object? I've been > passing the pos/axis of arrows with numpy arrays and it seems to work. > Is there a difference in using vector() as opposed to numpy.array? > > 3. Is there a matrix object similar to vector? I'm using the numpy > array and matrix objects now to represent the rotation matrix. > > I'm using Ubuntu-9.10 64 bit, with the Boost fixes described > previously in the list. > > Thanks, > Venkat. > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast > and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Guy K. K. <g....@ma...> - 2009-12-19 19:50:37
|
On Sun, 20 Dec 2009 04:13:58 James Mueller wrote: > Again, I haven't tried it, so I can't offer any review of it. I can somewhat help out there ... I've tested that Visual module. It's somewhat more geared towards the Visual 3.x API, it's *quite* a bit slower than visual, and it's not as feature rich. Also there are some draw backs due to bugs/limitations in the traits implementation limiting the range of usable sizes, etc. Some code also has to be (slightly) adapted to fit that visual API of Mayavi. Performance can be somewhat boosted significantly by switching to the Qt4 backend over the default wx windowing backend. Still, performance is not nearly as good as with Visual Python. I did a presentation with a paper at the last Kiwi PyCon touching this topic. The slides are here: http://www.slideshare.net/XEmacs/python-data-plotting-and-visualisation- extravaganza A paper of that is soon to be published under the Python Papers Monograph Series for that: http://pythonpapers.org Guy -- Guy K. Kloss Institute of Information and Mathematical Sciences Te Kura Pūtaiao o Mōhiohio me Pāngarau Massey University, Albany (North Shore City, Auckland) 473 State Highway 17, Gate 1, Mailroom, Quad B Building voice: +64 9 414-0800 ext. 9585 fax: +64 9 441-8181 G....@ma... http://www.massey.ac.nz/~gkloss |
From: Venkat R. <ven...@gm...> - 2009-12-22 15:25:16
|
Hi all, Thanks for the visual link. I've previously used VTK using Octaviz, which is an Octave interface to VTK. Octaviz is very easy to use, makes good plots. But animations using it is slow, many primitives like 3D-arrows are limited in functionality and sadly Octaviz is not being developed anymore, as far as I know. It is not even present in the 9.10 Ubuntu repositories. In general, VTK has a lot of options, but needlessly complicated for me. On the other hand, vpython is simple to setup and fast. It basically took only a few minutes to get the basics of it. BTW, regarding issue 1b of my original post, I was stupidly calling display every time the script was run. If I don't call it, it reuses the last display and it is fine. Can someone please comment on the remaining issues? 1. vector() versus numpy array differences? Basically what is better to use and why? 2. If only I can get ipython to play nice with vpython, I'm basically all set. Is it something on the ipython side or in vpython? I can hack something together, if there are some pointers. Thanks, Venkat. PS: I meant to send the reply to the list, but it was mistakenly sent personally to Guy Kloss. On Sat, Dec 19, 2009 at 2:52 PM, Guy K. Kloss <g....@ma...> wrote: > On Sun, 20 Dec 2009 04:13:58 James Mueller wrote: >> Again, I haven't tried it, so I can't offer any review of it. > > I can somewhat help out there ... > > I've tested that Visual module. It's somewhat more geared towards the Visual > 3.x API, it's *quite* a bit slower than visual, and it's not as feature rich. > Also there are some draw backs due to bugs/limitations in the traits > implementation limiting the range of usable sizes, etc. Some code also has to > be (slightly) adapted to fit that visual API of Mayavi. > > Performance can be somewhat boosted significantly by switching to the Qt4 > backend over the default wx windowing backend. Still, performance is not > nearly as good as with Visual Python. > > I did a presentation with a paper at the last Kiwi PyCon touching this topic. > The slides are here: > > http://www.slideshare.net/XEmacs/python-data-plotting-and-visualisation- > extravaganza > > A paper of that is soon to be published under the Python Papers Monograph > Series for that: http://pythonpapers.org > > Guy > > -- > Guy K. Kloss > Institute of Information and Mathematical Sciences > Te Kura Pūtaiao o Mōhiohio me Pāngarau > Massey University, Albany (North Shore City, Auckland) > 473 State Highway 17, Gate 1, Mailroom, Quad B Building > voice: +64 9 414-0800 ext. 9585 fax: +64 9 441-8181 > G....@ma... http://www.massey.ac.nz/~gkloss > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Bruce S. <Bru...@nc...> - 2009-12-22 16:26:45
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=UTF-8" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> I apologize for not responding to your earlier question about vectors. The Visual "vector" is designed to mimic the properties of 3D vectors used in math and science (add, subtract, magnitude, dot and cross product, etc.). The numpy module provides a very large number of structures and operations on arrays, which makes it possible to do scientific processing in Python where using lists would be unbearably slow. One uses Visual vectors for describing positions of Visual objects, and general geometric calculations related to 3D displays. The VPython example programs gas.py and stars.py are examples of the use of numpy arrays for doing numerical integrations of motion for many objects in single array statements.<br> <br> I've never used ipython and don't know what the problem is (I've only used IDLE or the more recent VIDLE). I would guess that the problem is with Visual, not with ipython, but I don't know. If you're willing to delve into Visual to see what the problem is (and maybe fix it), great!<br> <br> Bruce Sherwood<br> <br> Venkat Ramanan wrote: <blockquote cite="mid:c29...@ma..." type="cite"> <pre wrap="">Hi all, Thanks for the visual link. I've previously used VTK using Octaviz, which is an Octave interface to VTK. Octaviz is very easy to use, makes good plots. But animations using it is slow, many primitives like 3D-arrows are limited in functionality and sadly Octaviz is not being developed anymore, as far as I know. It is not even present in the 9.10 Ubuntu repositories. In general, VTK has a lot of options, but needlessly complicated for me. On the other hand, vpython is simple to setup and fast. It basically took only a few minutes to get the basics of it. BTW, regarding issue 1b of my original post, I was stupidly calling display every time the script was run. If I don't call it, it reuses the last display and it is fine. Can someone please comment on the remaining issues? 1. vector() versus numpy array differences? Basically what is better to use and why? 2. If only I can get ipython to play nice with vpython, I'm basically all set. Is it something on the ipython side or in vpython? I can hack something together, if there are some pointers. Thanks, Venkat. PS: I meant to send the reply to the list, but it was mistakenly sent personally to Guy Kloss. On Sat, Dec 19, 2009 at 2:52 PM, Guy K. Kloss <a class="moz-txt-link-rfc2396E" href="mailto:g....@ma..."><g....@ma...></a> wrote: </pre> <blockquote type="cite"> <pre wrap="">On Sun, 20 Dec 2009 04:13:58 James Mueller wrote: </pre> <blockquote type="cite"> <pre wrap="">Again, I haven't tried it, so I can't offer any review of it. </pre> </blockquote> <pre wrap="">I can somewhat help out there ... I've tested that Visual module. It's somewhat more geared towards the Visual 3.x API, it's *quite* a bit slower than visual, and it's not as feature rich. Also there are some draw backs due to bugs/limitations in the traits implementation limiting the range of usable sizes, etc. Some code also has to be (slightly) adapted to fit that visual API of Mayavi. Performance can be somewhat boosted significantly by switching to the Qt4 backend over the default wx windowing backend. Still, performance is not nearly as good as with Visual Python. I did a presentation with a paper at the last Kiwi PyCon touching this topic. The slides are here: <a class="moz-txt-link-freetext" href="http://www.slideshare.net/XEmacs/python-data-plotting-and-visualisation">http://www.slideshare.net/XEmacs/python-data-plotting-and-visualisation</a>- extravaganza A paper of that is soon to be published under the Python Papers Monograph Series for that: <a class="moz-txt-link-freetext" href="http://pythonpapers.org">http://pythonpapers.org</a> Guy -- Guy K. Kloss Institute of Information and Mathematical Sciences Te Kura Pūtaiao o Mōhiohio me Pāngarau Massey University, Albany (North Shore City, Auckland) 473 State Highway 17, Gate 1, Mailroom, Quad B Building voice: +64 9 414-0800 ext. 9585 fax: +64 9 441-8181 <a class="moz-txt-link-abbreviated" href="mailto:G....@ma...">G....@ma...</a> <a class="moz-txt-link-freetext" href="http://www.massey.ac.nz/~gkloss">http://www.massey.ac.nz/~gkloss</a> ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/verizon-dev2dev">http://p.sf.net/sfu/verizon-dev2dev</a> _______________________________________________ Visualpython-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Vis...@li...">Vis...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/visualpython-users">https://lists.sourceforge.net/lists/listinfo/visualpython-users</a> </pre> </blockquote> <pre wrap=""><!----> ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/verizon-dev2dev">http://p.sf.net/sfu/verizon-dev2dev</a> _______________________________________________ Visualpython-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Vis...@li...">Vis...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/visualpython-users">https://lists.sourceforge.net/lists/listinfo/visualpython-users</a> </pre> </blockquote> </body> </html> |
From: Venkat R. <ven...@gm...> - 2009-12-22 20:49:18
|
Bruce, Thanks for the helpful info. In fact, I'm using numpy arrays similar to the VPython examples to update pos/axis. I installed VIDLE and that works for me as well. I don't know if I can fix the issues with ipython, but I'll try. Thanks again, Venkat. On Tue, Dec 22, 2009 at 11:26 AM, Bruce Sherwood <Bru...@nc...> wrote: > I apologize for not responding to your earlier question about vectors. The > Visual "vector" is designed to mimic the properties of 3D vectors used in > math and science (add, subtract, magnitude, dot and cross product, etc.). > The numpy module provides a very large number of structures and operations > on arrays, which makes it possible to do scientific processing in Python > where using lists would be unbearably slow. One uses Visual vectors for > describing positions of Visual objects, and general geometric calculations > related to 3D displays. The VPython example programs gas.py and stars.py are > examples of the use of numpy arrays for doing numerical integrations of > motion for many objects in single array statements. > > I've never used ipython and don't know what the problem is (I've only used > IDLE or the more recent VIDLE). I would guess that the problem is with > Visual, not with ipython, but I don't know. If you're willing to delve into > Visual to see what the problem is (and maybe fix it), great! > > Bruce Sherwood > > Venkat Ramanan wrote: > > Hi all, > > Thanks for the visual link. I've previously used VTK using Octaviz, > which is an Octave interface to VTK. Octaviz is very easy to use, > makes good plots. But animations using it is slow, many primitives > like 3D-arrows are limited in functionality and sadly Octaviz is not > being developed anymore, as far as I know. It is not even present in > the 9.10 Ubuntu repositories. > > In general, VTK has a lot of options, but needlessly complicated for > me. On the other hand, vpython is simple to setup and fast. It > basically took only a few minutes to get the basics of it. > > BTW, regarding issue 1b of my original post, I was stupidly calling > display every time the script was run. If I don't call it, it reuses > the last display and it is fine. > > Can someone please comment on the remaining issues? > > 1. vector() versus numpy array differences? Basically what is better > to use and why? > > 2. If only I can get ipython to play nice with vpython, I'm basically > all set. Is it something on the ipython side or in vpython? > I can hack something together, if there are some pointers. > > Thanks, > Venkat. > > PS: I meant to send the reply to the list, but it was mistakenly sent > personally to Guy Kloss. > > On Sat, Dec 19, 2009 at 2:52 PM, Guy K. Kloss <g....@ma...> wrote: > > > On Sun, 20 Dec 2009 04:13:58 James Mueller wrote: > > > Again, I haven't tried it, so I can't offer any review of it. > > > I can somewhat help out there ... > > I've tested that Visual module. It's somewhat more geared towards the Visual > 3.x API, it's *quite* a bit slower than visual, and it's not as feature > rich. > Also there are some draw backs due to bugs/limitations in the traits > implementation limiting the range of usable sizes, etc. Some code also has > to > be (slightly) adapted to fit that visual API of Mayavi. > > Performance can be somewhat boosted significantly by switching to the Qt4 > backend over the default wx windowing backend. Still, performance is not > nearly as good as with Visual Python. > > I did a presentation with a paper at the last Kiwi PyCon touching this > topic. > The slides are here: > > http://www.slideshare.net/XEmacs/python-data-plotting-and-visualisation- > extravaganza > > A paper of that is soon to be published under the Python Papers Monograph > Series for that: http://pythonpapers.org > > Guy > > -- > Guy K. Kloss > Institute of Information and Mathematical Sciences > Te Kura Pūtaiao o Mōhiohio me Pāngarau > Massey University, Albany (North Shore City, Auckland) > 473 State Highway 17, Gate 1, Mailroom, Quad B Building > voice: +64 9 414-0800 ext. 9585 fax: +64 9 441-8181 > G....@ma... http://www.massey.ac.nz/~gkloss > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |
From: Guy K. K. <g....@ma...> - 2009-12-23 01:20:05
|
On Wed, 23 Dec 2009 09:49:07 Venkat Ramanan wrote: > I installed VIDLE and that works for me as well. I don't know if I can > fix the issues with ipython, but I'll try. If one looks at the documentation/tutorials for matplotlib (-pylab), Mayavi (- wthread), ... one finds that for ipython you need to start it with an extra parameter (the ones mentioned in parens above). The problem being that for GUI tools in order to function within the same process there's an event loop. But an interactive shell is somewhat of an event loop in itself. So some de- coupling needs to be done to integrate the two event loop concepts with each other. ipython provides that through the switches. I'd imagine that this was also one of the motivations to provide VIDLE over plain IDLE, although I've never used IDLE myself. Maybe one of the provided ipython switches would also help with VPython, or another one would need to be created to make them interact nicely. Definitely sounds like something that could be quite useful ... Guy -- Guy K. Kloss Institute of Information and Mathematical Sciences Te Kura Pūtaiao o Mōhiohio me Pāngarau Massey University, Albany (North Shore City, Auckland) 473 State Highway 17, Gate 1, Mailroom, Quad B Building voice: +64 9 414-0800 ext. 9585 fax: +64 9 441-8181 G....@ma... http://www.massey.ac.nz/~gkloss |
From: Michele M. <mat...@gm...> - 2009-12-23 09:34:48
|
Hi all, Visual use a gtk main loop to manage the display. the ipython -gthread switch will do the trick. Using the pylab switch instead will start the pylab interface using the backend configured on your matplotlib (~/matplotlib/matplotlibrc on Linux.) On ubuntu the default backend is gtk so ipython -gthread or ipython -pylab has the same effect, except some numpy function which are directly imported in the global namespace. HTH, Michele. On Wed, Dec 23, 2009 at 2:22 AM, Guy K. Kloss <g....@ma...> wrote: > On Wed, 23 Dec 2009 09:49:07 Venkat Ramanan wrote: > > I installed VIDLE and that works for me as well. I don't know if I can > > fix the issues with ipython, but I'll try. > > If one looks at the documentation/tutorials for matplotlib (-pylab), Mayavi > (- > wthread), ... one finds that for ipython you need to start it with an extra > parameter (the ones mentioned in parens above). The problem being that for > GUI > tools in order to function within the same process there's an event loop. > But > an interactive shell is somewhat of an event loop in itself. So some de- > coupling needs to be done to integrate the two event loop concepts with > each > other. ipython provides that through the switches. > > I'd imagine that this was also one of the motivations to provide VIDLE over > plain IDLE, although I've never used IDLE myself. Maybe one of the provided > ipython switches would also help with VPython, or another one would need to > be > created to make them interact nicely. Definitely sounds like something that > could be quite useful ... > > Guy > > -- > Guy K. Kloss > Institute of Information and Mathematical Sciences > Te Kura Pūtaiao o Mōhiohio me Pāngarau > Massey University, Albany (North Shore City, Auckland) > 473 State Highway 17, Gate 1, Mailroom, Quad B Building > voice: +64 9 414-0800 ext. 9585 fax: +64 9 441-8181 > G....@ma... http://www.massey.ac.nz/~gkloss<http://www.massey.ac.nz/%7Egkloss> > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and > easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |