Re: [sage-devel] No output from GAP

2019-05-06 Thread E. Madison Bray
On Mon, May 6, 2019 at 12:25 AM Andrey Novoseltsev  wrote:
>
> OK, here is me not trying to rely on implicit printing by REPL:
>
> sage: gap.eval("Print({});".format(10^1))
> '10'
> sage: gap.eval("Print({});".format(10^10))
> '100'
> sage: gap.eval("Print({});".format(10^100))
> ''
>
> Is gap pexpect interface still used internally? If not, it seems that 
> consistent end-user behaviour is important, while those who want optimization 
> should use libgap...

It is used quite extensively internally to poor performance in several
areas.  The plan is to get rid of it (or at least its use or internal
operations).  See e.g.

https://trac.sagemath.org/ticket/27594
https://trac.sagemath.org/ticket/26960
https://trac.sagemath.org/ticket/26963

About 2 or 3 weeks ago I made *significant* progress in practically
eliminating use of the pexpect interface for permutation groups, at
least by default, switching over to instead using libgap with some
performance improvement, especially on Windows.

But then I was stymied by this issue:
https://trac.sagemath.org/ticket/27681   I thought that at first it
was caused by my work on permutation groups, but it turns out to be
unrelated.  However, simply using libgap more extensively internally
makes that issue that much more severe and likely to be encountered,
so I think it needs to be solved first.  I still haven't posted a
ticket for that work, I don't think, but I will soon.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-05-05 Thread Nils Bruin
 On Sunday, May 5, 2019 at 3:25:27 PM UTC-7, Andrey Novoseltsev wrote:
>
> OK, here is me not trying to rely on implicit printing by REPL:
>
> sage: gap.eval("Print({});".format(10^1))
> '10'
> sage: gap.eval("Print({});".format(10^10))
> '100'
> sage: gap.eval("Print({});".format(10^100))
> ''
>
OK that's a bug. Disabling transer-via-file is a workaround. It doesn't fix 
the bug. I don't think discarding the eval_by_file option is a good 
solution, because it was put in for a very real problem (although I don't 
know if the hardcoded length 100 threshold for the gap interface is well 
tuned).  

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-05-05 Thread Andrey Novoseltsev
OK, here is me not trying to rely on implicit printing by REPL:

sage: gap.eval("Print({});".format(10^1))
'10'
sage: gap.eval("Print({});".format(10^10))
'100'
sage: gap.eval("Print({});".format(10^100))
''

Is gap pexpect interface still used internally? If not, it seems that 
consistent end-user behaviour is important, while those who want 
optimization should use libgap...

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-05-05 Thread Nils Bruin
On Sunday, May 5, 2019 at 12:04:32 PM UTC-7, Andrey Novoseltsev wrote:
>
>
> It seems to me that the best fix for the current situation is to prohibit 
> using files completely. Any reasons NOT to do it?
>
> One reason is that pexpect has a rather high per-character overhead, so 
when sending over *lots* of data, it can get really slow. Writing to a file 
can be much faster in those cases. When using the interface "manually", it 
may not feel so strange to incur this penalty, but the idea of the 
interface was that it could also be used internally, to seamlessly delegate 
computational tasks to gap without the user explicitly asking to use an 
interface. Then one may end up sending over quite substantial data (for a 
matrix group, or something like that). The stateful design of the 
interfaces allows this to happen without undue communication over the 
interface: once the object has been created in Gap, it can be referenced 
via its proxy instance in sage, which knows which gap variable to reference 
to get access to the object. But the first instantiation turns out to have 
a measurable impact in many cases.

Interfaces are not designed for interactive work, in particular not for 
creating side effects like printing to the console. You can print the proxy 
object if you want. I'd say the best way to get consistent behaviour is to 
not rely on implicit printing by the REPL.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-05-05 Thread Andrey Novoseltsev
Here is the logic of executing GAP commands via files:

if it has := before "
  write it to file as is
otherwise
  wrap it in Print( )
execute via Read() which has no input on its own

However when multiple commands are fed into gap.eval as in the original 
post, they all are combined into a single line for which the above 
algorithm makes no sense - if there is an assignment there will be no 
output and if there is no assignment multiple commands will be wrapped in a 
single Print resulting in an error inside GAP.

Perhaps it is supposed that there is some logic breaking up multiple 
commands into separate "lines", but it is obviously broken and in general 
it is not straightforward since one has to take into account comments, 
strings, and compound operators like loops.

It seems to me that the best fix for the current situation is to prohibit 
using files completely. Any reasons NOT to do it?

