Skip to content

Commit 430d7d6

Browse files
author
Release Manager
committed
sagemathgh-37076: src/sage/tests/gap_packages.py: remove These tests for the installed GAP packages are problematic in a world where Sage can use GAP from the system. Particularly, loading _all_ installed GAP packages is not a safe operation when there might be an enormous number of them. Moreover, with the system GAP, it's not really Sage's reponsibility to ensure that the installed packages load. It _would_ be nice to know that any extra packages from the gap_packages SPKG are installed correctly; however, that type of test would be more appropriate in that SPKG's spkg-check phase. Dependencies: - sagemath#37049 URL: sagemath#37076 Reported by: Michael Orlitzky Reviewer(s): Antonio Rojas
2 parents f435411 + 8d6bdbf commit 430d7d6

26 files changed

+466
-397
lines changed

.github/workflows/ci-conda-known-test-failures.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,5 @@
7676
},
7777
"sage.structure.coerce_actions": {
7878
"failed": "random failure https://github.com/sagemath/sage/issues/35973"
79-
},
80-
"sage.tests.gap_packages": {
81-
"failed": true
8279
}
8380
}

build/pkgs/configure/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=c72fc2006b1702e74f38c480b0376e3e6c8a5758
3-
md5=a650e8682fe75708f679eabe918d2aa7
4-
cksum=785462498
2+
sha1=8124eeddb2d440bd40f9656a8f69ce53175a4706
3+
md5=db7e8fb79c8cd9a69e8cc6865e43add9
4+
cksum=719116257
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
919b021b0c103e4fb798cc784218015e0a515510
1+
0c16f847a4db786d105c48e79bf3bc3fe07d82fc

src/doc/bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,4 @@ cat <<EOF
210210
211211
EOF
212212
) > "$OUTPUT_INDEX"
213-
sage-package list --has-file SPKG.rst | OUTPUT_DIR=$OUTPUT_DIR OUTPUT_RST=1 xargs -P 0 -n 1 sage-spkg-info
213+
sage-package list --has-file SPKG.rst | OUTPUT_DIR=$OUTPUT_DIR OUTPUT_RST=1 xargs -P 99 -n 1 sage-spkg-info

src/doc/en/reference/references/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2444,6 +2444,11 @@ REFERENCES:
24442444
J. Graph Algorithms and Applications 15 (2): 269-293, 2011.
24452445
:doi:`10.7155/jgaa.00226`, :arxiv:`0705.1025`.
24462446
2447+
.. [EPSV2023] Jonathan Komada Eriksen, Lorenz Panny, Jana Sotáková, and Mattia Veroni.
2448+
Deuring for the People: Supersingular Elliptic Curves with Prescribed
2449+
Endomorphism Ring in General Characteristic.
2450+
LuCaNT 2023. https://ia.cr/2023/106
2451+
24472452
.. [Eri1995] \H. Erikson. Computational and Combinatorial Aspects
24482453
of Coxeter Groups. Thesis, 1995.
24492454

