>
> > So I feel like pexpect must be doing something naughty.  Does anyone
> > have any ideas what might be going on so I can use more data?
>
> I tried this experiment: I added spaces to the first string to be
> evaluated.  When the string has length <= 1024, it seems to work, and when
> the string has length > 1024, it doesn't.  For example:
>
>     sage: s = 'matrix(c(1, 1, 1, 1,' + ' '*987 + '2,2,2,2), ncol=4)'
>     sage: len(s)
>     1024
>     sage: r.eval(s)
>     '     [,1] [,2] [,3] [,4]\n[1,]    1    1    2    2\n[2,]    1    1    
> 2    2'
>     sage: s = 'matrix(c(1, 1, 1, 1,' + ' '*988 + '2,2,2,2), ncol=4)'
>     sage: len(s)
>     1025
>     sage: r.eval(s)
>     ''
>
> I don't know why, but maybe that can help you track it down.

Thanks - that definitely helps, since pexpect is actually passing
strings.

At http://pexpect.sourceforge.net/pexpect.html I see
"The maxread attribute sets the read buffer size. This is maximum
number
of bytes that Pexpect will try to read from a TTY at one time. Setting
the maxread size to 1 will turn off buffering. Setting the maxread
value higher may help performance in cases where large amounts of
output are read back from the child. "

Can a pexpect expert help me here?  It seems like we have

maxread=100000

for R (and most other interfaces), which would seem to be plenty of
bytes for a 1000-character string, if that is what maxread controls.

Doing it in R "by hand" allows me arbitrarily long things (well, 'by
hand' arbitrary) so that is definitely not the bottleneck.  And I
don't see this problem in Maxima (I am using an older version of Sage
without the library interface for Maxima/ECL, so this is a relevant
data point).

Thanks to anyone!

- kcrisman

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to