From 36f1f79477d7445085973933174976ca91786adc Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Thu, 3 Oct 2024 22:47:03 +0100 Subject: [PATCH 1/4] use StructureDescrption() in tests This will fix #38760 --- src/sage/libs/gap/element.pyx | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx index 24db9c07cb8..9965b0aa4e4 100644 --- a/src/sage/libs/gap/element.pyx +++ b/src/sage/libs/gap/element.pyx @@ -2437,31 +2437,22 @@ cdef class GapElement_Function(GapElement): sage: b Sym( [ 1 .. 4 ] ) - sage: sorted(a(b)) - [Group(()), - Sym( [ 1 .. 4 ] ), - Alt( [ 1 .. 4 ] ), - Group([ (1,4)(2,3), (1,2)(3,4) ])] + sage: [x.StructureDescription() for x in sorted(b.NormalSubgroups()) + ["1", "S4", "A4", "C2 x C2"] sage: libgap.eval("a := NormalSubgroups") sage: libgap.eval("b := SymmetricGroup(4)") Sym( [ 1 .. 4 ] ) sage: libgap.collect() - sage: sorted(libgap.eval('a') (libgap.eval('b'))) - [Group(()), - Sym( [ 1 .. 4 ] ), - Alt( [ 1 .. 4 ] ), - Group([ (1,4)(2,3), (1,2)(3,4) ])] + sage: [x.StructureDescription() for x in sorted(libgap.eval('a') (libgap.eval('b')))] + ["1", "S4", "A4", "C2 x C2"] sage: a = libgap.eval('a') sage: b = libgap.eval('b') sage: libgap.collect() - sage: sorted(a(b)) - [Group(()), - Sym( [ 1 .. 4 ] ), - Alt( [ 1 .. 4 ] ), - Group([ (1,4)(2,3), (1,2)(3,4) ])] + sage: [x.StructureDescription() for x in sorted(b.NormalSubgroups()) + ["1", "S4", "A4", "C2 x C2"] Not every ``GapElement`` is callable:: From fe7e86c534613678a70c3e81984bba2cda0d8255 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Fri, 4 Oct 2024 09:28:24 +0200 Subject: [PATCH 2/4] fix syntax --- src/sage/libs/gap/element.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx index 9965b0aa4e4..4dcb750ae59 100644 --- a/src/sage/libs/gap/element.pyx +++ b/src/sage/libs/gap/element.pyx @@ -2437,7 +2437,7 @@ cdef class GapElement_Function(GapElement): sage: b Sym( [ 1 .. 4 ] ) - sage: [x.StructureDescription() for x in sorted(b.NormalSubgroups()) + sage: [x.StructureDescription() for x in sorted(b.NormalSubgroups())] ["1", "S4", "A4", "C2 x C2"] sage: libgap.eval("a := NormalSubgroups") @@ -2451,7 +2451,7 @@ cdef class GapElement_Function(GapElement): sage: a = libgap.eval('a') sage: b = libgap.eval('b') sage: libgap.collect() - sage: [x.StructureDescription() for x in sorted(b.NormalSubgroups()) + sage: [x.StructureDescription() for x in sorted(b.NormalSubgroups())] ["1", "S4", "A4", "C2 x C2"] Not every ``GapElement`` is callable:: From e6717eff1e31fddca40d5df9f326e7d1710d788e Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Fri, 4 Oct 2024 11:50:08 +0100 Subject: [PATCH 3/4] use a(b), not b.NormalSubgroups() Co-authored-by: Martin Rubey --- src/sage/libs/gap/element.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx index 4dcb750ae59..ffab3697999 100644 --- a/src/sage/libs/gap/element.pyx +++ b/src/sage/libs/gap/element.pyx @@ -2437,7 +2437,7 @@ cdef class GapElement_Function(GapElement): sage: b Sym( [ 1 .. 4 ] ) - sage: [x.StructureDescription() for x in sorted(b.NormalSubgroups())] + sage: [x.StructureDescription() for x in sorted(a(b))] ["1", "S4", "A4", "C2 x C2"] sage: libgap.eval("a := NormalSubgroups") From 08f203e353b62c1427554461e78d2e49e9552725 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Fri, 4 Oct 2024 11:50:37 +0100 Subject: [PATCH 4/4] use a(b), not b.NormalSubgroups() Co-authored-by: Martin Rubey --- src/sage/libs/gap/element.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx index ffab3697999..c24408f401a 100644 --- a/src/sage/libs/gap/element.pyx +++ b/src/sage/libs/gap/element.pyx @@ -2451,7 +2451,7 @@ cdef class GapElement_Function(GapElement): sage: a = libgap.eval('a') sage: b = libgap.eval('b') sage: libgap.collect() - sage: [x.StructureDescription() for x in sorted(b.NormalSubgroups())] + sage: [x.StructureDescription() for x in sorted(a(b))] ["1", "S4", "A4", "C2 x C2"] Not every ``GapElement`` is callable::