src/sage/categories/unital_algebras.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,7 @@ def __init_extra__(self):
107107
0
108108
sage: F(3)
109109
3*B[0]
110-
111-
sage: class Bar(Parent):
112-
....: _no_generic_basering_coercion = True
113-
sage: Bar(category=Algebras(QQ))
114-
doctest:warning...:
115-
DeprecationWarning: the attribute _no_generic_basering_coercion is deprecated, implement _coerce_map_from_base_ring() instead
116-
See https://github.com/sagemath/sage/issues/19225 for details.
117-
<__main__.Bar_with_category object at 0x...>
118110
"""
119-
if getattr(self, '_no_generic_basering_coercion', False):
120-
from sage.misc.superseded import deprecation
121-
deprecation(19225, "the attribute _no_generic_basering_coercion is deprecated, implement _coerce_map_from_base_ring() instead")
122-
return
123-
124111
base_ring = self.base_ring()
125112
if base_ring is self:
126113
# There are rings that are their own base rings. No need to register that.

src/sage/homology/free_resolution.py

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
.. MATH::
99
10-
R^{n_1} \xleftarrow{d_1} R^{n_1} \xleftarrow{d_2}
10+
R^{n_0} \xleftarrow{d_1} R^{n_1} \xleftarrow{d_2}
1111
\cdots \xleftarrow{d_k} R^{n_k} \xleftarrow{d_{k+1}} 0
1212
1313
terminating with a zero module at the end that is exact (all homology groups
@@ -242,9 +242,20 @@ def _repr_module(self, i):
242242
'S^2'
243243
sage: r # indirect doctest
244244
S^1 <-- S^3 <-- S^2 <-- 0
245+
246+
TESTS::
247+
248+
sage: S.<x,y,z> = PolynomialRing(QQ)
249+
sage: I = S.ideal(0)
250+
sage: C = I.free_resolution()
251+
sage: C
252+
S^1 <-- 0
245253
"""
246254
if i == 0:
247-
r = self._maps[0].nrows()
255+
if self._length > 0:
256+
r = self._maps[0].nrows()
257+
else:
258+
r = self._initial_differential.domain().dimension()
248259
s = f'{self._name}^{r}'
249260
return s
250261
elif i > self._length:
@@ -422,6 +433,8 @@ def __getitem__(self, i):
422433
raise IndexError('invalid index')
423434
elif i > self._length:
424435
F = FreeModule(self._base_ring, 0)
436+
elif i == 0:
437+
F = self.differential(0).domain()
425438
elif i == self._length:
426439
F = FreeModule(self._base_ring, self._maps[i - 1].ncols())
427440
else:
@@ -444,11 +457,12 @@ def differential(self, i):
444457
sage: r
445458
S(0) <-- S(-2)⊕S(-2)⊕S(-2) <-- S(-3)⊕S(-3) <-- 0
446459
sage: r.differential(3)
447-
Free module morphism defined by the matrix []
448-
Domain: Ambient free module of rank 0 over the integral domain
449-
Multivariate Polynomial Ring in x, y, z, w over Rational Field
450-
Codomain: Ambient free module of rank 2 over the integral domain
451-
Multivariate Polynomial Ring in x, y, z, w over Rational Field
460+
Free module morphism defined as left-multiplication by the matrix
461+
[]
462+
Domain: Ambient free module of rank 0 over the integral domain
463+
Multivariate Polynomial Ring in x, y, z, w over Rational Field
464+
Codomain: Ambient free module of rank 2 over the integral domain
465+
Multivariate Polynomial Ring in x, y, z, w over Rational Field
452466
sage: r.differential(2)
453467
Free module morphism defined as left-multiplication by the matrix
454468
[-y x]
@@ -476,6 +490,31 @@ def differential(self, i):
476490
[-z^2 + y*w]
477491
[ y*z - x*w]
478492
[-y^2 + x*z]
493+
494+
TESTS::
495+
496+
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
497+
sage: S = P2.coordinate_ring()
498+
sage: I = S.ideal(0)
499+
sage: C = I.graded_free_resolution(); C
500+
S(0) <-- 0
501+
sage: C[1]
502+
Ambient free module of rank 0 over the integral domain
503+
Multivariate Polynomial Ring in x, y, z over Rational Field
504+
sage: C[0]
505+
Ambient free module of rank 1 over the integral domain
506+
Multivariate Polynomial Ring in x, y, z over Rational Field
507+
sage: C.differential(1)
508+
Free module morphism defined as left-multiplication by the matrix
509+
[]
510+
Domain: Ambient free module of rank 0 over the integral domain
511+
Multivariate Polynomial Ring in x, y, z over Rational Field
512+
Codomain: Ambient free module of rank 1 over the integral domain
513+
Multivariate Polynomial Ring in x, y, z over Rational Field
514+
sage: C.differential(1).matrix()
515+
[]
516+
sage: C.differential(1).matrix().dimensions()
517+
(1, 0)
479518
"""
480519
if i < 0:
481520
raise IndexError('invalid index')
@@ -484,14 +523,17 @@ def differential(self, i):
484523
return self._initial_differential
485524
except AttributeError:
486525
raise ValueError('0th differential map undefined')
487-
elif i == self._length + 1:
488-
s = FreeModule(self._base_ring, 0)
489-
t = FreeModule(self._base_ring, self._maps[i - 2].ncols())
490-
m = s.hom(0, t)
491526
elif i > self._length + 1:
492527
s = FreeModule(self._base_ring, 0)
493528
t = FreeModule(self._base_ring, 0)
494-
m = s.hom(0, t)
529+
m = s.hom(0, t, side='right')
530+
elif i == self._length + 1:
531+
s = FreeModule(self._base_ring, 0)
532+
if self._length > 0:
533+
t = FreeModule(self._base_ring, self._maps[i - 2].ncols())
534+
else:
535+
t = self._initial_differential.domain()
536+
m = s.hom(0, t, side='right')
495537
else:
496538
s = FreeModule(self._base_ring, self._maps[i - 1].ncols())
497539
t = FreeModule(self._base_ring, self._maps[i - 1].nrows())

src/sage/logic/booleval.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
sage: booleval.eval_formula(t, d)
2424
False
2525
"""
26-
#*****************************************************************************
26+
# ****************************************************************************
2727
# Copyright (C) 2006 Chris Gorecki <[email protected]>
2828
# Copyright (C) 2013 Paul Scurek <[email protected]>
2929
#
3030
# Distributed under the terms of the GNU General Public License (GPL)
3131
# as published by the Free Software Foundation; either version 2 of
3232
# the License, or (at your option) any later version.
33-
# http://www.gnu.org/licenses/
34-
#*****************************************************************************
33+
# https://www.gnu.org/licenses/
34+
# ****************************************************************************
3535

