thegooglecodearchive / sfepy

Automatically exported from code.google.com/p/sfepy
0 stars 0 forks source link

live plotting #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

Plotting curves while doing computations is cool, but currently the plot is
freezed/does not repaint until pylab.show() is called, which in turn
freezes the computation.

To resolve this, plotting would have to be done in a separate thread.

Original issue reported on code.google.com by robert.c...@gmail.com on 13 Nov 2008 at 2:28

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Well, but Python doesn't have threads, only "threads", right? Maybe use 
multiprocessing? 

Original comment by ondrej.c...@gmail.com on 13 Nov 2008 at 2:39

GoogleCodeExporter commented 9 years ago
Yep. It seems there is no an easy way to run a GUI event-loop outside the main
thread. I have now looked at my matplotlib archives and found that the only 
reliable
option is probably using a separate process. How is it done in ipython, do you 
have
any idea?

Original comment by robert.c...@gmail.com on 13 Nov 2008 at 2:45

GoogleCodeExporter commented 9 years ago
No, but multiprocessing uses a separate process, so it should work nicely. Let 
me
know how it goes.

Original comment by ondrej.c...@gmail.com on 13 Nov 2008 at 2:54

GoogleCodeExporter commented 9 years ago
The multiprocessing package [1] looks good, but is new in 2.6 - I will try [2] 
(which
looks the same).

[1] http://docs.python.org/dev/library/multiprocessing.html
[2] http://pyprocessing.berlios.de/

Original comment by robert.c...@gmail.com on 13 Nov 2008 at 4:13

GoogleCodeExporter commented 9 years ago
Use this:

http://code.google.com/p/python-multiprocessing/

Original comment by ondrej.c...@gmail.com on 13 Nov 2008 at 4:17

GoogleCodeExporter commented 9 years ago
Nice, was not aware of it. As "The multiprocessing package itself is a renamed 
and
updated version of R Oudkerk's pyprocessing package.", I may try both 
(pyprocessing
is in gentoo repo).

Original comment by robert.c...@gmail.com on 13 Nov 2008 at 4:22

GoogleCodeExporter commented 9 years ago
Yeah, but there may be more api changes. Anyway, please report how it goes.

Original comment by ondrej.c...@gmail.com on 13 Nov 2008 at 4:32

GoogleCodeExporter commented 9 years ago
Changeset http://hg.sympy.org/sfepy/rev/c32c3c739968 implements the live 
plotting
using the multiprocessing module + GTKAgg backend.

Original comment by robert.c...@gmail.com on 20 Nov 2008 at 2:28

GoogleCodeExporter commented 9 years ago
Migrated to http://github.com/sfepy/sfepy/issues/66

Original comment by robert.c...@gmail.com on 30 Jan 2012 at 10:25