Hi Thomas,

Thanks for the contribution. Is your code released under a particular license, or could it be incorporated in the main code base for rpy2 ?

I'd see few things to tweak (for example make the class a singleton to prevent problems when calling several times rliveenvents.start() without calling rliveevents.stop() in between), but that would be an helpful addition.

Best,


Laurent


On 23/11/10 23:20, Thomas Kluyver wrote:
Hi all,

Working with rpy2, I ran into the "why isn't my graph updating when I resize the window?" question. I found the answer in the rinterface documentation [http://rpy.sourceforge.net/rpy2/doc-2.1/html/rinterface.html#rinterface-interactive-processevents], but I thought I could improve on it in a few ways: - The updates thread outlives the main thread, and stops the interpreter from exiting
- There's no obvious way to stop the updater when you no longer need it
- If it tries to call process_revents() while R is drawing a graph, it hits a runtime error

I have a small module which seems to solve all of these problems, but I think it would be better as part of rpy2, so that you could do something like:

from rpy2 import robjects, rliveevents
# Do stuff
rliveevents.stop()  # If you want to save performance
# Do more stuff
rliveevents.start()  # Start processing events again
# Yet more stuff
# Thread will automatically stop on exit (daemon mode)

I've put the code here: http://pastebin.com/DPzJMCEV

Thanks,
Thomas


------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App&  Earn a Chance To Win $500!
Tap into the largest installed PC base&  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev


_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to