3636
from . import logicparser
3737

@@ -72,8 +72,8 @@ def eval_formula(tree, vdict):
7272
"""
7373
global __vars
7474
__vars = vdict
75-
b = logicparser.apply_func(tree, eval_f)
76-
return b
75+
return logicparser.apply_func(tree, eval_f)
76+
7777

7878
def eval_f(tree):
7979
r"""
@@ -104,6 +104,7 @@ def eval_f(tree):
104104
"""
105105
return eval_op(tree[0], tree[1], tree[2])
106106

107+
107108
def eval_op(op, lv, rv):
108109
r"""
109110
Evaluate ``lv`` and ``rv`` according to the operator ``op``.

src/sage/logic/boolformula.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
('->', '\\rightarrow ')]
149149

150150

151-
class BooleanFormula():
151+
class BooleanFormula:
152152
"""
153153
Boolean formulas.
154154
@@ -673,10 +673,7 @@ def is_satisfiable(self):
673673
False
674674
"""
675675
table = self.truthtable().get_table_list()
676-
for row in table[1:]:
677-
if row[-1] is True:
678-
return True
679-
return False
676+
return any(row[-1] is True for row in table[1:])
680677

681678
def is_tautology(self):
682679
r"""
@@ -1309,11 +1306,11 @@ def reduce_op(self, tree):
13091306
if tree[0] == '<->':
13101307
# parse tree for (~tree[1]|tree[2])&(~tree[2]|tree[1])
13111308
new_tree = ['&', ['|', ['~', tree[1], None], tree[2]],
1312-
['|', ['~', tree[2], None], tree[1]]]
1309+
['|', ['~', tree[2], None], tree[1]]]
13131310
elif tree[0] == '^':
13141311
# parse tree for (tree[1]|tree[2])&~(tree[1]&tree[2])
13151312
new_tree = ['&', ['|', tree[1], tree[2]],
1316-
['~', ['&', tree[1], tree[2]], None]]
1313+
['~', ['&', tree[1], tree[2]], None]]
13171314
elif tree[0] == '->':
13181315
# parse tree for ~tree[1]|tree[2]
13191316
new_tree = ['|', ['~', tree[1], None], tree[2]]
@@ -1354,10 +1351,7 @@ def dist_not(self, tree):
13541351
if tree[0] == '~' and isinstance(tree[1], list):
13551352
op = tree[1][0]
13561353
if op != '~':
1357-
if op == '&':
1358-
op = '|'
1359-
else:
1360-
op = '&'
1354+
op = '|' if op == '&' else '&'
13611355
new_tree = [op, ['~', tree[1][1], None], ['~', tree[1][2], None]]
13621356
return logicparser.apply_func(new_tree, self.dist_not)
13631357
else:

0 commit comments

Comments
 (0)