I also played a bit with libgap.eval and while it requires a "single" 
command and complains if I give many, it is happy to accept compound 
statements like loops. Which makes me think that its restriction on having 
a single command only is a bit artificial/non-essential. Does anyone know 
why it is present?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-05-03 Thread E. Madison Bray
On Fri, May 3, 2019 at 5:10 PM E. Madison Bray  wrote:
>
> On Fri, May 3, 2019 at 5:06 PM E. Madison Bray  wrote:
> >
> > On Mon, Apr 29, 2019 at 2:30 AM Andrey Novoseltsev  
> > wrote:
> > >
> > > Hello,
> > >
> > > I got a report about GAP problem in SageMathCell, but it looks like the 
> > > GAP interface in Sage itself is having issues. I am getting an empty 
> > > string from the following command:
> > > sage: print(gap.eval("""
> > > : D_4 := SmallGroup(8,3);
> > > : IsAbelian( D_4 );
> > > : List( ConjugacyClasses( D_4 ), Size );
> > > : IsCyclic( D_4 );
> > > : Size( AllSubgroups( D_4 ) );
> > > : Size( Set( D_4, Order ) );
> > > : IsSolvable( D_4 );"""))
> > >
> > > All commands work fine in GAP and even in Sage each one seems to be 
> > > working, but certain combinations of them do not, while some do - I can't 
> > > understand the system here...
> > >
> > > Does anyone have any ideas on what is going on?
> >
> > It might be a bug in the pexpect interface I guess.  If I try, say,
> > just the first 2 or 3 snippets of the code you gave above I get the
> > full output.  But by the `Size( AllSubgroups( D_4 ) );` it becomes
> > empty.  I if I do just `D_4 := SmallGroup(8,3); Size( AllSubgroups(
> > D_4 ) );` it produces the correct output.
>
> Oh duh, I re-read the rest of the thread, and as Vincent pointed out,
> this is above the (seemingly arbitrary?) _eval_using_file_cutoff.
>
> I'm not sure why that's so buggy but I'm sure we can figure it out...

I see; it's because it writes the commands to a file, and then
executes the file in GAP by calling Read(...) on the filename, which
doesn't necessarily produce output for each command.  This is just
like the difference in Python between entering several lines of code
one-by-one in the REPL, versus simply executing a script.  You won't
see the result of each line unless it were wrapped in Print() or
something.  Surely there is a better solution...

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-05-03 Thread E. Madison Bray
On Fri, May 3, 2019 at 5:06 PM E. Madison Bray  wrote:
>
> On Mon, Apr 29, 2019 at 2:30 AM Andrey Novoseltsev  wrote:
> >
> > Hello,
> >
> > I got a report about GAP problem in SageMathCell, but it looks like the GAP 
> > interface in Sage itself is having issues. I am getting an empty string 
> > from the following command:
> > sage: print(gap.eval("""
> > : D_4 := SmallGroup(8,3);
> > : IsAbelian( D_4 );
> > : List( ConjugacyClasses( D_4 ), Size );
> > : IsCyclic( D_4 );
> > : Size( AllSubgroups( D_4 ) );
> > : Size( Set( D_4, Order ) );
> > : IsSolvable( D_4 );"""))
> >
> > All commands work fine in GAP and even in Sage each one seems to be 
> > working, but certain combinations of them do not, while some do - I can't 
> > understand the system here...
> >
> > Does anyone have any ideas on what is going on?
>
> It might be a bug in the pexpect interface I guess.  If I try, say,
> just the first 2 or 3 snippets of the code you gave above I get the
> full output.  But by the `Size( AllSubgroups( D_4 ) );` it becomes
> empty.  I if I do just `D_4 := SmallGroup(8,3); Size( AllSubgroups(
> D_4 ) );` it produces the correct output.

Oh duh, I re-read the rest of the thread, and as Vincent pointed out,
this is above the (seemingly arbitrary?) _eval_using_file_cutoff.

I'm not sure why that's so buggy but I'm sure we can figure it out...

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-05-03 Thread E. Madison Bray
On Mon, Apr 29, 2019 at 2:30 AM Andrey Novoseltsev  wrote:
>
> Hello,
>
> I got a report about GAP problem in SageMathCell, but it looks like the GAP 
> interface in Sage itself is having issues. I am getting an empty string from 
> the following command:
> sage: print(gap.eval("""
> : D_4 := SmallGroup(8,3);
> : IsAbelian( D_4 );
> : List( ConjugacyClasses( D_4 ), Size );
> : IsCyclic( D_4 );
> : Size( AllSubgroups( D_4 ) );
> : Size( Set( D_4, Order ) );
> : IsSolvable( D_4 );"""))
>
> All commands work fine in GAP and even in Sage each one seems to be working, 
> but certain combinations of them do not, while some do - I can't understand 
> the system here...
>
> Does anyone have any ideas on what is going on?

