Skip to content

Commit ba46dfa

Browse files
committed
src/sage/groups/perm_gps/permgroup_named.py: speed up a slow test
Fix the CI warning, 2025-07-14T18:38:36.5676939Z ##[warning]slow doctest: 2025-07-14T18:38:36.5679618Z all(SmallPermutationGroup(n,k).id() == [n,k] 2025-07-14T18:38:36.5681631Z for n in [1..64] for k in [1..numgps(n)]) # long time (180s) 2025-07-14T18:38:36.5683632Z Test ran for 67.66s cpu, 71.13s wall by making two few improvements: * Move the "long time" tag to the right line. * Check only a random subset of (up to five) n and k, rather than n <= 64 and all possible k.
1 parent 5fda5a5 commit ba46dfa

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/sage/groups/perm_gps/permgroup_named.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3505,16 +3505,24 @@ class SmallPermutationGroup(PermutationGroup_generic):
35053505
Group of order 12 and GAP Id 4 as a permutation group
35063506
sage: G.gens()
35073507
((4,5), (1,2), (3,4,5))
3508-
sage: G.character_table() # needs sage.rings.number_field
3508+
sage: G.character_table() # needs sage.rings.number_field
35093509
[ 1 1 1 1 1 1]
35103510
[ 1 -1 1 -1 1 -1]
35113511
[ 1 -1 1 1 -1 1]
35123512
[ 1 1 1 -1 -1 -1]
35133513
[ 2 0 -1 -2 0 1]
35143514
[ 2 0 -1 2 0 -1]
35153515
sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n))
3516-
sage: all(SmallPermutationGroup(n,k).id() == [n,k]
3517-
....: for n in [1..64] for k in [1..numgps(n)]) # long time (180s)
3516+
sage: # verify at most five n and k, randomly, to save time
3517+
sage: from random import sample
3518+
sage: ns = sample([1..64], 5)
3519+
sage: def ks(n):
3520+
....: ngps = numgps(n)
3521+
....: ssize = min(5, ngps)
3522+
....: return sample([1..ngps], ssize)
3523+
sage: all(SmallPermutationGroup(n,k).id() == [n,k] # long time
3524+
....: for n in ns
3525+
....: for k in ks(n))
35183526
True
35193527
sage: H = SmallPermutationGroup(6,1)
35203528
sage: H.is_abelian()

0 commit comments

Comments
 (0)