[Rpy] [patch] event processing on unix/OS X

2009-02-09 Thread Nathaniel Smith
Attached patch redoes process_revents (again); now it actually *works* on Unix (and I believe OS X, though someone should check). Which is nice. To test: >>> r("plot(1:10)") # window will appear # move the window around, resize it, etc.; it won't update >>> ri.process_revents() # window will redra

Re: [Rpy] [patch] expose R_MissingArg

2009-02-09 Thread Laurent Gautier
Nathaniel Smith wrote: > On Sun, Feb 8, 2009 at 2:22 AM, Laurent Gautier wrote: >> In the case of extracting elements from a matrix, there is a way >> (working in R, as well as in rpy2): >> >> m[2, TRUE] # Note the TRUE ! >> [1] 2 4 > > Ah, cute trick, thanks. > >> I'd be more keen on defining t

Re: [Rpy] [patch] rpy2 tip broken on Unix systems

2009-02-09 Thread Laurent Gautier
Nathaniel Smith wrote: > On Sun, Feb 8, 2009 at 2:01 PM, Laurent Gautier wrote: >> It turned out that a stale PYTHONPATH was getting an older version of rpy2 >> when running it on my end. >> So much for the cross-platform unifying bit. :/ >> >> Now the tip should build and run on Linux. > > It do

Re: [Rpy] [patch] expose R_MissingArg

2009-02-09 Thread Nathaniel Smith
On Mon, Feb 9, 2009 at 11:07 AM, Laurent Gautier wrote: > Yes. I would actually put at the rinterface/__init__.py level > (still at the rinterface level, but this would cut down on C-level > development time). Yeah, IME python wrapping is all about writing the thinnest barest-bones API possible i

Re: [Rpy] [patch] R 2.7 compatibility fix for rpy_device.c

2009-02-09 Thread Laurent Gautier
Nathaniel Smith wrote: > I tracked down that build error I've mentioned a few times with the > new graphics device code -- it's an R 2.7 vs. R 2.8 compatibility bug. > In 2.8, pDevDesc is (DevDesc *), but in 2.7 it's (NewDevDesc *), and > so trying to malloc a DevDesc doesn't work in 2.7, you need

Re: [Rpy] [patch] allow do_slot_assign to create new attributes

2009-02-09 Thread Laurent Gautier
Good catch. I suspect an overzealous copy/paste here. L. Nathaniel Smith wrote: > Currently, the following generates an exception: > s = ri.SexpVector([1, 2, 3, 4], ri.INTSXP) s.do_slot_assign("dim", ri.SexpVector([2, 2], ri.INTSXP) > > The issue is that s has no "dim" attribute to st

Re: [Rpy] [patch] event processing on unix/OS X

2009-02-09 Thread Laurent Gautier
I couldn't find that one incantation when I looked for it: R_runHandlers(R_InputHandlers, R_checkActivity(1, 1)); I change it to R_runHandlers(R_InputHandlers, R_checkActivity(0, 1)); because of https://stat.ethz.ch/pipermail/r-devel/2003-August/027281.html It is working on OS X as well. Tha

Re: [Rpy] [patch] event processing on unix/OS X

2009-02-09 Thread Nathaniel Smith
On Mon, Feb 9, 2009 at 2:45 PM, Laurent Gautier wrote: > > I couldn't find that one incantation when I looked for it: > R_runHandlers(R_InputHandlers, R_checkActivity(1, 1)); > > I change it to > R_runHandlers(R_InputHandlers, R_checkActivity(0, 1)); > because of > https://stat.ethz.ch/pipermail/

Re: [Rpy] [patch] R 2.7 compatibility fix for rpy_device.c

2009-02-09 Thread Nathaniel Smith
On Mon, Feb 9, 2009 at 1:06 PM, Laurent Gautier wrote: > I suppose that your have strong arguments for not moving from R-2.7 to R-2.8 > ? NewDevDesc was a transition entity and has gone away with R-2.8. > (It's still a moving target, but the target R for rpy2-2.1 by the time it > gets ready will l

Re: [Rpy] [patch] R 2.7 compatibility fix for rpy_device.c

2009-02-09 Thread Peter
On Mon, Feb 9, 2009 at 9:06 PM, Laurent Gautier wrote: > > I have no strong preference on the matter. I often get by with whatever > default the Emacs on the system has, but I can accommodate with no-tabs > if wished (although now comes The Question: how many spaces ?). > If you are talking about

Re: [Rpy] [patch] R 2.7 compatibility fix for rpy_device.c

2009-02-09 Thread Dirk Eddelbuettel
On 9 February 2009 at 14:39, Nathaniel Smith wrote: | On Mon, Feb 9, 2009 at 1:06 PM, Laurent Gautier wrote: | > I suppose that your have strong arguments for not moving from R-2.7 to R-2.8 | > ? NewDevDesc was a transition entity and has gone away with R-2.8. | > (It's still a moving target, but

Re: [Rpy] [patch] R 2.7 compatibility fix for rpy_device.c

2009-02-09 Thread Nathaniel Smith
On Mon, Feb 9, 2009 at 3:46 PM, Dirk Eddelbuettel wrote: > See http://cran.r-project.org/bin/linux/ubuntu/ -- see the detailed > README. New versions are typically available within days of R releases as > properly built and maintained .deb packages for the different Ubuntu flavours > in both x86 (

[Rpy] [patch] trivial console output fix

2009-02-09 Thread Nathaniel Smith
It turns out that the new definition of consolePrint (that I wrote, *cough*) is totally broken -- it tries to write to sys.stdout, and it's in a module that imports sys, but... there's some code in the middle that does 'del sys'. So console output just doesn't work right now. Fix: https://bitbucke

[Rpy] [patch] the Big R Lock

2009-02-09 Thread Nathaniel Smith
Currently, calls into R via rpy2 are *mostly* protected by the Python global interpreter lock. That means that calling rpy2 functions from different threads *almost* just works (even though R is not itself re-entrant). However, it happens from time to time that R calls back into Python (most common