It might be a bug in the pexpect interface I guess.  If I try, say,
just the first 2 or 3 snippets of the code you gave above I get the
full output.  But by the `Size( AllSubgroups( D_4 ) );` it becomes
empty.  I if I do just `D_4 := SmallGroup(8,3); Size( AllSubgroups(
D_4 ) );` it produces the correct output.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-04-30 Thread Andrey Novoseltsev
The use case here is: take a snippet of GAP code, execute it, and display 
the result. GAP is one of the languages "supported" by SageMathCell and it 
is done via print gap.eval(...) It is not really for users of Sage who need 
GAP functionality, it is an easy way for GAP users to embed live 
computations into web pages.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-04-30 Thread Dima Pasechnik
On Tue, Apr 30, 2019 at 1:37 PM E. Madison Bray  wrote:
>
> On Tue, Apr 30, 2019 at 6:55 AM Dima Pasechnik  wrote:
> >
> > On Tue, Apr 30, 2019 at 1:18 AM Andrey Novoseltsev  
> > wrote:
> > >
> > > On Monday, 29 April 2019 14:20:39 UTC-6, Dima Pasechnik wrote:
> > >>
> > >> would it be easier to switch to libgap?
> > >
> > >
> > > Do you mean this? 
> > > http://doc.sagemath.org/html/en/reference/libs/sage/libs/gap/libgap.html?highlight=libgap#sage.libs.gap.libgap.Gap.eval
> > > There is however a restriction on no trailing semicolon.
> >
> > the trailing ';' is ignored, it's not a restriction.
> >
> > > For SageMathCell it is very likely that the input contains several 
> > > commands (as it was the case for the original example here).
> >
> > OK, several commands won't work  - but I don't understand the use case here.
> > Are you trying to emulate gap_console() ?
>
> Of course, you can just do something like `for line in
> lines.split(';'): libgap.eval(line)`.
>
> I would avoid writing any new code that uses the GAP pexpect interface
> unless absolutely necessary.  If writing significant quantities of GAP
> code to be executed by Sage better to put it in an actual .g file and
> run it in GAP with `ReadFile`.

or use libgap.function_factory()
--- for nontrivial GAP functions to be called from Sage.

>
>
> > >What can be done in this case? Just splitting on l; is likely to break on 
> > >comments and strings.
> > >
> > >>
> > >> On Mon, Apr 29, 2019 at 5:54 PM Andrey Novoseltsev  
> > >> wrote:
> > >> >
> > >> > Reminded me of this old issue with Macaulay2 many years ago: 
> > >> > https://trac.sagemath.org/ticket/5467 I wonder if it is something 
> > >> > similar here...
> > >> >
> > >> > --
> > >> > You received this message because you are subscribed to the Google 
> > >> > Groups "sage-devel" group.
> > >> > To unsubscribe from this group and stop receiving emails from it, send 
> > >> > an email to sage-...@googlegroups.com.
> > >> > To post to this group, send email to sage-...@googlegroups.com.
> > >> > Visit this group at https://groups.google.com/group/sage-devel.
> > >> > For more options, visit https://groups.google.com/d/optout.
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "sage-devel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to sage-devel+unsubscr...@googlegroups.com.
> > > To post to this group, send email to sage-devel@googlegroups.com.
> > > Visit this group at https://groups.google.com/group/sage-devel.
> > > For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "sage-devel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to sage-devel+unsubscr...@googlegroups.com.
> > To post to this group, send email to sage-devel@googlegroups.com.
> > Visit this group at https://groups.google.com/group/sage-devel.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-04-30 Thread E. Madison Bray
On Tue, Apr 30, 2019 at 6:55 AM Dima Pasechnik  wrote:
>
> On Tue, Apr 30, 2019 at 1:18 AM Andrey Novoseltsev  wrote:
> >
> > On Monday, 29 April 2019 14:20:39 UTC-6, Dima Pasechnik wrote:
> >>
> >> would it be easier to switch to libgap?
> >
> >
> > Do you mean this? 
> > http://doc.sagemath.org/html/en/reference/libs/sage/libs/gap/libgap.html?highlight=libgap#sage.libs.gap.libgap.Gap.eval
> > There is however a restriction on no trailing semicolon.
>
> the trailing ';' is ignored, it's not a restriction.
>
> > For SageMathCell it is very likely that the input contains several commands 
> > (as it was the case for the original example here).
>
> OK, several commands won't work  - but I don't understand the use case here.
> Are you trying to emulate gap_console() ?

