Skip to content

Commit

Permalink
gh-37076: src/sage/tests/gap_packages.py: remove
Browse files Browse the repository at this point in the history
    
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:

- #37049
    
URL: #37076
Reported by: Michael Orlitzky
Reviewer(s): Antonio Rojas
  • Loading branch information
Release Manager committed Feb 1, 2024
2 parents 6cb86d9 + 8d6bdbf commit e7d8602
Show file tree
Hide file tree
Showing 26 changed files with 466 additions and 397 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci-conda-known-test-failures.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,5 @@
},
"sage.structure.coerce_actions": {
"failed": "random failure https://github.com/sagemath/sage/issues/35973"
},
"sage.tests.gap_packages": {
"failed": true
}
}
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=c72fc2006b1702e74f38c480b0376e3e6c8a5758
md5=a650e8682fe75708f679eabe918d2aa7
cksum=785462498
sha1=8124eeddb2d440bd40f9656a8f69ce53175a4706
md5=db7e8fb79c8cd9a69e8cc6865e43add9
cksum=719116257
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
919b021b0c103e4fb798cc784218015e0a515510
0c16f847a4db786d105c48e79bf3bc3fe07d82fc
2 changes: 1 addition & 1 deletion src/doc/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,4 @@ cat <<EOF
EOF
) > "$OUTPUT_INDEX"
sage-package list --has-file SPKG.rst | OUTPUT_DIR=$OUTPUT_DIR OUTPUT_RST=1 xargs -P 0 -n 1 sage-spkg-info
sage-package list --has-file SPKG.rst | OUTPUT_DIR=$OUTPUT_DIR OUTPUT_RST=1 xargs -P 99 -n 1 sage-spkg-info
5 changes: 5 additions & 0 deletions src/doc/en/reference/references/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2444,6 +2444,11 @@ REFERENCES:
J. Graph Algorithms and Applications 15 (2): 269-293, 2011.
:doi:`10.7155/jgaa.00226`, :arxiv:`0705.1025`.
.. [EPSV2023] Jonathan Komada Eriksen, Lorenz Panny, Jana Sotáková, and Mattia Veroni.
Deuring for the People: Supersingular Elliptic Curves with Prescribed
Endomorphism Ring in General Characteristic.
LuCaNT 2023. https://ia.cr/2023/106
.. [Eri1995] \H. Erikson. Computational and Combinatorial Aspects
of Coxeter Groups. Thesis, 1995.
Expand Down
13 changes: 0 additions & 13 deletions src/sage/categories/unital_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,7 @@ def __init_extra__(self):
0
sage: F(3)
3*B[0]
sage: class Bar(Parent):
....: _no_generic_basering_coercion = True
sage: Bar(category=Algebras(QQ))
doctest:warning...:
DeprecationWarning: the attribute _no_generic_basering_coercion is deprecated, implement _coerce_map_from_base_ring() instead
See https://github.com/sagemath/sage/issues/19225 for details.
<__main__.Bar_with_category object at 0x...>
"""
if getattr(self, '_no_generic_basering_coercion', False):
from sage.misc.superseded import deprecation
deprecation(19225, "the attribute _no_generic_basering_coercion is deprecated, implement _coerce_map_from_base_ring() instead")
return

base_ring = self.base_ring()
if base_ring is self:
# There are rings that are their own base rings. No need to register that.
Expand Down
66 changes: 54 additions & 12 deletions src/sage/homology/free_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.. MATH::
R^{n_1} \xleftarrow{d_1} R^{n_1} \xleftarrow{d_2}
R^{n_0} \xleftarrow{d_1} R^{n_1} \xleftarrow{d_2}
\cdots \xleftarrow{d_k} R^{n_k} \xleftarrow{d_{k+1}} 0
terminating with a zero module at the end that is exact (all homology groups
Expand Down Expand Up @@ -242,9 +242,20 @@ def _repr_module(self, i):
'S^2'
sage: r # indirect doctest
S^1 <-- S^3 <-- S^2 <-- 0
TESTS::
sage: S.<x,y,z> = PolynomialRing(QQ)
sage: I = S.ideal(0)
sage: C = I.free_resolution()
sage: C
S^1 <-- 0
"""
if i == 0:
r = self._maps[0].nrows()
if self._length > 0:
r = self._maps[0].nrows()
else:
r = self._initial_differential.domain().dimension()
s = f'{self._name}^{r}'
return s
elif i > self._length:
Expand Down Expand Up @@ -422,6 +433,8 @@ def __getitem__(self, i):
raise IndexError('invalid index')
elif i > self._length:
F = FreeModule(self._base_ring, 0)
elif i == 0:
F = self.differential(0).domain()
elif i == self._length:
F = FreeModule(self._base_ring, self._maps[i - 1].ncols())
else:
Expand All @@ -444,11 +457,12 @@ def differential(self, i):
sage: r
S(0) <-- S(-2)⊕S(-2)⊕S(-2) <-- S(-3)⊕S(-3) <-- 0
sage: r.differential(3)
Free module morphism defined by the matrix []
Domain: Ambient free module of rank 0 over the integral domain
Multivariate Polynomial Ring in x, y, z, w over Rational Field
Codomain: Ambient free module of rank 2 over the integral domain
Multivariate Polynomial Ring in x, y, z, w over Rational Field
Free module morphism defined as left-multiplication by the matrix
[]
Domain: Ambient free module of rank 0 over the integral domain
Multivariate Polynomial Ring in x, y, z, w over Rational Field
Codomain: Ambient free module of rank 2 over the integral domain
Multivariate Polynomial Ring in x, y, z, w over Rational Field
sage: r.differential(2)
Free module morphism defined as left-multiplication by the matrix
[-y x]
Expand Down Expand Up @@ -476,6 +490,31 @@ def differential(self, i):
[-z^2 + y*w]
[ y*z - x*w]
[-y^2 + x*z]
TESTS::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: S = P2.coordinate_ring()
sage: I = S.ideal(0)
sage: C = I.graded_free_resolution(); C
S(0) <-- 0
sage: C[1]
Ambient free module of rank 0 over the integral domain
Multivariate Polynomial Ring in x, y, z over Rational Field
sage: C[0]
Ambient free module of rank 1 over the integral domain
Multivariate Polynomial Ring in x, y, z over Rational Field
sage: C.differential(1)
Free module morphism defined as left-multiplication by the matrix
[]
Domain: Ambient free module of rank 0 over the integral domain
Multivariate Polynomial Ring in x, y, z over Rational Field
Codomain: Ambient free module of rank 1 over the integral domain
Multivariate Polynomial Ring in x, y, z over Rational Field
sage: C.differential(1).matrix()
[]
sage: C.differential(1).matrix().dimensions()
(1, 0)
"""
if i < 0:
raise IndexError('invalid index')
Expand All @@ -484,14 +523,17 @@ def differential(self, i):
return self._initial_differential
except AttributeError:
raise ValueError('0th differential map undefined')
elif i == self._length + 1:
s = FreeModule(self._base_ring, 0)
t = FreeModule(self._base_ring, self._maps[i - 2].ncols())
m = s.hom(0, t)
elif i > self._length + 1:
s = FreeModule(self._base_ring, 0)
t = FreeModule(self._base_ring, 0)
m = s.hom(0, t)
m = s.hom(0, t, side='right')
elif i == self._length + 1:
s = FreeModule(self._base_ring, 0)
if self._length > 0:
t = FreeModule(self._base_ring, self._maps[i - 2].ncols())
else:
t = self._initial_differential.domain()
m = s.hom(0, t, side='right')
else:
s = FreeModule(self._base_ring, self._maps[i - 1].ncols())
t = FreeModule(self._base_ring, self._maps[i - 1].nrows())
Expand Down
11 changes: 6 additions & 5 deletions src/sage/logic/booleval.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
sage: booleval.eval_formula(t, d)
False
"""
#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2006 Chris Gorecki <chris.k.gorecki@gmail.com>
# Copyright (C) 2013 Paul Scurek <scurek86@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
# http://www.gnu.org/licenses/
#*****************************************************************************
# https://www.gnu.org/licenses/
# ****************************************************************************