Of course, you can just do something like `for line in
lines.split(';'): libgap.eval(line)`.

I would avoid writing any new code that uses the GAP pexpect interface
unless absolutely necessary.  If writing significant quantities of GAP
code to be executed by Sage better to put it in an actual .g file and
run it in GAP with `ReadFile`.


> >What can be done in this case? Just splitting on l; is likely to break on 
> >comments and strings.
> >
> >>
> >> On Mon, Apr 29, 2019 at 5:54 PM Andrey Novoseltsev  
> >> wrote:
> >> >
> >> > Reminded me of this old issue with Macaulay2 many years ago: 
> >> > https://trac.sagemath.org/ticket/5467 I wonder if it is something 
> >> > similar here...
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google 
> >> > Groups "sage-devel" group.
> >> > To unsubscribe from this group and stop receiving emails from it, send 
> >> > an email to sage-...@googlegroups.com.
> >> > To post to this group, send email to sage-...@googlegroups.com.
> >> > Visit this group at https://groups.google.com/group/sage-devel.
> >> > For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "sage-devel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to sage-devel+unsubscr...@googlegroups.com.
> > To post to this group, send email to sage-devel@googlegroups.com.
> > Visit this group at https://groups.google.com/group/sage-devel.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-04-29 Thread Dima Pasechnik
On Tue, Apr 30, 2019 at 1:18 AM Andrey Novoseltsev  wrote:
>
> On Monday, 29 April 2019 14:20:39 UTC-6, Dima Pasechnik wrote:
>>
>> would it be easier to switch to libgap?
>
>
> Do you mean this? 
> http://doc.sagemath.org/html/en/reference/libs/sage/libs/gap/libgap.html?highlight=libgap#sage.libs.gap.libgap.Gap.eval
> There is however a restriction on no trailing semicolon.

the trailing ';' is ignored, it's not a restriction.

> For SageMathCell it is very likely that the input contains several commands 
> (as it was the case for the original example here).

OK, several commands won't work  - but I don't understand the use case here.
Are you trying to emulate gap_console() ?


>What can be done in this case? Just splitting on l; is likely to break on 
>comments and strings.
>
>>
>> On Mon, Apr 29, 2019 at 5:54 PM Andrey Novoseltsev  wrote:
>> >
>> > Reminded me of this old issue with Macaulay2 many years ago: 
>> > https://trac.sagemath.org/ticket/5467 I wonder if it is something similar 
>> > here...
>> >
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "sage-devel" group.
>> > To unsubscribe from this group and stop receiving emails from it, send an 
>> > email to sage-...@googlegroups.com.
>> > To post to this group, send email to sage-...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/sage-devel.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-04-29 Thread Andrey Novoseltsev
On Monday, 29 April 2019 14:20:39 UTC-6, Dima Pasechnik wrote:
>
> would it be easier to switch to libgap? 
>

Do you mean this? 
http://doc.sagemath.org/html/en/reference/libs/sage/libs/gap/libgap.html?highlight=libgap#sage.libs.gap.libgap.Gap.eval
There is however a restriction on no trailing semicolon. For SageMathCell 
it is very likely that the input contains several commands (as it was the 
case for the original example here). What can be done in this case? Just 
splitting on l; is likely to break on comments and strings.


> On Mon, Apr 29, 2019 at 5:54 PM Andrey Novoseltsev  > wrote: 
> > 
> > Reminded me of this old issue with Macaulay2 many years ago: 
> https://trac.sagemath.org/ticket/5467 I wonder if it is something similar 
> here... 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "sage-devel" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to sage-...@googlegroups.com . 
> > To post to this group, send email to sage-...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/sage-devel. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-04-29 Thread Dima Pasechnik
would it be easier to switch to libgap?

On Mon, Apr 29, 2019 at 5:54 PM Andrey Novoseltsev  wrote:
>
> Reminded me of this old issue with Macaulay2 many years ago: 
> https://trac.sagemath.org/ticket/5467 I wonder if it is something similar 
> here...
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-04-29 Thread Andrey Novoseltsev
Reminded me of this old issue with Macaulay2 many years ago: 
https://trac.sagemath.org/ticket/5467 I wonder if it is something similar 
here...

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-04-29 Thread Andrey Novoseltsev
Thank you for the confirmation and debugging, Vincent!