from . import logicparser

Expand Down Expand Up @@ -72,8 +72,8 @@ def eval_formula(tree, vdict):
"""
global __vars
__vars = vdict
b = logicparser.apply_func(tree, eval_f)
return b
return logicparser.apply_func(tree, eval_f)


def eval_f(tree):
r"""
Expand Down Expand Up @@ -104,6 +104,7 @@ def eval_f(tree):
"""
return eval_op(tree[0], tree[1], tree[2])


def eval_op(op, lv, rv):
r"""
Evaluate ``lv`` and ``rv`` according to the operator ``op``.
Expand Down
16 changes: 5 additions & 11 deletions src/sage/logic/boolformula.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
('->', '\\rightarrow ')]


class BooleanFormula():
class BooleanFormula:
"""
Boolean formulas.
Expand Down Expand Up @@ -673,10 +673,7 @@ def is_satisfiable(self):
False
"""
table = self.truthtable().get_table_list()
for row in table[1:]:
if row[-1] is True:
return True
return False
return any(row[-1] is True for row in table[1:])

def is_tautology(self):
r"""
Expand Down Expand Up @@ -1309,11 +1306,11 @@ def reduce_op(self, tree):
if tree[0] == '<->':
# parse tree for (~tree[1]|tree[2])&(~tree[2]|tree[1])
new_tree = ['&', ['|', ['~', tree[1], None], tree[2]],
['|', ['~', tree[2], None], tree[1]]]
['|', ['~', tree[2], None], tree[1]]]
elif tree[0] == '^':
# parse tree for (tree[1]|tree[2])&~(tree[1]&tree[2])
new_tree = ['&', ['|', tree[1], tree[2]],
['~', ['&', tree[1], tree[2]], None]]
['~', ['&', tree[1], tree[2]], None]]
elif tree[0] == '->':
# parse tree for ~tree[1]|tree[2]
new_tree = ['|', ['~', tree[1], None], tree[2]]
Expand Down Expand Up @@ -1354,10 +1351,7 @@ def dist_not(self, tree):
if tree[0] == '~' and isinstance(tree[1], list):
op = tree[1][0]
if op != '~':
if op == '&':
op = '|'
else:
op = '&'
op = '|' if op == '&' else '&'
new_tree = [op, ['~', tree[1][1], None], ['~', tree[1][2], None]]
return logicparser.apply_func(new_tree, self.dist_not)
else:
Expand Down

0 comments on commit e7d8602

Please sign in to comment.