It was pointed out to me that we even have it documented:
http://doc.sagemath.org/html/en/reference/interfaces/sage/interfaces/gap.html#long-input
Is it really that difficult to fix??? Surely there has to be some reason 
and solution for this behaviour...

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-04-28 Thread Vincent Delecroix

The option `allow_use_file` seems to be the problem as setting it
to False make the issue disappear.

sage: for i in range(10):
: print(i)
: gap.eval("D_4 := SmallGroup(8,3);;" + "IsSolvable(D_4);"*i, 
allow_use_file=False)

0
''
1
'true'
2
'true\ntrue'
3
'true\ntrue\ntrue'
4
'true\ntrue\ntrue\ntrue'
5
'true\ntrue\ntrue\ntrue\ntrue'
6
'true\ntrue\ntrue\ntrue\ntrue\ntrue'
7
'true\ntrue\ntrue\ntrue\ntrue\ntrue\ntrue'
8
'true\ntrue\ntrue\ntrue\ntrue\ntrue\ntrue\ntrue'
9
'true\ntrue\ntrue\ntrue\ntrue\ntrue\ntrue\ntrue\ntrue'


Le 29/04/2019 à 04:28, Vincent Delecroix a écrit :

I confirm the bug on arch. It seems to me that there is
something related to the "input length" (but nothing about the
specific commands)

sage: for i in range(10):
: print(i)
: gap.eval("D_4 := SmallGroup(8,3);;" + "IsSolvable(D_4);" * i)
0
''
1
'true'
2
'true\ntrue'
3
'true\ntrue\ntrue'
4
'true\ntrue\ntrue\ntrue'
5
''
6
''
7
''
8
''
9
''

Vincent

Le 29/04/2019 à 02:30, Andrey Novoseltsev a écrit :

Hello,

I got a report about GAP problem in SageMathCell, but it looks like 
the GAP

interface in Sage itself is having issues. I am getting an empty string
from the following command:
sage: print(gap.eval("""
: D_4 := SmallGroup(8,3);
: IsAbelian( D_4 );
: List( ConjugacyClasses( D_4 ), Size );
: IsCyclic( D_4 );
: Size( AllSubgroups( D_4 ) );
: Size( Set( D_4, Order ) );
: IsSolvable( D_4 );"""))

All commands work fine in GAP and even in Sage each one seems to be
working, but certain combinations of them do not, while some do - I can't
understand the system here...

Does anyone have any ideas on what is going on?

Thank you!
Andrey



--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] No output from GAP

2019-04-28 Thread Vincent Delecroix

I confirm the bug on arch. It seems to me that there is
something related to the "input length" (but nothing about the
specific commands)

sage: for i in range(10):
: print(i)
: gap.eval("D_4 := SmallGroup(8,3);;" + "IsSolvable(D_4);" * i)
0
''
1
'true'
2
'true\ntrue'
3
'true\ntrue\ntrue'
4
'true\ntrue\ntrue\ntrue'
5
''
6
''
7
''
8
''
9
''

Vincent

Le 29/04/2019 à 02:30, Andrey Novoseltsev a écrit :

Hello,

I got a report about GAP problem in SageMathCell, but it looks like the GAP
interface in Sage itself is having issues. I am getting an empty string
from the following command:
sage: print(gap.eval("""
: D_4 := SmallGroup(8,3);
: IsAbelian( D_4 );
: List( ConjugacyClasses( D_4 ), Size );
: IsCyclic( D_4 );
: Size( AllSubgroups( D_4 ) );
: Size( Set( D_4, Order ) );
: IsSolvable( D_4 );"""))

All commands work fine in GAP and even in Sage each one seems to be
working, but certain combinations of them do not, while some do - I can't
understand the system here...

Does anyone have any ideas on what is going on?

Thank you!
Andrey



--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] No output from GAP

2019-04-28 Thread Andrey Novoseltsev
Hello,

I got a report about GAP problem in SageMathCell, but it looks like the GAP 
interface in Sage itself is having issues. I am getting an empty string 
from the following command:
sage: print(gap.eval("""
: D_4 := SmallGroup(8,3);
: IsAbelian( D_4 );
: List( ConjugacyClasses( D_4 ), Size );
: IsCyclic( D_4 );
: Size( AllSubgroups( D_4 ) );
: Size( Set( D_4, Order ) );
: IsSolvable( D_4 );"""))

All commands work fine in GAP and even in Sage each one seems to be 
working, but certain combinations of them do not, while some do - I can't 
understand the system here...

Does anyone have any ideas on what is going on?

Thank you!
Andrey

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.