From ecf77d43f4be0276f321bc924c7516afdb31f2e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20R=C3=BCth?= Date: Fri, 6 Sep 2019 01:44:43 +0200 Subject: [PATCH 001/301] Tag docker images with their commit SHA so we can point to them from binder's Dockerfile. Note that mybinder does not support moving targets such as branches. --- .ci/build-docker.sh | 3 +++ .ci/update-env.sh | 2 ++ .gitlab-ci.yml | 1 + 3 files changed, 6 insertions(+) diff --git a/.ci/build-docker.sh b/.ci/build-docker.sh index 56c837b8322..05ce598cb6c 100755 --- a/.ci/build-docker.sh +++ b/.ci/build-docker.sh @@ -41,6 +41,9 @@ docker_build --target make-all --tag make-all:$DOCKER_TAG . # Build the release image without build artifacts. docker_build --target sagemath --tag "$DOCKER_IMAGE_CLI" . +# Tag the sagemath:$DOCKER_TAG image that CI has just built as +# sagemath:$COMMIT_HASH so we can refer to it uniquely later. +docker tag "$DOCKER_IMAGE_CLI" "$DOCKER_IMAGE_BINDER" # Display the layers of this image docker history "$DOCKER_IMAGE_CLI" # Build the developer image with the build artifacts intact. diff --git a/.ci/update-env.sh b/.ci/update-env.sh index 77e1cca4152..60544b4dbda 100755 --- a/.ci/update-env.sh +++ b/.ci/update-env.sh @@ -45,6 +45,8 @@ fi export DOCKER_IMAGE_CLI=${DOCKER_NAMESPACE:-sagemath}/sagemath:$DOCKER_TAG export DOCKER_IMAGE_DEV=${DOCKER_NAMESPACE:-sagemath}/sagemath-dev:$DOCKER_TAG +export DOCKER_IMAGE_BINDER="${DOCKER_NAMESPACE:-sagemath}/sagemath:${CI_COMMIT_SHA}}" + # Seed the build cache with this image (set to source-clean to build from # scratch.) export ARTIFACT_BASE=${ARTIFACT_BASE:-$DEFAULT_ARTIFACT_BASE} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e2f2427b02e..f43501e216c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -99,6 +99,7 @@ build-from-latest: - .ci/build-docker.sh | tee gitlab-build-docker.log | .ci/head-tail.sh 1048576 - .ci/push-gitlab.sh sagemath-dev - .ci/push-gitlab.sh sagemath + - DOCKER_TAG=$CI_COMMIT_SHA .ci/push-gitlab.sh sagemath except: - master - develop From e353fd549e71e3d97656942373ab1e8e3d770898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20R=C3=BCth?= Date: Fri, 6 Sep 2019 03:30:40 +0200 Subject: [PATCH 002/301] fix typo --- .ci/update-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/update-env.sh b/.ci/update-env.sh index 60544b4dbda..60ace995da1 100755 --- a/.ci/update-env.sh +++ b/.ci/update-env.sh @@ -45,7 +45,7 @@ fi export DOCKER_IMAGE_CLI=${DOCKER_NAMESPACE:-sagemath}/sagemath:$DOCKER_TAG export DOCKER_IMAGE_DEV=${DOCKER_NAMESPACE:-sagemath}/sagemath-dev:$DOCKER_TAG -export DOCKER_IMAGE_BINDER="${DOCKER_NAMESPACE:-sagemath}/sagemath:${CI_COMMIT_SHA}}" +export DOCKER_IMAGE_BINDER="${DOCKER_NAMESPACE:-sagemath}/sagemath:${CI_COMMIT_SHA}" # Seed the build cache with this image (set to source-clean to build from # scratch.) From 5956860faa57b8ddfab19b34d9838538cd553f6c Mon Sep 17 00:00:00 2001 From: Sebastian Oehms Date: Mon, 30 Mar 2020 23:01:35 +0200 Subject: [PATCH 003/301] 29432: initial version --- src/sage/rings/localization.py | 135 ++++++++++++++++++++++++++++++--- 1 file changed, 123 insertions(+), 12 deletions(-) diff --git a/src/sage/rings/localization.py b/src/sage/rings/localization.py index 652d4898bb7..6c3d573044a 100644 --- a/src/sage/rings/localization.py +++ b/src/sage/rings/localization.py @@ -7,7 +7,6 @@ allow non injective homomorphic images this construction will be needed. See the example on Ariki-Koike algebras below for such an application. - EXAMPLES:: sage: LZ = Localization(ZZ, (5,11)) @@ -441,19 +440,80 @@ def inverse_of_unit(self): return parent.element_class(parent, ~(parent._fraction_field(self))) def _richcmp_(self, other, op): - """ - EXAMPLES:: + """ + EXAMPLES:: - sage: P. = GF(7)[] - sage: L = Localization(P, (x, y, z)) - sage: L(1/x) < L(3/(x*y*z)**3) - False - sage: ~L(y*z/x) == L(x/(y*z)) + sage: P. = GF(7)[] + sage: L = Localization(P, (x, y, z)) + sage: L(1/x) < L(3/(x*y*z)**3) + False + sage: ~L(y*z/x) == L(x/(y*z)) + True + """ + sval = self._value + oval = other._value + return sval._richcmp_(oval, op) + + def __hash__(self): + """ + Return the hash of the corresponding fraction field element. + + EXAMPLES:: + + sage: L = ZZ.localization(5) + sage: l5 = L(5); l7 = L(7) + sage: {l5: ~l5, l7: 7} # indirect doctest + {5: 1/5, 7: 7} + """ + return hash(self._value) + + def _rational_(self): + r""" + Convert ``self`` to a rational. + + This is only possible if its base ring is the ring of integers. + + OUTPUT: + + A rational. + + TESTS:: + + sage: L = ZZ.localization(5) + sage: cp3 = cyclotomic_polynomial(3).change_ring(L) + sage: cp3.splitting_field('t') # indirect doctest + Number Field in t with defining polynomial x^2 + x + 1 + """ + from sage.rings.rational_field import QQ + if not self._value.parent() == QQ: + raise ValueError('{} is not a rational'.format(self)) + return self._value + + def _integer_(self, Z=None): + r""" + Convert ``self`` to an integer. + + This is only possible if its base ring is the ring of integers and + the denominator of ``self`` is one. + + OUTPUT: + + An integer. + + TESTS:: + + sage: L = ZZ.localization(5) + sage: L(5) in ZZ # indirect doctest True - """ - sval = self._value - oval = other._value - return sval._richcmp_(oval, op) + """ + from sage.rings.rational_field import QQ + if not self._value.parent() == QQ: + raise ValueError('{} is not a rational'.format(self)) + return self._value._integer_(Z=Z) + + + + class Localization(IntegralDomain, UniqueRepresentation): @@ -642,11 +702,13 @@ def _is_valid_homomorphism_(self, codomain, im_gens, base_map=None): Traceback (most recent call last): ... ValueError: images of some localized elements fail to be units + sage: phi=R.hom([5], codomain=QQ) sage: L._is_valid_homomorphism_(ZZ, [5], base_map=phi) Traceback (most recent call last): ... ValueError: codomain of base_map must be Integer Ring + sage: L._is_valid_homomorphism_(QQ, [5], base_map=phi) True """ @@ -846,3 +908,52 @@ def characteristic(self): 5 """ return self.base_ring().characteristic() + + def krull_dimension(self): + """ + Return the Krull dimension of this localization. + + Since the current implementation just allows integral domains as base ring + and localization at a finite set of elements the spectrum of ``self`` + is open in the irreducible spectrum of its base ring. + Therefore, by density we may take the dimension from there. + + EXAMPLES:: + + sage: R = ZZ.localization((2,3)) + sage: R.krull_dimension() + 1 + """ + return self.base_ring().krull_dimension() + + + def is_field(self, proof = True): + """ + Return ``True`` if this ring is a field. + + INPUT: + + - ``proof`` -- (default: ``True``) Determines what to do in unknown + cases + + ALGORITHM: + + If the parameter ``proof`` is set to ``True``, the returned value is + correct but the method might throw an error. Otherwise, if it is set + to ``False``, the method returns True if it can establish that self is + a field and False otherwise. + + EXAMPLES:: + + sage: R = ZZ.localization((2,3)) + sage: R.is_field() + False + """ + if proof: + try: + if self.krull_dimension() > 0: + return False + except NotImplementedError: + pass + return super(Localization, self).is_field(proof=proof) + From 85afe0a2ba045263981814a4f913dd2ff82fd9ba Mon Sep 17 00:00:00 2001 From: Sebastian Oehms Date: Sun, 5 Apr 2020 22:17:05 +0200 Subject: [PATCH 004/301] 29469: initial --- .../polynomial_quotient_ring_element.py | 25 +++++++++++++++++++ src/sage/rings/quotient_ring_element.py | 20 +++++++++------ 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/src/sage/rings/polynomial/polynomial_quotient_ring_element.py b/src/sage/rings/polynomial/polynomial_quotient_ring_element.py index 0feda96675d..84ada714948 100644 --- a/src/sage/rings/polynomial/polynomial_quotient_ring_element.py +++ b/src/sage/rings/polynomial/polynomial_quotient_ring_element.py @@ -361,11 +361,22 @@ def is_unit(self): Traceback (most recent call last): ... NotImplementedError: The base ring (=Ring of integers modulo 16) is not a field + + Check that :trac:`29469` is fixed:: + + sage: S(3).is_unit() + True """ if self._polynomial.is_zero(): return False if self._polynomial.is_one(): return True + try: + if self._polynomial.is_unit(): + return True + except NotImplementedError: + pass + parent = self.parent() base = parent.base_ring() if not base.is_field(): @@ -406,12 +417,26 @@ def __invert__(self): Traceback (most recent call last): ... NotImplementedError: The base ring (=Ring of integers modulo 16) is not a field + + Check that :trac:`29469` is fixed:: + + sage: ~S(3) + 11 """ if self._polynomial.is_zero(): raise ZeroDivisionError("element %s of quotient polynomial ring not invertible"%self) if self._polynomial.is_one(): return self + parent = self.parent() + + try: + if self._polynomial.is_unit(): + inv_pol = self._polynomial.inverse_of_unit() + return parent(inv_pol) + except (TypeError, NotImplementedError): + pass + base = parent.base_ring() if not base.is_field(): raise NotImplementedError("The base ring (=%s) is not a field" % base) diff --git a/src/sage/rings/quotient_ring_element.py b/src/sage/rings/quotient_ring_element.py index 051f47d9241..5850da34287 100644 --- a/src/sage/rings/quotient_ring_element.py +++ b/src/sage/rings/quotient_ring_element.py @@ -155,28 +155,32 @@ def is_unit(self): """ Return True if self is a unit in the quotient ring. - TODO: This is not fully implemented, as illustrated in the - example below. So far, self is determined to be unit only if - its representation in the cover ring `R` is also a unit. - EXAMPLES:: sage: R. = QQ[]; S. = R.quo(1 - x*y); type(a) sage: a*b 1 + sage: S(2).is_unit() + True + + Check that :trac:`29469` is fixed:: + sage: a.is_unit() - Traceback (most recent call last): - ... - NotImplementedError - sage: S(1).is_unit() True + sage: (a+b).is_unit() + False """ if self.__rep.is_unit(): return True from sage.categories.fields import Fields if self.parent() in Fields: return not self.is_zero() + try: + self.__invert__() + return True + except ArithmeticError: + return False raise NotImplementedError def _repr_(self): From 2084383a07908ba312fbc662dccb4407d1945e2c Mon Sep 17 00:00:00 2001 From: Siddharth Singh Date: Thu, 9 Apr 2020 02:54:13 +0530 Subject: [PATCH 005/301] Added representation to index.rst --- src/doc/en/reference/modules/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/src/doc/en/reference/modules/index.rst b/src/doc/en/reference/modules/index.rst index 35d0e3f2cf4..0975f276ffb 100644 --- a/src/doc/en/reference/modules/index.rst +++ b/src/doc/en/reference/modules/index.rst @@ -35,6 +35,7 @@ Modules sage/modules/with_basis/cell_module sage/modules/with_basis/morphism sage/modules/with_basis/subquotient + sage/modules/with_basis/representation sage/modules/finite_submodule_iter sage/modules/free_quadratic_module From 0beccc8a6aa2d4074241137f6d264a9d1d9f98bb Mon Sep 17 00:00:00 2001 From: Sebastian Oehms Date: Fri, 10 Apr 2020 21:03:06 +0200 Subject: [PATCH 006/301] 29469: fix doctest in matrix0 --- src/sage/matrix/matrix0.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/matrix/matrix0.pyx b/src/sage/matrix/matrix0.pyx index b2987867601..76666ccf101 100644 --- a/src/sage/matrix/matrix0.pyx +++ b/src/sage/matrix/matrix0.pyx @@ -5532,7 +5532,7 @@ cdef class Matrix(sage.structure.element.Matrix): sage: matrix(RR, 1, 1, [2]).inverse_of_unit() Traceback (most recent call last): ... - NotImplementedError + NotImplementedError: Lifting of multivariate polynomials over non-fields is not implemented. sage: R = ZZ.cartesian_product(ZZ) sage: m = matrix(R, 2, [R((2,1)), R((1,1)), R((1,1)), R((1,2))]) From 1792753d84ca88bb2dd03dd2dab7924ce7c18f63 Mon Sep 17 00:00:00 2001 From: Christian Wuthrich Date: Wed, 15 Apr 2020 23:55:18 +0100 Subject: [PATCH 007/301] numerical approximation modular symbols should work for non-unitary cusps --- .../schemes/elliptic_curves/mod_sym_num.pyx | 74 +++++++++++-------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index fa4ff530e1d..ec8a9d6e24d 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -3310,6 +3310,14 @@ cdef class ModularSymbolNumerical: 0.000000000000000 sage: M._evaluate_approx(1/17,0.01) # abs tol 1e-4 1.08712582106239 - 0.548379251277093*I + + Test that is also works for non-unitary cusps (:trac:`29476`) :: + + sage: E = EllipticCurve("20a1") + sage: m = E.modular_symbol_numerical() + sage: m(1/2) #abs tol 1e-4 + -0.166666666666667 + """ #verbose(" enter _evaluate_approx with r=%s, eps=%s"%(r,eps), # level=5) @@ -3327,45 +3335,47 @@ cdef class ModularSymbolNumerical: r = a/m B = m.gcd(N) Q = N // B - #verbose(" cusp is %s/%s of width %s"%(a,m,Q), level=4) + verbose(" cusp is %s/%s of width %s"%(a,m,Q), level=4) if r == 0: return self._from_ioo_to_r_approx(r, eps, use_partials=0) - + + M = N//Q + if Q.gcd(M) != 1: + return self._symbol_non_unitary_approx(r, eps) + if m < self._cut_val: # now at some point we go directly to ioo - M = N//Q - if Q.gcd(M) == 1: - res = self._from_ioo_to_r_approx(r, eps, use_partials=0) - else: - res = self._symbol_non_unitary_approx(r, eps) - else: - _, y, x = a.xgcd(m) - y = y % m - if 2*y > m: + return self._from_ioo_to_r_approx(r, eps, use_partials=0) + + _, y, x = a.xgcd(m) + y = y % m + if 2*y > m: + y -= m + x = (1-y*a) // m + #verbose(" smallest xgcd is " + # + " %s = %s * %s + %s * %s"%(a.gcd(m),a,y,x,m), + # level=4) + # make the cusp -x/y unitary if possible. + B = y.gcd(N) + if B.gcd(N//B) != 1: + if y > 0: y -= m - x = (1-y*a) // m - #verbose(" smallest xgcd is " - # + " %s = %s * %s + %s * %s"%(a.gcd(m),a,y,x,m), - # level=4) - # make the cusp -x/y unitary if possible. - B = y.gcd(N) - if B.gcd(N//B) != 1: - if y > 0: - y -= m - x += a - else: - y += m - x -= a - if Q.gcd(N//Q) != 1: # still bad ex: N=36 a=2, m=5 - res = self._from_ioo_to_r_approx(r, eps, use_partials=2) + x += a else: - r2 = - x/y - verbose("Next piece: integrate to the cusp %s "%r2, level=2) - res = self._from_r_to_rr_approx(r, r2, eps, - use_partials=2) - res += self._evaluate_approx(r2, eps) - + y += m + x -= a + r2 = - x/y + B = y.gcd(N) + Q = N // B + if Q.gcd(N//Q) != 1: # r2 is not unitary + return self._symbol_non_unitary_approx(r, eps) + + r2 = - x/y + verbose("Next piece: integrate to the cusp %s "%r2, level=2) + res = self._from_r_to_rr_approx(r, r2, eps, + use_partials=2) + res += self._evaluate_approx(r2, eps) return res def _symbol_non_unitary_approx(self, Rational r, double eps): From 71c02c0e0834f7119b528ff884c584b44308076c Mon Sep 17 00:00:00 2001 From: rbmj Date: Fri, 17 Apr 2020 13:57:02 -0400 Subject: [PATCH 008/301] Add logarithmic point selection to generate_plot_points() In plot(), if scale == 'semilogx' or 'loglog' when calling plot, it will now call the modified mode of generate_plot_points() that will select the points to evaluate exponentially. This places the evaluated points evenly along the viewport's x axis which decreases the number of points that are needed for accurate log-scale plots. --- src/sage/plot/plot.py | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py index 1000ef2380a..df1528f8632 100644 --- a/src/sage/plot/plot.py +++ b/src/sage/plot/plot.py @@ -589,7 +589,8 @@ def f(x): return (x-3)*(x-5)*(x-7)+40 from sage.arith.srange import srange from sage.misc.randstate import current_randstate #for plot adaptive refinement -from math import sin, cos, pi #for polar_plot +from math import sin, cos, pi, log, exp #for polar_plot and log scaling + from sage.ext.fast_eval import fast_float, is_fast_float @@ -1946,8 +1947,12 @@ def f(x): return (floor(x)+0.5) / (1-(x-0.5)**2) raise ValueError('only one of color or rgbcolor should be specified') elif 'color' in kwds: kwds['rgbcolor'] = kwds.pop('color', (0,0,1)) # take blue as default ``rgbcolor`` + G_kwds = Graphics._extract_kwds_for_show(kwds, ignore=['xmin', 'xmax']) + if 'scale' in G_kwds: + kwds['scale'] = G_kwds['scale'] # pass down so plot knows if log-scale + original_opts = kwds.pop('__original_opts', {}) do_show = kwds.pop('show',False) @@ -2103,6 +2108,12 @@ def _plot(funcs, xrange, parametric=False, else: f = funcs + #check to see if this is a log scale graph on the x axis + exp_points = False + if ('scale' in options.keys() and not parametric and + (options['scale'] == 'loglog' or options['scale'] == 'semilogx')): + exp_points = True + # Keep ``rgbcolor`` option 'automatic' only for lists of functions. # Otherwise, let the plot color be 'blue'. if parametric or not isinstance(funcs, (list, tuple)): @@ -2277,11 +2288,11 @@ def golden_rainbow(i,lightness=0.4): for x in excluded_points], []) data = generate_plot_points(f, xrange, plot_points, adaptive_tolerance, adaptive_recursion, - randomize, initial_points) + randomize, initial_points, exp_dist=exp_points) else: data = generate_plot_points(f, xrange, plot_points, adaptive_tolerance, adaptive_recursion, - randomize) + randomize, exp_dist=exp_points) for i in range(len(data)-1): @@ -2334,7 +2345,7 @@ def golden_rainbow(i,lightness=0.4): fill_f = fill filldata = generate_plot_points(fill_f, xrange, plot_points, adaptive_tolerance, \ - adaptive_recursion, randomize) + adaptive_recursion, randomize, exp_dist=exp_points) filldata.reverse() filldata += data else: @@ -2345,7 +2356,7 @@ def golden_rainbow(i,lightness=0.4): if not hasattr(fill, '__call__') and polar: filldata = generate_plot_points(lambda x: base_level, xrange, plot_points, adaptive_tolerance, \ - adaptive_recursion, randomize) + adaptive_recursion, randomize, exp_dist=exp_points) filldata.reverse() filldata += data if not hasattr(fill, '__call__') and not polar: @@ -3794,7 +3805,7 @@ def adaptive_refinement(f, p1, p2, adaptive_tolerance=0.01, adaptive_recursion=5 return [] -def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adaptive_recursion=5, randomize=True, initial_points=None): +def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adaptive_recursion=5, randomize=True, initial_points=None, exp_dist=False): r""" Calculate plot points for a function f in the interval xrange. The adaptive refinement algorithm is also automatically invoked with a @@ -3822,6 +3833,9 @@ def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adap - ``initial_points`` - (default: None) a list of points that should be evaluated. + - ``exp_dist`` - (default: False) whether points should be distributed linearly + (False) or exponentially (True) within the range specified + OUTPUT: - a list of points (x, f(x)) in the interval xrange, which approximate @@ -3871,6 +3885,16 @@ def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adap [97, 499, 2681] """ from sage.plot.misc import setup_for_eval_on_grid + + f_actual = f + xrange_actual = xrange + if exp_dist: + if xrange[0] <= 0: + sage.misc.misc.verbose("Unable to perform exponential scale on negative range, clipping...", 1) + xrange[0] = 0.01 + f = lambda x: f_actual(exp(x)) + xrange = (log(xrange[0]), log(xrange[1])) + ignore, ranges = setup_for_eval_on_grid([], [xrange], plot_points) xmin, xmax, delta = ranges[0] data = srange(*ranges[0], include_endpoint=True) @@ -3960,4 +3984,8 @@ def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adap sage.misc.misc.verbose("WARNING: When plotting, failed to evaluate function at %s points." % exceptions, level=0) sage.misc.misc.verbose("Last error message: '%s'" % msg, level=0) + if exp_dist: + for i in range(len(data)): + data[i] = (exp(data[i][0]), data[i][1]) + return data From 3468851e166b38937ce7e7bc17fdca71eeb2cb92 Mon Sep 17 00:00:00 2001 From: Christian Wuthrich Date: Sat, 18 Apr 2020 22:36:21 +0100 Subject: [PATCH 009/301] trac #29476: transportable case can use unitary eps --- src/sage/schemes/elliptic_curves/mod_sym_num.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index ec8a9d6e24d..d0225d60237 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -885,7 +885,7 @@ cdef class ModularSymbolNumerical: elif isinstance(r, sage.rings.infinity.PlusInfinity): return Rational(0) else: #who knows - raise ValueError("The modular symbol can be evaluated at a" + raise ValueError("The modular symbol can be evaluated at a " "rational number only.") if use_twist: if self._D == -1: @@ -1056,7 +1056,7 @@ cdef class ModularSymbolNumerical: # now determine the bound for E0 coming from the # theorem of Manin and Drinfeld. # delta is such that the cusps are all defined over - # the cyclotomic fireld zeta_delta + # the cyclotomic field zeta_delta delta = Integer(1) for p in N.prime_divisors(): delta *= p ** (N.valuation(p)//2) @@ -1256,7 +1256,7 @@ cdef class ModularSymbolNumerical: #from warnings import warn #warn(Rounded an error of %s, looks like a bug."%err, # RuntimeWarning, stacklevel=5) - print ( "Warning: Rounded an error of ", err, ", looks like a bug" + print ( "Warning: Rounded an error of ", err, ", looks like a bug " + "in mod_sym_num.pyx.") verbose(" rounding with an error of %s"%err, level=3) return res @@ -2662,7 +2662,7 @@ cdef class ModularSymbolNumerical: lap = la.real() else: lap = la.imag() - return self._round(lap, sign, False) + return self._round(lap, sign, True) #@cached_method def _symbol_non_unitary(self, Rational r, int sign=0): From 2fca84ef432eb9418b95c8ac9f96751303bf0895 Mon Sep 17 00:00:00 2001 From: Christian Wuthrich Date: Sat, 18 Apr 2020 23:55:33 +0100 Subject: [PATCH 010/301] trac #29476: improve denominator bound --- src/sage/schemes/elliptic_curves/mod_sym_num.pyx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index d0225d60237..4d0b223472a 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -1069,7 +1069,7 @@ cdef class ModularSymbolNumerical: p = Integer(1) co = 0 t0 = Integer(0) - while co < 3 or p < 100: + while co < 5 or p < max(100,10*delta) and p < self._lans: p += delta if p.is_prime() and N % p != 0: t0 = t0.gcd( p + 1 - self._ans[p] ) @@ -2691,6 +2691,12 @@ cdef class ModularSymbolNumerical: 1/4 sage: M._symbol_non_unitary(1/7,sign=-1) 5/28 + + Test for :trac:`28476` :: + + sage: M = ModularSymbolNumerical(EllipticCurve("361a1")) + sage: M._symbol_non_unitary(1/19) + 5/19 """ #verbose(" enter _symbol_non_unitary with r=%s," # " sign=%s"%(r,sign), level=5) From 1e9f0d60b3139d71db810858dbea4104105729e5 Mon Sep 17 00:00:00 2001 From: Christian Wuthrich Date: Sun, 19 Apr 2020 14:03:28 +0100 Subject: [PATCH 011/301] trac #29476: allow short cut again --- .../schemes/elliptic_curves/mod_sym_num.pyx | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index 4d0b223472a..29959a7aaa0 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -790,11 +790,11 @@ cdef class ModularSymbolNumerical: # this is a bound to decide when to go directly to ioo # rather than using further convergents. # see symbol(r) where it is used - #self._cut_val = ( E.conductor().isqrt() // 4 ) - #if self._cut_val < 100: - # self._cut_val = 100 - # this is now disabled - self._cut_val = (-1) + self._cut_val = ( E.conductor().isqrt() // 4 ) + if self._cut_val < 100: + self._cut_val = 100 + # this is can be used to disable it + #self._cut_val = (-1) #verbose(" leaving __init__", level=5) def __dealloc__(self): @@ -1131,17 +1131,19 @@ cdef class ModularSymbolNumerical: # this code checks if the above is ok, # we tested quite a few curves with it + # change the variables to public + # from sage.schemes.elliptic_curves.mod_sym_num import ModularSymbolNumerical # def dens_check(E): # N = E.conductor() # Cu = Gamma0(N).cusps() # m = E.modular_symbol() - # d_plus = lcm( [ denominator(m(r)) for r in Cu if r != oo] ) + # d_plus = max( [ denominator(m(r)) for r in Cu if r != oo] ) # m = E.modular_symbol(-1) - # d_minus = lcm( [ denominator(m(r)) for r in Cu if r != oo] ) + # d_minus = max( [ denominator(m(r)) for r in Cu if r != oo] ) # M = ModularSymbolNumerical(E) # print(E.label(), (d_plus, d_minus), (M._t_plus, M._t_minus), # (M._t_unitary_plus, M._t_unitary_plus)) - # if M._t_plus % d_plus != 0 or M._t_minus % d_minus: + # if M._t_plus < d_plus or M._t_minus < d_minus: # print("**** b u g *** ") def _set_up_twist(self): @@ -2845,7 +2847,7 @@ cdef class ModularSymbolNumerical: if d > 0: r = -Rational( (x,d) ) else: - r =Rational( (x, (-d)) ) + r = Rational( (x, (-d)) ) if isunitary: verbose(" integrate between %s and %s"%(r, rr), level=3) return self._value_r_to_rr(r, rr, sign, use_partials=2) @@ -3461,7 +3463,7 @@ cdef class ModularSymbolNumerical: def _twisted_approx(self, Rational ra, int sign=0, int prec=20): r""" - Compute the approximative value of the modular + Compute the approximate value of the modular symbol by using the symbols of the quadratic twist. Note that _set_up_twist needs to be called first @@ -3712,7 +3714,7 @@ def _test_integration_via_partials(E, y, m, T): sig_free(ra) return res -def _test_against_table(range_of_conductors, list_of_cusps=[], verb=False): +def _test_against_table(range_of_conductors, other_implementation="sage", list_of_cusps=[], verb=False): r""" This test function checks the modular symbols here against the ones implemented already. Note that for some curves the current @@ -3724,7 +3726,7 @@ def _test_against_table(range_of_conductors, list_of_cusps=[], verb=False): - ``range_of_conductors`` -- a list of integers; all curves with conductors in that list will be tested. - - ``list_of_cusps`` -- a lsit of rationals to be tested + - ``list_of_cusps`` -- a list of rationals to be tested - ``verb`` - if True (default) prints the values @@ -3742,8 +3744,8 @@ def _test_against_table(range_of_conductors, list_of_cusps=[], verb=False): for C in cremona_curves(range_of_conductors): if verb: print("testing curve ", C.label()) - m = C.modular_symbol(implementation="sage") - m2 = C.modular_symbol(sign=-1, implementation="sage") + m = C.modular_symbol(implementation=other_implementation) + m2 = C.modular_symbol(sign=-1, implementation=other_implementation) M = ModularSymbolNumerical(C) # a few random small rationals if len(list_of_cusps)==0: @@ -3757,7 +3759,7 @@ def _test_against_table(range_of_conductors, list_of_cusps=[], verb=False): Mr = M(r) M2r = M(r, sign=-1) if verb: - print("r={} : ({},{}),({}, {})".format(r,mr,m2r,Mr,M2r), end= " ") + print("r={} : ({},{}),({}, {})".format(r,mr,m2r,Mr,M2r), end= " ", flush=True) if mr != Mr or m2r != M2r: print (("B u g : curve = {}, cusp = {}, sage's symbols" + "({},{}), our symbols ({}, {})").format(C.label(), r, From ad99f7d5bd1ca81a65f8e4aa8079299b068cbc6d Mon Sep 17 00:00:00 2001 From: Christian Wuthrich Date: Sun, 19 Apr 2020 17:02:25 +0100 Subject: [PATCH 012/301] allow numercial padic L-functions and adjust precise outputs --- .../elliptic_curves/ell_rational_field.py | 2 +- .../schemes/elliptic_curves/mod_sym_num.pyx | 31 ++++++++++--------- src/sage/schemes/elliptic_curves/padics.py | 11 +++++++ 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/ell_rational_field.py b/src/sage/schemes/elliptic_curves/ell_rational_field.py index da748c5e9cc..a2cb084e168 100644 --- a/src/sage/schemes/elliptic_curves/ell_rational_field.py +++ b/src/sage/schemes/elliptic_curves/ell_rational_field.py @@ -1356,7 +1356,7 @@ def modular_symbol_numerical(self, sign=1, prec=20): sage: f(0) # abs tol 1e-4 0.000000000000000 sage: f(1/7) # abs tol 1e-4 - 1.00001356670155 + 0.999844176260303 sage: E = EllipticCurve([123,456]) sage: E.conductor() diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index 29959a7aaa0..5a48c7c555e 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -69,7 +69,7 @@ The most likely usage for the code is through the functions 4 sage: Mn = E.modular_symbol_numerical(sign=-1, prec=30) sage: Mn(3/123) # abs tol 1e-10 - 3.00000000000001 + 3.00000000000018 In more details. A numerical modular symbols ``M`` is created from an elliptic curve with a chosen ``sign`` (though the other sign will also be @@ -97,9 +97,9 @@ One can compute the numerical approximation to these rational numbers to any proven binary precision:: sage: M.approximative_value(13/17, prec=2) #abs tol 1e-4 - -0.500001498206669 + -0.500003172770455 sage: M.approximative_value(13/17, prec=4) #abs tol 1e-6 - -0.500000060447090 + -0.500000296037388 sage: M.approximative_value(0, sign=+1, prec=6) #abs tol 1e-8 0.000000000000000 @@ -923,9 +923,9 @@ cdef class ModularSymbolNumerical: sage: E = EllipticCurve("5077a1") sage: M = E.modular_symbol(implementation="num") sage: M.approximative_value(123/567) # abs tol 1e-8 - -4.00000000037670 + -4.00000000000845 sage: M.approximative_value(123/567,prec=2) # abs tol 1e-3 - -4.00003817366976 + -4.00002815242902 sage: E = EllipticCurve([11,88]) sage: E.conductor() @@ -934,9 +934,9 @@ cdef class ModularSymbolNumerical: sage: M.approximative_value(0,prec=2) # abs tol 1e-3 -0.0000176374317982166 sage: M.approximative_value(1/7,prec=2) # abs tol 1e-3 - 0.999973327579714 + 0.999981178147778 sage: M.approximative_value(1/7,prec=10) # abs tol 1e-6 - 0.999999895651603 + 0.999999972802649 """ cdef llong Q cdef Rational ra @@ -3307,9 +3307,9 @@ cdef class ModularSymbolNumerical: sage: E = EllipticCurve('5077a1') sage: m = ModularSymbolNumerical(E) sage: m._evaluate_approx(1/11,0.000001) # abs tol 1e-8 - -1.60961466377785e-10 + 3.91946031186308e-10*I + 9.69540669970570e-10 - 5.80486769763411e-11*I sage: m._evaluate_approx(1/17,0.000001) # abs tol 1e-8 - -8.04895428085928e-10 + 7.40274134150297*I + -9.01145713605445e-10 + 7.40274134212215*I sage: M = ModularSymbolNumerical( EllipticCurve([-12,79]) ) sage: M.elliptic_curve().conductor() @@ -3317,7 +3317,7 @@ cdef class ModularSymbolNumerical: sage: M._evaluate_approx(0/1,0.01) # abs tol 1e-4 0.000000000000000 sage: M._evaluate_approx(1/17,0.01) # abs tol 1e-4 - 1.08712582106239 - 0.548379251277093*I + 1.08712572498569 - 0.548379313090719*I Test that is also works for non-unitary cusps (:trac:`29476`) :: @@ -3412,7 +3412,7 @@ cdef class ModularSymbolNumerical: -0.470729190326520 + 2.59052039079203e-16*I sage: M = ModularSymbolNumerical(EllipticCurve("49a1")) - sage: M._symbol_non_unitary_approx(2/7,0.000000001)#abs tol 1e-12 + sage: M._symbol_non_unitary_approx(2/7,0.000000001) # abs tol 1e-12 -0.483327926404308 + 0.548042354981878*I A bit longer take:: @@ -3485,13 +3485,14 @@ cdef class ModularSymbolNumerical: sage: E = EllipticCurve("735e4") sage: M = E.modular_symbol(implementation="num") sage: M.approximative_value(1/19, sign=-1, prec=20, use_twist=False) # indirect doctest abs tol 1e-8 - 3.99999999988354 + 4.00000000089736 sage: M.approximative_value(1/19, sign=-1, prec=20, use_twist=True) # abs tol 1e-8 - 4.00000000000000 + 3.99999999982043 + sage: M.approximative_value(6/19, sign=1, prec=20, use_twist=False) # abs tol 1e-8 - 2.99999999897041 + 2.99999999944834 sage: M.approximative_value(6/19, sign=1, prec=20, use_twist=True) # abs tol 1e-8 - 3.00000000000000 + 3.00000000021937 """ cdef Integer D, Da, a, s, precd cdef RealNumber res, t diff --git a/src/sage/schemes/elliptic_curves/padics.py b/src/sage/schemes/elliptic_curves/padics.py index 61eaef3b0d3..ff9a8299085 100644 --- a/src/sage/schemes/elliptic_curves/padics.py +++ b/src/sage/schemes/elliptic_curves/padics.py @@ -92,6 +92,9 @@ def _normalize_padic_lseries(self, p, normalize, implementation, precision): raise ValueError("Must specify precision when using 'pollackstevens'") if normalize is not None: raise ValueError("The 'normalize' parameter is not used for Pollack-Stevens' overconvergent modular symbols") + elif implementation == "num": + if normalize is not None: + raise ValueError("The 'normalize' parameter is not used for numerical modular symbols") else: raise ValueError("Implementation should be one of 'sage', 'eclib', 'num' or 'pollackstevens'") return (p, normalize, implementation, precision) @@ -174,6 +177,14 @@ def padic_lseries(self, p, normalize = None, implementation = 'eclib', precision sage: L = e.padic_lseries(3, implementation = 'sage') sage: L.series(5,prec=10) 2 + 3 + 3^2 + 2*3^3 + 2*3^5 + 3^6 + O(3^7) + (1 + 3 + 2*3^2 + 3^3 + O(3^4))*T + (1 + 2*3 + O(3^4))*T^2 + (3 + 2*3^2 + O(3^3))*T^3 + (2*3 + 3^2 + O(3^3))*T^4 + (2 + 2*3 + 2*3^2 + O(3^3))*T^5 + (1 + 3^2 + O(3^3))*T^6 + (2 + 3^2 + O(3^3))*T^7 + (2 + 2*3 + 2*3^2 + O(3^3))*T^8 + (2 + O(3^2))*T^9 + O(T^10) + + Also the numerical modular symbols can be used. + This may allow for much larger conductor in some instances:: + + sage: E = EllipticCurve([101,103]) + sage: L = E.padic_lseries(5, implementation="num") + sage: L.series(2) + O(5^4) + (3 + O(5))*T + (1 + O(5))*T^2 + (3 + O(5))*T^3 + O(5)*T^4 + O(T^5) Finally, we can use the overconvergent method of Pollack-Stevens.:: From 9a4b89bba06a056e3663376e46a4783cfcb7c67a Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Tue, 21 Apr 2020 18:17:52 -0700 Subject: [PATCH 013/301] trac 29541: matplotlib 3.2.1 --- build/pkgs/matplotlib/checksums.ini | 7 +++---- build/pkgs/matplotlib/package-version.txt | 2 +- build/pkgs/matplotlib/patches/setup.py.patch | 13 ------------- src/sage/plot/colors.py | 10 +++++----- src/sage/plot/contour_plot.py | 2 +- 5 files changed, 10 insertions(+), 24 deletions(-) delete mode 100644 build/pkgs/matplotlib/patches/setup.py.patch diff --git a/build/pkgs/matplotlib/checksums.ini b/build/pkgs/matplotlib/checksums.ini index 11f9acfaca1..36060c42f88 100644 --- a/build/pkgs/matplotlib/checksums.ini +++ b/build/pkgs/matplotlib/checksums.ini @@ -1,5 +1,4 @@ tarball=matplotlib-VERSION.tar.gz -sha1=fdb01bd4b35a0947e0b10b4a349d32dca305d7fd -md5=422fc58e7323b7ba3f19382424f9ab7b -cksum=2814562579 -upstream_url=https://pypi.io/packages/source/m/matplotlib/matplotlib-VERSION.tar.gz +sha1=8263c2e1ceb3f610c898b85dfeb8b68bf338e86f +md5=6c018a644a88120886cc7211f7c826f0 +cksum=3466825812 diff --git a/build/pkgs/matplotlib/package-version.txt b/build/pkgs/matplotlib/package-version.txt index 21bb5e156fb..e4604e3afd0 100644 --- a/build/pkgs/matplotlib/package-version.txt +++ b/build/pkgs/matplotlib/package-version.txt @@ -1 +1 @@ -2.2.5 +3.2.1 diff --git a/build/pkgs/matplotlib/patches/setup.py.patch b/build/pkgs/matplotlib/patches/setup.py.patch deleted file mode 100644 index dc1807551dc..00000000000 --- a/build/pkgs/matplotlib/patches/setup.py.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/setup.py -+++ b/setup.py -@@ -85,8 +85,8 @@ mpl_packages = [ - 'Optional subpackages', - setupext.SampleData(), - setupext.Toolkits(), -- setupext.Tests(), -- setupext.Toolkits_Tests(), -+ # setupext.Tests(), -+ # setupext.Toolkits_Tests(), - 'Optional backend extensions', - # These backends are listed in order of preference, the first - # being the most preferred. The first one that looks like it will diff --git a/src/sage/plot/colors.py b/src/sage/plot/colors.py index 1860b6c948a..da3c9c34197 100644 --- a/src/sage/plot/colors.py +++ b/src/sage/plot/colors.py @@ -20,7 +20,7 @@ For a list of color maps in Sage, evaluate:: sage: sorted(colormaps) - [u'Accent', u'Accent_r', u'Blues', u'Blues_r', u'BrBG', u'BrBG_r', ...] + [u'Accent', u'Blues', u'BrBG', ...] These are imported from matplotlib's cm_ module. @@ -1374,7 +1374,7 @@ def get_cmap(cmap): and color names. For a list of map names, evaluate:: sage: sorted(colormaps) - [u'Accent', u'Accent_r', u'Blues', u'Blues_r', ...] + [u'Accent', u'Blues', ...] See :func:`rgbcolor` for valid list/tuple element formats. @@ -1468,7 +1468,7 @@ class Colormaps(collections.MutableMapping): For a list of map names, evaluate:: sage: sorted(colormaps) - [u'Accent', u'Accent_r', u'Blues', u'Blues_r', ...] + [u'Accent', u'Blues', ...] """ def __init__(self): """ @@ -1495,7 +1495,7 @@ def load_maps(self): sage: len(maps.maps) 0 sage: maps.load_maps() - sage: len(maps.maps)>130 + sage: len(maps.maps)>60 True """ global cm @@ -1539,7 +1539,7 @@ def __len__(self): sage: from sage.plot.colors import Colormaps sage: maps = Colormaps() - sage: len(maps)>130 + sage: len(maps)>60 True """ self.load_maps() diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py index a7533fa3d94..12a2b1f6701 100644 --- a/src/sage/plot/contour_plot.py +++ b/src/sage/plot/contour_plot.py @@ -223,7 +223,7 @@ def _render_on_subplot(self, subplot): cb.add_lines(CS) -@suboptions('colorbar', orientation='vertical', format=None, spacing=None) +@suboptions('colorbar', orientation='vertical', format=None, spacing='uniform') @suboptions('label', fontsize=9, colors='blue', inline=None, inline_spacing=3, fmt="%1.2f") @options(plot_points=100, fill=True, contours=None, linewidths=None, From cad019632f3d2a8ffc747c1613c54dc9c6f936c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Bissey?= Date: Wed, 22 Apr 2020 13:36:21 +1200 Subject: [PATCH 014/301] Easy to fix doctests --- src/sage/interacts/test_jupyter.rst | 4 +--- src/sage/plot/multigraphics.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/sage/interacts/test_jupyter.rst b/src/sage/interacts/test_jupyter.rst index ed2bcb59a5d..3f307d2c97c 100644 --- a/src/sage/interacts/test_jupyter.rst +++ b/src/sage/interacts/test_jupyter.rst @@ -281,9 +281,7 @@ Test all interacts from the Sage interact library:: Interactive function with 2 widgets n: IntSlider(value=1000, description=u'Number of Tosses', max=10000, min=2, step=100) interval: IntRangeSlider(value=(0, 0), description=u'Plotting range (y)', max=1) - doctest:...: UserWarning: Attempting to set identical bottom==top results - in singular transformations; automatically expanding. - bottom=0.0, top=0.0 + doctest:...: UserWarning: Attempting to set identical bottom == top == 0.0 results in singular transformations; automatically expanding. Test matrix control (see :trac:`27735`):: diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py index 3135cebe2dd..184a97cfd36 100644 --- a/src/sage/plot/multigraphics.py +++ b/src/sage/plot/multigraphics.py @@ -1295,15 +1295,15 @@ def position(self, index): sage: g2 = circle((0,1), 1.) sage: G = graphics_array([g1, g2]) sage: G.position(0) # tol 1.0e-13 - (0.028906249999999998, - 0.038541666666666696, - 0.45390624999999996, - 0.9229166666666667) + (0.023437500000000003, + 0.03415488992713045, + 0.4627803348994754, + 0.9345951100728696) sage: G.position(1) # tol 1.0e-13 - (0.5171874999999999, - 0.038541666666666696, - 0.45390624999999996, - 0.9229166666666667) + (0.5136230468749999, + 0.19293222169724827, + 0.46278033489947534, + 0.617040446532634) """ if not self._positions: From 86407117a484c3699fe1ee3b1194f47ca9d641b9 Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Tue, 21 Apr 2020 19:36:40 -0700 Subject: [PATCH 015/301] trac 29547: fix doctest in root_lattice_realizations.py --- src/sage/combinat/root_system/root_lattice_realizations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/root_system/root_lattice_realizations.py b/src/sage/combinat/root_system/root_lattice_realizations.py index f55c24f61f1..16d3ca5d51a 100644 --- a/src/sage/combinat/root_system/root_lattice_realizations.py +++ b/src/sage/combinat/root_system/root_lattice_realizations.py @@ -3131,8 +3131,8 @@ def plot_crystal(self, crystal, sage: L = RootSystem(['A',2]).ambient_space() sage: C = crystals.Tableaux(['A',2], shape=[2,1]) - sage: L.plot_crystal(C) - Graphics object consisting of 16 graphics primitives + sage: L.plot_crystal(C, plot_labels='multiplicities') + Graphics object consisting of 15 graphics primitives sage: C = crystals.Tableaux(['A',2], shape=[8,4]) sage: p = L.plot_crystal(C, plot_labels='circles') sage: p.show(figsize=15) From b436dbcabff07056ae4ea7eaebaf7cb528341cf9 Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Wed, 22 Apr 2020 22:13:24 -0700 Subject: [PATCH 016/301] trac 29547: rebase and restore upstream_url line in checksums.ini --- build/pkgs/matplotlib/checksums.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/build/pkgs/matplotlib/checksums.ini b/build/pkgs/matplotlib/checksums.ini index 36060c42f88..f9fdd8483d9 100644 --- a/build/pkgs/matplotlib/checksums.ini +++ b/build/pkgs/matplotlib/checksums.ini @@ -2,3 +2,4 @@ tarball=matplotlib-VERSION.tar.gz sha1=8263c2e1ceb3f610c898b85dfeb8b68bf338e86f md5=6c018a644a88120886cc7211f7c826f0 cksum=3466825812 +upstream_url=https://pypi.io/packages/source/m/matplotlib/matplotlib-VERSION.tar.gz From 5d1a52e4c73c33f69aeae6ad9e42265750394adb Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Fri, 24 Apr 2020 11:41:19 +0200 Subject: [PATCH 017/301] store incidence matrix, if initialized from it --- .../combinatorial_polyhedron/base.pyx | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx index 969c9f86db1..ab431210731 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx @@ -427,6 +427,12 @@ cdef class CombinatorialPolyhedron(SageObject): self._n_Hrepresentation = data.ncols() self._n_Vrepresentation = data.nrows() + # Store the incidence matrix. + if not data.is_immutable(): + data = data.__copy__() + data.set_immutable() + self.incidence_matrix.set_cache(data) + # Initializing the facets in their Bit-representation. self._bitrep_facets = incidence_matrix_to_bit_rep_of_facets(data) @@ -984,11 +990,22 @@ cdef class CombinatorialPolyhedron(SageObject): [0 0 0 1 1 1] [0 1 0 1 1 0] [0 1 1 1 0 0] - sage: P.incidence_matrix() == C.incidence_matrix() + + In this case the incidence matrix is only computed once:: + + sage: P.incidence_matrix() is C.incidence_matrix() + True + sage: C.incidence_matrix.clear_cache() + sage: C.incidence_matrix() is P.incidence_matrix() + False + sage: C.incidence_matrix() == P.incidence_matrix() True + :: + sage: P = polytopes.permutahedron(5) sage: C = P.combinatorial_polyhedron() + sage: C.incidence_matrix.clear_cache() sage: C.incidence_matrix() == P.incidence_matrix() True @@ -998,6 +1015,8 @@ cdef class CombinatorialPolyhedron(SageObject): sage: P = Polyhedron([[0,0]]) sage: P.incidence_matrix() [1 1] + sage: C = P.combinatorial_polyhedron() + sage: C.incidence_matrix.clear_cache() sage: P.combinatorial_polyhedron().incidence_matrix() [1 1] @@ -1006,9 +1025,11 @@ cdef class CombinatorialPolyhedron(SageObject): Check that :trac:`29455` is fixed:: sage: C = Polyhedron([[0]]).combinatorial_polyhedron() + sage: C.incidence_matrix.clear_cache() sage: C.incidence_matrix() [1] sage: C = CombinatorialPolyhedron(-1) + sage: C.incidence_matrix.clear_cache() sage: C.incidence_matrix() [] """ From fd5224085e46473d4315328f0f4ce35e5f8a8675 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Fri, 24 Apr 2020 21:28:15 +0200 Subject: [PATCH 018/301] First implementation of subresultants --- src/doc/en/reference/references/index.rst | 19 ++-- .../rings/polynomial/polynomial_element.pyx | 86 ++++++++++++++++++- 2 files changed, 94 insertions(+), 11 deletions(-) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 14838e1b9d4..9d13f5a6478 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -1741,7 +1741,7 @@ REFERENCES: .. [DGH2020] \C. Donnot, A. Genitrini and Y. Herida. Unranking Combinations Lexicographically: an efficient new strategy compared with others, 2020, - https://hal.archives-ouvertes.fr/hal-02462764v1 + https://hal.archives-ouvertes.fr/hal-02462764v1 .. [DGMPPS2019] \N. Datta, A. Ghoshal, D. Mukhopadhyay, S. Patranabis, S. Picek, R. Sashukhan. "TRIFLE" @@ -1889,6 +1889,9 @@ REFERENCES: Connection Table* (preprint); in Cryptology ePrint Archive, (2018), 631. +.. [Duc1998] \L. Ducos, Optimizations of the Subresultant Algorithm. + http://www-math.univ-poitiers.fr/~ducos/Travaux/sous-resultants.pdf + .. [Dur1998] \F. Durand, *A characterization of substitutive sequences using return words*, Discrete Math. 179 (1998) 89-101. @@ -4893,9 +4896,9 @@ REFERENCES: .. [St2011b] \W. Stein, *Toward a Generalization of the Gross-Zagier Conjecture*, Int Math Res Notices (2011), :doi:`10.1093/imrn/rnq075` - -.. [St2007] \W. Stein. *Modular Forms, a Computational Approach*. - With an appendix by Paul E. Gunnells. + +.. [St2007] \W. Stein. *Modular Forms, a Computational Approach*. + With an appendix by Paul E. Gunnells. AMS Graduate Studies in Mathematics, Volume 79, 2007. :doi:`10.1090/gsm/079` @@ -5376,11 +5379,11 @@ REFERENCES: .. [Wu2004] Wuthrich, Christian. *On p-adic heights in families of elliptic curves*. Journal of the London Mathematical Society, 70(1), 23-40, (2004). - + .. [Wu2018] Wuthrich, Christian. - *Numerical modular symbols for elliptic curves*. - Math. Comp. 87 (2018), no. 313, 2393–2423. - + *Numerical modular symbols for elliptic curves*. + Math. Comp. 87 (2018), no. 313, 2393–2423. + .. [WW1991] Michelle Wachs and Dennis White, *p, q-Stirling numbers and set partition statistics*, Journal of Combinatorial Theory, Series A 56.1 (1991): 27-46. diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index 5d639ebf390..0efc83b2a7a 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -28,7 +28,7 @@ AUTHORS: - David Zureick-Brown (2017-09): Added is_weil_polynomial. -- Sebastian Oehms (2018-10): made :meth:`roots` and :meth:`factor` work over more +- Sebastian Oehms (2018-10): made :meth:`roots` and :meth:`factor` work over more cases of proper integral domains (see :trac:`26421`) TESTS:: @@ -4404,14 +4404,14 @@ cdef class Polynomial(CommutativeAlgebraElement): try: F = R.fraction_field() PF = F[self.variable_name()] - pol_frac = PF(self) + pol_frac = PF(self) pol_frac_fact = pol_frac.factor(**kwargs) if R(pol_frac_fact.unit()).is_unit(): # Note: :meth:`base_change` may convert the unit to a non unit return pol_frac_fact.base_change(self.parent()) except (TypeError, AttributeError, NotImplementedError): raise NotImplementedError - + raise NotImplementedError return self._factor_pari_helper(G, n) @@ -6403,6 +6403,86 @@ cdef class Polynomial(CommutativeAlgebraElement): except (TypeError, ValueError, PariError, NotImplementedError): return self.sylvester_matrix(other).det() + @coerce_binop + def subresultants(self, other): + r""" + Return the nonzero subresultant polynomials of ``self`` and ``other``. + + INPUT: + + - ``other`` -- a polynomial + + OUTPUT: a list of polynomials in the same ring as ``self`` + + EXAMPLES:: + + sage: R. = ZZ[] + sage: f = x^8 + x^6 -3*x^4 -3*x^3 +8*x^2 +2*x -5 + sage: g = 3*x^6 +5*x^4 -4*x^2 -9*x +21 + sage: f.subresultants(g) + [260708, + 9326*x - 12300, + 169*x^2 + 325*x - 637, + 65*x^2 + 125*x - 245, + 25*x^4 - 5*x^2 + 15, + 15*x^4 - 3*x^2 + 9] + + ALGORITHM: + + We use the schoolbook algorithm with Lazard's optimization described in [Duc1998]_ + + REFERENCES: + + :wikipedia:`Polynomial_greatest_common_divisor#Subresultants` + + """ + P, Q = self, other + if P.degree() < Q.degree(): + P, Q = Q, P + S = [] + s = Q.leading_coefficient()**(P.degree()-Q.degree()) + A = Q + B = P.pseudo_quo_rem(-Q)[1] + ring = self.parent() + while True: + d = A.degree() + e = B.degree() + if B.is_zero(): + return S + S = [ring(B)] + S + delta = d-e + if delta > 1: + if len(S) > 1: + n = S[1].degree() - S[0].degree() - 1 + if n == 0: + C = S[0] + else: + x = S[0].leading_coefficient() + y = S[1].leading_coefficient() + a = 1 << (int(n).bit_length()-1) + c = x + n = n - a + while a > 1: + a = a/2 + c = c**2/y + if n >= a: + c = c*x/y + n = n - a + C = c*S[0]/y + else: + C = B.leading_coefficient()**(delta-1)*B/s**(delta-1) + S = [ring(C)] + S + else: + C = B + if e == 0: + return S + B = A.pseudo_quo_rem(-B)[1]/(s**delta*A.leading_coefficient()) + A = C + s = A.leading_coefficient() + + + + def composed_op(p1, p2, op, algorithm=None, monic=False): r""" Return the composed sum, difference, product or quotient of this From 01d9afb0d7cde6b205bb42edf07dfb022b75de34 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Mon, 13 Apr 2020 18:08:09 +0800 Subject: [PATCH 019/301] spkg-configure for suitesparse (draft) --- build/pkgs/suitesparse/distros/conda.txt | 1 + build/pkgs/suitesparse/distros/debian.txt | 1 + build/pkgs/suitesparse/distros/fedora.txt | 1 + build/pkgs/suitesparse/distros/homebrew.txt | 1 + build/pkgs/suitesparse/spkg-configure.m4 | 10 ++++++++++ 5 files changed, 14 insertions(+) create mode 100644 build/pkgs/suitesparse/distros/conda.txt create mode 100644 build/pkgs/suitesparse/distros/debian.txt create mode 100644 build/pkgs/suitesparse/distros/fedora.txt create mode 100644 build/pkgs/suitesparse/distros/homebrew.txt create mode 100644 build/pkgs/suitesparse/spkg-configure.m4 diff --git a/build/pkgs/suitesparse/distros/conda.txt b/build/pkgs/suitesparse/distros/conda.txt new file mode 100644 index 00000000000..8309d12f520 --- /dev/null +++ b/build/pkgs/suitesparse/distros/conda.txt @@ -0,0 +1 @@ +suitesparse diff --git a/build/pkgs/suitesparse/distros/debian.txt b/build/pkgs/suitesparse/distros/debian.txt new file mode 100644 index 00000000000..f6e0709fedf --- /dev/null +++ b/build/pkgs/suitesparse/distros/debian.txt @@ -0,0 +1 @@ +libsuitesparse-dev diff --git a/build/pkgs/suitesparse/distros/fedora.txt b/build/pkgs/suitesparse/distros/fedora.txt new file mode 100644 index 00000000000..473f5afeb82 --- /dev/null +++ b/build/pkgs/suitesparse/distros/fedora.txt @@ -0,0 +1 @@ +suitesparse suitesparse-devel diff --git a/build/pkgs/suitesparse/distros/homebrew.txt b/build/pkgs/suitesparse/distros/homebrew.txt new file mode 100644 index 00000000000..55da6065f71 --- /dev/null +++ b/build/pkgs/suitesparse/distros/homebrew.txt @@ -0,0 +1 @@ +suite-sparse diff --git a/build/pkgs/suitesparse/spkg-configure.m4 b/build/pkgs/suitesparse/spkg-configure.m4 new file mode 100644 index 00000000000..e35a191882b --- /dev/null +++ b/build/pkgs/suitesparse/spkg-configure.m4 @@ -0,0 +1,10 @@ +SAGE_SPKG_CONFIGURE([suitesparse], [ + SAGE_SPKG_DEPCHECK([openblas], [ + AC_CHECK_HEADER([suitesparse/SuiteSparse_config.h], [ + AC_SEARCH_LIBS([cholmod_speye], [cholmod],[], + [sage_spkg_install_suitesparse=yes]) + ], [ + sage_spkg_install_suitesparse=yes + ]) + ]) +]) From 8aec53420c49c0614d480ef04fbc3d556916576f Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Tue, 14 Apr 2020 11:47:52 +0800 Subject: [PATCH 020/301] more distros info --- build/pkgs/suitesparse/distros/arch.txt | 1 + build/pkgs/suitesparse/distros/cygwin.txt | 1 + build/pkgs/suitesparse/distros/gentoo.txt | 1 + build/pkgs/suitesparse/distros/opensuse.txt | 1 + 4 files changed, 4 insertions(+) create mode 100644 build/pkgs/suitesparse/distros/arch.txt create mode 100644 build/pkgs/suitesparse/distros/cygwin.txt create mode 100644 build/pkgs/suitesparse/distros/gentoo.txt create mode 100644 build/pkgs/suitesparse/distros/opensuse.txt diff --git a/build/pkgs/suitesparse/distros/arch.txt b/build/pkgs/suitesparse/distros/arch.txt new file mode 100644 index 00000000000..8309d12f520 --- /dev/null +++ b/build/pkgs/suitesparse/distros/arch.txt @@ -0,0 +1 @@ +suitesparse diff --git a/build/pkgs/suitesparse/distros/cygwin.txt b/build/pkgs/suitesparse/distros/cygwin.txt new file mode 100644 index 00000000000..fe7b2c3f23c --- /dev/null +++ b/build/pkgs/suitesparse/distros/cygwin.txt @@ -0,0 +1 @@ +libsuitesparseconfig-devel diff --git a/build/pkgs/suitesparse/distros/gentoo.txt b/build/pkgs/suitesparse/distros/gentoo.txt new file mode 100644 index 00000000000..7d1964f2171 --- /dev/null +++ b/build/pkgs/suitesparse/distros/gentoo.txt @@ -0,0 +1 @@ +sci-libs/suitesparse sci-libs/suitesparseconfig diff --git a/build/pkgs/suitesparse/distros/opensuse.txt b/build/pkgs/suitesparse/distros/opensuse.txt new file mode 100644 index 00000000000..8309d12f520 --- /dev/null +++ b/build/pkgs/suitesparse/distros/opensuse.txt @@ -0,0 +1 @@ +suitesparse From e6b207b31db114597d68fe9e8b0c06e2299271d6 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Tue, 14 Apr 2020 12:29:29 +0800 Subject: [PATCH 021/301] set up SAGE_SUITESPARSE_PREFIX it is set to '' if an external SuiteSparse is used, and to $SAGE_LOCAL otherwise. Needed for cvxopt setup. --- build/bin/sage-build-env-config.in | 1 + build/pkgs/cvxopt/spkg-install.in | 6 ++++-- build/pkgs/suitesparse/spkg-configure.m4 | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build/bin/sage-build-env-config.in b/build/bin/sage-build-env-config.in index 45f3086df69..01ba892dfd6 100644 --- a/build/bin/sage-build-env-config.in +++ b/build/bin/sage-build-env-config.in @@ -87,5 +87,6 @@ export SAGE_PARI_CFG="@SAGE_PARI_CFG@" export SAGE_GLPK_PREFIX="@SAGE_GLPK_PREFIX@" export SAGE_FREETYPE_PREFIX="@SAGE_FREETYPE_PREFIX@" +export SAGE_SUITESPARSE_PREFIX="@SAGE_SUITESPARSE_PREFIX@" export SAGE_CONFIGURE_FFLAS_FFPACK="@SAGE_CONFIGURE_FFLAS_FFPACK@" diff --git a/build/pkgs/cvxopt/spkg-install.in b/build/pkgs/cvxopt/spkg-install.in index e5cfab9e1b6..9c06ba20cd7 100644 --- a/build/pkgs/cvxopt/spkg-install.in +++ b/build/pkgs/cvxopt/spkg-install.in @@ -21,8 +21,10 @@ export CVXOPT_BLAS_LIB="$(pkg_libs blas)" export CVXOPT_BLAS_LIB_DIR="$(pkg-config --variable=libdir blas)" export CVXOPT_LAPACK_LIB="$(pkg_libs lapack)" -export CVXOPT_SUITESPARSE_LIB_DIR="${SAGE_LOCAL}" -export CVXOPT_SUITESPARSE_INC_DIR="${SAGE_LOCAL}/include" +if test x$SAGE_SUITESPARSE_PREFIX != x; then + export CVXOPT_SUITESPARSE_LIB_DIR="${SAGE_LOCAL}" + export CVXOPT_SUITESPARSE_INC_DIR="${SAGE_LOCAL}/include" +fi export CVXOPT_BUILD_GLPK=1 export CVXOPT_GLPK_LIB_DIR="${SAGE_LOCAL}" diff --git a/build/pkgs/suitesparse/spkg-configure.m4 b/build/pkgs/suitesparse/spkg-configure.m4 index e35a191882b..9ab66375bfc 100644 --- a/build/pkgs/suitesparse/spkg-configure.m4 +++ b/build/pkgs/suitesparse/spkg-configure.m4 @@ -7,4 +7,10 @@ SAGE_SPKG_CONFIGURE([suitesparse], [ sage_spkg_install_suitesparse=yes ]) ]) +], [], [], [ + AS_IF([test x$sage_spkg_install_suitesparse = xyes], [ + AC_SUBST(SAGE_SUITESPARSE_PREFIX, ['$SAGE_LOCAL']) + ], [ + AC_SUBST(SAGE_SUITESPARSE_PREFIX, ['']) + ]) ]) From 17a95e61cea2d28a8c44544e2c65e9921c560481 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Tue, 14 Apr 2020 12:30:55 +0800 Subject: [PATCH 022/301] remove an old FreeBSD leftover --- build/pkgs/cvxopt/spkg-install.in | 5 ----- 1 file changed, 5 deletions(-) diff --git a/build/pkgs/cvxopt/spkg-install.in b/build/pkgs/cvxopt/spkg-install.in index 9c06ba20cd7..50a183d9287 100644 --- a/build/pkgs/cvxopt/spkg-install.in +++ b/build/pkgs/cvxopt/spkg-install.in @@ -1,10 +1,5 @@ cd src -# Ensure FreeBSD build finds new, local math.h and complex.h -if [ "$UNAME" = FreeBSD ]; then - export CPPFLAGS="$CPPFLAGS -I$SAGE_LOCAL/include" -fi - # Stolen from Gentoo pkg_libs() { pkg-config --libs-only-l $* | \ From 3d9d0c1c9da3430b5f3dd598d910b10c3054fac3 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Tue, 14 Apr 2020 13:27:37 +0800 Subject: [PATCH 023/301] tests for other libs in sparsesuite --- build/pkgs/suitesparse/spkg-configure.m4 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/build/pkgs/suitesparse/spkg-configure.m4 b/build/pkgs/suitesparse/spkg-configure.m4 index 9ab66375bfc..77570a02436 100644 --- a/build/pkgs/suitesparse/spkg-configure.m4 +++ b/build/pkgs/suitesparse/spkg-configure.m4 @@ -1,11 +1,16 @@ SAGE_SPKG_CONFIGURE([suitesparse], [ SAGE_SPKG_DEPCHECK([openblas], [ AC_CHECK_HEADER([suitesparse/SuiteSparse_config.h], [ - AC_SEARCH_LIBS([cholmod_speye], [cholmod],[], - [sage_spkg_install_suitesparse=yes]) - ], [ - sage_spkg_install_suitesparse=yes - ]) + AC_SEARCH_LIBS([cholmod_speye], [cholmod], [ + AC_SEARCH_LIBS([umfpack_di_solve], [umfpack], [ + AC_SEARCH_LIBS([SuiteSparse_version], [suitesparseconfig], [], + [sage_spkg_install_suitesparse=yes]) + ], [ + sage_spkg_install_suitesparse=yes]) + ], [ + sage_spkg_install_suitesparse=yes]) + ], [ + sage_spkg_install_suitesparse=yes]) ]) ], [], [], [ AS_IF([test x$sage_spkg_install_suitesparse = xyes], [ From 7bc622bf554be5f6f0f754677ce59f186762f4da Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 26 Apr 2020 17:45:49 +0800 Subject: [PATCH 024/301] check for unprefixed header, too move the header check to the tail, to make it easier to read --- build/pkgs/suitesparse/spkg-configure.m4 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build/pkgs/suitesparse/spkg-configure.m4 b/build/pkgs/suitesparse/spkg-configure.m4 index 77570a02436..056ba403c9b 100644 --- a/build/pkgs/suitesparse/spkg-configure.m4 +++ b/build/pkgs/suitesparse/spkg-configure.m4 @@ -1,17 +1,19 @@ SAGE_SPKG_CONFIGURE([suitesparse], [ SAGE_SPKG_DEPCHECK([openblas], [ - AC_CHECK_HEADER([suitesparse/SuiteSparse_config.h], [ AC_SEARCH_LIBS([cholmod_speye], [cholmod], [ AC_SEARCH_LIBS([umfpack_di_solve], [umfpack], [ - AC_SEARCH_LIBS([SuiteSparse_version], [suitesparseconfig], [], - [sage_spkg_install_suitesparse=yes]) + AC_SEARCH_LIBS([SuiteSparse_version], [suitesparseconfig], [ + AC_CHECK_HEADER([SuiteSparse_config.h], [suispa_header_found=yes]) + AC_CHECK_HEADER([suitesparse/SuiteSparse_config.h], [suispa_header_found=yes]) + AS_IF([test x$suispa_header_found = xyes], [], + [sage_spkg_install_suitesparse=yes]) + ], [sage_spkg_install_suitesparse=yes]) ], [ sage_spkg_install_suitesparse=yes]) ], [ sage_spkg_install_suitesparse=yes]) ], [ sage_spkg_install_suitesparse=yes]) - ]) ], [], [], [ AS_IF([test x$sage_spkg_install_suitesparse = xyes], [ AC_SUBST(SAGE_SUITESPARSE_PREFIX, ['$SAGE_LOCAL']) From b8c83088cff21aec5c26866435f18bf10d1300f4 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 26 Apr 2020 17:55:13 +0800 Subject: [PATCH 025/301] check for amd.h too --- build/pkgs/suitesparse/spkg-configure.m4 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/pkgs/suitesparse/spkg-configure.m4 b/build/pkgs/suitesparse/spkg-configure.m4 index 056ba403c9b..0c2a1397671 100644 --- a/build/pkgs/suitesparse/spkg-configure.m4 +++ b/build/pkgs/suitesparse/spkg-configure.m4 @@ -3,8 +3,10 @@ SAGE_SPKG_CONFIGURE([suitesparse], [ AC_SEARCH_LIBS([cholmod_speye], [cholmod], [ AC_SEARCH_LIBS([umfpack_di_solve], [umfpack], [ AC_SEARCH_LIBS([SuiteSparse_version], [suitesparseconfig], [ - AC_CHECK_HEADER([SuiteSparse_config.h], [suispa_header_found=yes]) - AC_CHECK_HEADER([suitesparse/SuiteSparse_config.h], [suispa_header_found=yes]) + AC_CHECK_HEADERS([SuiteSparse_config.h amd.h], + [suispa_header_found=yes]) + AC_CHECK_HEADERS([suitesparse/SuiteSparse_config.h suitesparse/amd.h], + [suispa_header_found=yes]) AS_IF([test x$suispa_header_found = xyes], [], [sage_spkg_install_suitesparse=yes]) ], [sage_spkg_install_suitesparse=yes]) From 10ecc62cf702aa13400f5bbf8050579e2e12932d Mon Sep 17 00:00:00 2001 From: Christian Wuthrich Date: Sun, 26 Apr 2020 11:50:06 +0100 Subject: [PATCH 026/301] trac #29476: adjust precision in tests and delete some trailing whitespace --- .../elliptic_curves/ell_rational_field.py | 8 +- .../schemes/elliptic_curves/mod_sym_num.pyx | 155 +++++++++--------- 2 files changed, 82 insertions(+), 81 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/ell_rational_field.py b/src/sage/schemes/elliptic_curves/ell_rational_field.py index a2cb084e168..4f6ccb11954 100644 --- a/src/sage/schemes/elliptic_curves/ell_rational_field.py +++ b/src/sage/schemes/elliptic_curves/ell_rational_field.py @@ -1348,21 +1348,21 @@ def modular_symbol_numerical(self, sign=1, prec=20): sage: E = EllipticCurve('19a1') sage: f = E.modular_symbol_numerical(1) sage: g = E.modular_symbol(1) - sage: f(0), g(0) # abs tol 1e-14 + sage: f(0), g(0) # abs tol 1e-13 (0.333333333333333, 1/3) sage: E = EllipticCurve('5077a1') sage: f = E.modular_symbol_numerical(-1, prec=2) - sage: f(0) # abs tol 1e-4 + sage: f(0) # abs tol 1e-13 0.000000000000000 - sage: f(1/7) # abs tol 1e-4 + sage: f(1/7) # abs tol 1e-13 0.999844176260303 sage: E = EllipticCurve([123,456]) sage: E.conductor() 104461920 sage: f = E.modular_symbol_numerical(prec=2) - sage: f(0) # abs tol 1e-4 + sage: f(0) # abs tol 1e-13 2.00001004772210 """ from sage.schemes.elliptic_curves.mod_sym_num import ModularSymbolNumerical diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index 5a48c7c555e..c4c68970e7f 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -68,7 +68,7 @@ The most likely usage for the code is through the functions sage: M(1/123) 4 sage: Mn = E.modular_symbol_numerical(sign=-1, prec=30) - sage: Mn(3/123) # abs tol 1e-10 + sage: Mn(3/123) # abs tol 1e-13 3.00000000000018 In more details. A numerical modular symbols ``M`` is created from an @@ -560,6 +560,7 @@ cdef class _CuspsForModularSymbolNumerical: It is to only to be used internally. """ + cdef public llong _a, _m, _width, _N cdef public Rational _r @@ -738,7 +739,7 @@ cdef class ModularSymbolNumerical: def __cinit__(self): r""" - Initialisation function. + Initialisation function. Allocate memory to store the Fourier coefficients of the newform. @@ -922,20 +923,20 @@ cdef class ModularSymbolNumerical: sage: E = EllipticCurve("5077a1") sage: M = E.modular_symbol(implementation="num") - sage: M.approximative_value(123/567) # abs tol 1e-8 + sage: M.approximative_value(123/567) # abs tol 1e-13 -4.00000000000845 - sage: M.approximative_value(123/567,prec=2) # abs tol 1e-3 + sage: M.approximative_value(123/567,prec=2) # abs tol 1e-13 -4.00002815242902 sage: E = EllipticCurve([11,88]) sage: E.conductor() 1715296 sage: M = E.modular_symbol(implementation="num") - sage: M.approximative_value(0,prec=2) # abs tol 1e-3 + sage: M.approximative_value(0,prec=2) # abs tol 1e-13 -0.0000176374317982166 - sage: M.approximative_value(1/7,prec=2) # abs tol 1e-3 + sage: M.approximative_value(1/7,prec=2) # abs tol 1e-13 0.999981178147778 - sage: M.approximative_value(1/7,prec=10) # abs tol 1e-6 + sage: M.approximative_value(1/7,prec=10) # abs tol 1e-13 0.999999972802649 """ cdef llong Q @@ -1396,7 +1397,7 @@ cdef class ModularSymbolNumerical: ....: import ModularSymbolNumerical sage: I = ComplexField(53).0 sage: M = ModularSymbolNumerical(EllipticCurve("11a1")) - sage: M._integration_to_tau(0.01*I, 1000, 53) # abs tol 1e-8 + sage: M._integration_to_tau(0.01*I, 1000, 53) # abs tol 1e-13 0.253841860855911 sage: M._integration_to_tau(0.01*I, 1000, 200) # abs tol 1e-20 0.25384186085591068433775876735181198283836641798722... @@ -1405,9 +1406,9 @@ cdef class ModularSymbolNumerical: sage: E = EllipticCurve("37a1") sage: ms = ModularSymbolNumerical(E) - sage: ms._integration_to_tau(0.0001*I, 1000, 53) # abs tol 1e-8 + sage: ms._integration_to_tau(0.0001*I, 1000, 53) # abs tol 1e-13 -0.0105693920159096 - sage: ms._integration_to_tau(0.3+0.01*I,1000,60) # abs tol 1e-8 + sage: ms._integration_to_tau(0.3+0.01*I,1000,60) # abs tol 1e-13 0.41268108621256428 + 0.91370544691462463*I """ #verbose(" enter _integration_to_tau with tau=%s, T=%s," @@ -1789,19 +1790,19 @@ cdef class ModularSymbolNumerical: sage: E = EllipticCurve("43a1") sage: M = E.modular_symbol(implementation="num") - sage: M._kappa(3,4) # abs tol 1e-4 + sage: M._kappa(3,4) # abs tol 1e-13 [-5.379533671373222e-05, 0.043215661934968536, -0.0018675632930897528] - sage: M._kappa(3,17) # abs tol 1e-4 + sage: M._kappa(3,17) # abs tol 1e-13 [-0.0068222516409258815, 0.2189879706778559, -0.047856204984566546] - sage: M._kappa(3,12345,0.01) # abs tol 1e-4 + sage: M._kappa(3,12345,0.01) # abs tol 1e-13 [-0.04800196513225438, 1.501878908740486, -1.4540035671680258] - sage: M._kappa(3,12345,0.001) # abs tol 1e-5 + sage: M._kappa(3,12345,0.001) # abs tol 1e-13 [-0.04790883326924006, 1.5019073235739455, -1.4539982909123526] This is to check that the caching works when asked with lower precision:: - sage: M._kappa(7,9,0.0001) # abs tol 1e-5 + sage: M._kappa(7,9,0.0001) # abs tol 1e-13 [-3.848348562241613e-46, 0.12314471107014528, -0.01516461914094593, @@ -1809,7 +1810,7 @@ cdef class ModularSymbolNumerical: 0.00011498287475216501, -2.265525136998248e-05, 2.3248943281270047e-06] - sage: M._kappa(7,9,0.1) # abs tol 1e-5 + sage: M._kappa(7,9,0.1) # abs tol 1e-13 [-3.848348562241613e-46, 0.12314471107014528, -0.01516461914094593, @@ -1900,28 +1901,28 @@ cdef class ModularSymbolNumerical: ....: import ModularSymbolNumerical sage: E = EllipticCurve("37a1") sage: m = ModularSymbolNumerical(E) - sage: m._from_ioo_to_r_approx(1/7,0.01) # abs tol 1e-5 + sage: m._from_ioo_to_r_approx(1/7,0.01) # abs tol 1e-13 2.99345862520910 - 4.24742221394325e-8*I - sage: m._from_ioo_to_r_approx(2/7,0.01) # abs tol 1e-5 + sage: m._from_ioo_to_r_approx(2/7,0.01) # abs tol 1e-13 2.45138940312063*I - sage: m._from_ioo_to_r_approx(0/1,0.001) # abs tol 1e-5 + sage: m._from_ioo_to_r_approx(0/1,0.001) # abs tol 1e-13 -2.77555756156289e-17 sage: E = EllipticCurve("37b1") sage: m = ModularSymbolNumerical(E) - sage: m._from_ioo_to_r_approx(0/1,0.01) # abs tol 1e-5 + sage: m._from_ioo_to_r_approx(0/1,0.01) # abs tol 1e-13 0.725681061936153 sage: E = EllipticCurve("5077a1") sage: m = ModularSymbolNumerical(E) - sage: m._from_ioo_to_r_approx(-1/7,0.01, use_partials=1) # abs tol 1e-5 + sage: m._from_ioo_to_r_approx(-1/7,0.01, use_partials=1) # abs tol 1e-13 6.22747859174503 - 1.48055642530800*I - sage: m._from_ioo_to_r_approx(-1/7,0.01, use_partials=0) #abs tol 1e-5 + sage: m._from_ioo_to_r_approx(-1/7,0.01, use_partials=0) #abs tol 1e-13 6.22747410432385 - 1.48055182979493*I This uses 65 bits of precision:: - sage: m._from_ioo_to_r_approx(-1/7,0.0000000001) # abs tol 1e-10 + sage: m._from_ioo_to_r_approx(-1/7,0.0000000001) # abs tol 1e-13 6.227531974630294568 - 1.480548268241443085*I """ #verbose(" enter _from_ioo_to_r_approx with r=%s" @@ -2044,9 +2045,9 @@ cdef class ModularSymbolNumerical: sage: from sage.schemes.elliptic_curves.mod_sym_num \ ....: import ModularSymbolNumerical sage: M = ModularSymbolNumerical(EllipticCurve("11a1")) - sage: M._from_r_to_rr_approx(1/3,0/1,0.000001,use_partials=0) # abs tol 1e-8 + sage: M._from_r_to_rr_approx(1/3,0/1,0.000001,use_partials=0) # abs tol 1e-13 -0.634604652139777 + 1.45881661693850*I - sage: M._from_r_to_rr_approx(1/3,0/1,0.000001,use_partials=1) # abs tol 1e-8 + sage: M._from_r_to_rr_approx(1/3,0/1,0.000001,use_partials=1) # abs tol 1e-13 -0.634604652139777 + 1.45881661693849*I """ cdef: @@ -2189,18 +2190,18 @@ cdef class ModularSymbolNumerical: sage: from sage.schemes.elliptic_curves.mod_sym_num \ ....: import ModularSymbolNumerical sage: M = ModularSymbolNumerical(EllipticCurve("11a1")) - sage: M._from_r_to_rr_approx(0/1,2/5,0.01) # abs tol 1e-4 + sage: M._from_r_to_rr_approx(0/1,2/5,0.01) # abs tol 1e-13 1.90381395641933 - 1.45881661693850*I - sage: M._from_r_to_rr_approx(0/1,2/5,0.001, "both", use_partials=0) #abs tol 1e-5 + sage: M._from_r_to_rr_approx(0/1,2/5,0.001, "both", use_partials=0) #abs tol 1e-13 1.90381395641931 - 1.45881661693851*I - sage: M._from_r_to_rr_approx(0/1,2/5,0.001, "both", use_partials=1) #abs tol 1e-5 + sage: M._from_r_to_rr_approx(0/1,2/5,0.001, "both", use_partials=1) #abs tol 1e-13 1.90381395641933 - 1.45881661693850*I - sage: M._from_r_to_rr_approx(1/11,1/7,0.001) # abs tol 1e-5 + sage: M._from_r_to_rr_approx(1/11,1/7,0.001) # abs tol 1e-13 -0.888446512995687 + 1.45881661693850*I - sage: M._from_r_to_rr_approx(0/1,44/98761,0.001) # abs tol 1e-5 + sage: M._from_r_to_rr_approx(0/1,44/98761,0.001) # abs tol 1e-13 0.634604184365293 + 1.45881886531983*I - sage: M._from_r_to_rr_approx(0/1,123/456,0.0000001) # abs tol 1e-8 + sage: M._from_r_to_rr_approx(0/1,123/456,0.0000001) # abs tol 1e-13 1.26920930437008 - 2.91763323391590*I sage: M = ModularSymbolNumerical(EllipticCurve("389a1")) @@ -2358,38 +2359,38 @@ cdef class ModularSymbolNumerical: sage: from sage.schemes.elliptic_curves.mod_sym_num \ ....: import ModularSymbolNumerical sage: M = ModularSymbolNumerical(EllipticCurve("11a1")) - sage: M._transportable_approx(0/1,-2/7,0.001) # abs tol 1e-5 + sage: M._transportable_approx(0/1,-2/7,0.001) # abs tol 1e-13 -0.634604652139777 + 1.45881661693850*I - sage: M._from_r_to_rr_approx(0/1,-2/7,0.001) # abs tol 1e-5 + sage: M._from_r_to_rr_approx(0/1,-2/7,0.001) # abs tol 1e-13 -0.634604652139776 + 1.45881661693850*I - sage: M._from_r_to_rr_approx(0/1,-2/7,0.0001) # abs tol 1e-5 + sage: M._from_r_to_rr_approx(0/1,-2/7,0.0001) # abs tol 1e-13 -0.634604652139776 + 1.45881661693850*I - sage: M._from_r_to_rr_approx(0/1,-2/7,0.00001) # abs tol 1e-8 + sage: M._from_r_to_rr_approx(0/1,-2/7,0.00001) # abs tol 1e-13 -0.634604652139776 + 1.45881661693850*I - sage: M._from_r_to_rr_approx(0/1,-2/7,0.000001) # abs tol 1e-8 + sage: M._from_r_to_rr_approx(0/1,-2/7,0.000001) # abs tol 1e-13 -0.634604652139776 + 1.45881661693850*I sage: M = ModularSymbolNumerical(EllipticCurve("37a1")) - sage: M._transportable_approx(0/1,-1/19,0.001) # abs tol 1e-5 + sage: M._transportable_approx(0/1,-1/19,0.001) # abs tol 1e-13 -1.14879551982305e-8 + 1.65994273881864e-10*I - sage: M._transportable_approx(0/1,-4/17,0.001) # abs tol 1e-5 + sage: M._transportable_approx(0/1,-4/17,0.001) # abs tol 1e-13 -2.99345356727791 + 2.45138870627435*I - sage: M._transportable_approx(0/1,-4/17,0.00001) # abs tol 1e-8 + sage: M._transportable_approx(0/1,-4/17,0.00001) # abs tol 1e-13 -2.99345863532461 + 2.45138938269979*I - sage: M._from_r_to_rr_approx(0/1,-4/17,0.00001) # abs tol 1e-8 + sage: M._from_r_to_rr_approx(0/1,-4/17,0.00001) # abs tol 1e-13 -2.99345862657997 + 2.45138938852658*I This goes via i `\infty`:: sage: M = ModularSymbolNumerical(EllipticCurve("5077a1")) - sage: M._transportable_approx( 0/1, -35/144, 0.001) #abs tol 1e-5 + sage: M._transportable_approx( 0/1, -35/144, 0.001) #abs tol 1e-13 -6.22753189644996 + 3.23405342839145e-7*I - sage: M._from_r_to_rr_approx( 0/1, -35/144, 0.001) # abs tol 1e-5 + sage: M._from_r_to_rr_approx( 0/1, -35/144, 0.001) # abs tol 1e-13 -6.22753204310913 - 1.31710951034592e-8*I While this one goes via 0:: - sage: M._transportable_approx( 0/1, -7/31798, 0.001) #abs tol 1e-5 + sage: M._transportable_approx( 0/1, -7/31798, 0.001) #abs tol 1e-13 -7.01577418382726e-9 - 7.40274138232394*I sage: M._from_r_to_rr_approx( 0/1, -7/31798, 0.001) #abs tol 1e-5 #long time -7.02253033502132e-9 - 7.40274138234031*I @@ -2693,9 +2694,9 @@ cdef class ModularSymbolNumerical: 1/4 sage: M._symbol_non_unitary(1/7,sign=-1) 5/28 - + Test for :trac:`28476` :: - + sage: M = ModularSymbolNumerical(EllipticCurve("361a1")) sage: M._symbol_non_unitary(1/19) 5/19 @@ -3306,21 +3307,21 @@ cdef class ModularSymbolNumerical: ....: import ModularSymbolNumerical sage: E = EllipticCurve('5077a1') sage: m = ModularSymbolNumerical(E) - sage: m._evaluate_approx(1/11,0.000001) # abs tol 1e-8 + sage: m._evaluate_approx(1/11,0.000001) # abs tol 1e-13 9.69540669970570e-10 - 5.80486769763411e-11*I - sage: m._evaluate_approx(1/17,0.000001) # abs tol 1e-8 + sage: m._evaluate_approx(1/17,0.000001) # abs tol 1e-13 -9.01145713605445e-10 + 7.40274134212215*I sage: M = ModularSymbolNumerical( EllipticCurve([-12,79]) ) sage: M.elliptic_curve().conductor() 287280 - sage: M._evaluate_approx(0/1,0.01) # abs tol 1e-4 + sage: M._evaluate_approx(0/1,0.01) # abs tol 1e-13 0.000000000000000 - sage: M._evaluate_approx(1/17,0.01) # abs tol 1e-4 + sage: M._evaluate_approx(1/17,0.01) # abs tol 1e-13 1.08712572498569 - 0.548379313090719*I - + Test that is also works for non-unitary cusps (:trac:`29476`) :: - + sage: E = EllipticCurve("20a1") sage: m = E.modular_symbol_numerical() sage: m(1/2) #abs tol 1e-4 @@ -3347,15 +3348,15 @@ cdef class ModularSymbolNumerical: if r == 0: return self._from_ioo_to_r_approx(r, eps, use_partials=0) - + M = N//Q if Q.gcd(M) != 1: return self._symbol_non_unitary_approx(r, eps) - + if m < self._cut_val: # now at some point we go directly to ioo return self._from_ioo_to_r_approx(r, eps, use_partials=0) - + _, y, x = a.xgcd(m) y = y % m if 2*y > m: @@ -3408,19 +3409,19 @@ cdef class ModularSymbolNumerical: sage: from sage.schemes.elliptic_curves.mod_sym_num \ ....: import ModularSymbolNumerical sage: M = ModularSymbolNumerical(EllipticCurve("20a1")) - sage: M._symbol_non_unitary_approx(1/2,0.0001) # abs tol 1e-6 + sage: M._symbol_non_unitary_approx(1/2,0.0001) # abs tol 1e-13 -0.470729190326520 + 2.59052039079203e-16*I sage: M = ModularSymbolNumerical(EllipticCurve("49a1")) - sage: M._symbol_non_unitary_approx(2/7,0.000000001) # abs tol 1e-12 + sage: M._symbol_non_unitary_approx(2/7,0.000000001) # abs tol 1e-13 -0.483327926404308 + 0.548042354981878*I A bit longer take:: sage: M = ModularSymbolNumerical(EllipticCurve("78a1")) - sage: M._symbol_non_unitary_approx(1/38,0.1) # abs tol 1e-4 + sage: M._symbol_non_unitary_approx(1/38,0.1) # abs tol 1e-13 2.90087559068021 + 2.86538550720028e-7*I - sage: M._symbol_non_unitary_approx(5/38,0.1) # abs tol 1e-4 + sage: M._symbol_non_unitary_approx(5/38,0.1) # abs tol 1e-13 0.725215164486092 - 1.19349741385624*I """ #verbose(" enter _symbol_nonunitary_approx with r=%s," @@ -3484,14 +3485,14 @@ cdef class ModularSymbolNumerical: sage: E = EllipticCurve("735e4") sage: M = E.modular_symbol(implementation="num") - sage: M.approximative_value(1/19, sign=-1, prec=20, use_twist=False) # indirect doctest abs tol 1e-8 + sage: M.approximative_value(1/19, sign=-1, prec=20, use_twist=False) # indirect doctest abs tol 1e-13 4.00000000089736 - sage: M.approximative_value(1/19, sign=-1, prec=20, use_twist=True) # abs tol 1e-8 + sage: M.approximative_value(1/19, sign=-1, prec=20, use_twist=True) # abs tol 1e-13 3.99999999982043 - sage: M.approximative_value(6/19, sign=1, prec=20, use_twist=False) # abs tol 1e-8 + sage: M.approximative_value(6/19, sign=1, prec=20, use_twist=False) # abs tol 1e-13 2.99999999944834 - sage: M.approximative_value(6/19, sign=1, prec=20, use_twist=True) # abs tol 1e-8 + sage: M.approximative_value(6/19, sign=1, prec=20, use_twist=True) # abs tol 1e-13 3.00000000021937 """ cdef Integer D, Da, a, s, precd @@ -3550,26 +3551,26 @@ def _test_init(E): EXAMPLES:: sage: from sage.schemes.elliptic_curves.mod_sym_num import _test_init - sage: _test_init(EllipticCurve("11a1")) # abs tol 1e-8 + sage: _test_init(EllipticCurve("11a1")) # abs tol 1e-13 ({1: 1, 11: -1}, [1, -2, -1, -15, -12], [10, 2, 10, 2], [0.06346046521397766, 0.7294083084692475, 0.06346046521397766, 0.7294083084692475]) - sage: _test_init(EllipticCurve("11a2")) # abs tol 1e-8 + sage: _test_init(EllipticCurve("11a2")) # abs tol 1e-13 ({1: 1, 11: -1}, [1, -2, -1, -15, -12], [2, 2, 2, 2], [0.06346046521397766, 0.7294083084692475, 0.06346046521397766, 0.7294083084692475]) - sage: _test_init(EllipticCurve("11a3")) # abs tol 1e-8 + sage: _test_init(EllipticCurve("11a3")) # abs tol 1e-13 ({1: 1, 11: -1}, [1, -2, -1, -15, -12], [50, 2, 50, 2], [0.06346046521397768, 0.7294083084692478, 0.06346046521397768, 0.7294083084692478]) - sage: _test_init(EllipticCurve("14a6")) # abs tol 1e-8 + sage: _test_init(EllipticCurve("14a6")) # abs tol 1e-13 ({1: 1, 2: 1, 7: -1, 14: -1}, [1, -1, -2, 18, 0], [9, 1, 9, 1], @@ -3578,14 +3579,14 @@ def _test_init(E): 0.16511182967224025, 0.6627456198412432]) - sage: _test_init(EllipticCurve("20a1")) # abs tol 1e-8 + sage: _test_init(EllipticCurve("20a1")) # abs tol 1e-13 ({1: 1, 2: -1, 4: -1, 5: 1, 10: -1, 20: -1}, [1, 0, -2, -6, 0], [48, 48, 12, 2], [0.029420574395407434, 0.023689220823344594, 0.11768229758162974, 0.5685412997602702]) - sage: _test_init(EllipticCurve("37a1")) # abs tol 1e-8 + sage: _test_init(EllipticCurve("37a1")) # abs tol 1e-13 ({1: 1, 37: 1}, [1, -2, -3, 4, -120], [1, 2, 1, 2], [1.4967293231159797, 0.6128473454966975, @@ -3595,7 +3596,7 @@ def _test_init(E): sage: E = EllipticCurve([91,127]) sage: E.conductor().factor() 2^4 * 3449767 - sage: _test_init(E) # abs tol 1e-8 + sage: _test_init(E) # abs tol 1e-13 ({1: 1, 2: -1, 4: -1, @@ -3652,17 +3653,17 @@ def _test_integration(E, a, b, T): sage: from sage.schemes.elliptic_curves.mod_sym_num \ ....: import _test_integration sage: E = EllipticCurve("11a1") - sage: _test_integration(E, 0,0.01,1000) # abs tol 1e-5 + sage: _test_integration(E, 0,0.01,1000) # abs tol 1e-13 (0.2538418608559108+0j) - sage: _test_integration(E, 0,0.0001,10000) # abs tol 1e-7 + sage: _test_integration(E, 0,0.0001,10000) # abs tol 1e-13 (0.2538815728257322+0j) sage: E = EllipticCurve("37a1") - sage: _test_integration(E, 0, 0.0001,1000) # abs tol 1e-8 + sage: _test_integration(E, 0, 0.0001,1000) # abs tol 1e-13 (-0.0105693920159094+0j) - sage: _test_integration(E, 0.7, 0.1, 10000) # abs tol 1e-5 + sage: _test_integration(E, 0.7, 0.1, 10000) # abs tol 1e-13 (-0.021614803690068213-0.7770316490609953j) - sage: _test_integration(E, 0.7, 0.1, 20000) # abs tol 1e-5 + sage: _test_integration(E, 0.7, 0.1, 20000) # abs tol 1e-13 (-0.021614803690068213-0.7770316490609953j) """ M = ModularSymbolNumerical(E) @@ -3693,13 +3694,13 @@ def _test_integration_via_partials(E, y, m, T): sage: from sage.schemes.elliptic_curves.mod_sym_num \ ....: import _test_integration_via_partials sage: E = EllipticCurve("11a1") - sage: _test_integration_via_partials(E,0.001,3,1000) # abs tol 1e-8 + sage: _test_integration_via_partials(E,0.001,3,1000) # abs tol 1e-13 [-0.16916415619939476, 1.0536872023214188, -0.6306661264594561] sage: E = EllipticCurve("121c1") - sage: _test_integration_via_partials(E,0.03,3,700) # abs tol 1e-8 + sage: _test_integration_via_partials(E,0.03,3,700) # abs tol 1e-13 [0.49198993741342784, 0.6601504274130793, 0.3177042713926389] - sage: _test_integration_via_partials(E,0.03,3,7000) # abs tol 1e-8 + sage: _test_integration_via_partials(E,0.03,3,7000) # abs tol 1e-13 [0.49198993741342784, 0.6601504274130793, 0.3177042713926389] """ cdef int oi, mm = (m) From 45d6d0760d841c2b79794b696eb91f3eb46d3887 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Mon, 27 Apr 2020 05:53:20 +0100 Subject: [PATCH 027/301] adjust gentoo libs list --- build/pkgs/suitesparse/distros/gentoo.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/suitesparse/distros/gentoo.txt b/build/pkgs/suitesparse/distros/gentoo.txt index 7d1964f2171..3b1b625f3e6 100644 --- a/build/pkgs/suitesparse/distros/gentoo.txt +++ b/build/pkgs/suitesparse/distros/gentoo.txt @@ -1 +1 @@ -sci-libs/suitesparse sci-libs/suitesparseconfig +sci-libs/amd sci-libs/cholmod sci-libs/suitesparseconfig sci-libs/umfpack From c9e3b4cf905f5bb81821e8a078eb1dd1424930dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Wed, 18 Mar 2020 16:38:35 +0100 Subject: [PATCH 028/301] implementation of the ring of motivic multiple zeta values --- src/sage/modular/all.py | 2 + src/sage/modular/multiple_zeta.py | 2547 +++++++++++++++++++++++++++++ 2 files changed, 2549 insertions(+) create mode 100644 src/sage/modular/multiple_zeta.py diff --git a/src/sage/modular/all.py b/src/sage/modular/all.py index 5dfa44415a7..83ca4ab58f5 100644 --- a/src/sage/modular/all.py +++ b/src/sage/modular/all.py @@ -42,6 +42,8 @@ from .etaproducts import (EtaGroup, EtaProduct, EtaGroupElement, AllCusps, CuspFamily) +lazy_import('sage.modular.multiple_zeta', ['Multizeta', 'Multizetas']) + from .overconvergent.all import * from .local_comp.all import * diff --git a/src/sage/modular/multiple_zeta.py b/src/sage/modular/multiple_zeta.py new file mode 100644 index 00000000000..4416e70aa1f --- /dev/null +++ b/src/sage/modular/multiple_zeta.py @@ -0,0 +1,2547 @@ +# -*- coding: utf-8 -*- +r"""Algebra of motivic multiple zeta values + +This file contains an implementation of the algebra of motivic +multiple zeta values. + +The elements of this algebra are not the usual multiple zeta values as +real numbers defined by concrete iterated integrals, but abstract +symbols that satisfy all the linear relations between formal iterated +integrals that come from algebraic geometry (motivic +relations). Although this set of relations is not explicit, one can +test the equality as explained in the article [Brown2012]_. One can +map these motivic multiple zeta values to the associated real +numbers. Conjecturally, this period map should be injective. + +The implementation follows closely all the conventions from [Brown2012]_. + +As a convenient abbreviation, the elements will be called multizetas. + +EXAMPLES: + +One can input multizetas using compositions as arguments:: + + sage: Multizeta(3) + ζ(3) + sage: Multizeta(2,3,2) + ζ(2,3,2) + +as well as linear combinations of them:: + + sage: Multizeta(5)+6*Multizeta(2,3) + 6*ζ(2,3) + ζ(5) + +This creates elements of the class :class:`Multizetas`. + +One can multiply such elements:: + + sage: Multizeta(2)*Multizeta(3) + 6*ζ(1,4) + 3*ζ(2,3) + ζ(3,2) + +and their linear combinations:: + + sage: (Multizeta(2)+Multizeta(1,2))*Multizeta(3) + 9*ζ(1,1,4) + 5*ζ(1,2,3) + 2*ζ(1,3,2) + 6*ζ(1,4) + 2*ζ(2,1,3) + ζ(2,2,2) + + 3*ζ(2,3) + ζ(3,1,2) + ζ(3,2) + +The algebra is graded by the weight, which is the sum of the arguments. One +can extract homogeneous components:: + + sage: z = Multizeta(6)+6*Multizeta(2,3) + sage: z.homogeneous_component(5) + 6*ζ(2,3) + +One can also use the ring of multiple zeta values as a base ring for other +constructions:: + + sage: Z = Multizeta + sage: M = matrix(2,2,[Z(2),Z(3),Z(4),Z(5)]) + sage: M.det() + -10*ζ(1,6) - 5*ζ(2,5) - ζ(3,4) + ζ(4,3) + ζ(5,2) + +.. rubric:: Auxiliary class for alternative notation + +One can also use sequences of 0 and 1 as arguments:: + + sage: Multizeta(1,1,0)+3*Multizeta(1,0,0) + I(110) + 3*I(100) + +This creates an element of the auxiliary class :class:`Multizetas_iterated`. +This class is used to represent multiple zeta values as iterated integrals. + +One can also multiply such elements:: + + sage: Multizeta(1,0)*Multizeta(1,0) + 4*I(1100) + 2*I(1010) + +Back-and-forth conversion between the two classes can be done using +the methods "composition" and "iterated":: + + sage: (Multizeta(2)*Multizeta(3)).iterated() + 6*I(11000) + 3*I(10100) + I(10010) + + sage: (Multizeta(1,0)*Multizeta(1,0)).composition() + 4*ζ(1,3) + 2*ζ(2,2) + +Beware that the conversion between these two classes, besides +exchanging the indexing by words in 0 and 1 and the indexing by +compositions, also involves the sign `(-1)^w` where `w` is the length +of the composition and the number of `1` in the associated word in 0 +and 1. For example, one has the equality + +.. MATH:: \zeta(2,3,4) = (-1)^3 I(1,0,1,0,0,1,0,0,0). + +.. rubric:: Approximate period map + +The period map, or rather an approximation, is also available under +the generic numerical approximation method:: + + sage: z = Multizeta(5)+6*Multizeta(2,3) + sage: z.n() + 2.40979014076349 + sage: z.n(prec=100) + 2.4097901407634924849438423801 + +Behind the scene, all the numerical work is done by the PARI implementation +of numerical multiple zeta values. + +.. rubric:: Searching for linear relations + +All this can be used to find linear dependencies between any set of +multiple zeta values. Let us illustrate this by an example. + +Let us first build our sample set:: + + sage: Z = Multizeta + sage: L = [Z(*c) for c in [(1, 1, 4), (1, 2, 3), (1, 5), (6,)]] + +Then one can compute the space of relations:: + + sage: M = matrix([Zc.phi_as_vector() for Zc in L]) + sage: K = M.kernel(); K + Vector space of degree 4 and dimension 2 over Rational Field + Basis matrix: + [ 1 0 -2 1/16] + [ 0 1 6 -13/48] + +and check that the first relation holds:: + + sage: relation = L[0]-2*L[2]+1/16*L[3]; relation + ζ(1,1,4) - 2*ζ(1,5) + 1/16*ζ(6) + sage: relation.phi() + 0 + sage: relation.is_zero() + True + +.. WARNING:: + + Because this code uses an hardcoded multiplicative basis that is + available up to weight 17 included, some parts will not work + in larger weights, in particular the test of equality. + +REFERENCES: + +.. [Brown2012] Francis C. S. Brown, *On the decomposition of motivic + multiple zeta values*, Advanced Studies in Pure Mathematics 63, + 2012. Galois-Teichmuller Theory and Arithmetic Geometry. + +.. [Brown2019] Francis C. S. Brown, *From the Deligne-Ihara conjecture to + multiple modular values*, :arxiv:`1904.00179` + +.. [Deli2012] Pierre Deligne, *Multizêtas, d’après Francis Brown*, + Séminaire Bourbaki, janvier 2012. http://www.bourbaki.ens.fr/TEXTES/1048.pdf + +""" +# **************************************************************************** +# Copyright (C) 2020 Frédéric Chapoton +# +# 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. +# +# https://www.gnu.org/licenses/ +# **************************************************************************** +from sage.structure.unique_representation import UniqueRepresentation +from sage.algebras.free_zinbiel_algebra import FreeZinbielAlgebra +from sage.arith.misc import bernoulli +from sage.categories.cartesian_product import cartesian_product +from sage.categories.graded_algebras_with_basis import GradedAlgebrasWithBasis +from sage.categories.rings import Rings +from sage.categories.domains import Domains +from sage.combinat.free_module import CombinatorialFreeModule +from sage.combinat.integer_vector import IntegerVectors +from sage.combinat.partition import Partitions +from sage.combinat.words.finite_word import FiniteWord_class +from sage.combinat.words.word import Word +from sage.combinat.words.words import Words +from sage.libs.pari.all import pari +from sage.matrix.constructor import matrix +from sage.misc.cachefunc import cached_function, cached_method +from sage.misc.lazy_attribute import lazy_attribute +from sage.misc.misc_c import prod +from sage.modules.free_module_element import vector +from sage.rings.integer_ring import ZZ +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing +from sage.rings.rational_field import QQ +from sage.rings.semirings.non_negative_integer_semiring import NN + + +# multiplicative generators for weight <= 17 +# using the following convention +# (3, 5) <---> (sign) * [1,0,0,1,0,0,0,0] +# taken from the Maple implementation by F. Brown +B_data = [[], [], [(2,)], [(3,)], [], [(5,)], [], [(7,)], [(3, 5)], [(9,)], + [(3, 7)], [(11,), (3, 3, 5)], [(5, 7), (5, 3, 2, 2)], + [(13,), (3, 5, 5), (3, 3, 7)], [(5, 9), (3, 11), (3, 3, 3, 5)], + [(15,), (3, 5, 7), (3, 3, 9), (5, 3, 3, 2, 2)], + [(11, 5), (13, 3), (5, 5, 3, 3), (7, 3, 3, 3), (7, 5, 2, 2)], + [(17,), (7, 5, 5), (9, 3, 5), (9, 5, 3), (11, 3, 3), + (5, 3, 3, 3, 3), (5, 5, 3, 2, 2)]] + + +Words10 = Words((1, 0), infinite=False) + + +def coproduct_iterator(paire): + """ + Return an iterator for terms in the coproduct. + + This is an auxiliary function. + + INPUT: + + - ``paire`` -- a pair (list of indices, end of word) + + OUTPUT: + + iterator for terms in the motivic coproduct + + Each term is seen as a list of positions. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import coproduct_iterator + sage: list(coproduct_iterator(([0],[0,1,0,1]))) + [[0, 1, 2, 3], [0, 3]] + sage: list(coproduct_iterator(([0],[0,1,0,1,1,0,1]))) + [[0, 1, 2, 3, 4, 5, 6], + [0, 1, 2, 6], + [0, 1, 5, 6], + [0, 3, 4, 5, 6], + [0, 4, 5, 6], + [0, 6]] + """ + head, tail = paire + n = len(tail) + if n == 1: + yield head + return + start_value = tail[0] + last_index = head[-1] + yield from coproduct_iterator((head + [last_index + 1], tail[1:])) + for step in range(3, n): + if tail[step] != start_value: + yield from coproduct_iterator((head + [last_index + step], + tail[step:])) + + +def composition_to_iterated(w, reverse=False): + """ + Convert a composition to a word in 0 and 1. + + By default, the chosen convention maps (2,3) to (1,0,1,0,0), + respecting the reading order from left to right. + + The inverse map is given by :func:`iterated_to_composition`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import composition_to_iterated + sage: composition_to_iterated((1,2)) + (1, 1, 0) + sage: composition_to_iterated((3,1,2)) + (1, 0, 0, 1, 1, 0) + sage: composition_to_iterated((3,1,2,4)) + (1, 0, 0, 1, 1, 0, 1, 0, 0, 0) + + TESTS:: + + sage: composition_to_iterated((1,2), True) + (1, 0, 1) + """ + word = tuple([]) + loop_over = reversed(w) if reverse else w + for letter in loop_over: + word += (1,) + (0,) * (letter - 1) + return word + + +def iterated_to_composition(w, reverse=False): + """ + Convert a word in 0 and 1 to a composition. + + By default, the chosen convention maps (1,0,1,0,0) to (2,3). + + The inverse map is given by :func:`composition_to_iterated`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import iterated_to_composition + sage: iterated_to_composition([1,0,1,0,0]) + (2, 3) + sage: iterated_to_composition(Word([1,1,0])) + (1, 2) + sage: iterated_to_composition(Word([1,1,0,1,1,0,0])) + (1, 2, 1, 3) + + TESTS:: + + sage: iterated_to_composition([1,0,1,0,0], True) + (3, 2) + """ + b = [] + count = 1 + for letter in reversed(w): + if letter == 0: + count += 1 + else: + b.append(count) + count = 1 + return tuple(b) if reverse else tuple(reversed(b)) + + +def dual_composition(c): + """ + Return the dual composition of ``c``. + + This is an involution on compositions such that associated + multizetas are equal. + + INPUT: + + - ``c`` -- a composition + + OUTPUT: + + a composition + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import dual_composition + sage: dual_composition([3]) + (1, 2) + sage: dual_composition(dual_composition([3,4,5])) == (3,4,5) + True + """ + i = composition_to_iterated(c) + ri = [1 - x for x in reversed(i)] + return iterated_to_composition(ri) + + +def minimize_term(w, cf): + """ + Return the smallest among w and the dual word of w. + + INPUT: + + - w -- a word in the letters 0 and 1 + + - cf -- a coefficient + + OUTPUT: + + (word, coefficient) + + The chosen order is lexicographic with 1 < 0. + + If the dual word is chosen, the sign of the coefficient is changed, + otherwise the coefficient is returned unchanged. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import minimize_term, Words10 + sage: minimize_term(Words10((1,1,0)), 1) + (word: 110, 1) + sage: minimize_term(Words10((1,0,0)), 1) + (word: 110, -1) + """ + reverse_w = tuple(1 - t for t in reversed(w)) + for x, y in zip(w, reverse_w): + if x > y: + return (w, cf) + if x < y: + return (Words10(reverse_w), (-1)**len(w) * cf) + return (w, cf) + + +# numerical values + +class MultizetaValues(UniqueRepresentation): + """ + Custom cache for numerical values of multiple zetas. + + Computations are performed using the PARI/GP :pari:`zetamultall` (for the + cache) and :pari:`zetamult` (for indices/precision outside of the cache). + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import MultizetaValues + sage: M = MultizetaValues() + + sage: M((1,2)) + 1.202056903159594285399738161511449990764986292340... + sage: parent(M((2,3))) + Real Field with 1024 bits of precision + + sage: M((2,3), prec=53) + 0.228810397603354 + sage: parent(M((2,3), prec=53)) + Real Field with 53 bits of precision + + sage: M((2,3), reverse=False) == M((3,2)) + True + + sage: M((2,3,4,5)) + 2.9182061974731261426525583710934944310404272413...e-6 + sage: M((2,3,4,5), reverse=False) + 0.0011829360522243605614404196778185433287651... + + sage: parent(M((2,3,4,5))) + Real Field with 1024 bits of precision + sage: parent(M((2,3,4,5), prec=128)) + Real Field with 128 bits of precision + """ + def __init__(self): + """ + When first called, pre-compute up to weight 8 at precision 1024. + + TESTS:: + + sage: from sage.modular.multiple_zeta import MultizetaValues + sage: M = MultizetaValues() + """ + self.max_weight = 0 + self.prec = 0 + self.reset() + + def __repr__(self): + r""" + TESTS:: + + sage: from sage.modular.multiple_zeta import MultizetaValues + sage: MultizetaValues() + Cached multiple zeta values at precision 1024 up to weight 8 + """ + return "Cached multiple zeta values at precision %d up to weight %d" % (self.prec, self.max_weight) + + def reset(self, max_weight=8, prec=1024): + r""" + TESTS:: + + sage: from sage.modular.multiple_zeta import MultizetaValues + sage: M = MultizetaValues() + sage: M + Cached multiple zeta values at precision 1024 up to weight 8 + sage: M.reset(5, 64) + sage: M + Cached multiple zeta values at precision 64 up to weight 5 + sage: M.reset() + sage: M + Cached multiple zeta values at precision 1024 up to weight 8 + """ + self.prec = int(prec) + self.max_weight = int(max_weight) + self._data = pari.zetamultall(self.max_weight, self.prec) + + def update(self, max_weight, prec): + """ + Compute and store more values if needed. + + TESTS:: + + sage: from sage.modular.multiple_zeta import MultizetaValues + sage: M = MultizetaValues() + sage: M + Cached multiple zeta values at precision 1024 up to weight 8 + sage: M.update(5, 64) + sage: M + Cached multiple zeta values at precision 1024 up to weight 8 + sage: M.update(5, 2048) + sage: M + Cached multiple zeta values at precision 2048 up to weight 8 + sage: M.reset() + """ + if self.prec < prec or self.max_weight < max_weight: + self.reset(max(self.max_weight, max_weight), max(self.prec, prec)) + + def pari_eval(self, index): + r""" + TESTS:: + + sage: from sage.modular.multiple_zeta import MultizetaValues + sage: M = MultizetaValues() + sage: [M.pari_eval((n,)) for n in range(2,20)] + [1.64493406684823, 1.20205690315959, 1.08232323371114, 1.03692775514337, ... 1.00000381729326, 1.00000190821272] + """ + weight = sum(index) + index = list(reversed(index)) + if weight <= self.max_weight: + index = pari.zetamultconvert(index, 2) + return self._data[index - 1] + else: + return pari.zetamult(index, precision=self.prec) + + def __call__(self, index, prec=None, reverse=True): + r""" + Numerical multiple zeta value as a Sage real floating point number. + + TESTS:: + + sage: from sage.modular.multiple_zeta import MultizetaValues + sage: M = MultizetaValues() + sage: M((3,2)) + 0.7115661975505724320969738060864026120925612044383392364... + sage: M((3,2), reverse=False) + 0.2288103976033537597687461489416887919325093427198821602... + sage: M((3,2), prec=128) + 0.71156619755057243209697380608640261209 + sage: M((3,2), prec=128, reverse=False) + 0.22881039760335375976874614894168879193 + """ + if reverse: + index = list(reversed(index)) + if prec is None: + prec = self.prec + weight = sum(index) + if weight <= self.max_weight and prec <= self.prec: + index = pari.zetamultconvert(index, 2) + value = self._data[index - 1] + return value.sage().n(prec=prec) + else: + return pari.zetamult(index, precision=prec).sage().n(prec=prec) + +Values = MultizetaValues() + +def basis_f_odd_iterator(n): + """ + Return an iterator over compositions of ``n`` with parts in ``(3,5,7,...)`` + + INPUT: + + - ``n`` -- an integer + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import basis_f_odd_iterator + sage: [list(basis_f_odd_iterator(i)) for i in range(2,9)] + [[], [(3,)], [], [(5,)], [(3, 3)], [(7,)], [(5, 3), (3, 5)]] + sage: list(basis_f_odd_iterator(14)) + [(11, 3), + (5, 3, 3, 3), + (3, 5, 3, 3), + (3, 3, 5, 3), + (9, 5), + (3, 3, 3, 5), + (7, 7), + (5, 9), + (3, 11)] + """ + if n == 0: + yield tuple([]) + return + if n == 1: + return + if n % 2: + yield (n,) + for k in range(3, n, 2): + for start in basis_f_odd_iterator(n - k): + yield start + (k, ) + + +def basis_f_iterator(n): + """ + Return an iterator over decompositions of ``n`` using ``2,3,5,7,9,...``. + + The means that each term is made of a power of 2 and a composition + of the remaining integer with parts in ``(3,5,7,...)`` + + INPUT: + + - ``n`` -- an integer + + Each term is returned as a pair (integer, word) where + the integer is the exponent of 2. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import basis_f_iterator + sage: [list(basis_f_iterator(i)) for i in range(2,9)] + [[(1, word: )], + [(0, word: f3)], + [(2, word: )], + [(0, word: f5), (1, word: f3)], + [(0, word: f3,f3), (3, word: )], + [(0, word: f7), (1, word: f5), (2, word: f3)], + [(0, word: f5,f3), (0, word: f3,f5), (1, word: f3,f3), (4, word: )]] + sage: list(basis_f_iterator(11)) + [(0, word: f11), + (0, word: f5,f3,f3), + (0, word: f3,f5,f3), + (0, word: f3,f3,f5), + (1, word: f9), + (1, word: f3,f3,f3), + (2, word: f7), + (3, word: f5), + (4, word: f3)] + """ + if n < 2: + return + for k in range(n // 2 + 1): + for start in basis_f_odd_iterator(n - 2 * k): + yield (k, Word(['f{}'.format(d) for d in start])) + + +def extend_multiplicative_basis(B, n): + """ + Extend a multiplicative basis into a basis. + + This is an iterator. + + INPUT: + + - ``B`` -- function mapping integer to list of tuples of compositions + + - ``n`` -- an integer + + OUTPUT: + + Each term is a tuple of tuples of compositions. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import extend_multiplicative_basis + sage: from sage.modular.multiple_zeta import B_data + sage: list(extend_multiplicative_basis(B_data,5)) + [((5,),), ((3,), (2,))] + sage: list(extend_multiplicative_basis(B_data,6)) + [((3,), (3,)), ((2,), (2,), (2,))] + sage: list(extend_multiplicative_basis(B_data,7)) + [((7,),), ((5,), (2,)), ((3,), (2,), (2,))] + """ + for pi in Partitions(n, min_part=2): + for liste in cartesian_product([B[i] for i in pi]): + yield liste + + +# several classes for the algebra of MZV + + +def Multizeta(*args): + r""" + Common entry point for multiple zeta values. + + If the argument is a sequence of 0 and 1, an element of + :class:`Multizetas_iterated` will be returned. + + Otherwise, an element of :class:`Multizetas` will be returned. + + The base ring is `\QQ`. + + EXAMPLES:: + + sage: Z = Multizeta + sage: Z(1,0,1,0) + I(1010) + sage: Z(3,2,2) + ζ(3,2,2) + + TESTS:: + + sage: Z(3,2,2).iterated().composition() + ζ(3,2,2) + sage: Z(1,0,1,0).composition().iterated() + I(1010) + """ + if 0 in args: + return Multizetas_iterated(QQ)(tuple(args)) + return Multizetas(QQ)(tuple(args)) + + +class Multizetas(CombinatorialFreeModule): + r""" + Main class for the algebra of multiple zeta values. + + The convention is chosen so that `\zeta(1,2)` is convergent. + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: x = M((2,)) + sage: y = M((4,3)) + sage: x+5*y + ζ(2) + 5*ζ(4,3) + sage: x*y + 6*ζ(1,4,4) + 8*ζ(1,5,3) + 3*ζ(2,3,4) + 4*ζ(2,4,3) + 3*ζ(3,2,4) + + 2*ζ(3,3,3) + 6*ζ(4,1,4) + 3*ζ(4,2,3) + ζ(4,3,2) + + TESTS:: + + sage: A = QQ['u'] + sage: u = A.gen() + sage: M = Multizetas(A) + sage: (u*M((2,))+M((3,)))*M((2,)) + 4*u*ζ(1,3) + 6*ζ(1,4) + 2*u*ζ(2,2) + 3*ζ(2,3) + ζ(3,2) + """ + def __init__(self, R): + """ + TESTS:: + + sage: M = Multizetas(QQ) + sage: TestSuite(M).run() # not tested + sage: M.category() + Category of commutative no zero divisors graded algebras + with basis over Rational Field + """ + if R not in Rings(): + raise TypeError("argument R must be a ring") + cat = GradedAlgebrasWithBasis(R).Commutative() + if R in Domains(): + cat = cat & Domains() + CombinatorialFreeModule.__init__(self, R, Words(NN, infinite=False), + prefix="Z", + category=cat) + + def _repr_(self): + r""" + Return a string representation of the algebra. + + EXAMPLES:: + + sage: M = Multizetas(QQ); M + Algebra of motivic multiple zeta values indexed by compositions over Rational Field + """ + txt = "Algebra of motivic multiple zeta values indexed by compositions over {}" + return txt.format(self.base_ring()) + + def _repr_term(self, m): + """ + Return a custom string representation for the monomials. + + EXAMPLES:: + + sage: Multizeta(2,3) # indirect doctest + ζ(2,3) + """ + return "ζ(" + ','.join(str(letter) for letter in m) + ")" + + @cached_method + def one_basis(self): + r""" + Return the index of the unit for the algebra. + + This is the empty word. + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: M.one_basis() + word: + """ + return self.basis().keys()([]) + + def some_elements(self): + r""" + Return some elements of the algebra. + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: M.some_elements() + (ζ(), ζ(2), ζ(3), ζ(4), ζ(1,2)) + """ + return self([]), self([2]), self([3]), self([4]), self((1, 2)) + + def product_on_basis(self, w1, w2): + r""" + Compute the product of two monomials. + + This is done by converting to iterated integrals and + using the shuffle product. + + INPUT: + + - ``w1``, ``w2`` -- compositions + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: M.product_on_basis([2],[2]) + 4*ζ(1,3) + 2*ζ(2,2) + sage: x = M((2,)) + sage: x*x + 4*ζ(1,3) + 2*ζ(2,2) + """ + if not w1: + return self(w2) + if not w2: + return self(w1) + p1 = self.iterated_on_basis(w1) + p2 = self.iterated_on_basis(w2) + p1p2 = p1 * p2 + MZV_it = p1p2.parent() + return MZV_it.composition(p1p2) + + def half_product(self, w1, w2): + r""" + Compute half of the product of two elements. + + This comes from half of the shuffle product. + + INPUT: + + - ``w1``, ``w2`` -- elements + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: M.half_product(M([2]),M([2])) + 2*ζ(1,3) + ζ(2,2) + + TESTS: + + sage: M.half_product(M.one(), M([2])) + Traceback (most recent call last): + ... + ValueError: not defined on the unit + """ + empty = self.one_basis() + if w1.coefficient(empty) or w2.coefficient(empty): + raise ValueError('not defined on the unit') + p1 = self.iterated(w1) + p2 = self.iterated(w2) + MZV_it = p1.parent() + p1p2 = MZV_it.half_product(p1, p2) + return MZV_it.composition(p1p2) + + @lazy_attribute + def iterated(self): + """ + Convert to the algebra of iterated integrals. + + This is also available as a method of elements. + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: x = M((3,2)) + sage: M.iterated(3*x) + 3*I(10010) + sage: x = M((2,3,2)) + sage: M.iterated(4*x) + -4*I(1010010) + """ + cod = Multizetas_iterated(self.base_ring()) + return self.module_morphism(self.iterated_on_basis, codomain=cod) + + def iterated_on_basis(self, w): + """ + Convert to the algebra of iterated integrals. + + Beware that this conversion involves signs in our chosen convention. + + INPUT: + + - ``w`` -- a word + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: x = M.basis().keys()((3,2)) + sage: M.iterated_on_basis(x) + I(10010) + sage: x = M.basis().keys()((2,3,2)) + sage: M.iterated_on_basis(x) + -I(1010010) + """ + codomain = Multizetas_iterated(self.base_ring()) + return (-1)**len(w) * codomain(composition_to_iterated(w)) + + def degree_on_basis(self, w): + """ + Return the degree of the monomial ``w``. + + This is the sum of terms in ``w``. + + INPUT: + + - ``w`` -- a composition + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: x = (2,3) + sage: M.degree_on_basis(x) # indirect doctest + 5 + """ + return ZZ(sum(w)) + + @lazy_attribute + def phi(self): + r""" + Return the morphism ``phi``. + + This sends multiple zeta values to the algebra :func:`F_ring`, + which is a shuffle algebra in odd generators `f_3,f_5,f_7,\dots` + over the polynomial ring in one variable `f_2`. + + This is a ring isomorphism, that depends on the choice of a + multiplicative basis for the ring of motivic multiple zeta + values. Here we use one specific hardcoded basis. + + For the precise definition of ``phi`` by induction, see [Brown2012]_. + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: m = Multizeta(2,2) + 2*Multizeta(1,3); m + 2*ζ(1,3) + ζ(2,2) + sage: M.phi(m) + 1/2*f2^2*Z[] + + sage: Z = Multizeta + sage: B5 = [3*Z(1,4) + 2*Z(2,3) + Z(3,2), 3*Z(1,4) + Z(2,3)] + sage: [M.phi(b) for b in B5] + [f2*Z[f3] - 1/2*Z[f5], 1/2*Z[f5]] + """ + M_it = Multizetas_iterated(self.base_ring()) + return M_it.phi * self.iterated + + def _element_constructor_(self, x): + r""" + Convert ``x`` into ``self``. + + INPUT + + - ``x`` -- either a list, tuple, word or a multiple zeta value + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: M(Word((2,3))) + ζ(2,3) + sage: M(Word([2,3])) + ζ(2,3) + sage: x = M((2,3)); x + ζ(2,3) + sage: M(x) == x + True + """ + if isinstance(x, (FiniteWord_class, tuple, list)): + if x: + assert all(letter >= 1 for letter in x), 'bad letter' + assert x[-1] >= 2, 'bad last letter' + W = self.basis().keys() + return self.monomial(W(x)) + + P = x.parent() + if isinstance(P, Multizetas): + if P is self: + return x + if P is not self.base_ring(): + return self.element_class(self, x.monomial_coefficients()) + elif isinstance(P, Multizetas_iterated): + return x.composition() + + R = self.base_ring() + # coercion via base ring + x = R(x) + if x == 0: + return self.element_class(self, {}) + return self.from_base_ring_from_one_basis(x) + + def algebra_generators(self, n): + """ + Return a set of multiplicative generators in weight ``n``. + + This is obtained from hardcoded data, available only up to weight 17. + + INPUT: + + - ``n`` -- an integer + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: M.algebra_generators(5) + [ζ(5)] + sage: M.algebra_generators(8) + [ζ(3,5)] + """ + return [self(b) for b in B_data[n]] + + def basis_data(self, basering, n): + """ + Return an iterator for a basis in weight ``n``. + + This is obtained from hardcoded data, available only up to weight 17. + + INPUT: + + - ``n`` -- an integer + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: list(M.basis_data(QQ, 4)) + [4*ζ(1,3) + 2*ζ(2,2)] + """ + basis_MZV = extend_multiplicative_basis(B_data, n) + return (prod(self(compo) for compo in term) for term in basis_MZV) + + def basis_brown(self, n): + r""" + Return a basis of the algebra of multiple zeta values in weight ``n``. + + It was proved by Francis Brown that this is a basis of motivic + multiple zeta values. + + This is made of all `\zeta(n_1, ..., n_r)` with parts in {2,3}. + + INPUT: + + - ``n`` -- an integer + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: M.basis_brown(3) + [ζ(3)] + sage: M.basis_brown(4) + [ζ(2,2)] + sage: M.basis_brown(5) + [ζ(3,2), ζ(2,3)] + sage: M.basis_brown(6) + [ζ(3,3), ζ(2,2,2)] + """ + return [self(tuple(c)) + for c in IntegerVectors(n, min_part=2, max_part=3)] + + class Element(CombinatorialFreeModule.Element): + def iterated(self): + """ + Convert to the algebra of iterated integrals. + + Beware that this conversion involves signs. + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: x = M((2,3,4)) + sage: x.iterated() + -I(101001000) + """ + return self.parent().iterated(self) + + def simplify(self): + """ + Gather terms using the duality relations. + + This can help to lower the number of monomials. + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: z = 3*M((3,)) + 5*M((1,2)) + sage: z.simplify() + 8*ζ(1,2) + """ + return self.iterated().simplify().composition() + + def __eq__(self, other): + """ + Test for equality. + + This means equality as motivic multiple zeta value, computed + using the morphism ``phi``. + + EXAMPLES:: + + sage: M = Multizeta + sage: 4*M(1,3) == M(4) + True + sage: our_pi2 = 6*M(2) + sage: Multizeta(2,2,2) == our_pi2**3 / 7.factorial() + True + """ + return self.iterated().phi() == other.iterated().phi() + + def __ne__(self, other): + """ + Test for non-equality. + + This means non-equality as motivic multiple zeta value, computed + using the morphism ``phi``. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizeta + sage: M(2,2,2) != M(6) + True + """ + return not (self == other) + + def phi(self): + """ + Return the image of ``self`` by the morphism ``phi``. + + This sends multiple zeta values to the algebra :func:`F_ring`. + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: M((1,2)).phi() + Z[f3] + + TESTS:: + + sage: A = QQ['u'] + sage: u = A.gen() + sage: M = Multizetas(A) + sage: tst = u*M((1,2))+M((3,)) + sage: tst.phi() + (u+1)*Z[f3] + """ + return self.parent().phi(self) + + def phi_as_vector(self): + """ + Return the image of ``self`` by the morphism ``phi`` as a vector. + + The morphism ``phi`` sends multiple zeta values to the algebra + :func:`F_ring`. Then the image is expressed as a vector in + a fixed basis of one graded component of this algebra. + + This is only defined for homogeneous elements. + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: M((3,2)).phi_as_vector() + (9/2, -2) + + TESTS:: + + sage: (M((4,))+M((1,2))).phi_as_vector() + Traceback (most recent call last): + ... + ValueError: only defined for homogeneous elements + """ + if not self.is_homogeneous(): + raise ValueError('only defined for homogeneous elements') + return f_to_vector(self.parent().phi(self)) + + def _numerical_approx_pari(self): + r""" + The numerical values of individual multiple zeta are obtained via + the class :class:`MultizetaValues` that performs some caching. + + TESTS:: + + sage: M = Multizetas(QQ) + sage: a = M((3,2)) - 2*M((7,)) + sage: a._numerical_approx_pari() + -1.30513235721327 + sage: type(a._numerical_approx_pari()) + + """ + return sum(cf * Values.pari_eval(tuple(w)) for w, cf in self.monomial_coefficients().items()) + + def numerical_approx(self, prec=None, digits=None, algorithm=None): + """ + Return a numerical value for this element. + + EXAMPLES:: + + sage: M = Multizetas(QQ) + sage: M(Word((3,2))).n() # indirect doctest + 0.711566197550572 + sage: parent(M(Word((3,2))).n()) + Real Field with 53 bits of precision + + sage: (M((3,)) * M((2,))).n(prec=80) + 1.9773043502972961181971 + sage: M((1,2)).n(70) + 1.2020569031595942854 + + sage: M((3,)).n(digits=10) + 1.202056903 + + If you need plan to use intensively numerical approximation at high precision, + you might want to add more values and/or accuracy to the cache:: + + sage: from sage.modular.multiple_zeta import MultizetaValues + sage: M = MultizetaValues() + sage: M.update(max_weight=9, prec=2048) + sage: M + Cached multiple zeta values at precision 2048 up to weight 9 + sage: M.reset() # restore precision for the other doctests + """ + if prec is None: + if digits: + from sage.arith.numerical_approx import digits_to_bits + prec = digits_to_bits(digits) + else: + prec = 53 + if algorithm is not None: + raise ValueError("unknown algorithm") + if prec < Values.prec: + s = sum(cf * Values(tuple(w)) for w, cf in self.monomial_coefficients().items()) + return s.n(prec=prec) + else: + return sum(cf * Values(tuple(w), prec=prec) for w, cf in self.monomial_coefficients().items()) + + +class Multizetas_iterated(CombinatorialFreeModule): + r""" + Secondary class for the algebra of multiple zeta values. + + This is used to represent multiple zeta values as iterated integrals + of the differential forms `\omega_0 = \dt/t`and `\omega_1 = \dt/(t-1)`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ); M + Algebra of motivic multiple zeta values as convergent iterated + integrals over Rational Field + sage: M((1,0)) + I(10) + sage: M((1,0))**2 + 4*I(1100) + 2*I(1010) + sage: M((1,0))*M((1,0,0)) + 6*I(11000) + 3*I(10100) + I(10010) + """ + def __init__(self, R): + """ + TESTS:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: TestSuite(M).run() # not tested + sage: M.category() + Category of commutative no zero divisors graded algebras + with basis over Rational Field + """ + if R not in Rings(): + raise TypeError("argument R must be a ring") + cat = GradedAlgebrasWithBasis(R).Commutative() + if R in Domains(): + cat = cat & Domains() + CombinatorialFreeModule.__init__(self, R, Words10, prefix="I", + category=cat) + + def _repr_(self): + """ + Return a string representation for the ring. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ); M + Algebra of motivic multiple zeta values as convergent iterated integrals over Rational Field + """ + return "Algebra of motivic multiple zeta values as convergent iterated integrals over {}".format(self.base_ring()) + + def _repr_term(self, m): + """ + Return a custom string representation for the monomials. + + EXAMPLES:: + + sage: Multizeta(1,0,1,0) # indirect doctest + I(1010) + """ + return "I(" + ''.join(str(letter) for letter in m) + ")" + + @cached_method + def one_basis(self): + r""" + Return the index of the unit for the algebra. + + This is the empty word. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: M.one_basis() + word: + """ + return self.basis().keys()([]) + + def product_on_basis(self, w1, w2): + r""" + Compute the product of two monomials. + + This is the shuffle product. + + INPUT: + + - ``w1``, ``w2`` -- words in 0 and 1 + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: x = Word([1,0]) + sage: M.product_on_basis(x,x) + 2*I(1010) + 4*I(1100) + sage: y = Word([1,1,0]) + sage: M.product_on_basis(y,x) + I(10110) + 3*I(11010) + 6*I(11100) + """ + return sum(self.basis()[u] for u in w1.shuffle(w2)) + + def half_product_on_basis(self, w1, w2): + r""" + Compute half of the product of two monomials. + + This is half of the shuffle product. + + INPUT: + + - ``w1``, ``w2`` -- monomials + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: x = Word([1,0]) + sage: M.half_product_on_basis(x,x) + I(1010) + 2*I(1100) + """ + assert w1 + u1 = Word([w1[0]]) + r1 = w1[1:] + return sum(self.basis()[u1 + u] for u in r1.shuffle(w2)) + + @lazy_attribute + def half_product(self): + r""" + Compute half of the product of two elements. + + This is half of the shuffle product. + + INPUT: + + - ``w1``, ``w2`` -- elements + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: x = M(Word([1,0])) + sage: M.half_product(x,x) + I(1010) + 2*I(1100) + """ + half = self.half_product_on_basis + return self._module_morphism(self._module_morphism(half, position=0, + codomain=self), + position=1) + + def coproduct_on_basis(self, w): + """ + Return the motivic coproduct of a monomial. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: M.coproduct_on_basis([1,0]) + I() # I(10) + I(10) # I() + + sage: M.coproduct_on_basis((1,0,1,0)) + I() # I(1010) + 3*I(10) # I(10) + I(1010) # I() + """ + seq = [0] + list(w) + [1] + terms = coproduct_iterator(([0], seq)) + M_all = All_iterated(self.base_ring()) + + def split_word(indices): + L = self.one() + for i in range(len(indices) - 1): + w = Word(seq[indices[i]:indices[i + 1] + 1]) + if len(w) >= 4: + value = M_all(w) + L *= value.regularise() + return L + + resu = self.tensor_square().zero() + for indices in terms: + resu += split_word(indices).tensor( + M_all(Word(seq[i] for i in indices)).regularise()) + return resu + + @lazy_attribute + def coproduct(self): + """ + Return the motivic coproduct of an element. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: a = 3*Multizeta(1,4) + Multizeta(2,3) + sage: M.coproduct(a.iterated()) + 3*I() # I(11000) + I() # I(10100) + 3*I(11000) # I() + - I(10) # I(100) + I(10100) # I() + """ + cop = self.coproduct_on_basis + return self._module_morphism(cop, codomain=self.tensor_square()) + + @lazy_attribute + def composition(self): + """ + Convert to the algebra of multiple zeta values of composition style. + + This means the algebra :class:`Multizetas`. + + This is also available as a method of elements. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: x = M((1,0)) + sage: M.composition(2*x) + -2*ζ(2) + sage: x = M((1,0,1,0,0)) + sage: M.composition(x) + ζ(2,3) + """ + cod = Multizetas(self.base_ring()) + return self.module_morphism(self.composition_on_basis, codomain=cod) + + def composition_on_basis(self, w, basering=None): + """ + Convert to the algebra of multiple zeta values of composition style. + + INPUT: + + - ``basering`` -- optional choice of the coefficient ring + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: x = Word((1,0,1,0,0)) + sage: M.composition_on_basis(x) + ζ(2,3) + sage: x = Word((1,0,1,0,0,1,0)) + sage: M.composition_on_basis(x) + -ζ(2,3,2) + """ + if basering is None: + basering = self.base_ring() + codomain = Multizetas(basering) + return (-1)**w.count(1) * codomain(iterated_to_composition(w)) + + def dual_on_basis(self, w): + """ + Return the order of the word and exchange letters 0 and 1. + + This is an involution. + + INPUT: + + - ``w`` -- a word in 0 and 1 + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: x = Word((1,0,1,0,0)) + sage: M.dual_on_basis(x) + -I(11010) + """ + rev = [1 - x for x in reversed(w)] + return (-1)**len(w) * self(self.basis().keys()(rev)) + + def degree_on_basis(self, w): + """ + Return the degree of the monomial ``w``. + + This is the length of the word. + + INPUT: + + - ``w`` -- a word in 0 and 1 + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: x = Word((1,0,1,0,0)) + sage: M.degree_on_basis(x) + 5 + """ + return ZZ(len(w)) + + def D_on_basis(self, k, w): + """ + Return the action of the operator `D_k` on the monomial ``w``. + + This is one main tool in the procedure that allows + to map the algebra of multiple zeta values to + the F Ring. + + INPUT: + + - ``k`` -- an odd integer, at least 3 + + - ``w`` -- a word in 0 and 1 + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: M.D_on_basis(3,(1,1,1,0,0)) + I(110) # I(10) + 2*I(100) # I(10) + + sage: M.D_on_basis(3,(1,0,1,0,0)) + 3*I(100) # I(10) + sage: M.D_on_basis(5,(1,0,0,0,1,0,0,1,0,0)) + 10*I(10000) # I(10100) + """ + Im = All_iterated(self.base_ring()) + MZV_MZV = self.tensor_square() + N = len(w) + it = [0] + list(w) + [1] + coprod = MZV_MZV.zero() + for p in range(N + 1 - k): + left = Im(it[p: p + k + 2]) + right = Im(it[:p + 1] + it[p + k + 1:]) + if left and right: + coprod += left.regularise().tensor(right.regularise()) + return coprod + + @cached_method + def phi_extended(self, w): + r""" + Return the image of the monomial ``w`` by the morphism ``phi``. + + INPUT: + + - ``w`` -- a word in 0 and 1 + + OUTPUT: + + an element in the algebra :func:`F_ring` + + The coefficients are in the base ring. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: M.phi_extended((1,0)) + -f2*Z[] + sage: M.phi_extended((1,0,0)) + -Z[f3] + sage: M.phi_extended((1,1,0)) + Z[f3] + sage: M.phi_extended((1,0,1,0,0)) + 3*f2*Z[f3] - 11/2*Z[f5] + + More complicated examples:: + + sage: from sage.modular.multiple_zeta import composition_to_iterated + sage: M.phi_extended(composition_to_iterated((4,3))) + 2/5*f2^2*Z[f3] + 10*f2*Z[f5] - 18*Z[f7] + + sage: M.phi_extended(composition_to_iterated((3,4))) + -10*f2*Z[f5] + 17*Z[f7] + + sage: M.phi_extended(composition_to_iterated((4,2))) + 10/21*f2^3*Z[] - 2*Z[f3,f3] + sage: M.phi_extended(composition_to_iterated((3,5))) + -5*Z[f5,f3] + sage: M.phi_extended(composition_to_iterated((3,7))) + -6*Z[f5,f5] - 14*Z[f7,f3] + + sage: M.phi_extended(composition_to_iterated((3,3,2))) + -793/875*f2^4*Z[] - 4*f2*Z[f3,f3] + 9*Z[f3,f5] - 9/2*Z[f5,f3] + + TESTS:: + + sage: M.phi_extended(tuple([])) + Z[] + """ + # this is now hardcoded + # prec = 1024 + f = F_ring_generator + if not w: + F = F_ring(self.base_ring()) + empty = F.indices()([]) + return F.monomial(empty) + N = len(w) + compo = tuple(iterated_to_composition(w)) + BRf2 = PolynomialRing(self.base_ring(), 'f2') + if compo in B_data[N]: + # do not forget the sign + result_QQ = (-1)**len(compo) * phi_on_multiplicative_basis(compo) + return result_QQ.base_extend(BRf2) + u = compute_u_on_basis(w) + rho_inverse_u = rho_inverse(u) + xi = self.composition_on_basis(w, QQ) + c_xi = (xi - rho_inverse_u)._numerical_approx_pari() + c_xi /= Multizeta(N)._numerical_approx_pari() + c_xi = c_xi.bestappr().sage() # in QQ + result_QQ = u + c_xi * f(N) + return result_QQ.base_extend(BRf2) + + @lazy_attribute + def phi(self): + """ + Return the morphism ``phi``. + + This sends multiple zeta values to the algebra :func:`F_ring`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: m = Multizeta(1,0,1,0) + 2*Multizeta(1,1,0,0); m + 2*I(1100) + I(1010) + sage: M.phi(m) + 1/2*f2^2*Z[] + + sage: Z = Multizeta + sage: B5 = [3*Z(1,4) + 2*Z(2,3) + Z(3,2), 3*Z(1,4) + Z(2,3)] + sage: [M.phi(b.iterated()) for b in B5] + [f2*Z[f3] - 1/2*Z[f5], 1/2*Z[f5]] + + sage: B6 = [6*Z(1,5) + 3*Z(2,4) + Z(3,3), + ....: 6*Z(1,1,4) + 4*Z(1,2,3) + 2*Z(1,3,2) + 2*Z(2,1,3) + Z(2,2,2)] + sage: [M.phi(b.iterated()) for b in B6] + [Z[f3,f3], 1/6*f2^3*Z[]] + """ + cod = F_ring(self.base_ring()) + return self.module_morphism(self.phi_extended, codomain=cod) + + def _element_constructor_(self, x): + r""" + Convert ``x`` into ``self``. + + INPUT + + - ``x`` -- either a list, tuple, word or a multiple zeta value + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: x = Word((1,0,1,0,0)) + sage: M(x) + I(10100) + sage: y = M((1,1,0,0)); y + I(1100) + sage: y == M(y) + True + """ + if isinstance(x, (str, (FiniteWord_class, tuple, list))): + if x: + assert all(letter in (0, 1) for letter in x), 'bad letter' + assert x[0] == 1, 'bad first letter, should be 1' + assert x[-1] == 0, 'bad last letter, should be 0' + W = self.basis().keys() + return self.monomial(W(x)) + + P = x.parent() + if isinstance(P, Multizetas_iterated): + if P is self: + return x + if P is not self.base_ring(): + return self.element_class(self, x.monomial_coefficients()) + elif isinstance(P, Multizetas): + return x.iterated() + + R = self.base_ring() + # coercion via base ring + x = R(x) + if x == 0: + return self.element_class(self, {}) + else: + return self.from_base_ring_from_one_basis(x) + + class Element(CombinatorialFreeModule.Element): + def simplify(self): + """ + Gather terms using the duality relations. + + This can help to lower the number of monomials. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: z = 4*M((1,0,0)) + 3*M((1,1,0)) + sage: z.simplify() + -I(110) + """ + summing = self.parent().sum_of_terms + return summing(minimize_term(w, cf) + for w, cf in self.monomial_coefficients().items()) + + def composition(self): + """ + Convert to the algebra of multiple zeta values of composition style. + + This means the algebra :class:`Multizetas`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: x = M((1,0,1,0)) + sage: x.composition() + ζ(2,2) + sage: x = M((1,0,1,0,0)) + sage: x.composition() + ζ(2,3) + sage: x = M((1,0,1,0,0,1,0)) + sage: x.composition() + -ζ(2,3,2) + """ + return self.parent().composition(self) + + def numerical_approx(self, prec=None, digits=None, algorithm=None): + """ + Return a numerical approximation as a sage real. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: x = M((1,0,1,0)) + sage: y = M((1, 0, 0)) + sage: (3*x+y).n() # indirect doctest + 1.23317037269047 + """ + return self.composition().numerical_approx(prec=prec, digits=digits, algorithm=algorithm) + + def phi(self): + """ + Return the image of ``self`` by the morphism ``phi``. + + This sends multiple zeta values to the algebra :func:`F_ring`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: M((1,1,0)).phi() + Z[f3] + """ + return self.parent().phi(self) + + def __eq__(self, other): + """ + Test for equality. + + This means equality as motivic multiple zeta value, computed + using the morphism ``phi``. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: M((1,1,0)) == -M((1,0,0)) + True + + sage: M = Multizetas(QQ) + sage: a = 28*M((3,9))+150*M((5,7))+168*M((7,5)) + sage: b = 5197/691*M((12,)) + sage: a.iterated() == b.iterated() # not tested, long time 20s + True + """ + return self.phi() == other.phi() + + def __ne__(self, other): + """ + Test for non-equality. + + This means non-equality as motivic multiple zeta value, computed + using the morphism ``phi``. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import Multizetas_iterated + sage: M = Multizetas_iterated(QQ) + sage: M((1,0)) == M((1,0,0)) + False + """ + return not (self == other) + + +class All_iterated(CombinatorialFreeModule): + r""" + Auxiliary class for multiple zeta value as generalized iterated integrals. + + This is used to represent multiple zeta values as possibly + divergent iterated integrals + of the differential forms `\omega_0 = \dt/t`and `\omega_1 = \dt/(t-1)`. + + This means that the elements are symbols + `I(a_0 ; a_1,a_2,...a_m ; a_{n+1})` + where all arguments, including the starting and ending points + can be 0 or 1. + + This comes with a "regularise" method mapping + to :class:`Multizeta_iterated`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ); M + Space of motivic multiple zeta values as general iterated integrals + over Rational Field + sage: M((0,1,0,1)) + I(0;10;1) + sage: x = M((1,1,0,0)); x + I(1;10;0) + sage: x.regularise() + -I(10) + """ + def __init__(self, R): + """ + TESTS:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ) + sage: TestSuite(M).run() # not tested + """ + if R not in Rings(): + raise TypeError("argument R must be a ring") + CombinatorialFreeModule.__init__(self, R, Words10, prefix="I") + + def _repr_(self): + """ + Return a string representation of the module. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ); M + Space of motivic multiple zeta values as general iterated integrals over Rational Field + """ + txt = "Space of motivic multiple zeta values as general iterated integrals over {}" + return txt.format(self.base_ring()) + + def _repr_term(self, m): + """ + Return a custom string representation for the monomials. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ) + sage: x = Word((1,0,1,0,0)) + sage: M(x) # indirect doctest + I(1;010;0) + """ + start = str(m[0]) + end = str(m[-1]) + mid = ''.join(str(letter) for letter in m[1:-1]) + return "I(" + start + ";" + mid + ";" + end + ")" + + def _element_constructor_(self, x): + r""" + Convert ``x`` into ``self``. + + INPUT + + - ``x`` -- either a list, tuple, word + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ) + sage: y = M((1,1,0,0)); y + I(1;10;0) + sage: y == M(y) + True + """ + if isinstance(x, (str, (FiniteWord_class, tuple, list))): + if x: + assert all(letter in (0, 1) for letter in x), 'bad letter' + # assert len(x) >= 4, 'word too short' + W = self.basis().keys() + mot = W(x) + # conditions R1 de F. Brown + if mot[0] == mot[-1] or (len(x) >= 4 and + all(x == mot[1] for x in mot[2:-1])): + return self.zero() + return self.monomial(mot) + + def dual_on_basis(self, w): + """ + Reverse the word and exchange the letters 0 and 1. + + This is the operation R4 in [Brown2012]_. + + This should be used only when `a_0 = 0` and `a_{n+1} = 1`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ) + sage: x = Word((0,0,1,0,1)) + sage: M.dual_on_basis(x) + I(0;010;1) + sage: x = Word((0,1,0,1,1)) + sage: M.dual_on_basis(x) + -I(0;010;1) + """ + if w[-2] == 0: + return self(w) + rev = [1 - x for x in reversed(w)] + return (-1)**len(w) * self(self.basis().keys()(rev)) + + @lazy_attribute + def dual(self): + """ + Reverse words and exchange the letters 0 and 1. + + This is the operation R4 in [Brown2012]_. + + This should be used only when `a_0 = 0` and `a_{n+1} = 1`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ) + sage: x = Word((0,0,1,1,1)) + sage: y = Word((0,0,1,0,1)) + sage: M.dual(M(x)+5*M(y)) + 5*I(0;010;1) - I(0;001;1) + """ + return self.module_morphism(self.dual_on_basis, codomain=self) + + def reversal_on_basis(self, w): + """ + Reverse the word if necessary. + + This is the operation R3 in [Brown2012]_. + + This reverses the word only if `a_0 = 0` and `a_{n+1} = 1`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ) + sage: x = Word((1,0,1,0,0)) + sage: M.reversal_on_basis(x) + -I(0;010;1) + sage: x = Word((0,0,1,1,1)) + sage: M.reversal_on_basis(x) + I(0;011;1) + """ + if w[0] == 0 and w[-1] == 1: + return self(w) + W = self.basis().keys() + return (-1)**len(w) * self.monomial(W(list(reversed(w)))) + + @lazy_attribute + def reversal(self): + """ + Reverse words if necessary. + + This is the operation R3 in [Brown2012]_. + + This reverses the word only if `a_0 = 0` and `a_{n+1} = 1`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ) + sage: x = Word((1,0,1,0,0)) + sage: y = Word((0,0,1,1,1)) + sage: M.reversal(M(x)+2*M(y)) + 2*I(0;011;1) - I(0;010;1) + """ + return self.module_morphism(self.reversal_on_basis, codomain=self) + + def expand_on_basis(self, w): + """ + Perform an expansion as a linear combination. + + This is the operation R2 in [Brown2012]_. + + This should be used only when `a_0 = 0` and `a_{n+1} = 1`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ) + sage: x = Word((0,0,1,0,1)) + sage: M.expand_on_basis(x) + -2*I(0;100;1) + + sage: x = Word((0,0,0,1,0,1,0,0,1)) + sage: M.expand_on_basis(x) + 6*I(0;1010000;1) + 6*I(0;1001000;1) + 3*I(0;1000100;1) + + sage: x = Word((0,1,1,0,1)) + sage: M.expand_on_basis(x) + I(0;110;1) + """ + if w[1] == 1: + return self(w) + + mot = w[1:-1] + n_zeros = [] + k = 0 + for x in mot: + if x == 0: + k += 1 + else: + n_zeros.append(k) + k = 1 + n_zeros.append(k) + k = n_zeros[0] + n_zeros = n_zeros[1:] + r = len(n_zeros) + + resu = self.zero() + for idx in IntegerVectors(k, r): + coeff = ZZ.prod(ZZ(nj + ij - 1).binomial(ij) + for nj, ij in zip(n_zeros, idx)) + indice = [0] + for nj, ij in zip(n_zeros, idx): + indice += [1] + [0] * (nj + ij - 1) + resu += coeff * self(indice + [1]) + return (-1)**k * resu # attention au signe + + @lazy_attribute + def expand(self): + """ + Perform an expansion as a linear combination. + + This is the operation R2 in [Brown2012]_. + + This should be used only when `a_0 = 0` and `a_{n+1} = 1`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ) + sage: x = Word((0,0,1,0,1)) + sage: y = Word((0,0,1,1,1)) + sage: M.expand(M(x)+2*M(y)) + -2*I(0;110;1) - 2*I(0;101;1) - 2*I(0;100;1) + sage: M.expand(M([0,1,1,0,1])) + I(0;110;1) + sage: M.expand(M([0,1,0,0,1])) + I(0;100;1) + """ + return self.module_morphism(self.expand_on_basis, codomain=self) + + class Element(CombinatorialFreeModule.Element): + def conversion(self): + """ + Conversion to the :class:`Multizeta_iterated`. + + This assumed that the element has been prepared. + + Not to be used directly. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ) + sage: x = Word((0,1,0,0,1)) + sage: y = M(x).conversion(); y + I(100) + sage: y.parent() + Algebra of motivic multiple zeta values as convergent iterated + integrals over Rational Field + """ + M = Multizetas_iterated(self.parent().base_ring()) + return sum(cf * M.monomial(w[1:-1]) for w, cf in self) + + def regularise(self): + """ + Conversion to the :class:`Multizeta_iterated`. + + This is the regularisation procedure, done in several steps. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import All_iterated + sage: M = All_iterated(QQ) + sage: x = Word((0,0,1,0,1)) + sage: M(x).regularise() + -2*I(100) + sage: x = Word((0,1,1,0,1)) + sage: M(x).regularise() + I(110) + + sage: x = Word((1,0,1,0,0)) + sage: M(x).regularise() + 2*I(100) + """ + P = self.parent() + step1 = P.reversal(self) # R3 + step2 = P.expand(step1) # R2 + step3 = P.dual(step2) # R4 + step4 = P.expand(step3) # R2 + return step4.conversion() # dans Multizeta_iterated + + +# **************** procedures after F. Brown ************ + + +def F_ring(basering, N=18): + r""" + Return the free Zinbiel algebra on many generators `f_3,f_5,\dots` + over the polynomial ring with generator `f_2`. + + For the moment, only with a finite number of variables. + + INPUT: + + - ``N`` -- an integer (default 18), upper bound for indices of generators + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import F_ring + sage: F_ring(QQ) + Free Zinbiel algebra on generators (Z[f3], Z[f5], Z[f7], Z[f9], ...) + over Univariate Polynomial Ring in f2 over Rational Field + """ + ring = PolynomialRing(basering, ['f2']) + return FreeZinbielAlgebra(ring, ['f{}'.format(k) + for k in range(3, N, 2)]) + + +def F_prod(a, b): + """ + Return the associative and commutative product of ``a`` and ``b``. + + INPUT: + + - ``a``, ``b`` -- two elements of the F ring + + OUTPUT: + + an element of the F ring + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import F_ring_generator, F_prod + sage: f2 = F_ring_generator(2) + sage: f3 = F_ring_generator(3) + sage: F_prod(f2,f2) + f2^2*Z[] + sage: F_prod(f2,f3) + f2*Z[f3] + sage: F_prod(f3,f3) + 2*Z[f3,f3] + sage: F_prod(3*f2+5*f3,6*f2+f3) + 18*f2^2*Z[] + 33*f2*Z[f3] + 10*Z[f3,f3] + """ + F = a.parent() + empty = F.indices()([]) + one = F.monomial(empty) + ct_a = a.coefficient(empty) + ct_b = b.coefficient(empty) + rem_a = a - ct_a * one + rem_b = b - ct_b * one + resu = ct_a * ct_b * one + ct_a * rem_b + ct_b * rem_a + return resu + rem_a * rem_b + rem_b * rem_a + + +def F_ring_generator(i): + r""" + Return the generator of the F ring over `\QQ`. + + INPUT: + + - ``i`` -- a nonnegative integer + + If ``i`` is odd, this returns a single generator `f_i` of the free + shuffle algebra. + + Otherwise, it returns an appropriate multiple of a power of `f_2`. + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import F_ring_generator + sage: [F_ring_generator(i) for i in range(2,8)] + [f2*Z[], Z[f3], 2/5*f2^2*Z[], Z[f5], 8/35*f2^3*Z[], Z[f7]] + """ + F = F_ring(QQ) + one = F.monomial(Word([])) + f2 = F.base_ring().gen() + if i == 2: + return f2 * one + # now i odd >= 3 + if i % 2: + return F.monomial(Word(['f{}'.format(i)])) + i = i // 2 + B = bernoulli(2 * i) * (-1)**(i - 1) + B *= ZZ(2)**(3 * i - 1) * ZZ(3)**i / ZZ(2 * i).factorial() + return B * f2**i * one + + +def coeff_phi(w): + """ + Return the coefficient of `f_k` in the image by ``phi``. + + INPUT: + + - ``w`` -- a word in 0 and 1 with `k` letters (where `k` is odd) + + OUTPUT: + + a rational number + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import coeff_phi + sage: coeff_phi(Word([1,0,0])) + -1 + sage: coeff_phi(Word([1,1,0])) + 1 + sage: coeff_phi(Word([1,1,0,1,0])) + 11/2 + sage: coeff_phi(Word([1,1,0,0,0,1,0])) + 109/16 + """ + if all(x == 0 for x in w[1:]): + return -1 # beware the sign + k = len(w) + assert k % 2 + M = Multizetas_iterated(QQ) + z = M.phi_extended(w) + W = z.parent().basis().keys() + w = W(['f{}'.format(k)]) + return z.coefficient(w).lc() # in QQ + + +def phi_on_multiplicative_basis(compo): + """ + Compute ``phi`` on one single multiple zeta value. + + INPUT: + + - ``compo`` -- a composition (in the hardcoded multiplicative base) + + OUTPUT: + + an element in :func:`F_ring` with rational coefficients + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import phi_on_multiplicative_basis + sage: phi_on_multiplicative_basis((2,)) + f2*Z[] + sage: phi_on_multiplicative_basis((3,)) + Z[f3] + """ + f = F_ring_generator + F = F_ring(QQ) + one = F.monomial(Word([])) + + if tuple(compo) == (2,): + return f(2) * one + + if len(compo) == 1: + n, = compo + return f(n) + + return compute_u_on_compo(compo) + + +def phi_on_basis(L): + """ + Compute the value of phi on the hardcoded basis. + + INPUT: + + a list of compositions, each composition in the hardcoded basis + + This encodes a product of multiple zeta values. + + OUTPUT: + + an element in :func:`F_ring` + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import phi_on_basis + sage: phi_on_basis([(3,),(3,)]) + 2*Z[f3,f3] + sage: phi_on_basis([(2,),(2,)]) + f2^2*Z[] + sage: phi_on_basis([(2,),(3,),(3,)]) + 2*f2*Z[f3,f3] + """ + # beware that the default * is the half-shuffle ! + F = F_ring(QQ) + resu = F.monomial(Word([])) + for compo in L: + resu = F_prod(resu, phi_on_multiplicative_basis(compo)) + return resu + + +def D_on_compo(k, compo): + """ + Return the value of the operator `D_k` on a multiple zeta value. + + This is now only used as a place to keep many doctests. + + INPUT: + + - ``k`` -- an odd integer + + - ``compo`` -- a composition + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import D_on_compo + sage: D_on_compo(3,(2,3)) + 3*I(100) # I(10) + + sage: D_on_compo(3,(4,3)) + I(100) # I(1000) + sage: D_on_compo(5,(4,3)) + 10*I(10000) # I(10) + + sage: [D_on_compo(k, [3,5]) for k in (3,5,7)] + [0, -5*I(10000) # I(100), 0] + + sage: [D_on_compo(k, [3,7]) for k in (3,5,7,9)] + [0, -6*I(10000) # I(10000), -14*I(1000000) # I(100), 0] + + sage: D_on_compo(3,(4,3,3)) + -I(100) # I(1000100) + sage: D_on_compo(5,(4,3,3)) + -10*I(10000) # I(10100) + sage: D_on_compo(7,(4,3,3)) + 4*I(1001000) # I(100) + 2*I(1000100) # I(100) + + sage: [D_on_compo(k,(1,3,1,3,1,3)) for k in range(3,10,2)] + [0, 0, 0, 0] + """ + it = composition_to_iterated(compo) + M = Multizetas_iterated(QQ) + return (-1)**len(compo) * M.D_on_basis(k, it) + + +def compute_u_on_compo(compo): + r""" + Compute the value of the map ``u`` on a multiple zeta value. + + INPUT: + + - ``compo`` -- a composition + + OUTPUT: + + an element of :func:`F_ring` over `\QQ` + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import compute_u_on_compo + sage: compute_u_on_compo((2,4)) + 2*Z[f3,f3] + sage: compute_u_on_compo((2,3,2)) + -11/2*f2*Z[f5] + sage: compute_u_on_compo((3,2,3,2)) + 11*f2*Z[f3,f5] - 75/4*Z[f3,f7] - 9*f2*Z[f5,f3] + 81/4*Z[f5,f5] + 75/8*Z[f7,f3] + """ + it = composition_to_iterated(compo) + return (-1)**len(compo) * compute_u_on_basis(it) + + +def compute_u_on_basis(w): + r""" + Compute the value of ``u`` on a multiple zeta value. + + INPUT: + + - ``w`` -- a word in 0,1 + + OUTPUT: + + an element of :func:`F_ring` over `\QQ` + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import compute_u_on_basis + sage: compute_u_on_basis((1,0,0,0,1,0)) + -2*Z[f3,f3] + + sage: compute_u_on_basis((1,1,1,0,0)) + f2*Z[f3] + + sage: compute_u_on_basis((1,0,0,1,0,0,0,0)) + -5*Z[f5,f3] + + sage: compute_u_on_basis((1,0,1,0,0,1,0)) + 11/2*f2*Z[f5] + + sage: compute_u_on_basis((1,0,0,1,0,1,0,0,1,0)) + 11*f2*Z[f3,f5] - 75/4*Z[f3,f7] - 9*f2*Z[f5,f3] + 81/4*Z[f5,f5] + + 75/8*Z[f7,f3] + """ + M = Multizetas_iterated(QQ) + F = F_ring(QQ) + f = F_ring_generator + N = len(w) + xi_dict = {} + for k in range(3, N, 2): + xi_dict[k] = F.sum(cf * coeff_phi(ww[0]) * M.phi_extended(tuple(ww[1])) + for ww, cf in M.D_on_basis(k, w)) + return F.sum(f(k) * xi_dict[k] for k in range(3, N, 2)) + + +def f_to_vector(elt): + """ + Convert an element of F ring to a vector. + + INPUT: + + an homogeneous element of :func:`F_ring` over some base ring + + OUTPUT: + + a vector with coefficients in the base ring + + .. SEEALSO:: :func:`vector_to_f` + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import F_ring, vector_to_f, f_to_vector + sage: F = F_ring(QQ) + sage: f2 = F.base_ring().gen() + sage: x = f2**4*F.monomial(Word([]))+f2*F.monomial(Word(['f3','f3'])) + sage: f_to_vector(x) + (0, 0, 1, 1) + sage: vector_to_f(_,8) + f2^4*Z[] + f2*Z[f3,f3] + + sage: x = F.monomial(Word(['f11'])); x + Z[f11] + sage: f_to_vector(x) + (1, 0, 0, 0, 0, 0, 0, 0, 0) + """ + F = elt.parent() + BR = F.base_ring().base_ring() + a, b = next(iter(elt)) + N = sum(int(x[1:]) for x in a) + 2 * b.degree() + W = F.basis().keys() + return vector(BR, [elt.coefficient(W(b)).lc() + for _, b in basis_f_iterator(N)]) + + +def vector_to_f(vec, N): + """ + Convert back a vector to an element of the F ring. + + INPUT: + + a vector with coefficients in some base ring + + OUTPUT: + + an homogeneous element of :func:`F_ring` over this base ring + + .. SEEALSO:: :func:`f_to_vector` + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import vector_to_f, f_to_vector + sage: vector_to_f((4,5),6) + 5*f2^3*Z[] + 4*Z[f3,f3] + sage: f_to_vector(_) + (4, 5) + """ + if isinstance(vec, (list, tuple)): + vec = vector(vec) + BR = vec.base_ring() + F = F_ring(BR) + f2 = F.base_ring().gen() + basis_F = (f2**k * F.monomial(b) + for k, b in basis_f_iterator(N)) + return sum(cf * bi for cf, bi in zip(vec, basis_F)) + + +@cached_function +def rho_matrix_inverse(n): + """ + Return the matrix of the inverse of ``rho``. + + This is the matrix in the chosen bases, namely the hardcoded basis + of multiple zeta values and the natural basis of the F ring. + + INPUT: + + - ``n`` -- an integer + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import rho_matrix_inverse + sage: rho_matrix_inverse(3) + [1] + sage: rho_matrix_inverse(8) + [-1/5 0 0 0] + [ 1/5 1 0 0] + [ 0 0 1/2 0] + [ 0 0 0 1] + """ + base = extend_multiplicative_basis(B_data, n) + resu = [] + for b in base: + phi_b = phi_on_basis(b) + resu.append(f_to_vector(phi_b)) + dN = len(resu) + return ~matrix(QQ, dN, dN, resu) + + +def rho_inverse(elt): + """ + Return the image by the inverse of ``rho``. + + INPUT: + + - ``elt`` -- an homogeneous element of the F ring + + OUTPUT: + + a linear combination of multiple zeta values + + EXAMPLES:: + + sage: from sage.modular.multiple_zeta import F_ring_generator, rho_inverse + sage: f = F_ring_generator + sage: rho_inverse(f(3)) + ζ(3) + sage: rho_inverse(f(9)) + ζ(9) + """ + pa = elt.parent() + BR = pa.base_ring().base_ring() + M_BR = Multizetas(BR) + if elt == pa.zero(): + return M_BR.zero() + + a, b = next(iter(elt)) + N = sum(int(x[1]) for x in a) + 2 * b.degree() + + v = f_to_vector(elt) + w = v * rho_matrix_inverse(N) + return sum(cf * b for cf, b in zip(w, M_BR.basis_data(BR, N))) From e68f764e84ae09ebeff309058a2979ecff969cb5 Mon Sep 17 00:00:00 2001 From: Simon Brandhorst Date: Wed, 29 Apr 2020 13:13:08 +0200 Subject: [PATCH 029/301] direct sum for genera --- src/sage/quadratic_forms/genera/genus.py | 78 ++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/src/sage/quadratic_forms/genera/genus.py b/src/sage/quadratic_forms/genera/genus.py index 2b938fe2315..5f4e7b63100 100644 --- a/src/sage/quadratic_forms/genera/genus.py +++ b/src/sage/quadratic_forms/genera/genus.py @@ -1970,6 +1970,54 @@ def dimension(self): dim = dimension rank = dimension + def direct_sum(self, other): + r""" + Return the local genus of the direct sum of two representatives. + + + EXAMPLES:: + + sage: from sage.quadratic_forms.genera.genus import p_adic_symbol + sage: from sage.quadratic_forms.genera.genus import Genus_Symbol_p_adic_ring + sage: A = matrix.diagonal([1,2,3,4]) + sage: p = 2 + sage: G2 = Genus_Symbol_p_adic_ring(p, p_adic_symbol(A, p, 2)); G2 + Genus symbol at 2: [1^-2 2^1 4^1]_6 + sage: G2.direct_sum(G2) + Genus symbol at 2: [1^4 2^2 4^2]_4 + """ + if self.prime() != other.prime(): + raise ValueError("the local genus symbols must be over the same prime") + sym1 = self.symbol_tuple_list() + sym2 = other.symbol_tuple_list() + m = max(sym1[-1][0], sym2[-1][0]) + sym1 = dict([[s[0], s] for s in sym1]) + sym2 = dict([[s[0], s] for s in sym2]) + + symbol = [] + for k in range(m+1): + if self.prime() == 2: + b = [k, 0, 1, 0, 0] + else: + b = [k, 0, 1] + for sym in [sym1, sym2]: + try: + s = sym[k] + b[1] += s[1] + b[2] *= s[2] + if self.prime() == 2: + b[2] = b[2] % 8 + if s[3] == 1: + b[3] = s[3] + b[4] = (b[4] + s[4]) % 8 + except KeyError: + pass + if b[1] != 0: + symbol.append(b) + if self.rank() == other.rank() == 0: + symbol = self.symbol_tuple_list() + return Genus_Symbol_p_adic_ring(self.prime(), symbol) + def excess(self): r""" Returns the p-excess of the quadratic form whose Hessian @@ -2430,6 +2478,36 @@ def dimension(self): dim = dimension rank = dimension + def direct_sum(self, other): + r""" + Return the genus of the direct sum of ``self`` and ``other``. + + The direct sum is defined as the direct sum of representatives. + + EXAMPLES:: + + sage: G = IntegralLattice("A4").twist(3).genus() + sage: G.direct_sum(G) + Genus of + None + Signature: (8, 0) + Genus symbol at 2: 1^8 + Genus symbol at 3: 3^8 + Genus symbol at 5: 1^6 5^2 + """ + p1, n1 = self.signature_pair() + p2, n2 = other.signature_pair() + signature_pair = (p1 + p2, n1 + n2) + + primes = [s.prime() for s in self.local_symbols()] + primes += [s.prime() for s in other.local_symbols() if not s.prime() in primes] + primes.sort() + local_symbols = [] + for p in primes: + sym_p = self.local_symbol(p=p).direct_sum(other.local_symbol(p=p)) + local_symbols.append(sym_p) + return GenusSymbol_global_ring(signature_pair, local_symbols) + def discriminant_form(self): r""" Return the discriminant form associated to this genus. From e0d812f6786d1846e40257bdc61059514a2c7d1f Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Wed, 29 Apr 2020 14:06:00 +0100 Subject: [PATCH 030/301] correct the use of AC_CHECK_HEADERS --- build/pkgs/suitesparse/spkg-configure.m4 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/build/pkgs/suitesparse/spkg-configure.m4 b/build/pkgs/suitesparse/spkg-configure.m4 index 0c2a1397671..d3a2fb6f873 100644 --- a/build/pkgs/suitesparse/spkg-configure.m4 +++ b/build/pkgs/suitesparse/spkg-configure.m4 @@ -3,12 +3,10 @@ SAGE_SPKG_CONFIGURE([suitesparse], [ AC_SEARCH_LIBS([cholmod_speye], [cholmod], [ AC_SEARCH_LIBS([umfpack_di_solve], [umfpack], [ AC_SEARCH_LIBS([SuiteSparse_version], [suitesparseconfig], [ - AC_CHECK_HEADERS([SuiteSparse_config.h amd.h], - [suispa_header_found=yes]) - AC_CHECK_HEADERS([suitesparse/SuiteSparse_config.h suitesparse/amd.h], - [suispa_header_found=yes]) - AS_IF([test x$suispa_header_found = xyes], [], - [sage_spkg_install_suitesparse=yes]) + AC_CHECK_HEADERS([suitesparse/SuiteSparse_config.h SuiteSparse_config.h], [ + AC_CHECK_HEADERS([suitesparse/amd.h amd.h], [sage_spkg_install_suitesparse=no; break], [sage_spkg_install_suitesparse=yes]) + break + ], [sage_spkg_install_suitesparse=yes]) ], [sage_spkg_install_suitesparse=yes]) ], [ sage_spkg_install_suitesparse=yes]) From f2cc5b457f4945d15970bf823f5046d62564522a Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Wed, 29 Apr 2020 19:46:35 +0100 Subject: [PATCH 031/301] added quoting, renamed SAGE_SUITESPARSE_PREFIX to <>_LOCALINSTALL --- build/pkgs/cvxopt/spkg-install.in | 2 +- build/pkgs/suitesparse/spkg-configure.m4 | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build/pkgs/cvxopt/spkg-install.in b/build/pkgs/cvxopt/spkg-install.in index 50a183d9287..980eddf1493 100644 --- a/build/pkgs/cvxopt/spkg-install.in +++ b/build/pkgs/cvxopt/spkg-install.in @@ -16,7 +16,7 @@ export CVXOPT_BLAS_LIB="$(pkg_libs blas)" export CVXOPT_BLAS_LIB_DIR="$(pkg-config --variable=libdir blas)" export CVXOPT_LAPACK_LIB="$(pkg_libs lapack)" -if test x$SAGE_SUITESPARSE_PREFIX != x; then +if test "x$SAGE_SUITESPARSE_LOCALINSTALL" != "x"; then export CVXOPT_SUITESPARSE_LIB_DIR="${SAGE_LOCAL}" export CVXOPT_SUITESPARSE_INC_DIR="${SAGE_LOCAL}/include" fi diff --git a/build/pkgs/suitesparse/spkg-configure.m4 b/build/pkgs/suitesparse/spkg-configure.m4 index d3a2fb6f873..c22a8a3e94f 100644 --- a/build/pkgs/suitesparse/spkg-configure.m4 +++ b/build/pkgs/suitesparse/spkg-configure.m4 @@ -4,7 +4,8 @@ SAGE_SPKG_CONFIGURE([suitesparse], [ AC_SEARCH_LIBS([umfpack_di_solve], [umfpack], [ AC_SEARCH_LIBS([SuiteSparse_version], [suitesparseconfig], [ AC_CHECK_HEADERS([suitesparse/SuiteSparse_config.h SuiteSparse_config.h], [ - AC_CHECK_HEADERS([suitesparse/amd.h amd.h], [sage_spkg_install_suitesparse=no; break], [sage_spkg_install_suitesparse=yes]) + AC_CHECK_HEADERS([suitesparse/amd.h amd.h], [sage_spkg_install_suitesparse=no; break], + [sage_spkg_install_suitesparse=yes]) break ], [sage_spkg_install_suitesparse=yes]) ], [sage_spkg_install_suitesparse=yes]) @@ -16,8 +17,8 @@ SAGE_SPKG_CONFIGURE([suitesparse], [ sage_spkg_install_suitesparse=yes]) ], [], [], [ AS_IF([test x$sage_spkg_install_suitesparse = xyes], [ - AC_SUBST(SAGE_SUITESPARSE_PREFIX, ['$SAGE_LOCAL']) + AC_SUBST(SAGE_SUITESPARSE_LOCALINSTALL, ['$SAGE_LOCAL']) ], [ - AC_SUBST(SAGE_SUITESPARSE_PREFIX, ['']) + AC_SUBST(SAGE_SUITESPARSE_LOCALINSTALL, ['']) ]) ]) From b709cf2e10d491f0822e368774a8ee02aa9bea44 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 29 Apr 2020 20:27:46 -0700 Subject: [PATCH 032/301] build/pkgs/perl_term_readline_gnu/patches: Add 0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch --- .../patches/0001-Always-use-ncurses.patch | 4 +-- ...2-Makefile.PL-Include-CFLAGS-LDFLAGS.patch | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 build/pkgs/perl_term_readline_gnu/patches/0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch diff --git a/build/pkgs/perl_term_readline_gnu/patches/0001-Always-use-ncurses.patch b/build/pkgs/perl_term_readline_gnu/patches/0001-Always-use-ncurses.patch index 83d194fc58d..fbb95f70385 100644 --- a/build/pkgs/perl_term_readline_gnu/patches/0001-Always-use-ncurses.patch +++ b/build/pkgs/perl_term_readline_gnu/patches/0001-Always-use-ncurses.patch @@ -1,7 +1,7 @@ From e9fbab6c37a1955bdf44d8e7ab3fe125351e4aad Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 6 Apr 2018 15:17:41 -0500 -Subject: [PATCH] Always use ncurses +Subject: [PATCH 1/2] Always use ncurses --- Makefile.PL | 18 ++---------------- @@ -37,5 +37,5 @@ index ffd72c1..208aae0 100644 # Latest Perl in FreeBSD does not need this hack. (Dec.2002) $libs .= ' -lcrypt' if ($Config{osname} =~ /freebsd/i); -- -2.11.0 +2.24.1.1484.g7fcb965970 diff --git a/build/pkgs/perl_term_readline_gnu/patches/0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch b/build/pkgs/perl_term_readline_gnu/patches/0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch new file mode 100644 index 00000000000..e6f0ea33e0a --- /dev/null +++ b/build/pkgs/perl_term_readline_gnu/patches/0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch @@ -0,0 +1,33 @@ +From 0ac5aad01b5ca613d6147ce17ab1372ef6741ab1 Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Wed, 29 Apr 2020 19:15:30 -0700 +Subject: [PATCH 2/2] Makefile.PL: Include CFLAGS, LDFLAGS + +--- + Makefile.PL | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile.PL b/Makefile.PL +index 208aae0..c75dce3 100644 +--- a/Makefile.PL ++++ b/Makefile.PL +@@ -124,14 +124,14 @@ WriteMakefile + VERSION_FROM => 'Gnu.pm', + MIN_PERL_VERSION => '5.8.1', + LIBS => [ "$RLLIB $libs" ], +- LDDLFLAGS => "$RLLIB $Config{lddlflags}", ++ LDDLFLAGS => "$RLLIB $Config{lddlflags} $ENV{LDFLAGS}", + dynamic_lib => { OTHERLDFLAGS => $lddflags }, + DEFINE => $defs, + ($Config{osname} eq 'os2' ? + ( + IMPORTS => { xfree => 'emxlibcm.401' }, # Yuck! + ) : () ), +- INC => $RLINC, ++ INC => "$RLINC $ENV{CFLAGS}", + dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz' }, + clean => { FILES => "rlver.c rlver$Config{_exe} rlmalloc.c rlmalloc$Config{_exe}" }, + ); +-- +2.24.1.1484.g7fcb965970 + From 94fb0ecfec3f6235aafe5234d579efe40e32dfd0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 30 Apr 2020 23:24:06 -0700 Subject: [PATCH 033/301] Update patch for perl_term_readline_gnu --- ...2-Makefile.PL-Include-CFLAGS-LDFLAGS.patch | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/build/pkgs/perl_term_readline_gnu/patches/0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch b/build/pkgs/perl_term_readline_gnu/patches/0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch index e6f0ea33e0a..7bfb027f415 100644 --- a/build/pkgs/perl_term_readline_gnu/patches/0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch +++ b/build/pkgs/perl_term_readline_gnu/patches/0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch @@ -1,14 +1,14 @@ -From 0ac5aad01b5ca613d6147ce17ab1372ef6741ab1 Mon Sep 17 00:00:00 2001 +From 060a5f4b359f08de92171b838ba9ac7ec9cf5697 Mon Sep 17 00:00:00 2001 From: Isuru Fernando -Date: Wed, 29 Apr 2020 19:15:30 -0700 +Date: Thu, 30 Apr 2020 23:21:46 -0700 Subject: [PATCH 2/2] Makefile.PL: Include CFLAGS, LDFLAGS --- - Makefile.PL | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + Makefile.PL | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.PL b/Makefile.PL -index 208aae0..c75dce3 100644 +index 208aae0..737fa88 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -124,14 +124,14 @@ WriteMakefile @@ -28,6 +28,24 @@ index 208aae0..c75dce3 100644 dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz' }, clean => { FILES => "rlver.c rlver$Config{_exe} rlmalloc.c rlmalloc$Config{_exe}" }, ); +@@ -200,7 +200,7 @@ EOF + close(F); + + # compile it +- my $comp_cmd = "$Config{cc} $RLINC $Config{ccflags} $defs $frlver -o rlver $RLLIB $lddflags $Config{ldflags} $libs"; ++ my $comp_cmd = "$Config{cc} $RLINC $Config{ccflags} $ENV{CFLAGS} $defs $frlver -o rlver $RLLIB $lddflags $Config{ldflags} $ENV{LDFLAGS} $libs"; + print $comp_cmd, "\n"; + system($comp_cmd); + if ($?) { +@@ -302,7 +302,7 @@ EOF + for my $symbol_set (@symbol_sets) { + my $xdef = join " ", map "-D$_=$symbol_set->{$_}", sort keys %$symbol_set; + # compile it +- my $comp_cmd = "$Config{cc} $RLINC $Config{ccflags} $defs $xdef $frlmalloc -o rlmalloc $RLLIB $lddflags $Config{ldflags} $libs"; ++ my $comp_cmd = "$Config{cc} $RLINC $Config{ccflags} $ENV{CFLAGS} $defs $xdef $frlmalloc -o rlmalloc $RLLIB $lddflags $Config{ldflags} $ENV{LDFLAGS} $libs"; + print $comp_cmd, "\n"; + unless (system($comp_cmd) || `./rlmalloc` !~ /^ok$/ || $?) { + $extra_defs = $xdef; -- 2.24.1.1484.g7fcb965970 From 16e9f3b040af7ff0616c05bacc5b4c06246ffd3d Mon Sep 17 00:00:00 2001 From: Christian Wuthrich Date: Fri, 1 May 2020 10:26:50 +0100 Subject: [PATCH 034/301] trac #29476: readjusting tolerance to work for 32-bit --- .../elliptic_curves/ell_rational_field.py | 8 +- .../schemes/elliptic_curves/mod_sym_num.pyx | 138 +++++++++--------- 2 files changed, 73 insertions(+), 73 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/ell_rational_field.py b/src/sage/schemes/elliptic_curves/ell_rational_field.py index 4f6ccb11954..40f82ab282e 100644 --- a/src/sage/schemes/elliptic_curves/ell_rational_field.py +++ b/src/sage/schemes/elliptic_curves/ell_rational_field.py @@ -1348,21 +1348,21 @@ def modular_symbol_numerical(self, sign=1, prec=20): sage: E = EllipticCurve('19a1') sage: f = E.modular_symbol_numerical(1) sage: g = E.modular_symbol(1) - sage: f(0), g(0) # abs tol 1e-13 + sage: f(0), g(0) # abs tol 1e-11 (0.333333333333333, 1/3) sage: E = EllipticCurve('5077a1') sage: f = E.modular_symbol_numerical(-1, prec=2) - sage: f(0) # abs tol 1e-13 + sage: f(0) # abs tol 1e-11 0.000000000000000 - sage: f(1/7) # abs tol 1e-13 + sage: f(1/7) # abs tol 1e-11 0.999844176260303 sage: E = EllipticCurve([123,456]) sage: E.conductor() 104461920 sage: f = E.modular_symbol_numerical(prec=2) - sage: f(0) # abs tol 1e-13 + sage: f(0) # abs tol 1e-11 2.00001004772210 """ from sage.schemes.elliptic_curves.mod_sym_num import ModularSymbolNumerical diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index b4bface6941..d66fa6a2553 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -68,7 +68,7 @@ The most likely usage for the code is through the functions sage: M(1/123) 4 sage: Mn = E.modular_symbol_numerical(sign=-1, prec=30) - sage: Mn(3/123) # abs tol 1e-13 + sage: Mn(3/123) # abs tol 1e-11 3.00000000000018 In more details. A numerical modular symbols ``M`` is created from an @@ -923,20 +923,20 @@ cdef class ModularSymbolNumerical: sage: E = EllipticCurve("5077a1") sage: M = E.modular_symbol(implementation="num") - sage: M.approximative_value(123/567) # abs tol 1e-13 + sage: M.approximative_value(123/567) # abs tol 1e-11 -4.00000000000845 - sage: M.approximative_value(123/567,prec=2) # abs tol 1e-13 + sage: M.approximative_value(123/567,prec=2) # abs tol 1e-9 -4.00002815242902 sage: E = EllipticCurve([11,88]) sage: E.conductor() 1715296 sage: M = E.modular_symbol(implementation="num") - sage: M.approximative_value(0,prec=2) # abs tol 1e-13 + sage: M.approximative_value(0,prec=2) # abs tol 1e-11 -0.0000176374317982166 - sage: M.approximative_value(1/7,prec=2) # abs tol 1e-13 + sage: M.approximative_value(1/7,prec=2) # abs tol 1e-11 0.999981178147778 - sage: M.approximative_value(1/7,prec=10) # abs tol 1e-13 + sage: M.approximative_value(1/7,prec=10) # abs tol 1e-11 0.999999972802649 """ cdef llong Q @@ -1397,7 +1397,7 @@ cdef class ModularSymbolNumerical: ....: import ModularSymbolNumerical sage: I = ComplexField(53).0 sage: M = ModularSymbolNumerical(EllipticCurve("11a1")) - sage: M._integration_to_tau(0.01*I, 1000, 53) # abs tol 1e-13 + sage: M._integration_to_tau(0.01*I, 1000, 53) # abs tol 1e-11 0.253841860855911 sage: M._integration_to_tau(0.01*I, 1000, 200) # abs tol 1e-20 0.25384186085591068433775876735181198283836641798722... @@ -1406,9 +1406,9 @@ cdef class ModularSymbolNumerical: sage: E = EllipticCurve("37a1") sage: ms = ModularSymbolNumerical(E) - sage: ms._integration_to_tau(0.0001*I, 1000, 53) # abs tol 1e-13 + sage: ms._integration_to_tau(0.0001*I, 1000, 53) # abs tol 1e-11 -0.0105693920159096 - sage: ms._integration_to_tau(0.3+0.01*I,1000,60) # abs tol 1e-13 + sage: ms._integration_to_tau(0.3+0.01*I,1000,60) # abs tol 1e-11 0.41268108621256428 + 0.91370544691462463*I """ #verbose(" enter _integration_to_tau with tau=%s, T=%s," @@ -1790,19 +1790,19 @@ cdef class ModularSymbolNumerical: sage: E = EllipticCurve("43a1") sage: M = E.modular_symbol(implementation="num") - sage: M._kappa(3,4) # abs tol 1e-13 + sage: M._kappa(3,4) # abs tol 1e-11 [-5.379533671373222e-05, 0.043215661934968536, -0.0018675632930897528] - sage: M._kappa(3,17) # abs tol 1e-13 + sage: M._kappa(3,17) # abs tol 1e-11 [-0.0068222516409258815, 0.2189879706778559, -0.047856204984566546] - sage: M._kappa(3,12345,0.01) # abs tol 1e-13 + sage: M._kappa(3,12345,0.01) # abs tol 1e-11 [-0.04800196513225438, 1.501878908740486, -1.4540035671680258] - sage: M._kappa(3,12345,0.001) # abs tol 1e-13 + sage: M._kappa(3,12345,0.001) # abs tol 1e-11 [-0.04790883326924006, 1.5019073235739455, -1.4539982909123526] This is to check that the caching works when asked with lower precision:: - sage: M._kappa(7,9,0.0001) # abs tol 1e-13 + sage: M._kappa(7,9,0.0001) # abs tol 1e-11 [-3.848348562241613e-46, 0.12314471107014528, -0.01516461914094593, @@ -1810,7 +1810,7 @@ cdef class ModularSymbolNumerical: 0.00011498287475216501, -2.265525136998248e-05, 2.3248943281270047e-06] - sage: M._kappa(7,9,0.1) # abs tol 1e-13 + sage: M._kappa(7,9,0.1) # abs tol 1e-11 [-3.848348562241613e-46, 0.12314471107014528, -0.01516461914094593, @@ -1901,28 +1901,28 @@ cdef class ModularSymbolNumerical: ....: import ModularSymbolNumerical sage: E = EllipticCurve("37a1") sage: m = ModularSymbolNumerical(E) - sage: m._from_ioo_to_r_approx(1/7,0.01) # abs tol 1e-13 + sage: m._from_ioo_to_r_approx(1/7,0.01) # abs tol 1e-11 2.99345862520910 - 4.24742221394325e-8*I - sage: m._from_ioo_to_r_approx(2/7,0.01) # abs tol 1e-13 + sage: m._from_ioo_to_r_approx(2/7,0.01) # abs tol 1e-11 2.45138940312063*I - sage: m._from_ioo_to_r_approx(0/1,0.001) # abs tol 1e-13 + sage: m._from_ioo_to_r_approx(0/1,0.001) # abs tol 1e-11 -2.77555756156289e-17 sage: E = EllipticCurve("37b1") sage: m = ModularSymbolNumerical(E) - sage: m._from_ioo_to_r_approx(0/1,0.01) # abs tol 1e-13 + sage: m._from_ioo_to_r_approx(0/1,0.01) # abs tol 1e-11 0.725681061936153 sage: E = EllipticCurve("5077a1") sage: m = ModularSymbolNumerical(E) - sage: m._from_ioo_to_r_approx(-1/7,0.01, use_partials=1) # abs tol 1e-13 + sage: m._from_ioo_to_r_approx(-1/7,0.01, use_partials=1) # abs tol 1e-11 6.22747859174503 - 1.48055642530800*I - sage: m._from_ioo_to_r_approx(-1/7,0.01, use_partials=0) #abs tol 1e-13 + sage: m._from_ioo_to_r_approx(-1/7,0.01, use_partials=0) #abs tol 1e-11 6.22747410432385 - 1.48055182979493*I This uses 65 bits of precision:: - sage: m._from_ioo_to_r_approx(-1/7,0.0000000001) # abs tol 1e-13 + sage: m._from_ioo_to_r_approx(-1/7,0.0000000001) # abs tol 1e-11 6.227531974630294568 - 1.480548268241443085*I """ #verbose(" enter _from_ioo_to_r_approx with r=%s" @@ -2045,9 +2045,9 @@ cdef class ModularSymbolNumerical: sage: from sage.schemes.elliptic_curves.mod_sym_num \ ....: import ModularSymbolNumerical sage: M = ModularSymbolNumerical(EllipticCurve("11a1")) - sage: M._from_r_to_rr_approx(1/3,0/1,0.000001,use_partials=0) # abs tol 1e-13 + sage: M._from_r_to_rr_approx(1/3,0/1,0.000001,use_partials=0) # abs tol 1e-11 -0.634604652139777 + 1.45881661693850*I - sage: M._from_r_to_rr_approx(1/3,0/1,0.000001,use_partials=1) # abs tol 1e-13 + sage: M._from_r_to_rr_approx(1/3,0/1,0.000001,use_partials=1) # abs tol 1e-11 -0.634604652139777 + 1.45881661693849*I """ cdef: @@ -2190,18 +2190,18 @@ cdef class ModularSymbolNumerical: sage: from sage.schemes.elliptic_curves.mod_sym_num \ ....: import ModularSymbolNumerical sage: M = ModularSymbolNumerical(EllipticCurve("11a1")) - sage: M._from_r_to_rr_approx(0/1,2/5,0.01) # abs tol 1e-13 + sage: M._from_r_to_rr_approx(0/1,2/5,0.01) # abs tol 1e-11 1.90381395641933 - 1.45881661693850*I - sage: M._from_r_to_rr_approx(0/1,2/5,0.001, "both", use_partials=0) #abs tol 1e-13 + sage: M._from_r_to_rr_approx(0/1,2/5,0.001, "both", use_partials=0) #abs tol 1e-11 1.90381395641931 - 1.45881661693851*I - sage: M._from_r_to_rr_approx(0/1,2/5,0.001, "both", use_partials=1) #abs tol 1e-13 + sage: M._from_r_to_rr_approx(0/1,2/5,0.001, "both", use_partials=1) #abs tol 1e-11 1.90381395641933 - 1.45881661693850*I - sage: M._from_r_to_rr_approx(1/11,1/7,0.001) # abs tol 1e-13 + sage: M._from_r_to_rr_approx(1/11,1/7,0.001) # abs tol 1e-11 -0.888446512995687 + 1.45881661693850*I - sage: M._from_r_to_rr_approx(0/1,44/98761,0.001) # abs tol 1e-13 + sage: M._from_r_to_rr_approx(0/1,44/98761,0.001) # abs tol 1e-11 0.634604184365293 + 1.45881886531983*I - sage: M._from_r_to_rr_approx(0/1,123/456,0.0000001) # abs tol 1e-13 + sage: M._from_r_to_rr_approx(0/1,123/456,0.0000001) # abs tol 1e-11 1.26920930437008 - 2.91763323391590*I sage: M = ModularSymbolNumerical(EllipticCurve("389a1")) @@ -2359,38 +2359,38 @@ cdef class ModularSymbolNumerical: sage: from sage.schemes.elliptic_curves.mod_sym_num \ ....: import ModularSymbolNumerical sage: M = ModularSymbolNumerical(EllipticCurve("11a1")) - sage: M._transportable_approx(0/1,-2/7,0.001) # abs tol 1e-13 + sage: M._transportable_approx(0/1,-2/7,0.001) # abs tol 1e-11 -0.634604652139777 + 1.45881661693850*I - sage: M._from_r_to_rr_approx(0/1,-2/7,0.001) # abs tol 1e-13 + sage: M._from_r_to_rr_approx(0/1,-2/7,0.001) # abs tol 1e-11 -0.634604652139776 + 1.45881661693850*I - sage: M._from_r_to_rr_approx(0/1,-2/7,0.0001) # abs tol 1e-13 + sage: M._from_r_to_rr_approx(0/1,-2/7,0.0001) # abs tol 1e-11 -0.634604652139776 + 1.45881661693850*I - sage: M._from_r_to_rr_approx(0/1,-2/7,0.00001) # abs tol 1e-13 + sage: M._from_r_to_rr_approx(0/1,-2/7,0.00001) # abs tol 1e-11 -0.634604652139776 + 1.45881661693850*I - sage: M._from_r_to_rr_approx(0/1,-2/7,0.000001) # abs tol 1e-13 + sage: M._from_r_to_rr_approx(0/1,-2/7,0.000001) # abs tol 1e-11 -0.634604652139776 + 1.45881661693850*I sage: M = ModularSymbolNumerical(EllipticCurve("37a1")) - sage: M._transportable_approx(0/1,-1/19,0.001) # abs tol 1e-13 + sage: M._transportable_approx(0/1,-1/19,0.001) # abs tol 1e-11 -1.14879551982305e-8 + 1.65994273881864e-10*I - sage: M._transportable_approx(0/1,-4/17,0.001) # abs tol 1e-13 + sage: M._transportable_approx(0/1,-4/17,0.001) # abs tol 1e-11 -2.99345356727791 + 2.45138870627435*I - sage: M._transportable_approx(0/1,-4/17,0.00001) # abs tol 1e-13 + sage: M._transportable_approx(0/1,-4/17,0.00001) # abs tol 1e-11 -2.99345863532461 + 2.45138938269979*I - sage: M._from_r_to_rr_approx(0/1,-4/17,0.00001) # abs tol 1e-13 + sage: M._from_r_to_rr_approx(0/1,-4/17,0.00001) # abs tol 1e-11 -2.99345862657997 + 2.45138938852658*I This goes via i `\infty`:: sage: M = ModularSymbolNumerical(EllipticCurve("5077a1")) - sage: M._transportable_approx( 0/1, -35/144, 0.001) #abs tol 1e-13 + sage: M._transportable_approx( 0/1, -35/144, 0.001) #abs tol 1e-11 -6.22753189644996 + 3.23405342839145e-7*I - sage: M._from_r_to_rr_approx( 0/1, -35/144, 0.001) # abs tol 1e-13 + sage: M._from_r_to_rr_approx( 0/1, -35/144, 0.001) # abs tol 1e-11 -6.22753204310913 - 1.31710951034592e-8*I While this one goes via 0:: - sage: M._transportable_approx( 0/1, -7/31798, 0.001) #abs tol 1e-13 + sage: M._transportable_approx( 0/1, -7/31798, 0.001) #abs tol 1e-11 -7.01577418382726e-9 - 7.40274138232394*I sage: M._from_r_to_rr_approx( 0/1, -7/31798, 0.001) #abs tol 1e-5 #long time -7.02253033502132e-9 - 7.40274138234031*I @@ -3307,17 +3307,17 @@ cdef class ModularSymbolNumerical: ....: import ModularSymbolNumerical sage: E = EllipticCurve('5077a1') sage: m = ModularSymbolNumerical(E) - sage: m._evaluate_approx(1/11,0.000001) # abs tol 1e-13 + sage: m._evaluate_approx(1/11,0.000001) # abs tol 1e-11 9.69540669970570e-10 - 5.80486769763411e-11*I - sage: m._evaluate_approx(1/17,0.000001) # abs tol 1e-13 + sage: m._evaluate_approx(1/17,0.000001) # abs tol 1e-11 -9.01145713605445e-10 + 7.40274134212215*I sage: M = ModularSymbolNumerical( EllipticCurve([-12,79]) ) sage: M.elliptic_curve().conductor() 287280 - sage: M._evaluate_approx(0/1,0.01) # abs tol 1e-13 + sage: M._evaluate_approx(0/1,0.01) # abs tol 1e-11 0.000000000000000 - sage: M._evaluate_approx(1/17,0.01) # abs tol 1e-13 + sage: M._evaluate_approx(1/17,0.01) # abs tol 1e-11 1.08712572498569 - 0.548379313090719*I Test that is also works for non-unitary cusps (:trac:`29476`) :: @@ -3409,19 +3409,19 @@ cdef class ModularSymbolNumerical: sage: from sage.schemes.elliptic_curves.mod_sym_num \ ....: import ModularSymbolNumerical sage: M = ModularSymbolNumerical(EllipticCurve("20a1")) - sage: M._symbol_non_unitary_approx(1/2,0.0001) # abs tol 1e-13 + sage: M._symbol_non_unitary_approx(1/2,0.0001) # abs tol 1e-11 -0.470729190326520 + 2.59052039079203e-16*I sage: M = ModularSymbolNumerical(EllipticCurve("49a1")) - sage: M._symbol_non_unitary_approx(2/7,0.000000001) # abs tol 1e-13 + sage: M._symbol_non_unitary_approx(2/7,0.000000001) # abs tol 1e-11 -0.483327926404308 + 0.548042354981878*I A bit longer take:: sage: M = ModularSymbolNumerical(EllipticCurve("78a1")) - sage: M._symbol_non_unitary_approx(1/38,0.1) # abs tol 1e-13 + sage: M._symbol_non_unitary_approx(1/38,0.1) # abs tol 1e-11 2.90087559068021 + 2.86538550720028e-7*I - sage: M._symbol_non_unitary_approx(5/38,0.1) # abs tol 1e-13 + sage: M._symbol_non_unitary_approx(5/38,0.1) # abs tol 1e-11 0.725215164486092 - 1.19349741385624*I """ #verbose(" enter _symbol_nonunitary_approx with r=%s," @@ -3485,14 +3485,14 @@ cdef class ModularSymbolNumerical: sage: E = EllipticCurve("735e4") sage: M = E.modular_symbol(implementation="num") - sage: M.approximative_value(1/19, sign=-1, prec=20, use_twist=False) # indirect doctest abs tol 1e-13 + sage: M.approximative_value(1/19, sign=-1, prec=20, use_twist=False) # indirect doctest abs tol 1e-11 4.00000000089736 - sage: M.approximative_value(1/19, sign=-1, prec=20, use_twist=True) # abs tol 1e-13 + sage: M.approximative_value(1/19, sign=-1, prec=20, use_twist=True) # abs tol 1e-11 3.99999999982043 - sage: M.approximative_value(6/19, sign=1, prec=20, use_twist=False) # abs tol 1e-13 + sage: M.approximative_value(6/19, sign=1, prec=20, use_twist=False) # abs tol 1e-11 2.99999999944834 - sage: M.approximative_value(6/19, sign=1, prec=20, use_twist=True) # abs tol 1e-13 + sage: M.approximative_value(6/19, sign=1, prec=20, use_twist=True) # abs tol 1e-11 3.00000000021937 """ cdef Integer D, Da, a, s, precd @@ -3551,26 +3551,26 @@ def _test_init(E): EXAMPLES:: sage: from sage.schemes.elliptic_curves.mod_sym_num import _test_init - sage: _test_init(EllipticCurve("11a1")) # abs tol 1e-13 + sage: _test_init(EllipticCurve("11a1")) # abs tol 1e-11 ({1: 1, 11: -1}, [1, -2, -1, -15, -12], [10, 2, 10, 2], [0.06346046521397766, 0.7294083084692475, 0.06346046521397766, 0.7294083084692475]) - sage: _test_init(EllipticCurve("11a2")) # abs tol 1e-13 + sage: _test_init(EllipticCurve("11a2")) # abs tol 1e-11 ({1: 1, 11: -1}, [1, -2, -1, -15, -12], [2, 2, 2, 2], [0.06346046521397766, 0.7294083084692475, 0.06346046521397766, 0.7294083084692475]) - sage: _test_init(EllipticCurve("11a3")) # abs tol 1e-13 + sage: _test_init(EllipticCurve("11a3")) # abs tol 1e-11 ({1: 1, 11: -1}, [1, -2, -1, -15, -12], [50, 2, 50, 2], [0.06346046521397768, 0.7294083084692478, 0.06346046521397768, 0.7294083084692478]) - sage: _test_init(EllipticCurve("14a6")) # abs tol 1e-13 + sage: _test_init(EllipticCurve("14a6")) # abs tol 1e-11 ({1: 1, 2: 1, 7: -1, 14: -1}, [1, -1, -2, 18, 0], [9, 1, 9, 1], @@ -3579,14 +3579,14 @@ def _test_init(E): 0.16511182967224025, 0.6627456198412432]) - sage: _test_init(EllipticCurve("20a1")) # abs tol 1e-13 + sage: _test_init(EllipticCurve("20a1")) # abs tol 1e-11 ({1: 1, 2: -1, 4: -1, 5: 1, 10: -1, 20: -1}, [1, 0, -2, -6, 0], [48, 48, 12, 2], [0.029420574395407434, 0.023689220823344594, 0.11768229758162974, 0.5685412997602702]) - sage: _test_init(EllipticCurve("37a1")) # abs tol 1e-13 + sage: _test_init(EllipticCurve("37a1")) # abs tol 1e-11 ({1: 1, 37: 1}, [1, -2, -3, 4, -120], [1, 2, 1, 2], [1.4967293231159797, 0.6128473454966975, @@ -3596,7 +3596,7 @@ def _test_init(E): sage: E = EllipticCurve([91,127]) sage: E.conductor().factor() 2^4 * 3449767 - sage: _test_init(E) # abs tol 1e-13 + sage: _test_init(E) # abs tol 1e-11 ({1: 1, 2: -1, 4: -1, @@ -3653,17 +3653,17 @@ def _test_integration(E, a, b, T): sage: from sage.schemes.elliptic_curves.mod_sym_num \ ....: import _test_integration sage: E = EllipticCurve("11a1") - sage: _test_integration(E, 0,0.01,1000) # abs tol 1e-13 + sage: _test_integration(E, 0,0.01,1000) # abs tol 1e-11 (0.2538418608559108+0j) - sage: _test_integration(E, 0,0.0001,10000) # abs tol 1e-13 + sage: _test_integration(E, 0,0.0001,10000) # abs tol 1e-11 (0.2538815728257322+0j) sage: E = EllipticCurve("37a1") - sage: _test_integration(E, 0, 0.0001,1000) # abs tol 1e-13 + sage: _test_integration(E, 0, 0.0001,1000) # abs tol 1e-11 (-0.0105693920159094+0j) - sage: _test_integration(E, 0.7, 0.1, 10000) # abs tol 1e-13 + sage: _test_integration(E, 0.7, 0.1, 10000) # abs tol 1e-11 (-0.021614803690068213-0.7770316490609953j) - sage: _test_integration(E, 0.7, 0.1, 20000) # abs tol 1e-13 + sage: _test_integration(E, 0.7, 0.1, 20000) # abs tol 1e-11 (-0.021614803690068213-0.7770316490609953j) """ M = ModularSymbolNumerical(E) @@ -3694,13 +3694,13 @@ def _test_integration_via_partials(E, y, m, T): sage: from sage.schemes.elliptic_curves.mod_sym_num \ ....: import _test_integration_via_partials sage: E = EllipticCurve("11a1") - sage: _test_integration_via_partials(E,0.001,3,1000) # abs tol 1e-13 + sage: _test_integration_via_partials(E,0.001,3,1000) # abs tol 1e-11 [-0.16916415619939476, 1.0536872023214188, -0.6306661264594561] sage: E = EllipticCurve("121c1") - sage: _test_integration_via_partials(E,0.03,3,700) # abs tol 1e-13 + sage: _test_integration_via_partials(E,0.03,3,700) # abs tol 1e-11 [0.49198993741342784, 0.6601504274130793, 0.3177042713926389] - sage: _test_integration_via_partials(E,0.03,3,7000) # abs tol 1e-13 + sage: _test_integration_via_partials(E,0.03,3,7000) # abs tol 1e-11 [0.49198993741342784, 0.6601504274130793, 0.3177042713926389] """ cdef int oi, mm = (m) From 1c3b7f3049a21b807540a0f29df4efb8e9d5aecd Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 1 May 2020 14:53:00 -0700 Subject: [PATCH 035/301] Update patch --- .../patches/0001-Always-use-ncurses.patch | 2 +- ...2-Makefile.PL-Include-CFLAGS-LDFLAGS.patch | 2 +- .../0003-Need-LDFLAGS-in-LIBS-too.patch | 25 +++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 build/pkgs/perl_term_readline_gnu/patches/0003-Need-LDFLAGS-in-LIBS-too.patch diff --git a/build/pkgs/perl_term_readline_gnu/patches/0001-Always-use-ncurses.patch b/build/pkgs/perl_term_readline_gnu/patches/0001-Always-use-ncurses.patch index fbb95f70385..1ef0370492a 100644 --- a/build/pkgs/perl_term_readline_gnu/patches/0001-Always-use-ncurses.patch +++ b/build/pkgs/perl_term_readline_gnu/patches/0001-Always-use-ncurses.patch @@ -1,7 +1,7 @@ From e9fbab6c37a1955bdf44d8e7ab3fe125351e4aad Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 6 Apr 2018 15:17:41 -0500 -Subject: [PATCH 1/2] Always use ncurses +Subject: [PATCH 1/3] Always use ncurses --- Makefile.PL | 18 ++---------------- diff --git a/build/pkgs/perl_term_readline_gnu/patches/0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch b/build/pkgs/perl_term_readline_gnu/patches/0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch index 7bfb027f415..f0b3d5fe5c3 100644 --- a/build/pkgs/perl_term_readline_gnu/patches/0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch +++ b/build/pkgs/perl_term_readline_gnu/patches/0002-Makefile.PL-Include-CFLAGS-LDFLAGS.patch @@ -1,7 +1,7 @@ From 060a5f4b359f08de92171b838ba9ac7ec9cf5697 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 30 Apr 2020 23:21:46 -0700 -Subject: [PATCH 2/2] Makefile.PL: Include CFLAGS, LDFLAGS +Subject: [PATCH 2/3] Makefile.PL: Include CFLAGS, LDFLAGS --- Makefile.PL | 8 ++++---- diff --git a/build/pkgs/perl_term_readline_gnu/patches/0003-Need-LDFLAGS-in-LIBS-too.patch b/build/pkgs/perl_term_readline_gnu/patches/0003-Need-LDFLAGS-in-LIBS-too.patch new file mode 100644 index 00000000000..84991378f06 --- /dev/null +++ b/build/pkgs/perl_term_readline_gnu/patches/0003-Need-LDFLAGS-in-LIBS-too.patch @@ -0,0 +1,25 @@ +From e449c91dcb7881c252bb256d2b426d9de41ef16b Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Fri, 1 May 2020 01:31:04 -0500 +Subject: [PATCH 3/3] Need LDFLAGS in LIBS too + +--- + Makefile.PL | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.PL b/Makefile.PL +index 737fa88..83d73c0 100644 +--- a/Makefile.PL ++++ b/Makefile.PL +@@ -123,7 +123,7 @@ WriteMakefile + }, + VERSION_FROM => 'Gnu.pm', + MIN_PERL_VERSION => '5.8.1', +- LIBS => [ "$RLLIB $libs" ], ++ LIBS => [ "$RLLIB $ENV{LDFLAGS} $libs" ], + LDDLFLAGS => "$RLLIB $Config{lddlflags} $ENV{LDFLAGS}", + dynamic_lib => { OTHERLDFLAGS => $lddflags }, + DEFINE => $defs, +-- +2.24.1.1484.g7fcb965970 + From a08db46dcc85650aafbe690b2d65a4f81d3efcf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 2 May 2020 11:40:17 +0200 Subject: [PATCH 036/301] some details in combinat about partitions --- src/sage/combinat/partition.py | 22 +++++++------ src/sage/combinat/set_partition_ordered.py | 36 ++++++++++++---------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/sage/combinat/partition.py b/src/sage/combinat/partition.py index e046474e857..81b65fd422e 100644 --- a/src/sage/combinat/partition.py +++ b/src/sage/combinat/partition.py @@ -258,7 +258,7 @@ sage: Partition(frobenius_coordinates=([6,1],[2,0])) [7, 3, 1] sage: all(mu == Partition(frobenius_coordinates=mu.frobenius_coordinates()) - ....: for n in range(30) for mu in Partitions(n)) + ....: for n in range(12) for mu in Partitions(n)) True We use the lexicographic ordering:: @@ -282,12 +282,11 @@ from __future__ import print_function, absolute_import from copy import copy -import six -from six.moves import range, zip from sage.libs.all import pari from sage.libs.flint.arith import number_of_partitions as flint_number_of_partitions +from sage.arith.misc import multinomial from sage.structure.global_options import GlobalOptions from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation @@ -325,6 +324,7 @@ from sage.graphs.dot2tex_utils import have_dot2tex from sage.functions.other import binomial + class Partition(CombinatorialElement): r""" A partition `p` of a nonnegative integer `n` is a @@ -2804,12 +2804,14 @@ def top_garnir_tableau(self,e,cell): g=self.garnir_tableau(cell) # start with the Garnir tableau and modify - if e==0: return g # no more dominant tableau of the same residue + if e==0: + return g # no more dominant tableau of the same residue a=e*int((self[row]-col)/e) # number of cells in the e-bricks in row `row` b=e*int((col+1)/e) # number of cells in the e-bricks in row `row+1` - if a==0 or b==0: return g + if a==0 or b==0: + return g t=g.to_list() m=g[row+1][0] # smallest number in 0-Garnir belt @@ -3670,8 +3672,8 @@ def centralizer_size(self, t=0, q=0): sage: Partition([2,2,2]).aut() 48 """ - size = prod(i ** mi * factorial(mi) - for i, mi in six.iteritems(self.to_exp_dict())) + size = prod(i**mi * factorial(mi) + for i, mi in self.to_exp_dict().items()) if t or q: size *= prod((ZZ.one() - q ** j) / (ZZ.one() - t ** j) for j in self) @@ -4349,7 +4351,7 @@ def is_core(self, k): :meth:`core`, :class:`Core` """ - return not k in self.hooks() + return k not in self.hooks() def k_interior(self, k): r""" @@ -5109,7 +5111,7 @@ def multinomial_with_partitions(sizes,path_counts): # if we know the total length alloted for each of the paths (sizes), and the number # of paths for each component. A multinomial picks the ordering of the components where # each step is taken. - return prod(path_counts) * factorial(sum(sizes)) / prod([factorial(_) for _ in sizes]) + return prod(path_counts) * multinomial(sizes) sizes = [larger_quotients[i].size()-smaller_quotients[i].size() for i in range(k)] path_counts = [larger_quotients[i].dimension(smaller_quotients[i]) for i in range(k)] @@ -6228,7 +6230,7 @@ def from_core_and_quotient(self, core, quotient): True """ from .partition_tuple import PartitionTuple, PartitionTuples - if not quotient in PartitionTuples(): + if quotient not in PartitionTuples(): raise ValueError('the quotient %s must be a tuple of partitions'%quotient) components = PartitionTuple(quotient).components() length = len(components) diff --git a/src/sage/combinat/set_partition_ordered.py b/src/sage/combinat/set_partition_ordered.py index 70408ad52f1..791dfa13e09 100644 --- a/src/sage/combinat/set_partition_ordered.py +++ b/src/sage/combinat/set_partition_ordered.py @@ -10,7 +10,7 @@ - Travis Scrimshaw (2013-02-28): Removed ``CombinatorialClass`` and added entry point through :class:`OrderedSetPartition`. """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2007 Mike Hansen , # # Distributed under the terms of the GNU General Public License (GPL) @@ -23,16 +23,15 @@ # The full text of the GPL is available at: # # https://www.gnu.org/licenses/ -#***************************************************************************** +# **************************************************************************** from six import add_metaclass -from sage.arith.all import factorial +from sage.arith.all import factorial, multinomial from sage.sets.set import Set, Set_generic from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets from sage.sets.finite_enumerated_set import FiniteEnumeratedSet from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass -from sage.misc.all import prod from sage.structure.parent import Parent from sage.structure.element import parent from sage.structure.unique_representation import UniqueRepresentation @@ -185,10 +184,11 @@ def __classcall_private__(cls, parts=None, from_word=None): if from_word: return OrderedSetPartitions().from_finite_word(Words()(from_word)) # if `parts` looks like a sequence of "letters" then treat it like a word. - if parts in Words() or (len(parts) > 0 and (parts[0] in ZZ or isinstance(parts[0], str))): + if parts in Words() or (len(parts) and (parts[0] in ZZ or isinstance(parts[0], str))): return OrderedSetPartitions().from_finite_word(Words()(parts)) else: - P = OrderedSetPartitions( reduce(lambda x,y: x.union(y), map(Set, parts), Set([])) ) + P = OrderedSetPartitions(reduce(lambda x,y: x.union(y), + map(Set, parts), Set([]))) return P.element_class(P, parts) def __init__(self, parent, s): @@ -204,7 +204,6 @@ def __init__(self, parent, s): self._base_set = reduce(lambda x,y: x.union(y), map(Set, s), Set([])) ClonableArray.__init__(self, parent, [Set(_) for _ in s]) - def _repr_(self): """ Return a string representation of ``self``. @@ -368,8 +367,8 @@ def reversed(self): sage: OrderedSetPartition([]).reversed() [] """ - par = parent(self) - return par(list(reversed(list(self)))) + par = self.parent() + return par(list(reversed(self))) def complement(self): r""" @@ -479,7 +478,7 @@ def is_finer(self, co2): """ co1 = self if co1.base_set() != co2.base_set(): - raise ValueError("ordered set partitions self (= %s) and co2 (= %s) must be of the same set"%(self, co2)) + raise ValueError("ordered set partitions self (= %s) and co2 (= %s) must be of the same set" % (self, co2)) i1 = 0 for j2 in co2: @@ -665,7 +664,6 @@ def strongly_finer(self): return FiniteEnumeratedSet([par(sum((list(P) for P in C), [])) for C in cartesian_product([[buo(X, comp) for comp in Compositions(len(X))] for X in self])]) - def is_strongly_finer(self, co2): r""" Return ``True`` if the ordered set partition ``self`` is strongly @@ -766,7 +764,8 @@ def strongly_fatter(self): g = [-1] + [i for i in range(l-1) if c[i][-1] > c[i+1][0]] + [l-1] # g lists the positions of the blocks that cannot be merged # with their right neighbors. - subcomps = [OrderedSetPartition(c[g[i] + 1 : g[i+1] + 1]) for i in range(len(g)-1)] + subcomps = [OrderedSetPartition(c[g[i] + 1: g[i + 1] + 1]) + for i in range(len(g) - 1)] # Now, self is the concatenation of the entries of subcomps. # We can fatten each of the ordered set partitions setcomps # arbitrarily, and then concatenate the results. @@ -903,7 +902,7 @@ def __classcall_private__(cls, s=None, c=None): if isinstance(c, (int, Integer)): return OrderedSetPartitions_sn(s, c) if c not in Compositions(len(s)): - raise ValueError("c must be a composition of %s"%len(s)) + raise ValueError("c must be a composition of %s" % len(s)) return OrderedSetPartitions_scomp(s, Composition(c)) def __init__(self, s): @@ -929,7 +928,7 @@ def _element_constructor_(self, s): [{1, 3}, {2, 4}] """ if isinstance(s, OrderedSetPartition): - raise ValueError("cannot convert %s into an element of %s"%(s, self)) + raise ValueError("cannot convert %s into an element of %s" % (s, self)) return self.element_class(self, list(s)) Element = OrderedSetPartition @@ -1057,6 +1056,7 @@ def __iter__(self): for z in OrderedSetPartitions(self._set, x): yield self.element_class(self, z) + class OrderedSetPartitions_sn(OrderedSetPartitions): def __init__(self, s, n): """ @@ -1194,7 +1194,7 @@ def cardinality(self): sage: OrderedSetPartitions(5, [2,0,3]).cardinality() 10 """ - return factorial(len(self._set)) / prod([factorial(i) for i in self.c]) + return multinomial(self.c) def __iter__(self): """ @@ -1252,6 +1252,7 @@ def __iter__(self): yield self.element_class(self, [Set(res[dcomp[i]+1:dcomp[i+1]+1]) for i in range(l)]) + class OrderedSetPartitions_all(OrderedSetPartitions): r""" Ordered set partitions of `\{1, \ldots, n\}` for all @@ -1298,9 +1299,9 @@ def _element_constructor_(self, s): """ if isinstance(s, OrderedSetPartition): gset = s.parent()._set - if gset == frozenset(range(1,len(gset)+1)): + if gset == frozenset(range(1, len(gset) + 1)): return self.element_class(self, list(s)) - raise ValueError("cannot convert %s into an element of %s"%(s, self)) + raise ValueError("cannot convert %s into an element of %s" % (s, self)) return self.element_class(self, list(s)) def __contains__(self, x): @@ -1408,5 +1409,6 @@ def __setstate__(self, state): k = state['_k'] OrderedSetPartitions_scomp.__init__(self, range(state['_n']), (k,n-k)) + from sage.misc.persist import register_unpickle_override register_unpickle_override("sage.combinat.split_nk", "SplitNK_nk", SplitNK) From df4884530bcd1c29460feed2011e23ef3b42c12a Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 2 May 2020 23:45:34 +0000 Subject: [PATCH 037/301] Try a workaround for Perl changing LDFLAGS --- build/pkgs/perl_term_readline_gnu/spkg-install.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/pkgs/perl_term_readline_gnu/spkg-install.in b/build/pkgs/perl_term_readline_gnu/spkg-install.in index 648133310d5..9bf33372d2a 100644 --- a/build/pkgs/perl_term_readline_gnu/spkg-install.in +++ b/build/pkgs/perl_term_readline_gnu/spkg-install.in @@ -8,6 +8,11 @@ case $(uname) in # from system perl) do not contain -arch flags incompatible # with our gcc. export ARCHFLAGS="" + # Perl does some weird things with -Wl,-rpath commands. + # Add a workaround to those + if [[ "$($CC --version)" == *clang* ]]; then + export LDFLAGS=$(echo $LDFLAGS | sed "s/-Wl,-rpath,/-Xlinker -rpath -Xlinker /g") + fi ;; esac From aa9ada9eb2f0d31343b67dfa7c4ab5461bcbff43 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 May 2020 17:39:46 -0700 Subject: [PATCH 038/301] Delete changelog sections from all SPKG.txt files for f in build/pkgs/*/SPKG.txt; do sed -i.bak '/^=.*Changelog/,$d' $f; done --- build/pkgs/benzene/SPKG.txt | 8 - build/pkgs/buckygen/SPKG.txt | 11 -- build/pkgs/combinatorial_designs/SPKG.txt | 4 - build/pkgs/conway_polynomials/SPKG.txt | 14 -- build/pkgs/cvxopt/SPKG.txt | 90 ----------- build/pkgs/database_kohel/SPKG.txt | 4 - build/pkgs/database_symbolic_data/SPKG.txt | 7 - build/pkgs/dateutil/SPKG.txt | 6 - build/pkgs/docutils/SPKG.txt | 12 -- build/pkgs/elliptic_curves/SPKG.txt | 33 ----- build/pkgs/fflas_ffpack/SPKG.txt | 10 -- build/pkgs/frobby/SPKG.txt | 26 ---- build/pkgs/git/SPKG.txt | 26 ---- build/pkgs/givaro/SPKG.txt | 136 ----------------- build/pkgs/graphs/SPKG.txt | 20 --- build/pkgs/iconv/SPKG.txt | 54 ------- build/pkgs/jinja2/SPKG.txt | 12 -- build/pkgs/libogg/SPKG.txt | 4 - build/pkgs/libtheora/SPKG.txt | 4 - build/pkgs/linbox/SPKG.txt | 165 --------------------- build/pkgs/m4ri/SPKG.txt | 111 -------------- build/pkgs/m4rie/SPKG.txt | 35 ----- build/pkgs/mcqd/SPKG.txt | 4 - build/pkgs/mpfi/SPKG.txt | 129 ---------------- build/pkgs/p_group_cohomology/SPKG.txt | 149 ------------------- build/pkgs/plantri/SPKG.txt | 5 - build/pkgs/pyparsing/SPKG.txt | 6 - build/pkgs/ratpoints/SPKG.txt | 42 ------ build/pkgs/rpy2/SPKG.txt | 8 - build/pkgs/rubiks/SPKG.txt | 100 ------------- build/pkgs/scons/SPKG.txt | 12 -- build/pkgs/setuptools/SPKG.txt | 31 ---- build/pkgs/singledispatch/SPKG.txt | 5 - build/pkgs/six/SPKG.txt | 9 -- build/pkgs/symmetrica/SPKG.txt | 56 ------- build/pkgs/sympow/SPKG.txt | 55 ------- build/pkgs/sympy/SPKG.txt | 58 -------- build/pkgs/termcap/SPKG.txt | 32 ---- build/pkgs/tornado/SPKG.txt | 6 - build/pkgs/zn_poly/SPKG.txt | 126 ---------------- 40 files changed, 1625 deletions(-) diff --git a/build/pkgs/benzene/SPKG.txt b/build/pkgs/benzene/SPKG.txt index 9a5f543f797..58ff36aa478 100644 --- a/build/pkgs/benzene/SPKG.txt +++ b/build/pkgs/benzene/SPKG.txt @@ -13,11 +13,3 @@ http://www.grinvin.org/ == Dependencies == * None -== Changelog == - -=== benzene-20130630 Nico Van Cleemput (10th September 2014) === - * #16963: Update for the sage-git directory layout. - -=== benzene-20130630 Nico Van Cleemput (30th June 2013) === - * First release put into Sage. - diff --git a/build/pkgs/buckygen/SPKG.txt b/build/pkgs/buckygen/SPKG.txt index b2c90529321..884f75d275d 100644 --- a/build/pkgs/buckygen/SPKG.txt +++ b/build/pkgs/buckygen/SPKG.txt @@ -13,14 +13,3 @@ http://caagt.ugent.be/buckygen/ == Dependencies == * None -== Changelog == - -=== buckygen-1.0 (Nico Van Cleemput, 9th September 2014) === - * #16945: Update for the sage-git directory layout. - -=== buckygen-1.0 (Nico Van Cleemput, 3rd September 2013) === - * Fixed error in license info. - -=== buckygen-1.0 (Nico Van Cleemput, 25th May 2013) === - * First release put into Sage. - diff --git a/build/pkgs/combinatorial_designs/SPKG.txt b/build/pkgs/combinatorial_designs/SPKG.txt index e0fb5cfb6b2..197b3cd928b 100644 --- a/build/pkgs/combinatorial_designs/SPKG.txt +++ b/build/pkgs/combinatorial_designs/SPKG.txt @@ -19,7 +19,3 @@ Public domain. N/A -== Changelog == - -== designs-20140630 (Nathann Cohen, 2014-06-30) == - * #16541: Table of MOLS diff --git a/build/pkgs/conway_polynomials/SPKG.txt b/build/pkgs/conway_polynomials/SPKG.txt index de510059e7a..7a2ddc1e5d2 100644 --- a/build/pkgs/conway_polynomials/SPKG.txt +++ b/build/pkgs/conway_polynomials/SPKG.txt @@ -8,17 +8,3 @@ * Sage library -== Changelog == - -=== conway_polynomials-0.4.p0 (Karl-Dieter Crisman, 13 February 2013) === - * #14075: Remove printing of primes while installing - -=== conway_polynomials-0.4 (R. Andrew Ohana and William Stein, 18 June 2012) === - * #12205: Rewrite database to not use ZODB - -=== conway_polynomials-0.3 (R. Andrew Ohana, 18 June 2012) === - * #13123: Move SAGE_DATA to SAGE_LOCAL/share/sage/data - -=== conway_polynomials-early_versions (unknown, unknown) === - * previous version(s) - * lost to history diff --git a/build/pkgs/cvxopt/SPKG.txt b/build/pkgs/cvxopt/SPKG.txt index e479b4719cd..1ca9865e016 100644 --- a/build/pkgs/cvxopt/SPKG.txt +++ b/build/pkgs/cvxopt/SPKG.txt @@ -48,93 +48,3 @@ GNU Lesser General Public License, v2.1. See src/LICENSE for more details. spkg, apparently it will need an unclear to me "with seed(..)" construct. -== Changelog == - -=== cvxopt-1.1.8 (Dima Pasechnik, 10 Dec 2015) === - * #19687: upgrade to version 1.1.8. - -=== cvxopt-1.1.7 (Dima Pasechnik, 24 Aug 2014) === - * #16874: upgrade to version 1.1.7. - -=== cvxopt-1.1.6.p0 (Volker Braun, Jeroen Demeyer, 15 May 2013) === - * #12832: upgrade to version 1.1.6. - * Remove undocumented patch changing int_t to int. - * Fix BLAS_LIB_DIR on Cygwin and OS X. - -=== cvxopt-1.1.5.p0 (Jean-Pierre Flori, 5 December 2012) === - * #13799: add back linking dependencies removed by #13160 and needed on Cygwin. - -=== cvxopt-1.1.5 (François Bissey, 25 June 2012) === - * #13160: update to 1.1.5, drop dense.c patch as it is not needed anymore. - * rewrite and simplify the patch for setup.py. Keep the necessary linking minimal. - * First attempt at doc building - -=== cvxopt-1.1.4.p1 (Jeroen Demeyer, 3 April 2012) === - * Trac #12011: edit cvxopt.h.patch to apply with all GCC versions. - -=== cvxopt-1.1.4.p0 (John Palmieri, 31 March 2012) === - * Upgrade to version 1.1.4. - * Trac #12011: apply upstream fix (from 1.1.5) dense.c.patch to fix - self-tests on OS X Lion. - -=== cvxopt-1.1.3.p1 (Jeroen Demeyer, 23 February 2012) === - * Trac #12519: Do not add -lcblas and -latlas on Darwin, since those - libraries aren't installed on Darwin. - * Use patch for patching. - * Make spkg-check actually fail when there is a failure. - * Removed useless bits from patches/setup.py.patch - * Removed useless __init__.py.patch - -=== cvxopt-1.1.3 (Dima Pasechnik, Mike Hansen, Harald Schilly, David Kirkby, Peter Jeremy, November, 2010) === - * fiddled with the lists of libraries to link, on per Fortran compiler basis. - * added recognition of g95 directly, rather than by platform. - * added getting the right -L path to libf95 for g95. - * #6456 Updated to 1.1.3. - * Modified setup.py to build correctly under Cygwin. - * applied P.Jeremy's FreeBSD patch (see #6456) - * corrected the 64-bit specific int* bug reported by pjeremy - * turned on GSL extension (this is the default mode for CVXOPT, and GSL is a standard Sage spkg, so - this makes perfect sense); this in particular allowed to get rid of strange random seed-related - import bugs uncovered by David Kirkby's spkg-check - * modified spkg-check to report test names, cd to appropriate subdirs, and skip .bin files. - * corrected the .patch files in patches/ to be in right order --- just run the makepatchfiles - script to re-create these files! - * removed html doc files in src/doc; the .rst doc files are there, so it's a question of - rebuilding them - (e.g. one can do sage -sh; cd src/doc; make html) - * included David's shortened and gcc-version targeted Sun-specific patch - (comment 88 on #6456); removed sun_complex.h - * took care of SPKG.txt sections, as mentioned in comment 87 on #6456 - * incorporating building the GLPK extension (track #9598) - * #9525 Correct the fact that installation of cvxopt will allways - report it was - successful, even if it failed. - * Add a spkg-check file, as #9281 listed cvxopt was missing such a file - * implemented changes requested in comment 28 of track ticket #6456: - - (kept a harmless SAGE_LOCAL check) - - On building cvxopt extensions: - the non-required extension are not built; - however, it is possible to switch on the dsdp and dsl extensions by - flipping the BUILD_..-flags in setup.py (and modifying dirs for dsdp) - Remaining extensions were not tested; it should not be hard to have - them provided the corresponding libs are there (e.g. parts of Sage) - - * modified setup.py to streamline and make it more Sage-like; - in particular got rid of f77blas and f95 dependences that - are obsolete, since Sage switched to gfortran - * rebased Solaris-specific patches from cvxopt-0.9 spkg - (only cvxopt.h needed to be patched, while the old - native cvxopt random framework is now gone (since cvxopt-1.1 - at least) - * modified setup.py and src/python/__init__.py - * moved old patches to patches-old (solaris, ...) for future reference - * simplifying spkg-install - -=== cvxopt-0.9.p8 (Gonzalo Tornaria, June 19th, 2009) === - * Replace perl spkg-install with a bash one. - -=== cvxopt-0.9.p7 (Michael Abshoff, September 24th, 2008) === - * Work around Solaris 10 problem with complex.h - diff --git a/build/pkgs/database_kohel/SPKG.txt b/build/pkgs/database_kohel/SPKG.txt index b98875f31d7..ee24b701d92 100644 --- a/build/pkgs/database_kohel/SPKG.txt +++ b/build/pkgs/database_kohel/SPKG.txt @@ -8,7 +8,3 @@ Database of modular and Hilbert polynomials. * David Kohel -== Changelog == - - * new style package 20160724 (V. Delecroix) - * initial version 20060803 (D. Kohel and W. Stein) diff --git a/build/pkgs/database_symbolic_data/SPKG.txt b/build/pkgs/database_symbolic_data/SPKG.txt index cc59f6d5193..65c410df2a2 100644 --- a/build/pkgs/database_symbolic_data/SPKG.txt +++ b/build/pkgs/database_symbolic_data/SPKG.txt @@ -32,10 +32,3 @@ GNU General Public License List patches that need to be applied and what they do -== Changelog == - -=== database_symbolic_data-20070206 (Martin Albrecht, 8 Oct 2013) === - - * SPKG.txt added - * adapted to new git workflow - diff --git a/build/pkgs/dateutil/SPKG.txt b/build/pkgs/dateutil/SPKG.txt index c8b3d5d8779..becf1aff84a 100644 --- a/build/pkgs/dateutil/SPKG.txt +++ b/build/pkgs/dateutil/SPKG.txt @@ -19,9 +19,3 @@ Home page: http://labix.org/python-dateutil * Python * Six -== Changelog == - -=== dateutil-2.2 (John H. Palmieri, 20 December 2013) === - - * Trac #14993: initial release. - diff --git a/build/pkgs/docutils/SPKG.txt b/build/pkgs/docutils/SPKG.txt index 9b6eaa57634..14e239e7537 100644 --- a/build/pkgs/docutils/SPKG.txt +++ b/build/pkgs/docutils/SPKG.txt @@ -24,15 +24,3 @@ None None -== Changelog == - -=== docutils-0.7.p0 (Jeroen Demeyer, 8 August 2011) === - * Trac #11660: Change permissions of files inside /src to world-readable - -=== docutils-0.7 (Pablo De Napoli, 24 October 2010) === - * Upgrade to latest upstream stable release (trac #10166) - -=== docutils-0.5.p0 (undocumented, 25 July 2010) === - -=== docutils-0.5 (Mike Hansen, 15 September 2008) === - * Initial version. diff --git a/build/pkgs/elliptic_curves/SPKG.txt b/build/pkgs/elliptic_curves/SPKG.txt index 12cb9e62ceb..5c5ac942b06 100644 --- a/build/pkgs/elliptic_curves/SPKG.txt +++ b/build/pkgs/elliptic_curves/SPKG.txt @@ -26,36 +26,3 @@ Includes two databases: * sqlite * python -== Changelog == - -=== elliptic_curves-0.8.1 (Frédéric Chapoton, 2019-03-01) === - * #20717: remove macOS hidden files - -=== elliptic_curves-0.8 (Simon Spicer, 2014-10-24) === - * #16773: add more examples of high rank curves - -=== elliptic_curves-0.7 (R. Andrew Ohana, 2012-05-17) === - * #13123: move SAGE_DATA to SAGE_LOCAL/share - -=== elliptic_curves-0.6 (R. Andrew Ohana, 2012-03-27) === - * #12763: fix permissions for the installed files - -=== elliptic_curves-0.5 (Keshav Kini, 2012-03-18) === - * #12694: make the spkg contain a src/ directory and track everything else - -=== elliptic_curves-0.4 (R. Andrew Ohana, 9 March 2012) === - * #12644: reduce the size of the spkg by half - * use os.path.join and file.xreadlines - -=== elliptic_curves-0.3 (R. Andrew Ohana, 9 September 2011) === - * Fixed a potential bug in spkg-install script - * cremona_mini install script now constructs the database from scratch - -=== elliptic_curves-0.2 (R. Andrew Ohana, 1 August 2011) === - * Updated cremona_mini to use a SQLite3 database - * Made SPKG follow guidelines - -=== elliptic_curves-0.1 (unknown, unknown) === - * previous version(s) - * lost to history - diff --git a/build/pkgs/fflas_ffpack/SPKG.txt b/build/pkgs/fflas_ffpack/SPKG.txt index ef918623bcd..b09520745c0 100644 --- a/build/pkgs/fflas_ffpack/SPKG.txt +++ b/build/pkgs/fflas_ffpack/SPKG.txt @@ -28,13 +28,3 @@ LGPL V2.1 or later * bash.patch: fix shebang line to "#!/usr/bin/env bash" -== Changelog == - -=== fflas_ffpack-2.2.2 (Clement Pernet, 30 July 2016) === - * #13463: add bash.patch, use standard template for SPKG.txt. - -=== fflas_ffpack-1.6.0.p0 (Jeroen Demeyer, 5 February 2013) === - * #13463: add bash.patch, use standard template for SPKG.txt. - -=== fflas_ffpack-1.6.0 (Martin Albrecht, 7 June 2012) === - * #12883 new upstream release diff --git a/build/pkgs/frobby/SPKG.txt b/build/pkgs/frobby/SPKG.txt index bc18b4b46fe..56abd52173f 100644 --- a/build/pkgs/frobby/SPKG.txt +++ b/build/pkgs/frobby/SPKG.txt @@ -27,29 +27,3 @@ Download Frobby at www.broune.com/ and then type "make spkg VER=blah" which wil named frobby-VER.spkg in bin/. The files related to doing this is in the sage/ sub-directory of the Frobby source distribution. -== Changelog == - -=== frobby-0.9.0.p2 (Dima Pasechnik, Jun 30, 2016) === - * conversion to new-style package - * integration of Macaulay2 patches - * fix linking (rpath) - -=== frobby-0.9.0.p1 (Dima Pasechnik, Sept 7, 2013) === - * added for getpid() - -=== frobby-0.9.0 (Mike Hansen, May 24th, 2012) === - * #13007: Update to 0.9.0. - * Add a patch to the Makefile so that the build succeeds with SAGE_CHECK="yes" - -=== frobby-0.7.6 (Bjarke Hammersholt Roune, May 20th, 2008) === - * Move to Frobby 0.7.6 with Makefile improvements by Michale Abshoff. - -=== frobby-0.7.5.p1 (Michael Abshoff, May 19th, 2008) === - * fix the main Makefile to set include and library directories correctly when some env variables are defined - -=== frobby-0.7.5.p0 (Michael Abshoff, May 19th, 2008) === - * various cleanups, i.e. repo, .hgignore, missing SPKG.txt sections - * move all sources into src - -=== frobby-0.7.5 (Bjarke Hammersholt Roune) === - * initial version diff --git a/build/pkgs/git/SPKG.txt b/build/pkgs/git/SPKG.txt index 51e88426e20..a2c8e31260a 100644 --- a/build/pkgs/git/SPKG.txt +++ b/build/pkgs/git/SPKG.txt @@ -21,29 +21,3 @@ Note: excluding libcurl and expat because they are large and only required if you're communicating with repositories over HTTP. If you need to do so, please use an external version of git. -== Changelog == - -=== git-1.7.12.2.p0 (Jeroen Demeyer, 2012-10-02) === - - * #12707: Upgrade to git-1.7.12.2 - * Disable Tcl/Tk GUI (otherwise Tcl/Tk is a dependency) - * Various fixes to spkg-install - * Keep SANE_TOOL_PATH empty to ensure the PATH isn't changed - * Figure out *correct* path to "install" - * Add patch no-autoconf.patch to prevent running autoconf - -=== git-1.7.10 (Keshav Kini, 2012-04-20) === - - * #12707: Upgrade to latest stable - * Fix building on OS X by making the installer ignore Fink and Darwin - Ports - * Make sure not to use the system Python for anything - -=== git-1.7.9.4 (Keshav Kini, 2012-03-19) === - - * Upgrade to latest stable - * Track dependencies - -=== git-1.7.2.4 (William Stein, 2012-03-19) === - - * Initial version diff --git a/build/pkgs/givaro/SPKG.txt b/build/pkgs/givaro/SPKG.txt index 17ad6f9bec3..276d555dc03 100644 --- a/build/pkgs/givaro/SPKG.txt +++ b/build/pkgs/givaro/SPKG.txt @@ -29,139 +29,3 @@ SPKG Repository: https://bitbucket.org/malb/givaro-spkg * GNU patch * GMP/MPIR -== Changelog == - -=== givaro-4.0.3 (Clement Pernet, 18 November 2017) === - * #24214: updated to new upstream release. - -=== givaro-4.0.2 (Clement Pernet, 30 July 2016) === - * #13164: updated to new upstream release. - -=== givaro-3.7.1 (Jean-Pierre Flori, 9 August 2012) === - * #13164: updated to new upstream release. - -=== givaro-3.7.0 (Martin Albrecht, June 7th, 2012) === - * #9511: updated to new upstream release. - -=== givaro-3.2.13.p0 (Jeroen Demeyer, 25 May 2012) === - * #12761: Restore upstream sources to vanilla 3.2.13 (the previous - src/ directory was some never-released CVS version between - givaro-3.2.13.rc1 and givaro-3.2.13, but bootstrapped with a - different automake). - * Remove gmp++.h.patch which is upstreamed (the old diff was wrong). - * Use `patch` to apply all patches. - * Fix patch for givtablelimits.h such that it can be applied on all - systems, not only Cygwin. - * Merged all GCC-4.7.0 patches into one: cplusplus_scoping.patch - * Don't touch .pyx files, instead fix module_list.py (also on #12761). - -=== givaro-3.2.13.rc1.p4 (Leif Leonhardy, March 27th 2012) === - * #12761: Fix headers not conforming to C++11 to make Sage (especially the - Sage library) build with GCC 4.7.0 (and without `-fpermissive`). - Same for Givaro's test suite, which uses / instantiates much more! - (These headers get installed into `$SAGE_LOCAL/include/givaro/`.) - New patches: - - patches/src.kernel.integer.givintnumtheo.inl.patch - - patches/src.kernel.integer.givintrsa.inl.patch - - patches/src.library.poly1.givpoly1factor.inl.patch - - patches/src.library.poly1.givpoly1padic.h.patch - - patches/src.library.poly1.givpoly1proot.inl.patch - * Remove the obsolete Debian `dist/` directory. - * Remove obsolete GCC 4.3 patch. - * Rename diffs of prepatched files that are (still) copied over to `*.diff` - (rather than `*.patch`) such that they don't get "automatically" applied - by the `patch -p1` loop, which I added. - * Fix permissions of `SPKG.txt` and `spkg-install`, and two upstream files. - * Add "Special Update/Build Instructions" section. - * Clean up `spkg-check` and `spkg-install`. - * Also set up environment variables in `spkg-check`, as `make check` involves - compilation. (Although `configure` should have put them into the generated - Makefiles.) - * Use `$MAKE` in `spkg-check` as well. - * Exit in case the build failed! - * Only `touch` extension modules (`*.pyx`) if they (already) exist. - -=== givaro-3.2.13.rc1.p3 (Simon King, Dec 10th, 2011) === - * #12131: Use --libdir, to make the package work on openSUSE. - -=== givaro-3.2.13rc1.p2 (John Palmieri, June 27th, 2010) === - * #9352: Trivial typo in spkg-check. - -=== givaro-3.2.13rc1.p1 (Willem Jan Palenstijn, Apr 30th, 2010) === - * #8788: Avoid local static object with destructor to prevent double frees - on some platforms. - -=== givaro-3.2.13rc1.p0 (Jaap Spies, Jan 25th, 2010) === - * If $SAGE64="yes" add -m64 to CFLAGS. This works on Open Solaris x64 64 bit. - It used to work only on OSX and may work on other 64 bit systems. - * This is trac http://trac.sagemath.org/sage_trac/ticket/8062 - -=== givaro-3.2.13rc1 (Clement Pernet, Sept 18th, 2008) === - * Fix endianess pb with PPC-OSX - -=== givaro-3.2.12rc0 (Clement Pernet, July 10th, 2008) === - * Upgrade to givaro-3.2.12rc0 - -=== givaro-3.2.11 (Clement Pernet, June 25th, 2008) === - * Upgrade to givaro-3.2.11 (fixing long long issue on 64 bit archs) - -=== givaro-3.2.10.rc3.p3 (Michael Abshoff, May 18th, 2008) === - * improve 64 bit OSX build support - -=== givaro-3.2.10.rc3.p2 (William Stein, May 16th, 2008) === - * Fix cygwin "missing logb declaration" problem. - -=== givaro-3.2.10.rc3.p1 (Michael Abshoff, April 17th, 2008) === - * Fix Itanium specific gcc 4.3 build problem - -=== givaro-3.2.10.rc3.p0 (Michael Abshoff, April 15th, 2008) === - * fix gcc 4.3 build - patch send upstream - -=== givaro-3.2.10.rc3 (Michael Abshoff, March 15th, 2008) === - * update to upstream 3.2.10.rc3 - * add 64 bit OSX 10.5 support - * remove all patches since they were integrated upstream - * add spkg-check - -=== givaro-3.2.10 (Clement Pernet, March 2nd, 2008) === - * Updated to upstream 3.2.10 - * removed most patches - * Note: this was based on 3.2.10.rc2 - -=== givaro-3.2.6.p5 (Michael Abshoff) === - * fix #1091. This copies over updated version of givintrsa.h, - givintfactor.h and givintnumtheo.h into src/src/kernel/integer. - I also keft the patch itself in the patches directory. - -=== 2007-12-06 === - * include in givaromm.C to fix gcc 4.3 issue - -=== 2007-11-02 (Michael Abshoff) === - * apply rpw's work aorund for OSX 10.5 - * apply the same fix to givzpz32std.inl - * add .hgignore - -=== 2007-02-03 (Martin Albrecht) === - * new upstream release: 3.2.6 - * Changes to upstream (everything else below is irrelevant): - ./src/library/poly1/givpoly1factor.h (2006-10-21 fix) - ./src/kernel/zpz/givgfq.inl (2006-10-21 fix) - ./src/kernel/zpz/givgfq.h (2006-10-21 fix) - ./aclocal.m4 64-bit (2006-10-29 fix) - ./src/library/poly1/givpoly1padic.h (2006-11-09 fix) - -=== 2006-12-15 William Stein === - * I don't know why, but I had to comment out "Rep& amxy( Rep& r, const Rep& a, const Rep& b, const Rep& c ) const { return Integer::amxy(r,a,b,c); }" in src/kernel/integer/givinteger.h in order to get Givaro to compile on my computer. I'm guessing maybe amxy was deprecated from the C++ stl? - -=== 2006-12-10 (Martin Albrecht) === - * delete[] not delete where new[] in GivaroMM - -=== 2006-11-09 (Martin Albrecht) === - * GCC 4.0.0 on OSX PPC boxes doesn't seem to like "using Poly1Dom::_domain" so we work around this in givpoly1padic.h - -=== 2006-10-29 (Martin Albrecht) === - * replaced macro AC_LIBTOOL_SYS_DYNAMIC_LINKER with same macro from libtool 1.5.23a in aclocal.m4 to fix build on x86-64 systems as suggested by Kate Minola - -=== 2006-10-21 (Martin Albrecht) === - * ported constructor with modulus parameter from linbox to givaro - * added sage_generator() which returns the generator == cardinality if interpreted as an integer not a random one diff --git a/build/pkgs/graphs/SPKG.txt b/build/pkgs/graphs/SPKG.txt index c646eb65b4e..17e12fb75e9 100644 --- a/build/pkgs/graphs/SPKG.txt +++ b/build/pkgs/graphs/SPKG.txt @@ -24,23 +24,3 @@ Grout. Since April 2012 it also contains the ISGCI graph database. N/A -== Changelog == - -== graphs-20150724.p6 (Nathann Cohen, 2013-07-24 == - * Added the database on strongly regular graphs - -== graphs-20130920.p5 (Nathann Cohen, 2013-09-20) == - * #14396: Update of isgci_sage.xml, added smallgraphs.txt - -== graphs-20120404.p4 (R. Andrew Ohana, 2012-05-17) == - * #13123: Move SAGE_DATA to SAGE_LOCAL/share - -== graphs-20120404.p3 (Nathann Cohen, 2012-04-04) == - * Addition of the ISGCI database as a XML file. See trac #11880 - -== graphs-20070722.p2 (Keshav Kini, 2012-03-18) == - * #12694: Normalize directory structure - * Make R. Andrew Ohana the maintainer - -== graphs-20070722.p1 (?, ?) == -? diff --git a/build/pkgs/iconv/SPKG.txt b/build/pkgs/iconv/SPKG.txt index 3ae0547a38a..3b15e243885 100644 --- a/build/pkgs/iconv/SPKG.txt +++ b/build/pkgs/iconv/SPKG.txt @@ -18,57 +18,3 @@ languages, with different characters to be handled properly. * None, other than anyone updating this package should be familiar with how to write shell scripts. -== Changelog == - -=== iconv-1.14 (Jean-Pierre Flori, 26 May 2013) === - * #14647: update to version 1.14. - -=== iconv-1.13.1.p4 (Jean-Pierre Flori, 5 January 2013) === - * #13912: let iconv build on Cygwin without additional prereqs. - -=== iconv-1.13.1.p3 (David Kirkby, August 10th, 2010) === - * Use '$MAKE' instead of 'make' in spkg-install and spkg-check to enable - parallel builds, and allow the user to specify a different 'make' program. - * Use CC="$CC $CFLAG64" instead of adding $CFLAG64 to CFLAGS. The latter - caused problems on Solaris 10 x86 and an early version of OpenSolaris - on x86. It was never a problem on recent versions of OpenSolaris, or - Solaris 10 on SPARC. See #9718 for a discussion of this. - * Changed the format of the tests in spkg-install and spkg-check to be a - little clearer. - * Added a few extra comments. - * Removed code to remove old files, to avoid causing any confusion. - * Quoted "$SAGE_LOCAL" where this had been omitted before. - * Removed trailing white space on lines. - * Removed a surplus ; in both spkg-check and spkg-install. - * Added the "Upstream Contact" section to SPKG.txt. - * Changed the "Special Update/Build Instructions" to be "none", - as what was written before was confusing. - * Install iconv on HP-UX in addition to the two platforms iconv was - previously installed on (Solaris and Cygwin). - * Additionally force 'make check' to execute on HP-UX, too. - * No longer assume bash is in /bin, as it is not on HP-UX or AIX. - Instead use "#!/usr/bin/env bash", as suggested in the Sage - Developers Guide. - * Consistently use "$UNAME" (which is set by 'sage-env') rather than - `uname`. (Reviewer change. Also further cosmetic changes.) - * Stylistic change: Use 'case' statements for $UNAME case distinctions - rather than (nested) 'if's with or-lists of 'test' statements. - (Reviewer change, too.) - * All patches/changes made at #9603. - -=== iconv-1.13.1.p2 (John Palmieri, March 31st 2010) === - * spkg-check: only run 'make check' on Solaris and Cygwin. - -=== iconv-1.13.1.p1 (William Stein, March 31st 2010) === - * Really ensure iconv spkg only does something on Solaris and Cygwin. - In particular, don't delete old versions thus breaking everybody's - upgrades. - -=== iconv-1.13.1.p0 (David Kirkby, March 21st 2010) === - * #8567 Ensure iconv only builds on Solaris and Cygwin as - having two copies of iconv causes problems on some Linux systems. - -=== iconv-1.13.1 (David Kirkby, February 13th 2010) === - * #8191 First release of libiconv, needed for R on Solaris - and probably for Cygwin too (see #7319) - diff --git a/build/pkgs/jinja2/SPKG.txt b/build/pkgs/jinja2/SPKG.txt index 96b65425ac3..3ff6cd895b5 100644 --- a/build/pkgs/jinja2/SPKG.txt +++ b/build/pkgs/jinja2/SPKG.txt @@ -32,15 +32,3 @@ Homepage: http://jinja.pocoo.org/ None. (Just make sure its prerequisites are new enough in Sage, to avoid downloads during the build / installation.) -== Changelog == - -=== jinja2-2.5.5 (Leif Leonhardy, December 3rd, 2010) === - * #10423: Upgrade to version 2.5.5, as Sphinx (1.0.4) requires a version >=2.2 - (cf. #10350). - * Some clean-up, dependencies added. - -=== jinja2-2.1.1 (Tim Dumol, September 6th, 2009) === - * Upgrade to version 2. - -=== jinja2-1.2 (Mike Hansen, September 15th, 2008) === - * Initial version. diff --git a/build/pkgs/libogg/SPKG.txt b/build/pkgs/libogg/SPKG.txt index 7f0011fa9d5..d6c01f19e11 100644 --- a/build/pkgs/libogg/SPKG.txt +++ b/build/pkgs/libogg/SPKG.txt @@ -53,7 +53,3 @@ This spkg provides dependencies for * No changes went into src. -== Changelog == - -=== libogg-1.1.4 (Wilfried Huss, October 19th, 2009) === - * ligogg-1.1.4 diff --git a/build/pkgs/libtheora/SPKG.txt b/build/pkgs/libtheora/SPKG.txt index 9526cf4fb1d..259f162066d 100644 --- a/build/pkgs/libtheora/SPKG.txt +++ b/build/pkgs/libtheora/SPKG.txt @@ -57,7 +57,3 @@ This spkg provides dependencies for * No changes went into src. -== Changelog == - -=== libtheora-1.1.1 (Wilfried Huss, October 19th, 2009) === - * libtheora-1.1.1 diff --git a/build/pkgs/linbox/SPKG.txt b/build/pkgs/linbox/SPKG.txt index ef08537f536..d4d5bbbecc0 100644 --- a/build/pkgs/linbox/SPKG.txt +++ b/build/pkgs/linbox/SPKG.txt @@ -42,168 +42,3 @@ TODO: - Check whether `make fullcheck` works/builds, is worth running, and doesn't take ages. (Version 1.1.6 doesn't seem to have such a target.) -== Changelog == - -=== linbox-1.3.2.p0 (Jean-Pierre Flori, 25 November 2012) === - * Trac #13755: let LinBox build with MPIR >= 2.5.0. - -=== linbox-1.3.2 (Martin Albrecht, Volker Braun, 15 August 2012) === - * Trac: 12883: New upstream release - * split off fflas/ffpack SPKG - * The whole -fpermissive stuff isn't required any more - -=== linbox-1.1.6.p11 (Jeroen Demeyer, 19 June 2012) === - * #13118: Don't look at compiler versions, just use the -fpermissive - flag whenever the compiler supports it. - -=== linbox-1.1.6.p10 (Jeroen Demeyer, 25 May 2012) === - * #12762 review: Remove the touching of linbox.pyx, since - Cython knows the dependency of linbox.pyx on linbox-sage.h - * Only add the -fpermissive workaround on GCC-4.7.x, not other - compilers. - -=== linbox-1.1.6.p9 (Leif Leonhardy, April 7th 2012) === - * #12762: Temporarily add `-fpermissive` to `CXXFLAGS` if we're compiling - with `g++` 4.7.x, since the LinBox sources currently don't conform to - C++11, so GCC 4.7.x would otherwise reject them. - * Exit if the build failed. - * Use `CFLAG64` if it is set (and `SAGE64=yes`). - * Clean up `spkg-install`, add some messages. - * Add an `spkg-check` file, which currently runs `make check`. (There's also - a `fullcheck` target.) - * Change patch to disable the commentator, as default parameters were missing - with `-DDISABLE_COMMENTATOR`, such that the test suite wouldn't build. - Also, one must not unconditionally use `extern` for the global (dummy) - commentator since this is C++, and doing so also breaks the test suite. - * Fix (i.e. patch) the sources such that the test suite (`make check`) builds, - also with GCC 4.7.0. - * Add the "Special Update/Build Instructions" section. - -=== linbox-1.1.6.p8 (William Stein, 18 March 2012) === - * Trac #10281: Multimodular echelon form over cyclotomic fields fails - -=== linbox-1.1.6.p7 (Jeroen Demeyer, 5 March 2012) === - * Trac #12629: *always* disable the commentator. There are problems - om some systems (e.g. OS X 10.4 with GCC 4.6.3) when parts of LinBox - are compiled with the commentator and parts without. - * Backport patch disable_commentator.patch from LinBox-1.2.2 to enable - LinBox to be built with the commentator disabled. - * Remove all -I and -L compiler flags from spkg-install, ./configure - should detect these. - * Use $MAKE instead of make. - * Use patch for patching. - -=== linbox-1.1.6.p6 (Simon King, December 10th, 2011) === - * #12131: Use --libdir, to make the package work on openSUSE. - -=== linbox-1.1.6.p5 (Martin Albrecht, October 10th, 2011) === - * removed spkg-rebuild - * removed spkg-debian and the dist directory - * removed "linbox" from .hgignore - * added patch for file file patches/commentator.C - -=== linbox-1.1.6.p4 (Martin Albrecht, August 23rd, 2011) === - * add NonZeroRandIter to modular-float.h (fixed in 1.1.7) - -=== linbox-1.1.6.p3 (Jaap Spies, Jan 25th, 2010) === - -=== linbox-1.1.6.p2 (William Stein, ?) === - * ???? - -=== linbox-1.1.6.p1 (William Stein, Sept 21, 2009) === - * Use systemwide lapack on windows. - -=== linbox-1.1.6.p0 (Mike Hansen, June 20th, 2008) === - * Applied Peter Jeremy's FreeBSD fix at #5870. - -=== linbox-1.1.6 (Clement Pernet, Sept 18th, 2008) === - * Upgrade to 1.1.6 release upstream - * including the fixes of bugs related to cygwin (gcc-3.4, linking parameter - order,...) - -=== linbox-1.1.6rc1 (Clement Pernet, Aug 12th, 2008) === - * Fix bug in Charpoly and revert to the "good" algorithm. See #3671 - * upstream linbox-1.1.6rc1 - * uniformize source directory name (linbox->src) - -=== linbox-1.1.6.p0 (Michael Abshoff, July 21st, 2008) === - * Integrate patch by Clement Pernet fixing #3671 - * miscellaneous cleanup - -=== linbox-1.1.6 (Clement Pernet, June 14th, 2008) === - * Upstream 1.1.6 linbox version - * merge former linbox_wrap in linbox/interface - * no more gmp++ in LinBox - * several bug fixes - -=== linbox-1.1.5.p6 (Michael Abshoff, May 18th, 2008) === - * fix 64 bit OSX support - -=== linbox-1.1.5.p5 (Michael Abshoff/William Stein, May 16, 2008) === - * add support for cygwin - -=== linbox-1.1.5.p4 (Michael Abshoff, April 15th, 2008) === - * reenable optimization on all platforms because the detection was broken (fixes #3041) - -=== linbox-1.1.5.p3 (Michael Abshoff, April 15th, 2008) === - * apply gcc 4.3 build patch - -=== linbox-1.1.5.p2 (Michael Abshoff, April 9th, 2008) === - * Apply Clement Pernet's commentator fix (#2833) - * clean up spkg-install some more and remove unneeded and faulty gmp++ copying - -=== linbox-1.1.5.p1 (Clement Pernet, April 4th, 2008) === - * Revert charpoly method to LUK, waiting to investigate further the bug in ArithProg method (ticket #2804) - -=== linbox-1.1.5 (Clement Pernet, April 2nd, 2008) === - * Remove every patch - * Put upstream final 1.1.5 release of LinBox - * Remove useless patches in dist/debian/linbox-debian - -=== linbox-1.1.5rc2.p7 (Michael Abshoff, April 1st, 2008) === - * Copyright files for Debian packages (Tim Abbott, #2199) - * linbox updates for Debian gfortran transition (Tim Abbott, #2758) - -=== linbox-1.1.5rc2.p6 (Michael Abshoff, March 22nd, 2008) === - * integrate Debian build infrastructure (Tim Abbott, #2647) - * clean up SPKG.txt - * commit all outstanding changes - -=== linbox-1.1.5rc2.p5 (William Stein, March 17th, 2008) === - * bump version number to force rebuild on upgrade due to updated Givaro - -=== linbox-1.1.5rc2.p4 (Clement Pernet) === - * revert to a better commentator.h, which now works on PPC, and still uses static - -=== linbox-1.1.5rc2.p3 (Clement Pernet, William Stein, March 10th, 2008) === - * fix the bug with static_initialization of commentator on PPC. (ticket 2463) - -=== linbox-1.1.5rc2.p2 (Michael Abshoff, March 10th, 2008) === - * remove buggy case in libcblas detect (#2458) - -=== linbox-1.1.5rc2.p1 (Clement Pernet, March 4th, 2008) === - * Update full rank submatrix wrapper - * Set default alg for charpoly to ArithProg, thus avoiding Darwin-static initialization gcc bug (which still has to be addressed) - -=== linbox-1.1.5rc2.p0 (Michael Abshoff, March 3rd, 2008) === - * Apply Clement Pernet's PID_Integer patch (fixed #915) - -=== linbox-1.1.5rc2 (Clement Pernet, March 2nd, 2008) === - * updated to upstream 1.1.5rc2 - * added additional funcionality in linbox_wrap - -=== 2007-12-16 (Michael Abshoff) === - * detect internal ATLAS and link against it per default on non-OSX - -=== 2007-11-13 (Michael Abshoff) === - * Apply Clement Pernet's charpoly leak fix, i.e. the dreaded BLAS:MatrixHom - -=== 2007-10-29: (Michael Abshoff) === - * added fix for #1026 - * add "-g" to CXXFLAGS and CFLAGS for better valgrind output - * add .hgignore - * add all files under patches and linbox_wrap to hg repo - -=== 2007-09-03 (Michael Abshoff) === - * merged LinBox ChangeSet 2803, which fixes #498 without the performance regression of the initial workaround - diff --git a/build/pkgs/m4ri/SPKG.txt b/build/pkgs/m4ri/SPKG.txt index 1922b3a98cb..cfade2147e1 100644 --- a/build/pkgs/m4ri/SPKG.txt +++ b/build/pkgs/m4ri/SPKG.txt @@ -25,114 +25,3 @@ GF(2). (See also m4ri/README for a brief overview.) * Delete m4ri.vcproj (and perhaps other unnecessary baggage). * Touch m4ri/configure to make sure it is newer than its sources. -== Releases/Changelog == - -=== libm4ri-20130416 (Martin Albrecht, 22 March 2013) === - * #14335: new upstream release - -=== libm4ri-20121224 (Martin Albrecht, 21 December 2012) === - * #13858: new upstream release - -=== libm4ri-20120613 (Martin Albrecht, 7 June 2012) === - * #12840: new upstream release - * remove old headers before installing new ones - -=== libm4ri-20111004.p2 (John Palmieri, 23 March 2012) === - * #12311: Remove the script testcc.sh: - just use the version in the PATH (i.e., in SAGE_ROOT/spkg/bin) - -=== libm4ri-20111004.p1 (Keshav Kini, 2012-03-18) === - * #12694: Normalize directory structure - -=== libm4ri-20111004.p0 (Simon King, December 10th, 2011) === - * #12131: Use --libdir, to make the package work on openSUSE. - -=== libm4ri-20111004 (Martin Albrecht, October 4th, 2011) === - * new upstream release - -=== libm4ri-20110901 (Martin Albrecht, August 29th 2011) === - * new upstream release dealing with CFLAGS better - * dropped dist/ subdir - -=== libm4ri-20110715 (Martin Albrecht, July 6th 2011) === - * split M4RI and M4RIE in separate packages - -=== libm4ri-20100817 (Martin Albrecht, August 18th 2010) === - * Including M4RIE, an extension to M4RI for small extensions of GF(2). - * Enable tuning code to detect "cache sizes" - -=== libm4ri-20100701.p1 (Leif Leonhardy, July 13th 2010) === - * Committed Martin Albrecht's changes of July 13th (minor fixes, see #9475). - * SPKG.txt: - - Added "License" and "Special Update/Build Instructions" sections, - fixed some typos, some additions. - * spkg-install: - - Fixed old typo (CLFAGS), fixed syntax error due to missing spaces that - prevented SAGE_FAT_BINARY working. - - Renamed $SSE2_SUPPORT to $DISABLE_SSE2. - - Removed $SAGE_LOCAL/include from preprocessor search path since M4RI - doesn't depend on any Sage package (similarly for library search path). - - Removed redundant --includedir=... from configure. - - Some restructuring. - * spkg-check: - - Replaced "make" by "$MAKE". - - *Append* "-m64" to $CFLAGS rather than overwrite them if $SAGE64 is "yes". - * Removed extra baggage (see "Special Update/Build Instructions" above). - * (Note: There was no official p0. The above changes are all #9475.) - -=== libm4ri-20100701 (Martin Albrecht, July 11th, 2010) === - * new upstream release - + refactoring (function names now match what the function is doing) - + heuristic algorithm choice for RREF - + OpenMP tuning and fixes - + new option to suppress SSE2 instructions - * respecting SAGE_FAT_BINARY (cf. #9381) - * adding spkg-check (cf. #9281) - -=== libm4ri-20091119 (Martin Albrecht, November 19th, 2009) === - * portability improvements in configure.ac, cf. http://trac.sagemath.org/sage_trac/ticket/7375#comment:6 - -=== libm4ri-20091101 (Martin Albrecht, November 1st, 2009) === - * new upstream release - + switched to LQUP instead of PLUQ for better performance - + because of this and other improvements much better handling of sparse-ish matrices - + overall better performance for elimination - + better performance for mzd_transpose - + dropped the check for the numer of CPUs from configure which was unused and not cross platform - + optional tuning code to calculate cache sizes (not enabled by default) - + some refactoring - + mzd_row_add_offset() fixed a segfault - -=== libm4ri-20090615 (Martin Albrecht, June 15th, 2009) === - * new upstream release with bugfixes and new functionality (nullspace) - -=== libm4ri-20090512 (Martin Albrecht, May 12th, 2009) === - * new upstream release with API changes - -=== libm4ri-20090128 (Martin Albrecht, January 28th, 2009) === - * new upstream release with bug fixes and performance enhancements - -=== libm4ri-20080904 (Martin Albrecht, September 4th, 2008) === - * new upstream release with bug fixes and portability enhancements - -=== libm4ri-20080901 (Martin Albrecht, September 1st, 2008) === - * new upstream release - -=== libm4ri-20080831 (Martin Albrecht, August 31th, 2008) === - * new upstream release - -=== libm4ri-20080624 (Martin Albrecht, August 6th, 2008) === - * new upstream release - -=== libm4ri-20080601 (Martin Albrecht, June 1st, 2008) === - * new upstream release - -=== libm4ri-20080521 (Martin Albrecht, May 21th, 2008) === - * new upstream release - -=== libm4ri-20071224.p3 (Michael Abshoff, May 18th, 2008) === - * add 64 bit OSX build support - -=== libm4ri-20071224.p2 === - * Details lost to history - diff --git a/build/pkgs/m4rie/SPKG.txt b/build/pkgs/m4rie/SPKG.txt index 0f5d1a49f06..8aa21cd846a 100644 --- a/build/pkgs/m4rie/SPKG.txt +++ b/build/pkgs/m4rie/SPKG.txt @@ -20,38 +20,3 @@ GF(2^k) for 2 <= k <= 10. * M4RI * Givaro -== Releases/Changelog == - -=== libm4rie-20130416 (Martin Albrecht, 22 March 2013) === - * #14336: new upstream release - -=== libm4rie-20120613 (Martin Albrecht, 7 June 2012) === - * #12841: new upstream release - * delete old headers before installing new ones - -=== libm4rie-20111004.p3 (Jeroen Demeyer, 10 April 2012) === - * Trac #12821: don't quote $CC when running testcc.sh - * Use testcflags.sh to add -fPIC -Wall -pedantic -g - * Fix strings to test output of testcc.sh against - -=== libm4rie-20111004.p2 (Jeroen Demeyer, 16 February 2012) === - * Rename source directory "m4rie" to "src". - * Trac #12501: touch src/src/config.h.in to prevent autoheader from - running. - * Trac #12311: remove testcc.sh script, instead use the one from - $SAGE_ROOT/spkg/bin (in the $PATH). - -=== libm4rie-20111004.p1 (Martin Albrecht, January 2nd, 2012) === - * #12245: proper dependencies - -=== libm4rie-20111004.p0 (Simon King, December 10th, 2011) === - * #12131: Use --libdir, to make the package work on openSUSE. - -=== libm4rie-20111004 (Martin Albrecht, October 4th, 2011) === - * new upstream release - -=== libm4rie-20110821 (Martin Albrecht, August 21st, 2011) === - * new upstream release in preparation for Sage inclusion - -=== libm4rie-20110715 (Martin Albrecht, July 15th, 2011) === - * split form libm4ri diff --git a/build/pkgs/mcqd/SPKG.txt b/build/pkgs/mcqd/SPKG.txt index 8cee9ac6bcf..0e973a54623 100644 --- a/build/pkgs/mcqd/SPKG.txt +++ b/build/pkgs/mcqd/SPKG.txt @@ -18,7 +18,3 @@ https://gitlab.com/janezkonc/mcqd None -== Changelog == - -=== mcqd-1.0 (Jernej Azarija, Nathann Cohen, 19 march 2014) == - * Initial version diff --git a/build/pkgs/mpfi/SPKG.txt b/build/pkgs/mpfi/SPKG.txt index d360a94c372..d51bf510171 100644 --- a/build/pkgs/mpfi/SPKG.txt +++ b/build/pkgs/mpfi/SPKG.txt @@ -36,132 +36,3 @@ mpfi-users@lists.gforge.inria.fr * GMP * MPFR -== Changelog == - -=== mpfi-1.5.1 (Jean-Pierre Flori, January 23rd, 2012) === - * #12171: Update MPFI to 1.5.1 - -=== mpfi-1.5.0 (Mike Hansen, December 17th, 2011) === - * #12171: Update MPFI to 1.5.0 - -=== mpfi-1.3.4-cvs20071125.p9 (Simon King, December 10th, 2011) === - * #12131: Use --libdir, to make the package work on openSUSE. - -=== mpfi-1.3.4-cvs20071125.p8 (Jaap Spies, January 26th, 2010) === - * Make 64 bit Open Solaris work - -=== mpfi-1.3.4-cvs20071125.p7 (Michael Abshoff, May 18th, 2008) === - * add 64 bit OSX build support - -=== mpfi-1.3.4-cvs20071125.p6 (William Stein, May 16, 2008) === - * modify configure.ac to work with cygwin. - * NOTE: src/ is *not* pristine! I ran autogen.sh after patching configure.ac. - -=== mpfi-1.3.4-cvs20071125.p5 (Michael Abshoff, Jan. 31st, 2008) === - * remove binary files from src/tests (#2011) - -=== mpfi-1.3.4-cvs20071125.p4 (Michael Abshoff) === - * change configure.ac to detect dylibs on OSX, too. Changed the macros in - configure.ac to: - -# Checks for MPFR lib (Before GMP!) -if ` test "$with_mpfr_lib" ` -then - AC_MSG_CHECKING(MPFR library) - if test -r "$with_mpfr_lib/libmpfr.so" - then - LDADD="$LDADD -L$with_gmp_lib -lmpfr" - else - if test -r "$with_mpfr_lib/libmpfr.dylib" - then - LDADD="$LDADD -L$with_gmp_lib -lmpfr" - else - AC_MSG_ERROR([$with_mpfr_lib/libmpfr.so or libmpfr.dylib not found]) - fi - fi - AC_MSG_RESULT(yes) -else - AC_CHECK_LIB(mpfr, main, , AC_MSG_ERROR([Library MPFR not found])) -fi - -# Checks for GMP lib -if ` test "$with_gmp_lib" ` -then - AC_MSG_CHECKING(GMP library) - if test -r "$with_gmp_lib/libgmp.so" - then - LDADD="$LDADD -L$with_gmp_lib -lgmp" - else - if test -r "$with_gmp_lib/libgmp.dylib" - then - LDADD="$LDADD -L$with_gmp_lib -lgmp" - else - AC_MSG_ERROR([$with_gmp_lib/libgmp.so or libgmp.dylib not found]) - fi - fi - AC_MSG_RESULT(yes) -else - AC_CHECK_LIB(gmp, main, , AC_MSG_ERROR([Library GMP not found])) -fi - - -=== mpfi-1.3.4-cvs20071125.p3 (Michael Abshoff) === - * change configure.ac to check and link against a dynamic gmp.so, mpfr.so - -Clean up the test of the changelog - -1. I have changed two functions: - -First, mpfi_set_str() in mpfi/src/mpfi_io.c. -(The original version was very wrong; I fixed off-by-one errors, fixed -a buffer overflow, and fixed it so that it could return precise -intervals on precisely representable inputs, instead of always making -an interval containing two floats.) The original version of the file -is at mpfi/src/mpfi_io.c.ORIG - -Second, mpfi_diam_rel() in mpfi/src/mpfi.c: I changed line 598 from - if (!mpfr_cmp_ui(centre,0)) -to - if (mpfr_cmp_ui(centre,0)) - -2. I (=William Stein) changed configure.ac to only build src and not tests or -doc, since building tests on some systems fails. Of course, it would be -better to fix building of tests. I put the changed version of configure.ac -in the patches directory. After changing it, I ran - autoreconf --force -in the src directory. - -3. Carl Witty 2007-11-01 -a. Fixed mpfi_ui_sub, by applying a patch posted by Paul Zimmerman to the -MPFI bug tracker. -b. Fixed the infinite loop in mpfi_cmp_sym_pi() (fixes the infinite loop -in mpfi_cos(), reported as MPFI bug# 1868 and Sage issue #389. - -4. Carl Witty 2007-11-25 -MPFI upstream is alive again! I'm switching to the current upstream CVS -version as of today, fetched with: - -cvs -d :pserver:anonymous@scm.gforge.inria.fr:/cvsroot/mpfi login -cvs -d :pserver:anonymous@scm.gforge.inria.fr:/cvsroot/mpfi checkout mpfi -mv mpfi src -cd src -./autogen.sh - -This version includes all the patches from the Sage spkg (or -equivalent code), and fixes several additional bugs. (So I removed -the patches/ directory, and the corresponding lines in spkg-install.) -Also, this new version installs both shared and static libraries. - -5. Carl Witty 2007-11-29 -The previous version did not compile on OSX 10.4 Intel. I think the problem -may be with src/autogen.sh, which makes ltmain.sh, config.sub, and -config.guess be symlinks instead of files; so we get whatever versions -of these files happen to be already installed on the user's computer. - -So I've replaced these three symlinks with the corresponding files, and -we'll see if that fixes the problem. - -6. Carl Witty 2007-12-01 -The previous version required "autoheader" (part of autoconf). -I've copied in a new version of src/missing, and touched src/mpfi_config.h.in; -I believe that either of these changes would suffice to fix the problem. diff --git a/build/pkgs/p_group_cohomology/SPKG.txt b/build/pkgs/p_group_cohomology/SPKG.txt index ab586478112..42bd0ccc36d 100644 --- a/build/pkgs/p_group_cohomology/SPKG.txt +++ b/build/pkgs/p_group_cohomology/SPKG.txt @@ -96,152 +96,3 @@ variable SAGE_SPKG_INSTALL_DOCS is yes (do "export SAGE_SPKG_INSTALL_DOCS=yes" on the command line before installation). The documents are put into SAGE_ROOT/local/share/doc/p_group_cohomology/. -== Changelog == - - * v3.3 (September 2019): - - Python-3 support. - - Cleaner code and tests for the mechanism that updates moved data. - - Use proper isomorphism tests in unit_test_64. - * v3.2 (Simon King, July 2019): - - Detection of graded non-induced isomorphisms of cohomology rings. - - Easier creation of a cohomology ring from a tower of subgroups. - - Kernels and preimage representatives of induced maps. - - Stop hard-coding the MTXLIB environment variable. - * 3.1 (Simon King, December 2018): - - Hilbert series computation by using a new implementation in SageMath. - - Vastly improved computation of filter degree type (now relying on - Hilbert series). - - Use libgap instead of the GAP pexpect interface. - - Sub-package upgrade: modres-1.1 - * 3.0.1 (Simon King, August 2018): - - Add a routine to compute filter regular parameters in small degrees - by enumeration. - - Cope with some changes in Singular. - * 3.0 (Simon King, January/February 2018): - - The MeatAxe has been removed from this package and has been replaced - by "SharedMeatAxe", as an external package. - - David Green's C code for the computation of minimal projective resolutions - is now using autotools and is now providing a library. - - The Python/Cython part of this package is now pip installable. - - Remove some experimental options. - - Drop support for Singular versions < 3-1-0 - - Drop the old test script, as `sage -t` now works for this package. - - Drop the old doc builder, as building the docs is now closer to - Sage's documentation than before. - - Cope with an API change in SageMath. - * 2.1.5 (Simon King, Mai 2015): - - Cope with removal of the ._domain attribute of maps and with changed import locations. - - Improved computation of the nil-radical, including degree-wise computation. - - Methods is_nilpotent and nilpotency_degree for cohomology ring elements. - - Improved computation of Poincaré series. - - Hilbert-driven computations for depth and filter degree type. - - For computing depth, only use filter degree type if it has been previously computed. - * 2.1.4 (Simon King, April 2013): - Computational techniques: - - find_small_last_parameter will now construct a parameter of the cohomology - ring, by studying the restriction to maximal elementary abelian - subgroups. In previous version, we could only find parameters of the ring - approximation. The additional advantage: The computations are easier, since - the complicated relations of the ring approximation do not need to be - considered. - - Compute a complete Gröbner basis, if there was no relation in the previous - degree. This is an essential speed-up for computing the mod-3 cohomology of - the third Janko group. - - Coping with changes in Sage: - - tmp_filename -> tmp_dir - - SAGE_DATA -> SAGE_SHARE - - Replace double underscore by single underscore attributes, to avoid name - mangling - - Change tests according to GAP's changed random generator - - Miscellaneae: - - Increase optimization level. If the gcc version is too old, David - Green's programs won't work in this optimization level. However, - functionality will be tested before finishing installation of the package. - - Remove the indentation parameter of RESL. The protocol output first prints - a short descriptor of the instance whose methods are being called (the descriptor - is only printed when the active instance changes). - - Use utilities from os.path, for better portability - - Unlink symbolic links before saving data - - Use urllib2 - - Some methods changed from temporary_result to permanent_result. But old data - remain legible. Most important example: Construction of parameters. - - Address of Simon King changed from Galway to Jena - * 2.1.3 (Simon King, July 2012): - - Improve the heuristic of choosing between Hilbert-Poincaré and Symonds - criteria. If the computation of parameters in small degrees by lifting - the Dickson invariants using elimination seems too difficult - to the user, then this computation can be interrupted with - Ctrl-c, and then other completion tests (perhaps in higher - degree) are automatically attempted, without the need of further - manual intervention. - - Cope with Cython's new name mangling, by avoiding double underscore - attributes. - - If a "permanent result" is indexed by data in the Gap interface, - then these results can now be pickled, provided that the data - in Gap can be reconstructed from string representation. - - Use a lower bound for the depth, if the actual depth is too difficult - to obtain. - - Switch the public web repository to a new location. - - Fix the creation of symbolic links from a private data base to - a public data base. - - Fix comparison of MTX matrices (comparison with None used to fail). - * 2.1.2 (Simon King, March 2012): - - Some fixes needed with the new version of Cython used by sage-5.0. - - Some fixes needed with Singular 3-1-3. - - Using the coercion framework in a better way. - - Small improvements in the MeatAxe code. - - Include the docs in the spkg. - - Improved construction of dependent parameters for Symonds' test. - * 2.1.1 (Simon King, September 2010): - - Cohomology data are now by default only created in the private - database. - - Data in the public database are accessed via symbolic links - - Code restructured: The cohomology ring constructor is modularised. - - Parallel testing now only if the patch of ticket #10004 is applied. - * 2.1 (Simon King, September 2010): - - Full doctest coverage and a parallel test script. - - Cleaning up code in order to reduce the number of compiler - warnings. - - Builds and tests on little and big endian machines. - - Uses features of Singular-3-1-1, but still works with - Singular-3-1-0. - - Support for setting random seeds. If the same random seed is - used, the resulting ring presentation is computationally - unique and machine independent. - - Kernels/preimages of induced homomorphisms; Essential and Depth - Essential ideal. - - Decorators for methods that cache results that may change if the - ring structure changes, resp. that cache results that will not - change once computed. The cached results are preserved under - pickling. KeyboardInterrupts are cached as well, but a re-computation - can be forced. - - Improved use of the Symonds and the Hilbert-Poincaré criteria, using - algebraically *dependent* parameters. - * 2.0 (Simon King, April 2010): - - Modular cohomology rings for *any* finite groups (not just for - p-groups). This is implemented in a new module - pGroupCohomology.modular_cohomology, that builds on top of the - old pGroupCohomology.cohomology module. - - The build process now uses environment variables such as $MAKE - or $MKDIR, in order to increase portability. - * 1.2.p0 (Dima Pasechnik and Simon King, March 2010): - - Adding .hgignore (ignoring src/db and mtxoriginal). - - Adding a robuster test for the existence of the SmallGroups library. - * 1.2 (Simon King, October 2009): - - Modified printing for cocycles - - Minor bug fixes and code improvements. - - The data base at sage.math has moved. - - New: Persistent Group Cohomology (bar codes), based on ideas of Graham - Ellis and Simon King. - * 1.1 (Simon King August 2009): - - Yoneda cocomplex - - Restricted Massey powers and general Massey products. - * 1.0.2 (Simon King, July 2009): - - Fixing a computation time regression and two minor bugs. - - Changing Simon King's email address - * 1.0.1 (Simon King, July 2009): - - Licensing GPL 2 or later - * 1.0 (Simon King and David Green July 2009): - - First public version diff --git a/build/pkgs/plantri/SPKG.txt b/build/pkgs/plantri/SPKG.txt index 24defea2632..5c4fe542614 100644 --- a/build/pkgs/plantri/SPKG.txt +++ b/build/pkgs/plantri/SPKG.txt @@ -31,8 +31,3 @@ See http://cs.anu.edu.au/~bdm/plantri == Dependencies == * None -== Changelog == - -=== plantri-4.5, 11th September 2014 === - * #16970: First release put into Sage. - diff --git a/build/pkgs/pyparsing/SPKG.txt b/build/pkgs/pyparsing/SPKG.txt index be9bcc4075a..6fb6d64513e 100644 --- a/build/pkgs/pyparsing/SPKG.txt +++ b/build/pkgs/pyparsing/SPKG.txt @@ -17,9 +17,3 @@ Home page: http://pyparsing.wikispaces.com Python -== Changelog == - -=== pyparsing-2.0.1 (John H. Palmieri, 20 December 2013) === - - * Trac #14993: initial release. - diff --git a/build/pkgs/ratpoints/SPKG.txt b/build/pkgs/ratpoints/SPKG.txt index fed925f9bba..c183090831a 100644 --- a/build/pkgs/ratpoints/SPKG.txt +++ b/build/pkgs/ratpoints/SPKG.txt @@ -28,45 +28,3 @@ removed from Sage. compiler errors. In the case that ratpoints fails to build with SSE2 instructions enabled, the build is repeated with SSE2 disabled. -== Changelog == - -=== ratpoints-2.1.3.p3 (Leif Leonhardy, March 17th 2012) === - * #12682: Patch `Makefile` such that the `CC` (and `INSTALL_DIR`) environment - variable(s) override(s) the setting in the Makefile. - * Some clean-up; use `$MAKE` instead of `make`, also install the library - with `make` (i.e., `$MAKE`) rather than "by hand". - * TODO: - - The Makefile has a `test` target; don't know whether we should - run some tests, and whether it's worth an `spkg-check` script (for - which we'd presumably have to duplicate the whole `CCFLAGS*` setup). - -=== ratpoints-2.1.3.p2 (Jeroen Demeyer, 13 February 2012) === - * #12368: Add compiler flag -fnested-functions if and only if it is - supported by the C compiler. - * Copy $CFLAGS (which is the standard variable for this) to $CCFLAGS - (which is what ratpoints uses). - -=== ratpoints-2.1.3.p1 (Jaap Spies, 24 Feb 2010) === - * #8351 make ratpoints build 64 bit for Open Solaris x64 with SAGE64=yes - -=== ratpoints-2.1.3.p0 (William Stein, 14 Feb 2010) === - * Include change to spkg-install so that build works on Cygwin, - a fix that was in (trac #7015), and somehow got lost. See - trac #8267. - -=== ratpoints-2.1.3 (William Stein, 14 Feb 2010) === - * Evidently somebody updated ratpoints to 2.1.3 and didn't - update the SPKG.txt. Oops. See below! jsp - -=== ratpoints-2.1.2.p1 (William Stein, 8 July 2009) === - * add hgignore - * fix mistake in spkg-install (!= versus -ne) - * make work on 64-bit OS X - -=== ratpoints-2.1.2 (Robert Miller, 22 April 2009) === - * Initial spkg - * Work around SSE2 build issues by disabling on fail - * Helped Michael Stoll fix several memory leaks. - -=== ratpoints-2.1.3 (Robert Miller, 30 September 2009) === - * Updated to 2.1.3 diff --git a/build/pkgs/rpy2/SPKG.txt b/build/pkgs/rpy2/SPKG.txt index 9c78b19257c..806f1c946cf 100644 --- a/build/pkgs/rpy2/SPKG.txt +++ b/build/pkgs/rpy2/SPKG.txt @@ -22,11 +22,3 @@ Website: http://rpy.sourceforge.net/rpy2.html * setup.patch: takes care of a few parsing issues. * cygwin.patch: let rpy2 build on Cygwin. -== Changelog == - -=== rpy2-2.7.4 (Emmanuel Charpentier, December 1st, 2015) === - * Trac #19638 : upgrade to allow interaction with Jupyter notebook - * Updated cygwin.patch to add "|| #defined(__CyGWIN__)" to ALL occurrences - of "#defined(Win32) || #defined(Win64)". This should be reviewed by - someone who knows what (he|she)'s doing with Cygwin (I don't). - * Removed setup.patch, which as no target now. diff --git a/build/pkgs/rubiks/SPKG.txt b/build/pkgs/rubiks/SPKG.txt index 7a98bd2aeb0..af4e9a21bb9 100644 --- a/build/pkgs/rubiks/SPKG.txt +++ b/build/pkgs/rubiks/SPKG.txt @@ -23,103 +23,3 @@ Eric Dietz (GPL) http://www.wrongway.org/?rubiksource cubex - A fast, non-optimal 3x3x3 solver mcube - A fast, non-optimal 4x4x4 solver -== Changelog == - -=== rubiks-20070912.p18 (John Palmieri, 23 March 2012) === - * #12311: Remove explicit path to testcc.sh in spkg-install. - -=== rubiks-20070912.p17 (Jeroen Demeyer, 8 June 2011) === - * #11437: Apply workaround for versions 4.6.0 and 4.6.1 of gcc. - The bug is supposed to be fixed in the final gcc 4.6.1 but we still - apply the workaround for gcc 4.6.1 to support pre-release versions - of gcc 4.6.1. - -=== rubiks-20070912.p16 (Jeroen Demeyer, 3 May 2011) === - * #11168: Apply workaround for versions 4.6.x of gcc, not only - version 4.6.0. - -=== rubiks-20070912.p15 (Jeroen Demeyer, 25 April 2011) === - * #11168: Instead of using -O1 with gcc 4.6.0, use -O2 -fno-ivopts - The is because the bug is in the file gcc/tree-ssa-loop-ivopts.c, - see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48702 - -=== rubiks-20070912.p14 (David Kirkby, 23rd April 2011) === - * #11168: Drop optimisation level to -O1 on all platforms, but - only if gcc 4.6.0 is used. - -=== rubiks-20070912.p13 (David Kirkby, 10th April 2011) === - * #11168: Drop optimisation level on Solaris to -O1 as this - mis-compiles on OpenSolaris with gcc 4.6.0. It is not - worth making the test too specific, so the optimisation - level is dropped to -O1 on any sort of Solaris machine. - * Correct a few typos in SPKG.txt - -=== rubiks-20070912.p12 (David Kirkby, 30th June 2010) === - * #9388 Corrected my unportable use of 'mktemp' which I erroneously - believed was portable, but it is not defined as a command (only - a system call) by POSIX. The revised version avoids this. - - -=== rubiks-20070912.p11 (David Kirkby, 30th May 2010) === - * #9030 rubiks is building part 32-bit and part 64-bit on OpenSolaris x64. - Added ${CFLAG64} to src/dik/makefile. CFLAG64 gets set to -m64 (by default) - if the variable SAGE64 is "yes". So this patch adds an -m64 which is - needed to build rubiks fully 64-bit. - -=== rubiks-20070912.p10 ???????????????????????????????? === - -=== rubiks-20070912.p9 (William Stein, June 14, 2009) === - * Make too many changes to the Makefiles to list really! - * Remove hard coding of CC, which was set to g++ in some places - There was a total mix-up of variable names for compilers. - * Remove the hard-coding of gcc, which was supposedly done - by Micheal to allow it to build on Solaris (see - rubiks-20070912.p1 below). With the intention later to - build Sage on Solaris with the Sun compiler, why the hell - he hard-coded g++ I do not know. - * Added -Wall to build if using g++ - * Checks there are not a mix of Sun and GNU compilers - * Adds -m64 if SAGE64 is set to yes. - * Print out what things like CC, CXX etc are set to - The Makefile do not modify these in this case. - -=== rubiks-20070912.p9 (William Stein, June 14, 2009) === - * use $MAKE environment variable so that parallel build works - -=== rubiks-20070912.p8 (Michael Abshoff, September 1st, 2008) === - * work around install problem on Solaris - -=== rubiks-20070912.p7 (William Stein, May 16th, 2008) === - * Add Cygwin build support (#3241) - -=== rubiks-20070912.p6 (Michael Abshoff, April 14th, 2008) === - * remove binary crap from reid solver (fixes #2985) - * build Reid solvers with "-O2 -g" - -=== rubiks-20070912.p5 (Michael Abshoff, April 14th, 2008) === - * fix gcc 4.3 build. The patch has been applied to the source tree. It need to be send upstream. - -=== rubiks-20070912.p4 (Michael Abshoff, April 1st, 2008) === - * Debian amd64 fixes for rubiks (Tim Abbott, #2763) - -=== rubiks-20070912.p3 (Michael Abshoff, March 21st, 2008) === - * SAGE_LOCAL check (#633) - * remove binary crap - * rename cube to dikcube to avoid name clash with polymake (#2595) - * detect the location of install instead of hardcoding it (#2287) - -=== rubiks-20070912.p2 (Tim Abbott, Feb. 17th, 2008) === - * Convert normal spkg-install to using new Makefile - -=== rubiks-20070912.p1 (Michael Abshoff, Jan. 28th, 2008) === - * fix Solaris build by setting CC to gcc and changing Dik's makefile to use $CC instead of cc - -=== rubiks-20070912.p0 (Michael Abshoff) === - * clean up SPKG.txt - * remove *DS*Store and various prebuild binaries from tree - * remove global hg repo (that included src!) - -=== rubiks-20070912 === - * initial version - - diff --git a/build/pkgs/scons/SPKG.txt b/build/pkgs/scons/SPKG.txt index 7b822f26f9c..bad9e3a9bf9 100644 --- a/build/pkgs/scons/SPKG.txt +++ b/build/pkgs/scons/SPKG.txt @@ -16,15 +16,3 @@ X/MIT == Dependencies == * Python -== Changelog == - -=== scons-1.2.0 (Mike Hansen, June 19th, 2009) === - * Updated to 1.2.0. - -=== scons-0.97.0d20071212 (Michael Abshoff, March 24th, 2008) === - * update to latest 0.97 snapshot release - * remove "-no_archive" from ifort.py (#1618) - * make sure SAGE_LOCAL is defined (#633) - -=== scons-0.97 (Joel B. Mohler) === - * initial version diff --git a/build/pkgs/setuptools/SPKG.txt b/build/pkgs/setuptools/SPKG.txt index 6f9783df002..39446467083 100644 --- a/build/pkgs/setuptools/SPKG.txt +++ b/build/pkgs/setuptools/SPKG.txt @@ -28,34 +28,3 @@ The patches are applied during the build process. * easy_install_lock.patch: lock the easy_install.pth file to allow simultaneous installation -= Changelog == - -=== setuptools-0.6.16.p0 (Jeroen Demeyer, 27 February 2012) === - * Trac #12599: make spkg-install executable. - -=== setuptools-0.6.16 (Francois Bissey, June 1, 2011) === - * Switch to the "distribute" fork of setuptools and update to 0.6.16, - * adopt a Gentoo patch to avoid warnings with python-2.7 (works with 2.6 too). - * Remove the two windows binaries and patch so setup.py doesn't - try to install them. - -=== setuptools-0.6c9 (Mike Hansen, February 19, 2008) === - * Update to 0.6c9 - -=== setuptools-0.6c8.p1 (William Stein, July 7, 2008) === - * Delete two windows binaries (!!) - src/setuptools/gui.exe - src/setuptools/cli.exe - -=== setuptools-0.6c8.p0 (Michael Abshoff, March 14th, 2008) === - * add hg repo - * add .hgignore - * clean up SPKG.txt - * make setuptools a default spkg - -=== setuptools-0.6c8 (Jaap Spies, March 12th, 2008) === - * upgrade to setuptools-0.6c8 - -=== setuptools-0.6.spkg (Jaap Spies) === - * initial release - diff --git a/build/pkgs/singledispatch/SPKG.txt b/build/pkgs/singledispatch/SPKG.txt index f056e32320c..b4e1bf97614 100644 --- a/build/pkgs/singledispatch/SPKG.txt +++ b/build/pkgs/singledispatch/SPKG.txt @@ -18,8 +18,3 @@ Home page: http://docs.python.org/3/library/functools.html#functools.singledispa Python -== Changelog == - -=== singledispatch-3.4.0.3 (Emmanuel Charpentier, December 1st, 2015) === - - * Trac #19638: initial release, enabling upgrade of rpy2. diff --git a/build/pkgs/six/SPKG.txt b/build/pkgs/six/SPKG.txt index 97f82a992b2..e0601654686 100644 --- a/build/pkgs/six/SPKG.txt +++ b/build/pkgs/six/SPKG.txt @@ -17,12 +17,3 @@ Home page: http://pypi.python.org/pypi/six/ Python -== Changelog == - -=== six-1.4.1 (John H. Palmieri, 20 December 2013) === - - * Trac #14993: initial release. - -=== six-1.10.0 (Emmanuel Charpentier, December 1st, 2015) === - -* Trac #19638 : upgrade to allow upgrading rpy2. diff --git a/build/pkgs/symmetrica/SPKG.txt b/build/pkgs/symmetrica/SPKG.txt index 04e978bc418..bafe8ac922d 100644 --- a/build/pkgs/symmetrica/SPKG.txt +++ b/build/pkgs/symmetrica/SPKG.txt @@ -42,59 +42,3 @@ The following patches are applied in spkg-install: Permissions in the upstream tarball are funky, please run "chmod 644 src/*" after unpacking. -== Changelog == - -=== symmetrica-2.0.p9 (Mike Zabrocki, 22 October 2013) === - * #15312: fix instances of accessing pointers to memory which was free'd - -=== symmetrica-2.0.p8 (Jeroen Demeyer, 17 October 2013) === - * #13413: fix integer overflow bug on 64-bit systems, see int32.patch. - * Remove macro.h.patch (no longer needed due to change in Sage library) - * Use standard spkg-install template for applying patches. - -=== symmetrica-2.0.p7 (Leif Leonhardy, October 6th 2011) === - #10719 (Fix linker errors on OpenSUSE 11.2 and Ubuntu 11.10): - Additional reviewer changes: - * Add more error checks, normalize error messages. - * Set up flags in spkg-check as well, as we build the test - program there. Also use $MAKE there. Put CFLAG64 into - LDFLAGS if appropriate (i.e. SAGE64=yes). - * Clean up our Makefile, also use LDFLAGS when linking the test program. - * Add GNU patch to the dependencies. - -=== symmetrica-2.0.p6 (Volker Braun, 28th September 2011) === - * #10719: Change -lm option order in Makefile. - * Removed dist/ directory (obsolete Debian stuff). - * src/ is now the pristine upstream source, patches are applied in - spkg-install. - * Added spkg-check. - -=== symmetrica-2.0.p5 (David Kirkby, 6th January 2009) === - * Allow SAGE64 to work on any platform, not just OS X. - * Update the makefile to use '$(CC)' rather than use 'gcc' - -=== symmetrica-2.0.p4 () === - * ??????????????????????? - -=== symmetrica-2.0.p3 (Michael Abshoff, May 15th, 2009) === - * Work around Solaris linker problem - * Apply patches to src directly against policy - see above - -=== symmetrica-2.0.p2 (Michael Abshoff, April 3rd, 2008) === - * OS 64 bit build support - * make sure SAGE_ROOT is defined - * Fix FreeBSD build issue - * Build symmetrica with -fPIC on Debian (Tim Abbott, #2791) - -=== symmetrica-2.0.p1 (Tim Abbott) === - * Add Debian build support - -=== symmetrica-2.0.p0 (Mike Hansen) === - * Change compile flags to "-O1" to reduce compile time by 2/3. - -=== symmetrica-2.0 (Mike Hansen) === - * update to latest release - -=== symmetrica-0.3.3 (Mike Hansen) === - * package ancient release - diff --git a/build/pkgs/sympow/SPKG.txt b/build/pkgs/sympow/SPKG.txt index 89dcf729da9..d108adc33ed 100644 --- a/build/pkgs/sympow/SPKG.txt +++ b/build/pkgs/sympow/SPKG.txt @@ -41,58 +41,3 @@ curve L-functions. It can compute up to about 64 digits of precision. so these will work. However, creating totally new datafiles from scratch will not work. -== Changelog == - -=== sympow-1.018.1.p11 (Jeroen Demeyer, 19 Jan 2012) === - * #11920: Remove -fno-expensive-optimizations workaround, instead try - various flags which might force 53-bit precision doubles. - * Find out the actual FPU precision with config/fpubits1.c and - config/fpubits2.c. - * Move all x86 extended precision FPU-control word stuff from - src/Configure to spkg-install - * Generate binary datafiles when installing SYMPOW. This ensures that - all users (not only the one which installed Sage) can use the standard - datafiles. - * execlp.patch: Use execlp() instead of execl() to execute "sh". This - is needed for the -new_data option to work (which surely could never - have worked before). - * Use `patch` instead of `cp` for patching. - * Lots of small fixes in spkg-install. - * Remove dist/debian directory. - -=== sympow-1.018.1.p9 (Jeroen Demeyer, 2 May 2011) === - * #11226: Add flag -fno-expensive-optimizations when compiling with - gcc 4.6.x on a ia64 system. See also gcc bugzilla: - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48823 - -=== sympow-1.018.1.p8 (David Kirkby, 21st August 2010) === - * #9703 + #9166 Implement inline assembly code to set the control - word of the floating point processor to round to an - IEEE-754 double (53-bit mantissa, 64-bits in total), rather - than the default extended precision. This resolves problems with - doctest failures on Solaris 10 x86, OpenSolaris on x86 and Cygwin. - This is in the file patches/fpu.c - * Tidied up SPKG.txt, to conform to the Sage Developers Guide. - * Move part of the contents of SPKG.txt to a file called 'email-exchange.txt' - which shows some email exchanges between William Stein and Mark - Watkins. It was previously here in SPKG.txt, but is rather out of place. - * Changed the very badly written Configure script to work with any compiler - (not gcc as before). Actually, since the C code is so badly written, - the Sun compiler will not compile it, but at least the errors can be seen - if one tries. - * Changed the Configure script so the code to change the precision control - of the floating point processor is implemented on any non-OS X system - with an x86 CPU. It now no longer assumes Linux. - * Removed code from spkg-install which tries to first build SYMPOW with - assembly code, then without it. The code must be old and redundant, as - the varibles set are not anywhere in the SYMPOW source code. - -=== sympow-1.018.1.p7 (David Kirkby, 25th May 2010) === - * #9029 Allow to build 64-bit - -=== sympow-1.018.1.p6 (Michael Abshoff, November 30th, 2008) === - * add build fix for tcsh by Willem Jan Palenstijn (trac #4261) - * small cleanups - -=== sympow-1.018.1.p5 === - * make sure we pick gcc over cc diff --git a/build/pkgs/sympy/SPKG.txt b/build/pkgs/sympy/SPKG.txt index 3b384bb0c1d..0136f8ca23d 100644 --- a/build/pkgs/sympy/SPKG.txt +++ b/build/pkgs/sympy/SPKG.txt @@ -23,61 +23,3 @@ sympy mailinglist: http://groups.google.com/group/sympy * A simple script can be used to ease the updating of the SPKG. See the README. -== Changelog == - -=== sympy-0.7.5 (Sergey B Kirpichev, 29 September 2014) === - * new upstream release - * fix SPKG.txt - -=== sympy-0.7.3 (Eviatar Bach, 17 August 2013) === - * Trac #14694: new upstream release - * updating SymPy download URL - -=== sympy-0.7.1.p0 (Francois Bissey, 22 February 2012) === - * Trac #12563: add -S option to python to prevent sympy's installer - from importing sage. - * Clean up spkg-install. - -=== sympy-0.7.1 (Francois Bissey, Sep 16, 2011) === - * trac 11560: update to new upstream release - * clean old obsolete script. - * mention the update instruction of the README in this file - * update spkg-install to clean old sympy version in all python 2.x install not just python2.5, - when sage is currently using 2.6 - * delete old version of sympy only if building of new sympy is successful - -=== sympy-0.6.4 (Ondrej Certik, April 5th, 2008) === - * new upstream release - -=== sympy-0.6.3.p0 (Michael Abshoff, November 22nd, 2008) === - * Clean up SPKG.txt and spkg-install - -=== sympy-0.6.3 (Ondrej Certik, November 19th, 2008) === - * new upstream release - -=== sympy-0.6.2 (Ondrej Certik) === - * new upstream release - -=== sympy-0.6.0 (Ondrej Certik) === - * new upstream release - -=== sympy-0.5.13 (Ondrej Certik) === - * new upstream release - * added a README file - -=== sympy-0.5.11 (Ondrej Certik) === - * new upstream release - -=== sympy-0.5.7 (Ondrej Certik) === - * new upstream release - * added a script for getting a hg version - * added a script for downloading the upstream sources, creating the src dir - -=== sympy-0.5.6 (Ondrej Certik) === - * new upstream release - -=== sympy-0.5.5 (Ondrej Certik) === - * new upstream release - -=== sympy-0.5.3 (William Stein) === - * initial version of the packaging diff --git a/build/pkgs/termcap/SPKG.txt b/build/pkgs/termcap/SPKG.txt index e6007fe8581..7a26059e18f 100644 --- a/build/pkgs/termcap/SPKG.txt +++ b/build/pkgs/termcap/SPKG.txt @@ -21,35 +21,3 @@ Please report any bugs in this library to bug-gnu-emacs@prep.ai.mit.edu None -== Changelog == - -=== termcap-1.3.1.p3 (Jeroen Demeyer, 28 March 2012) === - * Trac #12725: Symlink libtermcap.a to libncurses.a if we cannot link - programs against -lncurses. - -=== termcap-1.3.1.p2 (Jeroen Demeyer, 11 January 2012) === - * Trac #12282: Add patches/strcmp_NULL.patch to fix a bug when the - environment variable TERM is not set. - * Restore upstream sources, put existing patch in - patches/Makefile.in.patch - * Use patch for patching - * Standardize SPKG.txt - -=== termcap-1.3.1.p1 (Jaap Spies, Jan 28th, 2010) === - * If $SAGE64="yes" add -m64 to CFLAGS. This used to work only on Darwin. - This works now on Open Solaris x64 64 bit and may work on other 64 bit systems. - * SPKG.txt needs more work!!!!! Not by me now. - * This is trac http://trac.sagemath.org/sage_trac/ticket/8097 - -=== termcap-1.3.1.p0 (Michael Abshoff, May 18th, 2008) === - * add 64 OSX build support - * check in all files - * add .hgignore - * Changes from upstream: -1) Deleted some lines from Makefile.in to prevent info docs being built - -2) In Makefile.in I commented out the line - - oldincludedir = /usr/include - -since SAGE install should work as not-root. diff --git a/build/pkgs/tornado/SPKG.txt b/build/pkgs/tornado/SPKG.txt index 7f0068d6516..5938a047bed 100644 --- a/build/pkgs/tornado/SPKG.txt +++ b/build/pkgs/tornado/SPKG.txt @@ -16,9 +16,3 @@ Home page: http://www.tornadoweb.org Python -== Changelog == - -=== tornado-3.1.1 (John H. Palmieri, 20 December 2013) === - - * Trac #14993: initial release. - diff --git a/build/pkgs/zn_poly/SPKG.txt b/build/pkgs/zn_poly/SPKG.txt index 2f9b0c44a80..e6f3dde412a 100644 --- a/build/pkgs/zn_poly/SPKG.txt +++ b/build/pkgs/zn_poly/SPKG.txt @@ -68,129 +68,3 @@ the file src/COPYING for details. As the name says; fix provided by upstream (David Harvey); see #13947. -== Changelog == - -=== zn_poly-0.9.1 === - * Update to new upstream sources. - -=== zn_poly-0.9.p11 (Leif Leonhardy, May 24th, 2013) === - * #13947: Fix `nuss_mul()` test failing especially if tuning happened - under "heavy" load (at least on MacOS X and Cygwin) - Add `fix_fudge_factor_in_nuss-test.c.patch`; fix suggested by David - Harvey. - -=== zn_poly-0.9.p10 ( Francois Bissey, 14 February 2013 ) === - * Trac #14098: Fix a potential problem with the tests where values can get out of - range. The problem occurs only in rare case but the code is more sane that way. - The fix was gracously provided by the original zn_poly author. - -=== zn_poly-0.9.p9 (Jeroen Demeyer, 28 May 2012) === - * Trac #12751: remove the gcc-4.7.0 workaround for ia64 since this bug - has been fixed in gcc-4.7.1 and we will not fully support building - Sage with gcc-4.7.0 on Itanium. - * Don't override user-set CFLAGS and CXXFLAGS. - -=== zn_poly-0.9.p8 (Leif Leonhardy, April 20th, 2012) === - * #12433: Further reviewer changes / additions. - * Work around GCC 4.7.0 bug on ia64 (by almost completely disabling optimi- - zation if the compiler is GCC 4.7.x, of course only on that platform); cf. - #12751, #12765. - * Add a patch to avoid conflicting definitions (i.e., redundant `typedefs`) - of `ulong`, by changing `ulong` to a macro. - * Don't hardcode the zn_poly version number in `spkg-install`; instead read - it from the file `VERSION`, like the generated `makefile` does. - * Remove some of the code previously just commented out, as well as some - obsolete comments. - * Document patches (and correct ticket reference in an old changelog entry). - -=== zn_poly-0.9.p7 (Leif Leonhardy, April 8th, 2012) === - * #12433: Reviewer changes. - * Restore upstream sources. (One file in `src/tune/` was already patched.) - * Remove the obsolete Debian `dist/` directory. - * Use `patch` to apply the patches. - * Remove `patches/` from `.hgignore`! (And remove the prepatched files.) - * Add Python to the dependencies, since (some) Python is needed to create - the Makefile during build / `configure`. (`spkg/standard/deps` already - reflects this.) - * Rework (upstream's) `makemakefile.py` to create a proper Makefile, - respecting `CC`, `CXX`, `CFLAGS`, `CXXFLAGS`, `CPPFLAGS` etc. with their - *usual* meaning (i.e., not using `CPP` to compile C++!), and using `LDFLAGS` - consistently, also not hardcoding e.g. `-m64` (which was added by Sage). - * Do not add `-O3` to `CFLAGS` (in `spkg-install`) without the possibility to - get overridden by user-provided `CFLAGS`. Also honor `SAGE_DEBUG=yes` by - completely disabling optimization in that case. - * Fix typo in `spkg-check`, which certainly would break building the test - program when `SAGE64=yes`. (Although it is actually already built from - within `spkg-install`.) - * Clean up `spkg-install` and `spkg-check`; redirect error messages to - `stderr`, add more error checks, use `$MAKE` in `spkg-check` as well, - quote more environment variables, use `cp [-f]` instead of `$CP`, don't - create an absolute symbolic link on Cygwin. - -=== zn_poly-0.9.p6 (R. Andrew Ohana, February 4th, 2012) === - * #12433: Make spkg respect global CC flag - -=== zn_poly-0.9.p5 (David Kirkby, July 14th, 2010) === - * #9358 Ensure that spkg-install can handle the case - of where SAGE64=yes and Solaris with a Sun linker. Previously - this worked properly if SAGE64 was yes, OR if the operating system - was Solaris with the sun linker. But spkg-install failed - to work properly if both SAGE64=yes AND the operating system - was Solaris with the Sun linker. - * No longer run 'make check' from spkg-check. Since this was quick to run - it has already been run from spkg-install, so it was pointless running - it from spkg-check too. Instead a much more comprehensive test suite is - run, using - $ test/test all - * Change the dependancy from GMP to MPIR in this SPKG.txt file, as Sage no - longer uses GMP. - -=== zn_poly-0.9.p4 (Willem Jan Palenstijn, William Stein, April 26th, 2010) === - * Ticket #8771: Fix build error on gcc 4.5, and check if make tune succeeded. - * Added more checks for errors in spkg-install. - -=== zn_poly-0.9.p3 (Jaap Spies, February 21th, 2010) === - * Ticket #8178: if SAGE64=yes we set CFLAGS appropriate. In patches/makemakefile.py we add $(LDFLAGS) - when we build the shared library. This works for Darwin and Open Solaris. - - -=== zn_poly-0.9.p2 (Mike Hansen, February 15th, 2010) === - * Ticket #8280: cygwin: zn_poly shared library named incorrectly on cygwin - -=== zn_poly-0.9.p1 (David Kirkby, June 29th, 2009) === - * Ticket #6443 A GNUism in zn_poly-0.9.p0 causes linking problems with Sun's linker - This was an easy fix - just substitue -soname for -h in src/makemakefile.py - I did this with a sed script in spkg-install - -=== zn_poly-0.9.p0 (Michael Abshoff, September 26th, 2008) === - * remerge OSX 64 bit fixes - * clean up spkg-install - -=== zn_poly-0.9 (David Harvey and Timothy Abbott, September 19th, 2008) === - * updated to zn_poly-0.9 - * shared versioning filename issues - * re-enabled test suite (now only takes ~10 seconds) - * updated upstream URL - -=== zn_poly-0.8.p2 (Michael Abshoff, August 19th, 2008) === - * Add 64 bit OSX build support - -=== zn_poly-0.8.p1 (Michael Abshoff, June 9th, 2008) === - * Do not run the test suite per default any more (#3386) - -=== zn_poly-0.8.p0 (David Harvey, April 4th, 2008) === - * updated to zn_poly-0.8 (fix minor bugs and memleaks) - * updated SPKG.txt - -=== zn_poly-0.8 (David Harvey, April 2nd, 2008) === - * updated to zn_poly-0.8.alpha0 - * updated SPKG.txt - * changed spkg-install to run tuning program, test suite - -=== zn_poly-0.4.1.p0 (Michael Abshoff, March 19th, 2008) === - * updated SPKG.txt - * add hg repo, hg ignore - * cleaned up spkg-install - -=== zn_poly-0.4.1 (David Harvey, Dec. 18th, 2007) === - * created spkg from zn_poly-0.4.1 From 079224e0fed934534f72e9bfa9feeaef6e532763 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 May 2020 18:01:00 -0700 Subject: [PATCH 039/301] Remove remaining SPKG.txt changelog sections manually --- build/pkgs/4ti2/SPKG.txt | 19 ------------- build/pkgs/boost_cropped/SPKG.txt | 19 ------------- build/pkgs/freetype/SPKG.txt | 34 ----------------------- build/pkgs/lidia/SPKG.txt | 4 --- build/pkgs/palp/SPKG.txt | 42 ----------------------------- build/pkgs/zlib/SPKG.txt | 45 ------------------------------- 6 files changed, 163 deletions(-) diff --git a/build/pkgs/4ti2/SPKG.txt b/build/pkgs/4ti2/SPKG.txt index 9a791bd4ce2..92ffa4737fb 100644 --- a/build/pkgs/4ti2/SPKG.txt +++ b/build/pkgs/4ti2/SPKG.txt @@ -15,22 +15,3 @@ Matthias Köppe, UC Davis, CA, USA == Dependencies == GLPK, GMP. - -=== 4ti2-1.6.5 (Matthias Köppe, May 19, 2015) === - * update to 4ti2 version 1.6.5 - * add spkg-check script - -=== 4ti2-1.6.3 (Dima Pasechnik, May 1, 2015) === - * update to 4ti2 version 1.6.3 and to new spkg style - -=== 4ti2-1.6.2 (Dima Pasechnik, Jul 4, 2014) === - * update to 4ti2 version 1.6.2 - -=== 4ti2-1.6 (Dima Pasechnik, Sept 7, 2013) === - * update to 4ti2 version 1.6 - * hg: added stuff to track - * updated upstream contacts - -=== 4ti2.p0 (Marshall Hampton, July 31th, 2009) === - * Created a first attempt. - diff --git a/build/pkgs/boost_cropped/SPKG.txt b/build/pkgs/boost_cropped/SPKG.txt index 0ed6c59696b..f23b9d5cc2c 100644 --- a/build/pkgs/boost_cropped/SPKG.txt +++ b/build/pkgs/boost_cropped/SPKG.txt @@ -21,22 +21,3 @@ See mailing list page at http://www.boost.org/community/groups.html == Dependencies == None - -== Releases == - -=== boost_cropped-1.58.0 (Emmanuel Charpentier, November 13th, 2015) === - * Updated to boost_1_58_0/boost - * Created spkg-src - -=== boost_cropped-1.52.0 (Timo Kluck, February 26th, 2013) === - * Drop sage patches; take all upstream headers - - This package contains the complete contents of the directory - - boost_1_52_0/boost - - of the upstream tarball. - -=== boost-cropped-1.34.1 (Michael Abshoff, May 15th, 2009) === - * Split boost sources off of polybori.spkg - diff --git a/build/pkgs/freetype/SPKG.txt b/build/pkgs/freetype/SPKG.txt index 5c0cc067e8c..51773022212 100644 --- a/build/pkgs/freetype/SPKG.txt +++ b/build/pkgs/freetype/SPKG.txt @@ -44,37 +44,3 @@ From the documentation: See the `dependencies` file. -== Releases == - -Old changes are listed below. For more recent history, see the git repository. - -=== freetype-2.5.2.p0 (Emmanuel Charpentier, December 21st 2013) === - * #15561: mindless drop-in-place of the current upstream source. - * Added the license information in the present file. - * Minor patch to libpng in order to work around a double setjmp setup. - * buil/deps : freetype depends on libpng to work around a buildbot race condition. - -=== freetype-2.3.5.p4 (Simon King, December 11th 2011) === - * #12131: Use --libdir, to make the package work on openSUSE - -=== freetype-2.3.5.p3 (Mitesh Patel, October 21st 2010) === - * #9221, #9896: Increase the patch level to force reinstallation when - upgrading to Sage 4.6. This works around a problem with moved - Sage installations. - -=== freetype-2.3.5.p2 (David Kirkby, January 2nd 2010) === - * #7138 Ensure -m64 gets added on all platforms, not just OS X - A better fix will be to remove all the hard-coded -m64 junk - and replace by an environment variable CFLAG64, but until - sage-env is updated, that will not work, so I've just left it - as it has always been, but now working on all platforms if the - compiler is gcc. -=== freetype-2.3.5.p1 (Mike Hansen, June 19th, 2009) === - * Applied Peter Jeremy's fix from #5866. - -=== freetype-2.3.5.p0 (Michael Abshoff, May 18th, 2008) === - * add OSX 64 bit build support - -=== freetype-2.3.5 === - * details lost to history - diff --git a/build/pkgs/lidia/SPKG.txt b/build/pkgs/lidia/SPKG.txt index 54d712d6998..412345cd8a7 100644 --- a/build/pkgs/lidia/SPKG.txt +++ b/build/pkgs/lidia/SPKG.txt @@ -23,7 +23,3 @@ Matthias Köppe, UC Davis, CA, USA == Dependencies == GMP. - -=== lidia-2.3.0+latte-patches-2014-10-04 (Matthias Köppe, 2015-05-01) === - * First attempt at a Sage package. - diff --git a/build/pkgs/palp/SPKG.txt b/build/pkgs/palp/SPKG.txt index fa55828a258..1add1810ed5 100644 --- a/build/pkgs/palp/SPKG.txt +++ b/build/pkgs/palp/SPKG.txt @@ -34,45 +34,3 @@ facet enumeration compares well with existing packages. * Author: Harald Skarke (skarke@maths.ox.ac.uk) * Home page: http://hep.itp.tuwien.ac.at/~kreuzer/CY/CYpalp.html - -== Change log == - -=== palp-2.1.p1 (Dima Pasechnik, 27 January 2013) === - * #13960: as proposed by J.-P. Flori; set the stack size to 8MB - for Cygwin. - -=== palp-2.1.p0 (Volker Braun, 4th June 2012) === - * #12088 Updated to the latest upstream version - * Solaris sed does not understand character classes (:space:), dumb - down even further - * Removed the patched Polynf.c and MoriCone.c - -=== palp-2.0.p2 (Volker Braun, 4th May 2012) === - * #12088 change regex in spkg-install from \s to [[:space:]], only - the latter works on OSX - -=== palp-2.0.p1 (R. Andrew Ohana, 26th February 2012) === - * #7071 Make spkg respect global CC and CFLAGS variables - * made SAGE64 set the '-m64' flag the "proper" way - -=== palp-2.0.p0 (Volker Braun, 19th November 2011) === - * #12055 Update to new upstream version - * Now building multiple versions for different ambient dimensions - * Patched Polynf.c and MoriCone.c that do not use nested functions - (private communication with Harald Skarke) - -=== palp-1.1.p3 (David Kirkby, 24th May 2010) === - * #9025 Add compiler option -m64 if the variable SAGE64 is set to - "yes". The flag is added by 'sed'. - -=== palp-1.1.p2 (Mitesh Patel, 12 Mar 2010) === - - * #8477: Work around apparent GNU make problem when building spkgs in - parallel. - * SPKG.txt cleanup. The description is based on the abstract of this - paper: https://arxiv.org/abs/math/0204356 - -=== palp-1.1.p1 (Tim Abbott, William Stein) === - - * Debian packaging. See 'hg log'. - * Lost to history. diff --git a/build/pkgs/zlib/SPKG.txt b/build/pkgs/zlib/SPKG.txt index d5f3d58f208..eeb3ae76007 100644 --- a/build/pkgs/zlib/SPKG.txt +++ b/build/pkgs/zlib/SPKG.txt @@ -22,48 +22,3 @@ Free, Not to Mention Unencumbered by Patents) === Patches === * cygwin_symbols.patch: remove undefined symbols on Cygwin. - -=== zlib-1.2.8.p0 (Jean-Pierre Flori, 6 August 2013) === - * Trac #14985: Let zlib 1.2.>=7 build on Cygwin. - -=== zlib-1.2.8 (Jeroen Demeyer, 30 May 2013) === - * Trac #14661: Upgrade to version 1.2.8 - * Do not unset AR (why was that needed?) - -=== zlib-1.2.6.p0 (Jean-Pierre Flori, 5 January 2013) === - * Trac #13914: Install shared objects on Cygwin. - -=== zlib-1.2.6 (Jeroen Demeyer, Leif Leonhardy, 11 April 2012) === - * Trac #12800: Upgrade to zlib-1.2.6 - * Remove patches/Makefile.in.patch which is no longer needed - * Exit when building fails - * Clean up spkg-install - -=== zlib-1.2.5.p0 (Jeroen Demeyer, 9 December 2011) === - * Trac #12138: Fix parallel build by patching Makefile.in - * Use $MAKE variable in spkg-install - -=== zlib-1.2.5 (David Kirkby, May 21st 2010) === - * Update to the latest upstream version - 1.2.5 - * Remove the patches directory. - * Remove hacks for OSX - * Remove the -fPIC flag from spkg-install, which was added so zlib - worked properly on at least Debian on the Opteron processor. The - -fPIC flag is added by the new zlib, so there is no need to add it - in spkg-install. This has been tested on OS X, Linux and OpenSolaris. - In each case, -fPIC gets added. - * There was no need to remove object files *(.obj) are there - are none in the latest source code. - -=== zlib-1.2.3.p5 (William Stein, December 17, 2009) === - * Remove some binary crap - -=== zlib-1.2.3.p4 (Michael Abshoff, August 18th, 2008) === - * handle 64 bit OSX build case - -=== zlib-1.2.3.p3 (Michael Abshoff) === - * add "-g" to CFLAGS to get better backtraces and valgrind stack traces. - -=== zlib-1.2.3.p2 === - * first documented version - From 38be0f094708039e9487bd63ce3278a9d614c595 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 May 2020 16:39:22 -0700 Subject: [PATCH 040/301] build/bin/sage-spkg-info: Factor out from build/bin/sage-spkg --- build/bin/sage-spkg | 47 +---------------------------------- build/bin/sage-spkg-info | 53 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 46 deletions(-) create mode 100755 build/bin/sage-spkg-info diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index 6129555958a..e4ce1b2812b 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -361,52 +361,7 @@ EOF fi if [ $INFO -ne 0 -a "$USE_LOCAL_SCRIPTS" = yes ]; then - cat "$PKG_SCRIPTS/SPKG.txt" - if [ -r "$PKG_SCRIPTS/type" ] ; then - echo - echo "== Type ==" - echo - cat "$PKG_SCRIPTS/type" - echo - fi - echo "== Equivalent System Packages ==" - echo - PKG_DISTROS="$PKG_SCRIPTS"/distros - for system_package_file in "$PKG_DISTROS"/*.txt; do - if [ -f "$system_package_file" ]; then - system=$(basename "$system_package_file" .txt) - system_packages="$(echo $(sed 's/#.*//;' $system_package_file))" - case $system in - debian) - # Generic - echo "Debian/Ubuntu:" - ;; - fedora) - # Generic - echo "Fedora/Redhat/CentOS:" - ;; - *) - echo "$system:" - ;; - esac - echo -n " " - sage-print-system-package-command $system --prompt --sudo install $system_packages - fi - done - if [ -z "$system" ]; then - echo "(none known)" - else - echo - if [ -f "$PKG_SCRIPTS"/spkg-configure.m4 ]; then - echo "If the system package is installed, ./configure will check whether it can be used." - else - echo "However, these system packages will not be used for building Sage" - echo "because spkg-configure.m4 has not been written for this package;" - echo "see https://trac.sagemath.org/ticket/27330" - fi - fi - echo - exit 0 + exec sage-spkg-info $PKG_BASE fi # If we haven't found the package yet, we must download it diff --git a/build/bin/sage-spkg-info b/build/bin/sage-spkg-info new file mode 100755 index 00000000000..3f6c17a347e --- /dev/null +++ b/build/bin/sage-spkg-info @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# +# sage-spkg-info SPKG +# Format information about a Sage package +# +# Assumes SAGE_ROOT is set +PKG_BASE=$1 +PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE" +cat "$PKG_SCRIPTS/SPKG.txt" +if [ -r "$PKG_SCRIPTS/type" ] ; then + echo + echo "== Type ==" + echo + cat "$PKG_SCRIPTS/type" + echo +fi +echo "== Equivalent System Packages ==" +echo +PKG_DISTROS="$PKG_SCRIPTS"/distros +for system_package_file in "$PKG_DISTROS"/*.txt; do + if [ -f "$system_package_file" ]; then + system=$(basename "$system_package_file" .txt) + system_packages="$(echo $(sed 's/#.*//;' $system_package_file))" + case $system in + debian) + # Generic + echo "Debian/Ubuntu:" + ;; + fedora) + # Generic + echo "Fedora/Redhat/CentOS:" + ;; + *) + echo "$system:" + ;; + esac + echo -n " " + sage-print-system-package-command $system --prompt --sudo install $system_packages + fi +done +if [ -z "$system" ]; then + echo "(none known)" +else + echo + if [ -f "$PKG_SCRIPTS"/spkg-configure.m4 ]; then + echo "If the system package is installed, ./configure will check whether it can be used." + else + echo "However, these system packages will not be used for building Sage" + echo "because spkg-configure.m4 has not been written for this package;" + echo "see https://trac.sagemath.org/ticket/27330" + fi +fi +echo From eff0d77f76ece84c22355d9082e062c98bc33fa0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 May 2020 17:17:58 -0700 Subject: [PATCH 041/301] Accept SPKG.rst in place of SPKG.txt --- build/bin/sage-spkg-info | 8 +++++++- src/bin/sage | 3 ++- src/doc/en/developer/packaging.rst | 10 ++++++---- src/doc/en/reference/repl/options.rst | 4 ++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/build/bin/sage-spkg-info b/build/bin/sage-spkg-info index 3f6c17a347e..1a8847bb875 100755 --- a/build/bin/sage-spkg-info +++ b/build/bin/sage-spkg-info @@ -6,7 +6,13 @@ # Assumes SAGE_ROOT is set PKG_BASE=$1 PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE" -cat "$PKG_SCRIPTS/SPKG.txt" +for ext in rst txt; do + SPKG_FILE="$PKG_SCRIPTS/SPKG.$ext" + if [ -f "$SPKG_FILE" ]; then + cat "$SPKG_FILE" + break + fi +done if [ -r "$PKG_SCRIPTS/type" ] ; then echo echo "== Type ==" diff --git a/src/bin/sage b/src/bin/sage index cc7bc0cba25..6fd8da46b22 100755 --- a/src/bin/sage +++ b/src/bin/sage @@ -170,7 +170,8 @@ usage_advanced() { echo " checking and with support for old-style spkgs." echo " Options are -c, -d and -s with the same meaning as" echo " for the -i command" - echo " -info [packages] -- print the SPKG.txt of the given packages" + echo " -info [packages] -- print the SPKG.txt or SPKG.rst of the given packages," + echo " and some additional information." echo " --location -- if needed, fix paths to make Sage relocatable" echo " -optional -- list all optional packages that can be installed" echo " -standard -- list all standard packages that can be installed" diff --git a/src/doc/en/developer/packaging.rst b/src/doc/en/developer/packaging.rst index 65d25a08d18..d229f9d02df 100644 --- a/src/doc/en/developer/packaging.rst +++ b/src/doc/en/developer/packaging.rst @@ -156,7 +156,7 @@ a minimum the following files: |-- dependencies |-- package-version.txt |-- spkg-install.in - |-- SPKG.txt + |-- SPKG.rst `-- type The following are some additional files which can be added: @@ -459,8 +459,8 @@ example, the ``scipy`` ``spkg-check.in`` file contains the line .. _section-spkg-SPKG-txt: -The SPKG.txt File ------------------ +The SPKG.rst or SPKG.txt File +----------------------------- The ``SPKG.txt`` file should follow this pattern: @@ -497,6 +497,8 @@ with ``PACKAGE_NAME`` replaced by the package name. Legacy ``SPKG.txt`` files have an additional changelog section, but this information is now kept in the git repository. +It is now also possible to use an ``SPKG.rst`` file instead, with the same +sections. .. _section-dependencies: @@ -869,7 +871,7 @@ License Information If you are patching a standard Sage spkg, then you should make sure that the license information for that package is up-to-date, both in its -``SPKG.txt`` file and in the file ``SAGE_ROOT/COPYING.txt``. For +``SPKG.rst`` or ``SPKG.txt`` file and in the file ``SAGE_ROOT/COPYING.txt``. For example, if you are producing an spkg which upgrades the vanilla source to a new version, check whether the license changed between versions. diff --git a/src/doc/en/reference/repl/options.rst b/src/doc/en/reference/repl/options.rst index 9cdb63f1506..3bc37ca1961 100644 --- a/src/doc/en/reference/repl/options.rst +++ b/src/doc/en/reference/repl/options.rst @@ -103,8 +103,8 @@ Command-line options for Sage - ``-f [options] [packages]`` -- shortcut for ``-i -f``: force build of the given Sage packages. -- ``--info [packages]`` -- display the ``SPKG.txt`` file of the given - Sage packages. +- ``--info [packages]`` -- display the ``SPKG.txt`` or ``SPKG.rst`` file of + the given Sage packages, and some additional information. - ``--standard`` -- list all standard packages that can be installed - ``--optional`` -- list all optional packages that can be installed - ``--experimental`` -- list all experimental packages that can be installed From d57d9c52654fa7fd90c7c68a328cf27fcc0d4fd2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 May 2020 18:43:27 -0700 Subject: [PATCH 042/301] Convert SPKG.txt to SPKG.rst for f in build/pkgs/*/SPKG.txt; do sed 's/^ *[*]/*/;s/^ *-/*/;s/^ */:/;' $f | pandoc --from=mediawiki --to=rst --output=$(dirname $f)/SPKG.rst; git rm -f $f; git add $(dirname $f)/SPKG.rst; done --- build/pkgs/4ti2/SPKG.rst | 25 + build/pkgs/4ti2/SPKG.txt | 17 - build/pkgs/alabaster/SPKG.rst | 15 + build/pkgs/alabaster/SPKG.txt | 13 - build/pkgs/appnope/SPKG.rst | 7 + build/pkgs/appnope/SPKG.txt | 5 - build/pkgs/arb/{SPKG.txt => SPKG.rst} | 29 +- build/pkgs/atlas/SPKG.rst | 117 ++ build/pkgs/atlas/SPKG.txt | 85 -- build/pkgs/autotools/{SPKG.txt => SPKG.rst} | 65 +- build/pkgs/awali/SPKG.rst | 45 + build/pkgs/awali/SPKG.txt | 33 - build/pkgs/babel/{SPKG.txt => SPKG.rst} | 6 +- .../pkgs/backports_abc/{SPKG.txt => SPKG.rst} | 18 +- .../backports_functools_lru_cache/SPKG.rst | 8 + .../backports_functools_lru_cache/SPKG.txt | 5 - .../SPKG.rst | 7 + .../SPKG.txt | 5 - .../backports_ssl_match_hostname/SPKG.rst | 33 + .../backports_ssl_match_hostname/SPKG.txt | 24 - build/pkgs/barvinok/SPKG.rst | 21 + build/pkgs/barvinok/SPKG.txt | 15 - build/pkgs/benzene/SPKG.rst | 30 + build/pkgs/benzene/SPKG.txt | 15 - build/pkgs/bleach/{SPKG.txt => SPKG.rst} | 17 +- build/pkgs/bliss/SPKG.rst | 34 + build/pkgs/bliss/SPKG.txt | 26 - build/pkgs/boost/{SPKG.txt => SPKG.rst} | 17 +- build/pkgs/boost_cropped/SPKG.rst | 39 + build/pkgs/boost_cropped/SPKG.txt | 23 - build/pkgs/brial/{SPKG.txt => SPKG.rst} | 14 +- build/pkgs/buckygen/SPKG.rst | 29 + build/pkgs/buckygen/SPKG.txt | 15 - build/pkgs/bzip2/{SPKG.txt => SPKG.rst} | 33 +- build/pkgs/cbc/SPKG.rst | 38 + build/pkgs/cbc/SPKG.txt | 28 - build/pkgs/ccache/SPKG.rst | 23 + build/pkgs/ccache/SPKG.txt | 17 - build/pkgs/cddlib/SPKG.rst | 39 + build/pkgs/cddlib/SPKG.txt | 28 - build/pkgs/certifi/SPKG.rst | 24 + build/pkgs/certifi/SPKG.txt | 18 - build/pkgs/cliquer/SPKG.rst | 32 + build/pkgs/cliquer/SPKG.txt | 19 - build/pkgs/cmake/SPKG.rst | 38 + build/pkgs/cmake/SPKG.txt | 32 - build/pkgs/cocoalib/SPKG.rst | 34 + build/pkgs/cocoalib/SPKG.txt | 24 - build/pkgs/combinatorial_designs/SPKG.rst | 31 + build/pkgs/combinatorial_designs/SPKG.txt | 21 - build/pkgs/compilerwrapper/SPKG.rst | 38 + build/pkgs/compilerwrapper/SPKG.txt | 26 - .../pkgs/configparser/{SPKG.txt => SPKG.rst} | 13 +- build/pkgs/configure/{SPKG.txt => SPKG.rst} | 24 +- build/pkgs/conway_polynomials/SPKG.rst | 14 + build/pkgs/conway_polynomials/SPKG.txt | 10 - build/pkgs/coxeter3/SPKG.rst | 55 + build/pkgs/coxeter3/SPKG.txt | 45 - build/pkgs/cryptominisat/SPKG.rst | 39 + build/pkgs/cryptominisat/SPKG.txt | 31 - build/pkgs/csdp/SPKG.rst | 55 + build/pkgs/csdp/SPKG.txt | 41 - build/pkgs/curl/SPKG.rst | 33 + build/pkgs/curl/SPKG.txt | 23 - build/pkgs/cvxopt/SPKG.rst | 61 + build/pkgs/cvxopt/SPKG.txt | 50 - build/pkgs/cycler/SPKG.rst | 30 + build/pkgs/cycler/SPKG.txt | 24 - build/pkgs/cypari/SPKG.rst | 27 + build/pkgs/cypari/SPKG.txt | 20 - build/pkgs/cysignals/SPKG.rst | 26 + build/pkgs/cysignals/SPKG.txt | 19 - build/pkgs/cython/SPKG.rst | 37 + build/pkgs/cython/SPKG.txt | 27 - build/pkgs/d3js/SPKG.rst | 39 + build/pkgs/d3js/SPKG.txt | 29 - build/pkgs/database_cremona_ellcurve/SPKG.rst | 53 + build/pkgs/database_cremona_ellcurve/SPKG.txt | 44 - build/pkgs/database_jones_numfield/SPKG.rst | 32 + build/pkgs/database_jones_numfield/SPKG.txt | 21 - build/pkgs/database_kohel/SPKG.rst | 16 + build/pkgs/database_kohel/SPKG.txt | 10 - build/pkgs/database_mutation_class/SPKG.rst | 36 + build/pkgs/database_mutation_class/SPKG.txt | 23 - .../{SPKG.txt => SPKG.rst} | 13 +- .../{SPKG.txt => SPKG.rst} | 21 +- .../{SPKG.txt => SPKG.rst} | 21 +- build/pkgs/database_symbolic_data/SPKG.rst | 49 + build/pkgs/database_symbolic_data/SPKG.txt | 34 - build/pkgs/dateutil/SPKG.rst | 27 + build/pkgs/dateutil/SPKG.txt | 21 - build/pkgs/decorator/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/deformation/SPKG.rst | 20 + build/pkgs/deformation/SPKG.txt | 14 - build/pkgs/defusedxml/SPKG.rst | 33 + build/pkgs/defusedxml/SPKG.txt | 23 - build/pkgs/docutils/SPKG.rst | 34 + build/pkgs/docutils/SPKG.txt | 26 - build/pkgs/dot2tex/SPKG.rst | 56 + build/pkgs/dot2tex/SPKG.txt | 42 - build/pkgs/e_antic/SPKG.rst | 31 + build/pkgs/e_antic/SPKG.txt | 22 - build/pkgs/ecl/SPKG.rst | 77 + build/pkgs/ecl/SPKG.txt | 56 - build/pkgs/eclib/{SPKG.txt => SPKG.rst} | 32 +- build/pkgs/ecm/{SPKG.txt => SPKG.rst} | 61 +- build/pkgs/elliptic_curves/SPKG.rst | 37 + build/pkgs/elliptic_curves/SPKG.txt | 28 - build/pkgs/entrypoints/{SPKG.txt => SPKG.rst} | 16 +- build/pkgs/enum34/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/fflas_ffpack/SPKG.rst | 40 + build/pkgs/fflas_ffpack/SPKG.txt | 30 - build/pkgs/flask/{SPKG.txt => SPKG.rst} | 6 +- .../flask_autoindex/{SPKG.txt => SPKG.rst} | 8 +- build/pkgs/flask_babel/{SPKG.txt => SPKG.rst} | 8 +- build/pkgs/flask_oldsessions/SPKG.rst | 9 + build/pkgs/flask_oldsessions/SPKG.txt | 5 - build/pkgs/flask_openid/SPKG.rst | 9 + build/pkgs/flask_openid/SPKG.txt | 5 - build/pkgs/flask_silk/{SPKG.txt => SPKG.rst} | 8 +- build/pkgs/flint/SPKG.rst | 31 + build/pkgs/flint/SPKG.txt | 22 - build/pkgs/flintqs/SPKG.rst | 8 + build/pkgs/flintqs/SPKG.txt | 9 - build/pkgs/fplll/SPKG.rst | 30 + build/pkgs/fplll/SPKG.txt | 21 - build/pkgs/fpylll/SPKG.rst | 27 + build/pkgs/fpylll/SPKG.txt | 20 - build/pkgs/freetype/SPKG.rst | 52 + build/pkgs/freetype/SPKG.txt | 46 - build/pkgs/fricas/SPKG.rst | 24 + build/pkgs/fricas/SPKG.txt | 19 - build/pkgs/frobby/SPKG.rst | 46 + build/pkgs/frobby/SPKG.txt | 29 - build/pkgs/functools32/{SPKG.txt => SPKG.rst} | 21 +- build/pkgs/future/{SPKG.txt => SPKG.rst} | 28 +- build/pkgs/gambit/SPKG.rst | 31 + build/pkgs/gambit/SPKG.txt | 24 - build/pkgs/gap/{SPKG.txt => SPKG.rst} | 54 +- build/pkgs/gap3/SPKG.rst | 92 ++ build/pkgs/gap3/SPKG.txt | 67 - build/pkgs/gap_jupyter/SPKG.rst | 24 + build/pkgs/gap_jupyter/SPKG.txt | 16 - build/pkgs/gap_packages/SPKG.rst | 149 ++ build/pkgs/gap_packages/SPKG.txt | 152 -- build/pkgs/gc/SPKG.rst | 37 + build/pkgs/gc/SPKG.txt | 25 - build/pkgs/gcc/SPKG.rst | 34 + build/pkgs/gcc/SPKG.txt | 24 - build/pkgs/gdb/SPKG.rst | 38 + build/pkgs/gdb/SPKG.txt | 29 - build/pkgs/gf2x/SPKG.rst | 70 + build/pkgs/gf2x/SPKG.txt | 40 - build/pkgs/gfan/SPKG.rst | 48 + build/pkgs/gfan/SPKG.txt | 36 - build/pkgs/gfortran/SPKG.rst | 35 + build/pkgs/gfortran/SPKG.txt | 25 - build/pkgs/giac/SPKG.rst | 59 + build/pkgs/giac/SPKG.txt | 40 - build/pkgs/giacpy_sage/SPKG.rst | 33 + build/pkgs/giacpy_sage/SPKG.txt | 22 - build/pkgs/git/SPKG.rst | 30 + build/pkgs/git/SPKG.txt | 23 - build/pkgs/git_trac/SPKG.rst | 35 + build/pkgs/git_trac/SPKG.txt | 24 - build/pkgs/givaro/SPKG.rst | 37 + build/pkgs/givaro/SPKG.txt | 31 - build/pkgs/glpk/SPKG.rst | 77 + build/pkgs/glpk/SPKG.txt | 59 - build/pkgs/glucose/SPKG.rst | 47 + build/pkgs/glucose/SPKG.txt | 35 - build/pkgs/gmp/SPKG.rst | 23 + build/pkgs/gmp/SPKG.txt | 15 - build/pkgs/gmpy2/SPKG.rst | 13 + build/pkgs/gmpy2/SPKG.txt | 11 - build/pkgs/gp2c/SPKG.rst | 27 + build/pkgs/gp2c/SPKG.txt | 18 - build/pkgs/graphs/{SPKG.txt => SPKG.rst} | 29 +- build/pkgs/gsl/SPKG.rst | 64 + build/pkgs/gsl/SPKG.txt | 45 - build/pkgs/html5lib/{SPKG.txt => SPKG.rst} | 17 +- build/pkgs/iconv/SPKG.rst | 36 + build/pkgs/iconv/SPKG.txt | 20 - build/pkgs/igraph/SPKG.rst | 35 + build/pkgs/igraph/SPKG.txt | 23 - build/pkgs/imagesize/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/iml/{SPKG.txt => SPKG.rst} | 45 +- build/pkgs/ipaddress/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/ipykernel/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/ipython/{SPKG.txt => SPKG.rst} | 29 +- build/pkgs/ipython_genutils/SPKG.rst | 7 + build/pkgs/ipython_genutils/SPKG.txt | 5 - build/pkgs/ipywidgets/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/isl/{SPKG.txt => SPKG.rst} | 34 +- build/pkgs/itsdangerous/SPKG.rst | 8 + build/pkgs/itsdangerous/SPKG.txt | 6 - build/pkgs/jinja2/SPKG.rst | 41 + build/pkgs/jinja2/SPKG.txt | 34 - build/pkgs/jmol/SPKG.rst | 45 + build/pkgs/jmol/SPKG.txt | 33 - build/pkgs/jsonschema/{SPKG.txt => SPKG.rst} | 19 +- build/pkgs/jupymake/SPKG.rst | 30 + build/pkgs/jupymake/SPKG.txt | 20 - .../jupyter_client/{SPKG.txt => SPKG.rst} | 6 +- .../pkgs/jupyter_core/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/kenzo/SPKG.rst | 26 + build/pkgs/kenzo/SPKG.txt | 21 - build/pkgs/kiwisolver/SPKG.rst | 38 + build/pkgs/kiwisolver/SPKG.txt | 31 - build/pkgs/latte_int/SPKG.rst | 25 + build/pkgs/latte_int/SPKG.txt | 19 - build/pkgs/lcalc/SPKG.rst | 130 ++ build/pkgs/lcalc/SPKG.txt | 91 -- build/pkgs/libatomic_ops/SPKG.rst | 32 + build/pkgs/libatomic_ops/SPKG.txt | 22 - build/pkgs/libbraiding/SPKG.rst | 27 + build/pkgs/libbraiding/SPKG.txt | 17 - build/pkgs/libffi/{SPKG.txt => SPKG.rst} | 29 +- build/pkgs/libgd/SPKG.rst | 40 + build/pkgs/libgd/SPKG.txt | 30 - build/pkgs/libhomfly/SPKG.rst | 32 + build/pkgs/libhomfly/SPKG.txt | 21 - build/pkgs/libogg/SPKG.rst | 68 + build/pkgs/libogg/SPKG.txt | 55 - build/pkgs/libpng/SPKG.rst | 72 + build/pkgs/libpng/SPKG.txt | 56 - build/pkgs/libsemigroups/SPKG.rst | 21 + build/pkgs/libsemigroups/SPKG.txt | 15 - build/pkgs/libtheora/SPKG.rst | 72 + build/pkgs/libtheora/SPKG.txt | 59 - build/pkgs/lidia/{SPKG.txt => SPKG.rst} | 26 +- build/pkgs/lie/{SPKG.txt => SPKG.rst} | 24 +- build/pkgs/linbox/SPKG.rst | 62 + build/pkgs/linbox/SPKG.txt | 44 - build/pkgs/lrcalc/{SPKG.txt => SPKG.rst} | 14 +- build/pkgs/lrslib/{SPKG.txt => SPKG.rst} | 33 +- build/pkgs/m4ri/SPKG.rst | 38 + build/pkgs/m4ri/SPKG.txt | 27 - build/pkgs/m4rie/SPKG.rst | 28 + build/pkgs/m4rie/SPKG.txt | 22 - build/pkgs/markupsafe/{SPKG.txt => SPKG.rst} | 19 +- build/pkgs/mathjax/SPKG.rst | 40 + build/pkgs/mathjax/SPKG.txt | 29 - build/pkgs/matplotlib/SPKG.rst | 65 + build/pkgs/matplotlib/SPKG.txt | 51 - build/pkgs/maxima/SPKG.rst | 87 ++ build/pkgs/maxima/SPKG.txt | 68 - build/pkgs/mcqd/SPKG.rst | 28 + build/pkgs/mcqd/SPKG.txt | 20 - build/pkgs/meataxe/SPKG.rst | 28 + build/pkgs/meataxe/SPKG.txt | 22 - build/pkgs/mistune/SPKG.rst | 24 + build/pkgs/mistune/SPKG.txt | 19 - build/pkgs/modular_decomposition/SPKG.rst | 35 + build/pkgs/modular_decomposition/SPKG.txt | 25 - build/pkgs/mpc/SPKG.rst | 46 + build/pkgs/mpc/SPKG.txt | 34 - build/pkgs/mpfi/{SPKG.txt => SPKG.rst} | 32 +- build/pkgs/mpfr/SPKG.rst | 70 + build/pkgs/mpfr/SPKG.txt | 51 - build/pkgs/mpfrcx/SPKG.rst | 27 + build/pkgs/mpfrcx/SPKG.txt | 19 - build/pkgs/mpir/SPKG.rst | 48 + build/pkgs/mpir/SPKG.txt | 30 - build/pkgs/mpmath/SPKG.rst | 29 + build/pkgs/mpmath/SPKG.txt | 15 - build/pkgs/nauty/SPKG.rst | 39 + build/pkgs/nauty/SPKG.txt | 35 - build/pkgs/nbconvert/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/nbformat/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/ncurses/SPKG.rst | 51 + build/pkgs/ncurses/SPKG.txt | 41 - build/pkgs/networkx/SPKG.rst | 20 + build/pkgs/networkx/SPKG.txt | 13 - build/pkgs/ninja_build/SPKG.rst | 24 + build/pkgs/ninja_build/SPKG.txt | 17 - build/pkgs/normaliz/SPKG.rst | 42 + build/pkgs/normaliz/SPKG.txt | 29 - build/pkgs/nose/SPKG.rst | 36 + build/pkgs/nose/SPKG.txt | 26 - build/pkgs/notebook/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/notedown/SPKG.rst | 29 + build/pkgs/notedown/SPKG.txt | 23 - build/pkgs/ntl/SPKG.rst | 37 + build/pkgs/ntl/SPKG.txt | 21 - build/pkgs/numpy/SPKG.rst | 38 + build/pkgs/numpy/SPKG.txt | 27 - build/pkgs/openblas/SPKG.rst | 35 + build/pkgs/openblas/SPKG.txt | 23 - build/pkgs/openssl/SPKG.rst | 29 + build/pkgs/openssl/SPKG.txt | 23 - build/pkgs/p_group_cohomology/SPKG.rst | 117 ++ build/pkgs/p_group_cohomology/SPKG.txt | 98 -- build/pkgs/packaging/SPKG.rst | 7 + build/pkgs/packaging/SPKG.txt | 5 - build/pkgs/palp/SPKG.rst | 45 + build/pkgs/palp/SPKG.txt | 36 - build/pkgs/pandoc/SPKG.rst | 10 + build/pkgs/pandoc/SPKG.txt | 8 - build/pkgs/pandoc_attributes/SPKG.rst | 37 + build/pkgs/pandoc_attributes/SPKG.txt | 28 - build/pkgs/pandocfilters/SPKG.rst | 32 + build/pkgs/pandocfilters/SPKG.txt | 23 - build/pkgs/pari/SPKG.rst | 47 + build/pkgs/pari/SPKG.txt | 35 - build/pkgs/pari_elldata/SPKG.rst | 26 + build/pkgs/pari_elldata/SPKG.txt | 18 - .../pkgs/pari_galdata/{SPKG.txt => SPKG.rst} | 17 +- build/pkgs/pari_galpol/{SPKG.txt => SPKG.rst} | 21 +- build/pkgs/pari_jupyter/SPKG.rst | 29 + build/pkgs/pari_jupyter/SPKG.txt | 22 - build/pkgs/pari_nftables/SPKG.rst | 26 + build/pkgs/pari_nftables/SPKG.txt | 19 - build/pkgs/pari_seadata/SPKG.rst | 29 + build/pkgs/pari_seadata/SPKG.txt | 23 - .../pari_seadata_small/{SPKG.txt => SPKG.rst} | 21 +- build/pkgs/patch/SPKG.rst | 45 + build/pkgs/patch/SPKG.txt | 34 - build/pkgs/pathlib2/{SPKG.txt => SPKG.rst} | 11 +- build/pkgs/pathpy/SPKG.rst | 7 + build/pkgs/pathpy/SPKG.txt | 5 - build/pkgs/pcre/{SPKG.txt => SPKG.rst} | 22 +- build/pkgs/perl_cpan_polymake_prereq/SPKG.rst | 13 + build/pkgs/perl_cpan_polymake_prereq/SPKG.txt | 10 - build/pkgs/perl_term_readline_gnu/SPKG.rst | 26 + build/pkgs/perl_term_readline_gnu/SPKG.txt | 19 - build/pkgs/pexpect/SPKG.rst | 28 + build/pkgs/pexpect/SPKG.txt | 21 - build/pkgs/pickleshare/{SPKG.txt => SPKG.rst} | 14 +- build/pkgs/pillow/SPKG.rst | 28 + build/pkgs/pillow/SPKG.txt | 22 - build/pkgs/pip/SPKG.rst | 32 + build/pkgs/pip/SPKG.txt | 26 - build/pkgs/pkgconf/SPKG.rst | 35 + build/pkgs/pkgconf/SPKG.txt | 25 - build/pkgs/pkgconfig/SPKG.rst | 34 + build/pkgs/pkgconfig/SPKG.txt | 24 - build/pkgs/planarity/SPKG.rst | 48 + build/pkgs/planarity/SPKG.txt | 36 - build/pkgs/plantri/SPKG.rst | 43 + build/pkgs/plantri/SPKG.txt | 33 - build/pkgs/polylib/SPKG.rst | 25 + build/pkgs/polylib/SPKG.txt | 19 - build/pkgs/polymake/SPKG.rst | 89 ++ build/pkgs/polymake/SPKG.txt | 76 - build/pkgs/polytopes_db/SPKG.rst | 28 + build/pkgs/polytopes_db/SPKG.txt | 21 - build/pkgs/ppl/SPKG.rst | 62 + build/pkgs/ppl/SPKG.txt | 45 - build/pkgs/pplpy/{SPKG.txt => SPKG.rst} | 19 +- build/pkgs/primecount/SPKG.rst | 22 + build/pkgs/primecount/SPKG.txt | 16 - build/pkgs/prometheus_client/SPKG.rst | 9 + build/pkgs/prometheus_client/SPKG.txt | 6 - .../prompt_toolkit/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/psutil/{SPKG.txt => SPKG.rst} | 17 +- build/pkgs/ptyprocess/SPKG.rst | 33 + build/pkgs/ptyprocess/SPKG.txt | 25 - build/pkgs/pycosat/SPKG.rst | 37 + build/pkgs/pycosat/SPKG.txt | 28 - build/pkgs/pycygwin/SPKG.rst | 14 + build/pkgs/pycygwin/SPKG.txt | 11 - build/pkgs/pygments/SPKG.rst | 56 + build/pkgs/pygments/SPKG.txt | 39 - build/pkgs/pynac/SPKG.rst | 38 + build/pkgs/pynac/SPKG.txt | 28 - build/pkgs/pynormaliz/SPKG.rst | 30 + build/pkgs/pynormaliz/SPKG.txt | 21 - build/pkgs/pyparsing/SPKG.rst | 24 + build/pkgs/pyparsing/SPKG.txt | 19 - build/pkgs/pysingular/SPKG.rst | 21 + build/pkgs/pysingular/SPKG.txt | 15 - build/pkgs/python2/SPKG.rst | 103 ++ build/pkgs/python2/SPKG.txt | 71 - build/pkgs/python_igraph/SPKG.rst | 34 + build/pkgs/python_igraph/SPKG.txt | 22 - build/pkgs/python_openid/SPKG.rst | 15 + build/pkgs/python_openid/SPKG.txt | 11 - build/pkgs/pytz/SPKG.rst | 17 + build/pkgs/pytz/SPKG.txt | 12 - build/pkgs/pyx/{SPKG.txt => SPKG.rst} | 7 +- build/pkgs/pyzmq/SPKG.rst | 33 + build/pkgs/pyzmq/SPKG.txt | 24 - build/pkgs/qepcad/SPKG.rst | 51 + build/pkgs/qepcad/SPKG.txt | 39 - build/pkgs/qhull/SPKG.rst | 49 + build/pkgs/qhull/SPKG.txt | 43 - build/pkgs/r/{SPKG.txt => SPKG.rst} | 41 +- build/pkgs/ratpoints/SPKG.rst | 43 + build/pkgs/ratpoints/SPKG.txt | 30 - build/pkgs/readline/SPKG.rst | 53 + build/pkgs/readline/SPKG.txt | 39 - build/pkgs/requests/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/rpy2/SPKG.rst | 40 + build/pkgs/rpy2/SPKG.txt | 24 - build/pkgs/rst2ipynb/{SPKG.txt => SPKG.rst} | 30 +- build/pkgs/rubiks/SPKG.rst | 27 + build/pkgs/rubiks/SPKG.txt | 25 - build/pkgs/rw/{SPKG.txt => SPKG.rst} | 14 +- build/pkgs/saclib/SPKG.rst | 42 + build/pkgs/saclib/SPKG.txt | 35 - build/pkgs/sage_brial/{SPKG.txt => SPKG.rst} | 14 +- build/pkgs/sagenb/SPKG.rst | 49 + build/pkgs/sagenb/SPKG.txt | 40 - .../pkgs/sagenb_export/{SPKG.txt => SPKG.rst} | 10 +- build/pkgs/sagetex/SPKG.rst | 66 + build/pkgs/sagetex/SPKG.txt | 56 - build/pkgs/scandir/{SPKG.txt => SPKG.rst} | 11 +- build/pkgs/scipoptsuite/SPKG.rst | 52 + build/pkgs/scipoptsuite/SPKG.txt | 38 - build/pkgs/scipy/SPKG.rst | 43 + build/pkgs/scipy/SPKG.txt | 28 - build/pkgs/scons/SPKG.rst | 31 + build/pkgs/scons/SPKG.txt | 18 - build/pkgs/send2trash/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/setuptools/SPKG.rst | 44 + build/pkgs/setuptools/SPKG.txt | 30 - .../setuptools_scm/{SPKG.txt => SPKG.rst} | 6 +- .../pkgs/simplegeneric/{SPKG.txt => SPKG.rst} | 31 +- build/pkgs/singledispatch/SPKG.rst | 26 + build/pkgs/singledispatch/SPKG.txt | 20 - build/pkgs/singular/SPKG.rst | 48 + build/pkgs/singular/SPKG.txt | 36 - build/pkgs/singular_jupyter/SPKG.rst | 23 + build/pkgs/singular_jupyter/SPKG.txt | 15 - build/pkgs/sip/SPKG.rst | 25 + build/pkgs/sip/SPKG.txt | 18 - build/pkgs/sirocco/SPKG.rst | 32 + build/pkgs/sirocco/SPKG.txt | 21 - build/pkgs/six/SPKG.rst | 24 + build/pkgs/six/SPKG.txt | 19 - build/pkgs/snowballstemmer/SPKG.rst | 29 + build/pkgs/snowballstemmer/SPKG.txt | 25 - build/pkgs/speaklater/SPKG.rst | 14 + build/pkgs/speaklater/SPKG.txt | 12 - build/pkgs/sphinx/SPKG.rst | 50 + build/pkgs/sphinx/SPKG.txt | 38 - build/pkgs/sphinxcontrib_websupport/SPKG.rst | 17 + build/pkgs/sphinxcontrib_websupport/SPKG.txt | 12 - build/pkgs/sqlite/SPKG.rst | 32 + build/pkgs/sqlite/SPKG.txt | 22 - .../pkgs/subprocess32/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/suitesparse/SPKG.rst | 1315 +++++++++++++++++ build/pkgs/suitesparse/SPKG.txt | 967 ------------ build/pkgs/surf/SPKG.rst | 40 + build/pkgs/surf/SPKG.txt | 33 - build/pkgs/symmetrica/SPKG.rst | 59 + build/pkgs/symmetrica/SPKG.txt | 44 - build/pkgs/sympow/SPKG.rst | 69 + build/pkgs/sympow/SPKG.txt | 43 - build/pkgs/sympy/SPKG.rst | 41 + build/pkgs/sympy/SPKG.txt | 25 - build/pkgs/tachyon/SPKG.rst | 78 + build/pkgs/tachyon/SPKG.txt | 61 - build/pkgs/tdlib/SPKG.rst | 34 + build/pkgs/tdlib/SPKG.txt | 20 - build/pkgs/termcap/SPKG.rst | 32 + build/pkgs/termcap/SPKG.txt | 23 - build/pkgs/terminado/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/testpath/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/texlive/SPKG.rst | 41 + build/pkgs/texlive/SPKG.txt | 31 - build/pkgs/thebe/SPKG.rst | 39 + build/pkgs/thebe/SPKG.txt | 30 - build/pkgs/threejs/SPKG.rst | 31 + build/pkgs/threejs/SPKG.txt | 22 - build/pkgs/tides/SPKG.rst | 35 + build/pkgs/tides/SPKG.txt | 25 - build/pkgs/topcom/SPKG.rst | 43 + build/pkgs/topcom/SPKG.txt | 34 - build/pkgs/tornado/SPKG.rst | 24 + build/pkgs/tornado/SPKG.txt | 18 - build/pkgs/traitlets/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/twisted/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/typing/{SPKG.txt => SPKG.rst} | 9 +- build/pkgs/valgrind/SPKG.rst | 56 + build/pkgs/valgrind/SPKG.txt | 44 - build/pkgs/vcversioner/SPKG.rst | 26 + build/pkgs/vcversioner/SPKG.txt | 20 - build/pkgs/wcwidth/{SPKG.txt => SPKG.rst} | 6 +- build/pkgs/webencodings/SPKG.rst | 24 + build/pkgs/webencodings/SPKG.txt | 17 - build/pkgs/werkzeug/SPKG.rst | 21 + build/pkgs/werkzeug/SPKG.txt | 18 - build/pkgs/widgetsnbextension/SPKG.rst | 7 + build/pkgs/widgetsnbextension/SPKG.txt | 6 - build/pkgs/xz/SPKG.rst | 24 + build/pkgs/xz/SPKG.txt | 17 - build/pkgs/yasm/SPKG.rst | 42 + build/pkgs/yasm/SPKG.txt | 19 - build/pkgs/zeromq/SPKG.rst | 33 + build/pkgs/zeromq/SPKG.txt | 24 - build/pkgs/zlib/SPKG.rst | 35 + build/pkgs/zlib/SPKG.txt | 24 - build/pkgs/zn_poly/SPKG.rst | 105 ++ build/pkgs/zn_poly/SPKG.txt | 70 - build/pkgs/zope_interface/SPKG.rst | 16 + build/pkgs/zope_interface/SPKG.txt | 13 - 498 files changed, 10200 insertions(+), 7341 deletions(-) create mode 100644 build/pkgs/4ti2/SPKG.rst delete mode 100644 build/pkgs/4ti2/SPKG.txt create mode 100644 build/pkgs/alabaster/SPKG.rst delete mode 100644 build/pkgs/alabaster/SPKG.txt create mode 100644 build/pkgs/appnope/SPKG.rst delete mode 100644 build/pkgs/appnope/SPKG.txt rename build/pkgs/arb/{SPKG.txt => SPKG.rst} (53%) create mode 100644 build/pkgs/atlas/SPKG.rst delete mode 100644 build/pkgs/atlas/SPKG.txt rename build/pkgs/autotools/{SPKG.txt => SPKG.rst} (63%) create mode 100644 build/pkgs/awali/SPKG.rst delete mode 100644 build/pkgs/awali/SPKG.txt rename build/pkgs/babel/{SPKG.txt => SPKG.rst} (73%) rename build/pkgs/backports_abc/{SPKG.txt => SPKG.rst} (54%) create mode 100644 build/pkgs/backports_functools_lru_cache/SPKG.rst delete mode 100644 build/pkgs/backports_functools_lru_cache/SPKG.txt create mode 100644 build/pkgs/backports_shutil_get_terminal_size/SPKG.rst delete mode 100644 build/pkgs/backports_shutil_get_terminal_size/SPKG.txt create mode 100644 build/pkgs/backports_ssl_match_hostname/SPKG.rst delete mode 100644 build/pkgs/backports_ssl_match_hostname/SPKG.txt create mode 100644 build/pkgs/barvinok/SPKG.rst delete mode 100644 build/pkgs/barvinok/SPKG.txt create mode 100644 build/pkgs/benzene/SPKG.rst delete mode 100644 build/pkgs/benzene/SPKG.txt rename build/pkgs/bleach/{SPKG.txt => SPKG.rst} (50%) create mode 100644 build/pkgs/bliss/SPKG.rst delete mode 100644 build/pkgs/bliss/SPKG.txt rename build/pkgs/boost/{SPKG.txt => SPKG.rst} (51%) create mode 100644 build/pkgs/boost_cropped/SPKG.rst delete mode 100644 build/pkgs/boost_cropped/SPKG.txt rename build/pkgs/brial/{SPKG.txt => SPKG.rst} (86%) create mode 100644 build/pkgs/buckygen/SPKG.rst delete mode 100644 build/pkgs/buckygen/SPKG.txt rename build/pkgs/bzip2/{SPKG.txt => SPKG.rst} (54%) create mode 100644 build/pkgs/cbc/SPKG.rst delete mode 100644 build/pkgs/cbc/SPKG.txt create mode 100644 build/pkgs/ccache/SPKG.rst delete mode 100644 build/pkgs/ccache/SPKG.txt create mode 100644 build/pkgs/cddlib/SPKG.rst delete mode 100644 build/pkgs/cddlib/SPKG.txt create mode 100644 build/pkgs/certifi/SPKG.rst delete mode 100644 build/pkgs/certifi/SPKG.txt create mode 100644 build/pkgs/cliquer/SPKG.rst delete mode 100644 build/pkgs/cliquer/SPKG.txt create mode 100644 build/pkgs/cmake/SPKG.rst delete mode 100644 build/pkgs/cmake/SPKG.txt create mode 100644 build/pkgs/cocoalib/SPKG.rst delete mode 100644 build/pkgs/cocoalib/SPKG.txt create mode 100644 build/pkgs/combinatorial_designs/SPKG.rst delete mode 100644 build/pkgs/combinatorial_designs/SPKG.txt create mode 100644 build/pkgs/compilerwrapper/SPKG.rst delete mode 100644 build/pkgs/compilerwrapper/SPKG.txt rename build/pkgs/configparser/{SPKG.txt => SPKG.rst} (83%) rename build/pkgs/configure/{SPKG.txt => SPKG.rst} (52%) create mode 100644 build/pkgs/conway_polynomials/SPKG.rst delete mode 100644 build/pkgs/conway_polynomials/SPKG.txt create mode 100644 build/pkgs/coxeter3/SPKG.rst delete mode 100644 build/pkgs/coxeter3/SPKG.txt create mode 100644 build/pkgs/cryptominisat/SPKG.rst delete mode 100644 build/pkgs/cryptominisat/SPKG.txt create mode 100644 build/pkgs/csdp/SPKG.rst delete mode 100644 build/pkgs/csdp/SPKG.txt create mode 100644 build/pkgs/curl/SPKG.rst delete mode 100644 build/pkgs/curl/SPKG.txt create mode 100644 build/pkgs/cvxopt/SPKG.rst delete mode 100644 build/pkgs/cvxopt/SPKG.txt create mode 100644 build/pkgs/cycler/SPKG.rst delete mode 100644 build/pkgs/cycler/SPKG.txt create mode 100644 build/pkgs/cypari/SPKG.rst delete mode 100644 build/pkgs/cypari/SPKG.txt create mode 100644 build/pkgs/cysignals/SPKG.rst delete mode 100644 build/pkgs/cysignals/SPKG.txt create mode 100644 build/pkgs/cython/SPKG.rst delete mode 100644 build/pkgs/cython/SPKG.txt create mode 100644 build/pkgs/d3js/SPKG.rst delete mode 100644 build/pkgs/d3js/SPKG.txt create mode 100644 build/pkgs/database_cremona_ellcurve/SPKG.rst delete mode 100644 build/pkgs/database_cremona_ellcurve/SPKG.txt create mode 100644 build/pkgs/database_jones_numfield/SPKG.rst delete mode 100644 build/pkgs/database_jones_numfield/SPKG.txt create mode 100644 build/pkgs/database_kohel/SPKG.rst delete mode 100644 build/pkgs/database_kohel/SPKG.txt create mode 100644 build/pkgs/database_mutation_class/SPKG.rst delete mode 100644 build/pkgs/database_mutation_class/SPKG.txt rename build/pkgs/database_odlyzko_zeta/{SPKG.txt => SPKG.rst} (52%) rename build/pkgs/database_stein_watkins/{SPKG.txt => SPKG.rst} (59%) rename build/pkgs/database_stein_watkins_mini/{SPKG.txt => SPKG.rst} (57%) create mode 100644 build/pkgs/database_symbolic_data/SPKG.rst delete mode 100644 build/pkgs/database_symbolic_data/SPKG.txt create mode 100644 build/pkgs/dateutil/SPKG.rst delete mode 100644 build/pkgs/dateutil/SPKG.txt rename build/pkgs/decorator/{SPKG.txt => SPKG.rst} (51%) create mode 100644 build/pkgs/deformation/SPKG.rst delete mode 100644 build/pkgs/deformation/SPKG.txt create mode 100644 build/pkgs/defusedxml/SPKG.rst delete mode 100644 build/pkgs/defusedxml/SPKG.txt create mode 100644 build/pkgs/docutils/SPKG.rst delete mode 100644 build/pkgs/docutils/SPKG.txt create mode 100644 build/pkgs/dot2tex/SPKG.rst delete mode 100644 build/pkgs/dot2tex/SPKG.txt create mode 100644 build/pkgs/e_antic/SPKG.rst delete mode 100644 build/pkgs/e_antic/SPKG.txt create mode 100644 build/pkgs/ecl/SPKG.rst delete mode 100644 build/pkgs/ecl/SPKG.txt rename build/pkgs/eclib/{SPKG.txt => SPKG.rst} (62%) rename build/pkgs/ecm/{SPKG.txt => SPKG.rst} (53%) create mode 100644 build/pkgs/elliptic_curves/SPKG.rst delete mode 100644 build/pkgs/elliptic_curves/SPKG.txt rename build/pkgs/entrypoints/{SPKG.txt => SPKG.rst} (57%) rename build/pkgs/enum34/{SPKG.txt => SPKG.rst} (87%) create mode 100644 build/pkgs/fflas_ffpack/SPKG.rst delete mode 100644 build/pkgs/fflas_ffpack/SPKG.txt rename build/pkgs/flask/{SPKG.txt => SPKG.rst} (84%) rename build/pkgs/flask_autoindex/{SPKG.txt => SPKG.rst} (69%) rename build/pkgs/flask_babel/{SPKG.txt => SPKG.rst} (55%) create mode 100644 build/pkgs/flask_oldsessions/SPKG.rst delete mode 100644 build/pkgs/flask_oldsessions/SPKG.txt create mode 100644 build/pkgs/flask_openid/SPKG.rst delete mode 100644 build/pkgs/flask_openid/SPKG.txt rename build/pkgs/flask_silk/{SPKG.txt => SPKG.rst} (53%) create mode 100644 build/pkgs/flint/SPKG.rst delete mode 100644 build/pkgs/flint/SPKG.txt create mode 100644 build/pkgs/flintqs/SPKG.rst delete mode 100644 build/pkgs/flintqs/SPKG.txt create mode 100644 build/pkgs/fplll/SPKG.rst delete mode 100644 build/pkgs/fplll/SPKG.txt create mode 100644 build/pkgs/fpylll/SPKG.rst delete mode 100644 build/pkgs/fpylll/SPKG.txt create mode 100644 build/pkgs/freetype/SPKG.rst delete mode 100644 build/pkgs/freetype/SPKG.txt create mode 100644 build/pkgs/fricas/SPKG.rst delete mode 100644 build/pkgs/fricas/SPKG.txt create mode 100644 build/pkgs/frobby/SPKG.rst delete mode 100644 build/pkgs/frobby/SPKG.txt rename build/pkgs/functools32/{SPKG.txt => SPKG.rst} (53%) rename build/pkgs/future/{SPKG.txt => SPKG.rst} (53%) create mode 100644 build/pkgs/gambit/SPKG.rst delete mode 100644 build/pkgs/gambit/SPKG.txt rename build/pkgs/gap/{SPKG.txt => SPKG.rst} (53%) create mode 100644 build/pkgs/gap3/SPKG.rst delete mode 100644 build/pkgs/gap3/SPKG.txt create mode 100644 build/pkgs/gap_jupyter/SPKG.rst delete mode 100644 build/pkgs/gap_jupyter/SPKG.txt create mode 100644 build/pkgs/gap_packages/SPKG.rst delete mode 100644 build/pkgs/gap_packages/SPKG.txt create mode 100644 build/pkgs/gc/SPKG.rst delete mode 100644 build/pkgs/gc/SPKG.txt create mode 100644 build/pkgs/gcc/SPKG.rst delete mode 100644 build/pkgs/gcc/SPKG.txt create mode 100644 build/pkgs/gdb/SPKG.rst delete mode 100644 build/pkgs/gdb/SPKG.txt create mode 100644 build/pkgs/gf2x/SPKG.rst delete mode 100644 build/pkgs/gf2x/SPKG.txt create mode 100644 build/pkgs/gfan/SPKG.rst delete mode 100644 build/pkgs/gfan/SPKG.txt create mode 100644 build/pkgs/gfortran/SPKG.rst delete mode 100644 build/pkgs/gfortran/SPKG.txt create mode 100644 build/pkgs/giac/SPKG.rst delete mode 100644 build/pkgs/giac/SPKG.txt create mode 100644 build/pkgs/giacpy_sage/SPKG.rst delete mode 100644 build/pkgs/giacpy_sage/SPKG.txt create mode 100644 build/pkgs/git/SPKG.rst delete mode 100644 build/pkgs/git/SPKG.txt create mode 100644 build/pkgs/git_trac/SPKG.rst delete mode 100644 build/pkgs/git_trac/SPKG.txt create mode 100644 build/pkgs/givaro/SPKG.rst delete mode 100644 build/pkgs/givaro/SPKG.txt create mode 100644 build/pkgs/glpk/SPKG.rst delete mode 100644 build/pkgs/glpk/SPKG.txt create mode 100644 build/pkgs/glucose/SPKG.rst delete mode 100644 build/pkgs/glucose/SPKG.txt create mode 100644 build/pkgs/gmp/SPKG.rst delete mode 100644 build/pkgs/gmp/SPKG.txt create mode 100644 build/pkgs/gmpy2/SPKG.rst delete mode 100644 build/pkgs/gmpy2/SPKG.txt create mode 100644 build/pkgs/gp2c/SPKG.rst delete mode 100644 build/pkgs/gp2c/SPKG.txt rename build/pkgs/graphs/{SPKG.txt => SPKG.rst} (51%) create mode 100644 build/pkgs/gsl/SPKG.rst delete mode 100644 build/pkgs/gsl/SPKG.txt rename build/pkgs/html5lib/{SPKG.txt => SPKG.rst} (53%) create mode 100644 build/pkgs/iconv/SPKG.rst delete mode 100644 build/pkgs/iconv/SPKG.txt create mode 100644 build/pkgs/igraph/SPKG.rst delete mode 100644 build/pkgs/igraph/SPKG.txt rename build/pkgs/imagesize/{SPKG.txt => SPKG.rst} (55%) rename build/pkgs/iml/{SPKG.txt => SPKG.rst} (50%) rename build/pkgs/ipaddress/{SPKG.txt => SPKG.rst} (54%) rename build/pkgs/ipykernel/{SPKG.txt => SPKG.rst} (65%) rename build/pkgs/ipython/{SPKG.txt => SPKG.rst} (60%) create mode 100644 build/pkgs/ipython_genutils/SPKG.rst delete mode 100644 build/pkgs/ipython_genutils/SPKG.txt rename build/pkgs/ipywidgets/{SPKG.txt => SPKG.rst} (61%) rename build/pkgs/isl/{SPKG.txt => SPKG.rst} (58%) create mode 100644 build/pkgs/itsdangerous/SPKG.rst delete mode 100644 build/pkgs/itsdangerous/SPKG.txt create mode 100644 build/pkgs/jinja2/SPKG.rst delete mode 100644 build/pkgs/jinja2/SPKG.txt create mode 100644 build/pkgs/jmol/SPKG.rst delete mode 100644 build/pkgs/jmol/SPKG.txt rename build/pkgs/jsonschema/{SPKG.txt => SPKG.rst} (50%) create mode 100644 build/pkgs/jupymake/SPKG.rst delete mode 100644 build/pkgs/jupymake/SPKG.txt rename build/pkgs/jupyter_client/{SPKG.txt => SPKG.rst} (85%) rename build/pkgs/jupyter_core/{SPKG.txt => SPKG.rst} (58%) create mode 100644 build/pkgs/kenzo/SPKG.rst delete mode 100644 build/pkgs/kenzo/SPKG.txt create mode 100644 build/pkgs/kiwisolver/SPKG.rst delete mode 100644 build/pkgs/kiwisolver/SPKG.txt create mode 100644 build/pkgs/latte_int/SPKG.rst delete mode 100644 build/pkgs/latte_int/SPKG.txt create mode 100644 build/pkgs/lcalc/SPKG.rst delete mode 100644 build/pkgs/lcalc/SPKG.txt create mode 100644 build/pkgs/libatomic_ops/SPKG.rst delete mode 100644 build/pkgs/libatomic_ops/SPKG.txt create mode 100644 build/pkgs/libbraiding/SPKG.rst delete mode 100644 build/pkgs/libbraiding/SPKG.txt rename build/pkgs/libffi/{SPKG.txt => SPKG.rst} (80%) create mode 100644 build/pkgs/libgd/SPKG.rst delete mode 100644 build/pkgs/libgd/SPKG.txt create mode 100644 build/pkgs/libhomfly/SPKG.rst delete mode 100644 build/pkgs/libhomfly/SPKG.txt create mode 100644 build/pkgs/libogg/SPKG.rst delete mode 100644 build/pkgs/libogg/SPKG.txt create mode 100644 build/pkgs/libpng/SPKG.rst delete mode 100644 build/pkgs/libpng/SPKG.txt create mode 100644 build/pkgs/libsemigroups/SPKG.rst delete mode 100644 build/pkgs/libsemigroups/SPKG.txt create mode 100644 build/pkgs/libtheora/SPKG.rst delete mode 100644 build/pkgs/libtheora/SPKG.txt rename build/pkgs/lidia/{SPKG.txt => SPKG.rst} (58%) rename build/pkgs/lie/{SPKG.txt => SPKG.rst} (86%) create mode 100644 build/pkgs/linbox/SPKG.rst delete mode 100644 build/pkgs/linbox/SPKG.txt rename build/pkgs/lrcalc/{SPKG.txt => SPKG.rst} (63%) rename build/pkgs/lrslib/{SPKG.txt => SPKG.rst} (53%) create mode 100644 build/pkgs/m4ri/SPKG.rst delete mode 100644 build/pkgs/m4ri/SPKG.txt create mode 100644 build/pkgs/m4rie/SPKG.rst delete mode 100644 build/pkgs/m4rie/SPKG.txt rename build/pkgs/markupsafe/{SPKG.txt => SPKG.rst} (51%) create mode 100644 build/pkgs/mathjax/SPKG.rst delete mode 100644 build/pkgs/mathjax/SPKG.txt create mode 100644 build/pkgs/matplotlib/SPKG.rst delete mode 100644 build/pkgs/matplotlib/SPKG.txt create mode 100644 build/pkgs/maxima/SPKG.rst delete mode 100644 build/pkgs/maxima/SPKG.txt create mode 100644 build/pkgs/mcqd/SPKG.rst delete mode 100644 build/pkgs/mcqd/SPKG.txt create mode 100644 build/pkgs/meataxe/SPKG.rst delete mode 100644 build/pkgs/meataxe/SPKG.txt create mode 100644 build/pkgs/mistune/SPKG.rst delete mode 100644 build/pkgs/mistune/SPKG.txt create mode 100644 build/pkgs/modular_decomposition/SPKG.rst delete mode 100644 build/pkgs/modular_decomposition/SPKG.txt create mode 100644 build/pkgs/mpc/SPKG.rst delete mode 100644 build/pkgs/mpc/SPKG.txt rename build/pkgs/mpfi/{SPKG.txt => SPKG.rst} (67%) create mode 100644 build/pkgs/mpfr/SPKG.rst delete mode 100644 build/pkgs/mpfr/SPKG.txt create mode 100644 build/pkgs/mpfrcx/SPKG.rst delete mode 100644 build/pkgs/mpfrcx/SPKG.txt create mode 100644 build/pkgs/mpir/SPKG.rst delete mode 100644 build/pkgs/mpir/SPKG.txt create mode 100644 build/pkgs/mpmath/SPKG.rst delete mode 100644 build/pkgs/mpmath/SPKG.txt create mode 100644 build/pkgs/nauty/SPKG.rst delete mode 100644 build/pkgs/nauty/SPKG.txt rename build/pkgs/nbconvert/{SPKG.txt => SPKG.rst} (72%) rename build/pkgs/nbformat/{SPKG.txt => SPKG.rst} (78%) create mode 100644 build/pkgs/ncurses/SPKG.rst delete mode 100644 build/pkgs/ncurses/SPKG.txt create mode 100644 build/pkgs/networkx/SPKG.rst delete mode 100644 build/pkgs/networkx/SPKG.txt create mode 100644 build/pkgs/ninja_build/SPKG.rst delete mode 100644 build/pkgs/ninja_build/SPKG.txt create mode 100644 build/pkgs/normaliz/SPKG.rst delete mode 100644 build/pkgs/normaliz/SPKG.txt create mode 100644 build/pkgs/nose/SPKG.rst delete mode 100644 build/pkgs/nose/SPKG.txt rename build/pkgs/notebook/{SPKG.txt => SPKG.rst} (68%) create mode 100644 build/pkgs/notedown/SPKG.rst delete mode 100644 build/pkgs/notedown/SPKG.txt create mode 100644 build/pkgs/ntl/SPKG.rst delete mode 100644 build/pkgs/ntl/SPKG.txt create mode 100644 build/pkgs/numpy/SPKG.rst delete mode 100644 build/pkgs/numpy/SPKG.txt create mode 100644 build/pkgs/openblas/SPKG.rst delete mode 100644 build/pkgs/openblas/SPKG.txt create mode 100644 build/pkgs/openssl/SPKG.rst delete mode 100644 build/pkgs/openssl/SPKG.txt create mode 100644 build/pkgs/p_group_cohomology/SPKG.rst delete mode 100644 build/pkgs/p_group_cohomology/SPKG.txt create mode 100644 build/pkgs/packaging/SPKG.rst delete mode 100644 build/pkgs/packaging/SPKG.txt create mode 100644 build/pkgs/palp/SPKG.rst delete mode 100644 build/pkgs/palp/SPKG.txt create mode 100644 build/pkgs/pandoc/SPKG.rst delete mode 100644 build/pkgs/pandoc/SPKG.txt create mode 100644 build/pkgs/pandoc_attributes/SPKG.rst delete mode 100644 build/pkgs/pandoc_attributes/SPKG.txt create mode 100644 build/pkgs/pandocfilters/SPKG.rst delete mode 100644 build/pkgs/pandocfilters/SPKG.txt create mode 100644 build/pkgs/pari/SPKG.rst delete mode 100644 build/pkgs/pari/SPKG.txt create mode 100644 build/pkgs/pari_elldata/SPKG.rst delete mode 100644 build/pkgs/pari_elldata/SPKG.txt rename build/pkgs/pari_galdata/{SPKG.txt => SPKG.rst} (55%) rename build/pkgs/pari_galpol/{SPKG.txt => SPKG.rst} (57%) create mode 100644 build/pkgs/pari_jupyter/SPKG.rst delete mode 100644 build/pkgs/pari_jupyter/SPKG.txt create mode 100644 build/pkgs/pari_nftables/SPKG.rst delete mode 100644 build/pkgs/pari_nftables/SPKG.txt create mode 100644 build/pkgs/pari_seadata/SPKG.rst delete mode 100644 build/pkgs/pari_seadata/SPKG.txt rename build/pkgs/pari_seadata_small/{SPKG.txt => SPKG.rst} (53%) create mode 100644 build/pkgs/patch/SPKG.rst delete mode 100644 build/pkgs/patch/SPKG.txt rename build/pkgs/pathlib2/{SPKG.txt => SPKG.rst} (66%) create mode 100644 build/pkgs/pathpy/SPKG.rst delete mode 100644 build/pkgs/pathpy/SPKG.txt rename build/pkgs/pcre/{SPKG.txt => SPKG.rst} (51%) create mode 100644 build/pkgs/perl_cpan_polymake_prereq/SPKG.rst delete mode 100644 build/pkgs/perl_cpan_polymake_prereq/SPKG.txt create mode 100644 build/pkgs/perl_term_readline_gnu/SPKG.rst delete mode 100644 build/pkgs/perl_term_readline_gnu/SPKG.txt create mode 100644 build/pkgs/pexpect/SPKG.rst delete mode 100644 build/pkgs/pexpect/SPKG.txt rename build/pkgs/pickleshare/{SPKG.txt => SPKG.rst} (57%) create mode 100644 build/pkgs/pillow/SPKG.rst delete mode 100644 build/pkgs/pillow/SPKG.txt create mode 100644 build/pkgs/pip/SPKG.rst delete mode 100644 build/pkgs/pip/SPKG.txt create mode 100644 build/pkgs/pkgconf/SPKG.rst delete mode 100644 build/pkgs/pkgconf/SPKG.txt create mode 100644 build/pkgs/pkgconfig/SPKG.rst delete mode 100644 build/pkgs/pkgconfig/SPKG.txt create mode 100644 build/pkgs/planarity/SPKG.rst delete mode 100644 build/pkgs/planarity/SPKG.txt create mode 100644 build/pkgs/plantri/SPKG.rst delete mode 100644 build/pkgs/plantri/SPKG.txt create mode 100644 build/pkgs/polylib/SPKG.rst delete mode 100644 build/pkgs/polylib/SPKG.txt create mode 100644 build/pkgs/polymake/SPKG.rst delete mode 100644 build/pkgs/polymake/SPKG.txt create mode 100644 build/pkgs/polytopes_db/SPKG.rst delete mode 100644 build/pkgs/polytopes_db/SPKG.txt create mode 100644 build/pkgs/ppl/SPKG.rst delete mode 100644 build/pkgs/ppl/SPKG.txt rename build/pkgs/pplpy/{SPKG.txt => SPKG.rst} (52%) create mode 100644 build/pkgs/primecount/SPKG.rst delete mode 100644 build/pkgs/primecount/SPKG.txt create mode 100644 build/pkgs/prometheus_client/SPKG.rst delete mode 100644 build/pkgs/prometheus_client/SPKG.txt rename build/pkgs/prompt_toolkit/{SPKG.txt => SPKG.rst} (67%) rename build/pkgs/psutil/{SPKG.txt => SPKG.rst} (62%) create mode 100644 build/pkgs/ptyprocess/SPKG.rst delete mode 100644 build/pkgs/ptyprocess/SPKG.txt create mode 100644 build/pkgs/pycosat/SPKG.rst delete mode 100644 build/pkgs/pycosat/SPKG.txt create mode 100644 build/pkgs/pycygwin/SPKG.rst delete mode 100644 build/pkgs/pycygwin/SPKG.txt create mode 100644 build/pkgs/pygments/SPKG.rst delete mode 100644 build/pkgs/pygments/SPKG.txt create mode 100644 build/pkgs/pynac/SPKG.rst delete mode 100644 build/pkgs/pynac/SPKG.txt create mode 100644 build/pkgs/pynormaliz/SPKG.rst delete mode 100644 build/pkgs/pynormaliz/SPKG.txt create mode 100644 build/pkgs/pyparsing/SPKG.rst delete mode 100644 build/pkgs/pyparsing/SPKG.txt create mode 100644 build/pkgs/pysingular/SPKG.rst delete mode 100644 build/pkgs/pysingular/SPKG.txt create mode 100644 build/pkgs/python2/SPKG.rst delete mode 100644 build/pkgs/python2/SPKG.txt create mode 100644 build/pkgs/python_igraph/SPKG.rst delete mode 100644 build/pkgs/python_igraph/SPKG.txt create mode 100644 build/pkgs/python_openid/SPKG.rst delete mode 100644 build/pkgs/python_openid/SPKG.txt create mode 100644 build/pkgs/pytz/SPKG.rst delete mode 100644 build/pkgs/pytz/SPKG.txt rename build/pkgs/pyx/{SPKG.txt => SPKG.rst} (76%) create mode 100644 build/pkgs/pyzmq/SPKG.rst delete mode 100644 build/pkgs/pyzmq/SPKG.txt create mode 100644 build/pkgs/qepcad/SPKG.rst delete mode 100644 build/pkgs/qepcad/SPKG.txt create mode 100644 build/pkgs/qhull/SPKG.rst delete mode 100644 build/pkgs/qhull/SPKG.txt rename build/pkgs/r/{SPKG.txt => SPKG.rst} (62%) create mode 100644 build/pkgs/ratpoints/SPKG.rst delete mode 100644 build/pkgs/ratpoints/SPKG.txt create mode 100644 build/pkgs/readline/SPKG.rst delete mode 100644 build/pkgs/readline/SPKG.txt rename build/pkgs/requests/{SPKG.txt => SPKG.rst} (66%) create mode 100644 build/pkgs/rpy2/SPKG.rst delete mode 100644 build/pkgs/rpy2/SPKG.txt rename build/pkgs/rst2ipynb/{SPKG.txt => SPKG.rst} (61%) create mode 100644 build/pkgs/rubiks/SPKG.rst delete mode 100644 build/pkgs/rubiks/SPKG.txt rename build/pkgs/rw/{SPKG.txt => SPKG.rst} (69%) create mode 100644 build/pkgs/saclib/SPKG.rst delete mode 100644 build/pkgs/saclib/SPKG.txt rename build/pkgs/sage_brial/{SPKG.txt => SPKG.rst} (79%) create mode 100644 build/pkgs/sagenb/SPKG.rst delete mode 100644 build/pkgs/sagenb/SPKG.txt rename build/pkgs/sagenb_export/{SPKG.txt => SPKG.rst} (72%) create mode 100644 build/pkgs/sagetex/SPKG.rst delete mode 100644 build/pkgs/sagetex/SPKG.txt rename build/pkgs/scandir/{SPKG.txt => SPKG.rst} (76%) create mode 100644 build/pkgs/scipoptsuite/SPKG.rst delete mode 100644 build/pkgs/scipoptsuite/SPKG.txt create mode 100644 build/pkgs/scipy/SPKG.rst delete mode 100644 build/pkgs/scipy/SPKG.txt create mode 100644 build/pkgs/scons/SPKG.rst delete mode 100644 build/pkgs/scons/SPKG.txt rename build/pkgs/send2trash/{SPKG.txt => SPKG.rst} (93%) create mode 100644 build/pkgs/setuptools/SPKG.rst delete mode 100644 build/pkgs/setuptools/SPKG.txt rename build/pkgs/setuptools_scm/{SPKG.txt => SPKG.rst} (51%) rename build/pkgs/simplegeneric/{SPKG.txt => SPKG.rst} (50%) create mode 100644 build/pkgs/singledispatch/SPKG.rst delete mode 100644 build/pkgs/singledispatch/SPKG.txt create mode 100644 build/pkgs/singular/SPKG.rst delete mode 100644 build/pkgs/singular/SPKG.txt create mode 100644 build/pkgs/singular_jupyter/SPKG.rst delete mode 100644 build/pkgs/singular_jupyter/SPKG.txt create mode 100644 build/pkgs/sip/SPKG.rst delete mode 100644 build/pkgs/sip/SPKG.txt create mode 100644 build/pkgs/sirocco/SPKG.rst delete mode 100644 build/pkgs/sirocco/SPKG.txt create mode 100644 build/pkgs/six/SPKG.rst delete mode 100644 build/pkgs/six/SPKG.txt create mode 100644 build/pkgs/snowballstemmer/SPKG.rst delete mode 100644 build/pkgs/snowballstemmer/SPKG.txt create mode 100644 build/pkgs/speaklater/SPKG.rst delete mode 100644 build/pkgs/speaklater/SPKG.txt create mode 100644 build/pkgs/sphinx/SPKG.rst delete mode 100644 build/pkgs/sphinx/SPKG.txt create mode 100644 build/pkgs/sphinxcontrib_websupport/SPKG.rst delete mode 100644 build/pkgs/sphinxcontrib_websupport/SPKG.txt create mode 100644 build/pkgs/sqlite/SPKG.rst delete mode 100644 build/pkgs/sqlite/SPKG.txt rename build/pkgs/subprocess32/{SPKG.txt => SPKG.rst} (57%) create mode 100644 build/pkgs/suitesparse/SPKG.rst delete mode 100644 build/pkgs/suitesparse/SPKG.txt create mode 100644 build/pkgs/surf/SPKG.rst delete mode 100644 build/pkgs/surf/SPKG.txt create mode 100644 build/pkgs/symmetrica/SPKG.rst delete mode 100644 build/pkgs/symmetrica/SPKG.txt create mode 100644 build/pkgs/sympow/SPKG.rst delete mode 100644 build/pkgs/sympow/SPKG.txt create mode 100644 build/pkgs/sympy/SPKG.rst delete mode 100644 build/pkgs/sympy/SPKG.txt create mode 100644 build/pkgs/tachyon/SPKG.rst delete mode 100644 build/pkgs/tachyon/SPKG.txt create mode 100644 build/pkgs/tdlib/SPKG.rst delete mode 100644 build/pkgs/tdlib/SPKG.txt create mode 100644 build/pkgs/termcap/SPKG.rst delete mode 100644 build/pkgs/termcap/SPKG.txt rename build/pkgs/terminado/{SPKG.txt => SPKG.rst} (87%) rename build/pkgs/testpath/{SPKG.txt => SPKG.rst} (75%) create mode 100644 build/pkgs/texlive/SPKG.rst delete mode 100644 build/pkgs/texlive/SPKG.txt create mode 100644 build/pkgs/thebe/SPKG.rst delete mode 100644 build/pkgs/thebe/SPKG.txt create mode 100644 build/pkgs/threejs/SPKG.rst delete mode 100644 build/pkgs/threejs/SPKG.txt create mode 100644 build/pkgs/tides/SPKG.rst delete mode 100644 build/pkgs/tides/SPKG.txt create mode 100644 build/pkgs/topcom/SPKG.rst delete mode 100644 build/pkgs/topcom/SPKG.txt create mode 100644 build/pkgs/tornado/SPKG.rst delete mode 100644 build/pkgs/tornado/SPKG.txt rename build/pkgs/traitlets/{SPKG.txt => SPKG.rst} (65%) rename build/pkgs/twisted/{SPKG.txt => SPKG.rst} (82%) rename build/pkgs/typing/{SPKG.txt => SPKG.rst} (89%) create mode 100644 build/pkgs/valgrind/SPKG.rst delete mode 100644 build/pkgs/valgrind/SPKG.txt create mode 100644 build/pkgs/vcversioner/SPKG.rst delete mode 100644 build/pkgs/vcversioner/SPKG.txt rename build/pkgs/wcwidth/{SPKG.txt => SPKG.rst} (72%) create mode 100644 build/pkgs/webencodings/SPKG.rst delete mode 100644 build/pkgs/webencodings/SPKG.txt create mode 100644 build/pkgs/werkzeug/SPKG.rst delete mode 100644 build/pkgs/werkzeug/SPKG.txt create mode 100644 build/pkgs/widgetsnbextension/SPKG.rst delete mode 100644 build/pkgs/widgetsnbextension/SPKG.txt create mode 100644 build/pkgs/xz/SPKG.rst delete mode 100644 build/pkgs/xz/SPKG.txt create mode 100644 build/pkgs/yasm/SPKG.rst delete mode 100644 build/pkgs/yasm/SPKG.txt create mode 100644 build/pkgs/zeromq/SPKG.rst delete mode 100644 build/pkgs/zeromq/SPKG.txt create mode 100644 build/pkgs/zlib/SPKG.rst delete mode 100644 build/pkgs/zlib/SPKG.txt create mode 100644 build/pkgs/zn_poly/SPKG.rst delete mode 100644 build/pkgs/zn_poly/SPKG.txt create mode 100644 build/pkgs/zope_interface/SPKG.rst delete mode 100644 build/pkgs/zope_interface/SPKG.txt diff --git a/build/pkgs/4ti2/SPKG.rst b/build/pkgs/4ti2/SPKG.rst new file mode 100644 index 00000000000..28f9b8d862d --- /dev/null +++ b/build/pkgs/4ti2/SPKG.rst @@ -0,0 +1,25 @@ +4ti2 +==== + +Description +----------- + +A software package for algebraic, geometric and combinatorial problems +on linear spaces. Available at www.4ti2.de. + +License +------- + +4ti2 is released under a GPL v2 license. + +.. _upstream_contact: + +Upstream Contact +---------------- + +Raymond Hemmecke, TU Munich, Germany Matthias Köppe, UC Davis, CA, USA + +Dependencies +------------ + +GLPK, GMP. diff --git a/build/pkgs/4ti2/SPKG.txt b/build/pkgs/4ti2/SPKG.txt deleted file mode 100644 index 92ffa4737fb..00000000000 --- a/build/pkgs/4ti2/SPKG.txt +++ /dev/null @@ -1,17 +0,0 @@ -= 4ti2 = - -== Description == - -A software package for algebraic, geometric and combinatorial problems on linear spaces. Available at www.4ti2.de. - -== License == -4ti2 is released under a GPL v2 license. - -== Upstream Contact == - -Raymond Hemmecke, TU Munich, Germany -Matthias Köppe, UC Davis, CA, USA - -== Dependencies == - -GLPK, GMP. diff --git a/build/pkgs/alabaster/SPKG.rst b/build/pkgs/alabaster/SPKG.rst new file mode 100644 index 00000000000..63abb0eed3c --- /dev/null +++ b/build/pkgs/alabaster/SPKG.rst @@ -0,0 +1,15 @@ +alabaster +========= + +Description +----------- + +Alabaster is a visually (c)lean, responsive, configurable theme for the +Sphinx documentation system. It is Python 2+3 compatible. + +It began as a third-party theme, and is still maintained separately, but +as of Sphinx 1.3, Alabaster is an install-time dependency of Sphinx and +is selected as the default theme. + +Live examples of this theme can be seen on paramiko.org, fabfile.org and +pyinvoke.org. diff --git a/build/pkgs/alabaster/SPKG.txt b/build/pkgs/alabaster/SPKG.txt deleted file mode 100644 index b6f8231441d..00000000000 --- a/build/pkgs/alabaster/SPKG.txt +++ /dev/null @@ -1,13 +0,0 @@ -= alabaster = - -== Description == - -Alabaster is a visually (c)lean, responsive, configurable theme for the Sphinx -documentation system. It is Python 2+3 compatible. - -It began as a third-party theme, and is still maintained separately, but as of -Sphinx 1.3, Alabaster is an install-time dependency of Sphinx and is selected -as the default theme. - -Live examples of this theme can be seen on paramiko.org, fabfile.org and -pyinvoke.org. diff --git a/build/pkgs/appnope/SPKG.rst b/build/pkgs/appnope/SPKG.rst new file mode 100644 index 00000000000..bd3e10e2962 --- /dev/null +++ b/build/pkgs/appnope/SPKG.rst @@ -0,0 +1,7 @@ +appnope +======= + +Description +----------- + +Disable App Nap on OS X 10.9 diff --git a/build/pkgs/appnope/SPKG.txt b/build/pkgs/appnope/SPKG.txt deleted file mode 100644 index eafadb7faad..00000000000 --- a/build/pkgs/appnope/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= appnope = - -== Description == - -Disable App Nap on OS X 10.9 diff --git a/build/pkgs/arb/SPKG.txt b/build/pkgs/arb/SPKG.rst similarity index 53% rename from build/pkgs/arb/SPKG.txt rename to build/pkgs/arb/SPKG.rst index 20a790f549c..b1942674518 100644 --- a/build/pkgs/arb/SPKG.txt +++ b/build/pkgs/arb/SPKG.rst @@ -1,6 +1,8 @@ -= arb = +arb +=== -== Description == +Description +----------- Arb is a C library for arbitrary-precision floating-point ball arithmetic, developed by Fredrik Johansson @@ -9,21 +11,26 @@ computation with polynomials, power series, matrices and special functions over the real and complex numbers, with automatic, rigorous error control. -== License == +License +------- GNU General Public License v2+ +.. _upstream_contact: -== Upstream Contact == +Upstream Contact +---------------- -* Fredrik Johansson: fredrik.johansson@gmail.com +- Fredrik Johansson: fredrik.johansson@gmail.com +Dependencies +------------ -== Dependencies == +- FLINT +- MPIR or GMP +- MPFR -* FLINT -* MPIR or GMP -* MPFR - -== Special Update/Build Instructions == +.. _special_updatebuild_instructions: +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/atlas/SPKG.rst b/build/pkgs/atlas/SPKG.rst new file mode 100644 index 00000000000..ac06b0f23ad --- /dev/null +++ b/build/pkgs/atlas/SPKG.rst @@ -0,0 +1,117 @@ +ATLAS +===== + +Description +----------- + +This spkg builds ATLAS for Sage. + +License +------- + +3-clause BSD + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Atlas devel mailing list. +- Clint Whaley has frequently answered questions from the Sage project + +Dependencies +------------ + +- Python + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- src/lapack-x.y.z.tgz: The netlib lapack tarball. If you update this, + + make sure you also update the LAPACK_TARBALL variable in + spkg-install. + +- src/ATLAS-lib: We are using a dummy autotools/libtools project + + to repack the static ATLAS libraries into shared libraries. + +- src/ARCHS: We ship some archdef tarballs to speed ATLAS build. +- spkg-install: If you update atlas to a new version make sure that the + + ATLAS_OSTYPE, ATLAS_MACHTYPE, and ATLAS_ISAEXT variables in + spkg-install remain in sync with atlas' CONFIG/include/atlconf.h + +- The package is never installed on OS X, unless you set + SAGE_ATLAS_ARCH. + +Patches +~~~~~~~ + +- patches/detect.patch: Fix Itanium2 support on modern + + RHEL 5 and SLES 10 systems, work around -m64 issue on Itanium2, + and correctly detect number and speed of CPUs on a bunch of systems. + +- patches/arm_hard_floats.patch: make sure soft floats are not enforced + on ARM. +- patches/Makefile.patch: fix clean target. +- patches/do_not_force_mutex.patch: always use assembly over mutex + + since the mutex version fails to build a shared library. See #15045 + for details. + +- patches/glibc_scanf_workaround.patch: Workaround for the scanf bug + + in glibc-2.18 that breaks the atlas auto-tuning system. + +Configuration +~~~~~~~~~~~~~ + +The package can be configured via three environment variables: + +- SAGE_ATLAS_LIB=path + + If this environment variable is set, the libraries libatlas, + libcblas, liblapack, and libf77blas from the direcory "path" are + used and ATLAS is not compiled from source. The libraries can be + either static (endin in .a) or shared libraries (ending in .so or + .dylib). + +- SAGE_ATLAS_ARCH=arch[,isaext1][,isaext2]...[,isaextN] + + The given architectural default and instruction set extensions are + used instead of the empirical tuning. Available architectures are + + POWER3, POWER4, POWER5, PPCG4, PPCG5, POWER6, POWER7, IBMz9, + IBMz10, IBMz196, x86x87, x86SSE1, x86SSE2, x86SSE3, P5, P5MMX, + PPRO, PII, PIII, PM, CoreSolo, CoreDuo, Core2Solo, Core2, Corei1, + Corei2, Atom, P4, P4E, Efficeon, K7, HAMMER, AMD64K10h, AMDDOZER, + UNKNOWNx86, IA64Itan, IA64Itan2, USI, USII, USIII, USIV, UST1, UST2, + UnknownUS, MIPSR1xK, MIPSICE9, ARMv6, ARMv7 + + and instruction set extensions are + + VSX, AltiVec, AVXMAC, AVXFMA4, AVX, SSE3, SSE2, SSE1, 3DNow, NEON + + In addition, you can also set + +- SAGE_ATLAS_ARCH=fast picks defaults for a modern (2-3 year old) + + CPU of your processor line, and + +- SAGE_ATLAS_ARCH=base picks defaults that should work for a ~10 + + year old CPU. + + For example, + + SAGE_ATLAS_ARCH=Corei2,AVX,SSE3,SSE2,SSE1 + + would be appropriate for a Core i7 CPU. + +- If SAGE_ATLAS_SAVE_ARCHDEF = is given, then a new archdef + + file is created and saved to the given path. diff --git a/build/pkgs/atlas/SPKG.txt b/build/pkgs/atlas/SPKG.txt deleted file mode 100644 index eb015aa4ec4..00000000000 --- a/build/pkgs/atlas/SPKG.txt +++ /dev/null @@ -1,85 +0,0 @@ -= ATLAS = - -== Description == - -This spkg builds ATLAS for Sage. - -== License == - -3-clause BSD - -== Upstream Contact == - - * Atlas devel mailing list. - * Clint Whaley has frequently answered questions from the Sage project - -== Dependencies == - - * Python - -== Special Update/Build Instructions == - - * src/lapack-x.y.z.tgz: The netlib lapack tarball. If you update this, - make sure you also update the LAPACK_TARBALL variable in spkg-install. - * src/ATLAS-lib: We are using a dummy autotools/libtools project - to repack the static ATLAS libraries into shared libraries. - * src/ARCHS: We ship some archdef tarballs to speed ATLAS build. - * spkg-install: If you update atlas to a new version make sure that the - ATLAS_OSTYPE, ATLAS_MACHTYPE, and ATLAS_ISAEXT variables in - spkg-install remain in sync with atlas' CONFIG/include/atlconf.h - * The package is never installed on OS X, unless you set SAGE_ATLAS_ARCH. - -=== Patches === - * patches/detect.patch: Fix Itanium2 support on modern - RHEL 5 and SLES 10 systems, work around -m64 issue on Itanium2, - and correctly detect number and speed of CPUs on a bunch of systems. - * patches/arm_hard_floats.patch: make sure soft floats are not enforced on ARM. - * patches/Makefile.patch: fix clean target. - * patches/do_not_force_mutex.patch: always use assembly over mutex - since the mutex version fails to build a shared library. See #15045 - for details. - * patches/glibc_scanf_workaround.patch: Workaround for the scanf bug - in glibc-2.18 that breaks the atlas auto-tuning system. - -=== Configuration === -The package can be configured via three environment variables: - - * SAGE_ATLAS_LIB=path - If this environment variable is set, the libraries libatlas, - libcblas, liblapack, and libf77blas from the direcory "path" are - used and ATLAS is not compiled from source. The libraries can be - either static (endin in .a) or shared libraries (ending in .so or - .dylib). - - * SAGE_ATLAS_ARCH=arch[,isaext1][,isaext2]...[,isaextN] - The given architectural default and instruction set extensions are - used instead of the empirical tuning. Available architectures are - - POWER3, POWER4, POWER5, PPCG4, PPCG5, POWER6, POWER7, IBMz9, - IBMz10, IBMz196, x86x87, x86SSE1, x86SSE2, x86SSE3, P5, P5MMX, - PPRO, PII, PIII, PM, CoreSolo, CoreDuo, Core2Solo, Core2, Corei1, - Corei2, Atom, P4, P4E, Efficeon, K7, HAMMER, AMD64K10h, AMDDOZER, - UNKNOWNx86, IA64Itan, IA64Itan2, USI, USII, USIII, USIV, UST1, UST2, - UnknownUS, MIPSR1xK, MIPSICE9, ARMv6, ARMv7 - - and instruction set extensions are - - VSX, AltiVec, AVXMAC, AVXFMA4, AVX, SSE3, SSE2, SSE1, 3DNow, NEON - - In addition, you can also set - - - SAGE_ATLAS_ARCH=fast picks defaults for a modern (2-3 year old) - CPU of your processor line, and - - - SAGE_ATLAS_ARCH=base picks defaults that should work for a ~10 - year old CPU. - - For example, - - SAGE_ATLAS_ARCH=Corei2,AVX,SSE3,SSE2,SSE1 - - would be appropriate for a Core i7 CPU. - - * If SAGE_ATLAS_SAVE_ARCHDEF = is given, then a new archdef - file is created and saved to the given path. - diff --git a/build/pkgs/autotools/SPKG.txt b/build/pkgs/autotools/SPKG.rst similarity index 63% rename from build/pkgs/autotools/SPKG.txt rename to build/pkgs/autotools/SPKG.rst index 11919b30bfa..7df67e23a8e 100644 --- a/build/pkgs/autotools/SPKG.txt +++ b/build/pkgs/autotools/SPKG.rst @@ -1,15 +1,17 @@ -= autotools = +autotools +========= -== Description == +Description +----------- This package contains a recent version of Texinfo, GNU m4, and help2man. It contains the git repository of autoconf, automake and libtool. -For the latter 3 packages (commonly referred to as "autotools"), -many different versions are installed, by checking out the versions -from the git repo and building/installing them separately. Since the -complete git repository is shipped in the spkg, this does not require -internet access. +For the latter 3 packages (commonly referred to as "autotools"), many +different versions are installed, by checking out the versions from the +git repo and building/installing them separately. Since the complete git +repository is shipped in the spkg, this does not require internet +access. For Texinfo, m4 and help2man, just one version is installed. These are prerequisites for autotools. Moreover, Texinfo is often needed for @@ -24,33 +26,43 @@ version is run. The goal of all this is to make it easier to patch configure.ac or Makefile.am files inside a spkg. By using the same version of autotools as originally used, the patch files should be relatively small. The environment variables AUTOCONF_VERSION, -AUTOMAKE_VERSION and LIBTOOL_VERSION can be used to override the -chosen version. +AUTOMAKE_VERSION and LIBTOOL_VERSION can be used to override the chosen +version. -== License == +License +------- GNU General Public License version 3 or later. -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- -* http://www.gnu.org/software/texinfo/ -* http://www.gnu.org/software/m4/ -* http://www.gnu.org/software/help2man/ -* http://www.gnu.org/software/autoconf/ -* http://www.gnu.org/software/automake/ -* http://www.gnu.org/software/libtool/ +- http://www.gnu.org/software/texinfo/ +- http://www.gnu.org/software/m4/ +- http://www.gnu.org/software/help2man/ +- http://www.gnu.org/software/autoconf/ +- http://www.gnu.org/software/automake/ +- http://www.gnu.org/software/libtool/ -== Dependencies == +Dependencies +------------ To install the package: -* Perl -* Git + +- Perl +- Git To update the package: -* Sage with autotools package installed -* Internet access -== Special Update/Build Instructions == +- Sage with autotools package installed +- Internet access + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- The file spkg-src can be used to automatically create the upstream tarball from the git repositories. This obviously requires internet @@ -60,6 +72,7 @@ The file version-list defines the list of versions installed by this spkg. If you edit this, you must update Makefile.build using the spkg-write-makefile script. After optionally updating the git repos using spkg-src, you need to run - ./spkg-write-makefile >Makefile.build -This must be run in a Sage shell, with the autotools spkg -installed. + + ./spkg-write-makefile >Makefile.build + +This must be run in a Sage shell, with the autotools spkg installed. diff --git a/build/pkgs/awali/SPKG.rst b/build/pkgs/awali/SPKG.rst new file mode 100644 index 00000000000..a0b7f840e5e --- /dev/null +++ b/build/pkgs/awali/SPKG.rst @@ -0,0 +1,45 @@ +awali +===== + +Description +----------- + +Awali is a software platform dedicated to the computation of, and with, +finite state machines. Here finite state machines is to be understood in +the broadest possible sense: finite automata with output — often called +transducers then — or even more generally finite automata with +multiplicity, that is, automata that not only accept, or recognize, +sequences of symbols but compute for every such sequence a \`value' that +is associated with it and which can be taken in any semiring. Hence the +variety of situations that can thus be modellized. + +License +------- + +- GPL 3.0 + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Website: http://vaucanson-project.org/Awali/index.html +- Releases: http://files.vaucanson-project.org/tarballs/ + +Dependencies +------------ + +- Python +- CMake +- Cython +- ncurses + +- graphviz must be installed from your distro, and available in the + path. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- None diff --git a/build/pkgs/awali/SPKG.txt b/build/pkgs/awali/SPKG.txt deleted file mode 100644 index 37d42039b32..00000000000 --- a/build/pkgs/awali/SPKG.txt +++ /dev/null @@ -1,33 +0,0 @@ -= awali = - -== Description == - -Awali is a software platform dedicated to the computation of, and with, finite -state machines. Here finite state machines is to be understood in the broadest -possible sense: finite automata with output — often called transducers then — or -even more generally finite automata with multiplicity, that is, automata that -not only accept, or recognize, sequences of symbols but compute for every such -sequence a `value' that is associated with it and which can be taken in any -semiring. Hence the variety of situations that can thus be modellized. - -== License == - - * GPL 3.0 - -== Upstream Contact == - - * Website: http://vaucanson-project.org/Awali/index.html - * Releases: http://files.vaucanson-project.org/tarballs/ - -== Dependencies == - - * Python - * CMake - * Cython - * ncurses - - * graphviz must be installed from your distro, and available in the path. - -== Special Update/Build Instructions == - - * None diff --git a/build/pkgs/babel/SPKG.txt b/build/pkgs/babel/SPKG.rst similarity index 73% rename from build/pkgs/babel/SPKG.txt rename to build/pkgs/babel/SPKG.rst index ae0451d58be..265c2757cee 100644 --- a/build/pkgs/babel/SPKG.txt +++ b/build/pkgs/babel/SPKG.rst @@ -1,6 +1,8 @@ -= babel = +babel +===== -== Description == +Description +----------- Internationalization utilities diff --git a/build/pkgs/backports_abc/SPKG.txt b/build/pkgs/backports_abc/SPKG.rst similarity index 54% rename from build/pkgs/backports_abc/SPKG.txt rename to build/pkgs/backports_abc/SPKG.rst index e6f57200183..25187ea00b0 100644 --- a/build/pkgs/backports_abc/SPKG.txt +++ b/build/pkgs/backports_abc/SPKG.rst @@ -1,18 +1,24 @@ -= backports_abc = +backports_abc +============= -== Description == +Description +----------- A backport of recent additions to the 'collections.abc' module. -== License == +License +------- Python Software Foundation License -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- Home page: https://pypi.python.org/pypi/backports_abc -== Dependencies == +Dependencies +------------ Python, Setuptools - diff --git a/build/pkgs/backports_functools_lru_cache/SPKG.rst b/build/pkgs/backports_functools_lru_cache/SPKG.rst new file mode 100644 index 00000000000..b8bcbc948e7 --- /dev/null +++ b/build/pkgs/backports_functools_lru_cache/SPKG.rst @@ -0,0 +1,8 @@ +backports.functools_lru_cache +============================= + +Description +----------- + +A backport of functools.lru_cache from Python 3.3 as published at +ActiveState. diff --git a/build/pkgs/backports_functools_lru_cache/SPKG.txt b/build/pkgs/backports_functools_lru_cache/SPKG.txt deleted file mode 100644 index ecee62e1137..00000000000 --- a/build/pkgs/backports_functools_lru_cache/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= backports.functools_lru_cache = - -== Description == - -A backport of functools.lru_cache from Python 3.3 as published at ActiveState. diff --git a/build/pkgs/backports_shutil_get_terminal_size/SPKG.rst b/build/pkgs/backports_shutil_get_terminal_size/SPKG.rst new file mode 100644 index 00000000000..87dd9ddeeb8 --- /dev/null +++ b/build/pkgs/backports_shutil_get_terminal_size/SPKG.rst @@ -0,0 +1,7 @@ +backports.shutil_get_terminal_size +================================== + +Description +----------- + +A backport of the get_terminal_size function from Python 3.3's shutil. diff --git a/build/pkgs/backports_shutil_get_terminal_size/SPKG.txt b/build/pkgs/backports_shutil_get_terminal_size/SPKG.txt deleted file mode 100644 index 6aa6bcfc6ce..00000000000 --- a/build/pkgs/backports_shutil_get_terminal_size/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= backports.shutil_get_terminal_size = - -== Description == - -A backport of the get_terminal_size function from Python 3.3's shutil. diff --git a/build/pkgs/backports_ssl_match_hostname/SPKG.rst b/build/pkgs/backports_ssl_match_hostname/SPKG.rst new file mode 100644 index 00000000000..d43ba82b16c --- /dev/null +++ b/build/pkgs/backports_ssl_match_hostname/SPKG.rst @@ -0,0 +1,33 @@ +backports.ssl_match_hostname +============================ + +Description +----------- + +This backport brings match_hostname() to users of Python 2.x + +License +------- + +Python Software Foundation License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Home page: https://pypi.python.org/pypi/backports.ssl_match_hostname + +Dependencies +------------ + +Python, Setuptools + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- Unpack the tarball +- rename backports.ssl_match_hostname -> backports_ssl_match_hostname +- Tar as backports_ssl_match_hostname.VERSION.tar.gz diff --git a/build/pkgs/backports_ssl_match_hostname/SPKG.txt b/build/pkgs/backports_ssl_match_hostname/SPKG.txt deleted file mode 100644 index 503b01228f0..00000000000 --- a/build/pkgs/backports_ssl_match_hostname/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= backports.ssl_match_hostname = - -== Description == - -This backport brings match_hostname() to users of -Python 2.x - -== License == - -Python Software Foundation License - -== Upstream Contact == - -Home page: https://pypi.python.org/pypi/backports.ssl_match_hostname - -== Dependencies == - -Python, Setuptools - -== Special Update/Build Instructions == - -* Unpack the tarball -* rename backports.ssl_match_hostname -> backports_ssl_match_hostname -* Tar as backports_ssl_match_hostname.VERSION.tar.gz diff --git a/build/pkgs/barvinok/SPKG.rst b/build/pkgs/barvinok/SPKG.rst new file mode 100644 index 00000000000..6255ae14973 --- /dev/null +++ b/build/pkgs/barvinok/SPKG.rst @@ -0,0 +1,21 @@ +barvinok +======== + +Description +----------- + +barvinok is a library for counting the number of integer points in +parametric and non-parametric polytopes as well as projections of such +sets. + +License +------- + +GPL v2 + +.. _upstream_contact: + +Upstream Contact +---------------- + +- http://groups.google.com/group/isl-development diff --git a/build/pkgs/barvinok/SPKG.txt b/build/pkgs/barvinok/SPKG.txt deleted file mode 100644 index 6b658a9a21c..00000000000 --- a/build/pkgs/barvinok/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= barvinok = - -== Description == - -barvinok is a library for counting the number of integer points -in parametric and non-parametric polytopes as well as projections -of such sets. - -== License == - -GPL v2 - -== Upstream Contact == - - * http://groups.google.com/group/isl-development diff --git a/build/pkgs/benzene/SPKG.rst b/build/pkgs/benzene/SPKG.rst new file mode 100644 index 00000000000..ba4b3091095 --- /dev/null +++ b/build/pkgs/benzene/SPKG.rst @@ -0,0 +1,30 @@ +Benzene +======= + +Description +----------- + +Benzene is a program for the efficient generation of all nonisomorphic +fusenes and benzenoids with a given number of faces. Fusenes are planar +polycyclic hydrocarbons with all bounded faces hexagons. Benzenoids are +fusenes that are subgraphs of the hexagonal lattice. + +License +------- + +Benzene is licensed under the GNU General Public License v2 or later ( +June 2007 ) + +.. _upstream_contact: + +Upstream Contact +---------------- + +Benzene was written by Gunnar Brinkmann and Gilles Caporossi. This +version was adapted by Gunnar Brinkmann and Nico Van Cleemput for +Grinvin. http://www.grinvin.org/ + +Dependencies +------------ + +- None diff --git a/build/pkgs/benzene/SPKG.txt b/build/pkgs/benzene/SPKG.txt deleted file mode 100644 index 58ff36aa478..00000000000 --- a/build/pkgs/benzene/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= Benzene = - -== Description == -Benzene is a program for the efficient generation of all nonisomorphic fusenes and benzenoids with a given number of faces. Fusenes are planar polycyclic hydrocarbons with all bounded faces hexagons. Benzenoids are fusenes that are subgraphs of the hexagonal lattice. - -== License == -Benzene is licensed under the GNU General Public License v2 or later ( June 2007 ) - -== Upstream Contact == -Benzene was written by Gunnar Brinkmann and Gilles Caporossi. This version was adapted by Gunnar Brinkmann and Nico Van Cleemput for Grinvin. -http://www.grinvin.org/ - -== Dependencies == - * None - diff --git a/build/pkgs/bleach/SPKG.txt b/build/pkgs/bleach/SPKG.rst similarity index 50% rename from build/pkgs/bleach/SPKG.txt rename to build/pkgs/bleach/SPKG.rst index d999ee7f8a5..12f5838dbf8 100644 --- a/build/pkgs/bleach/SPKG.txt +++ b/build/pkgs/bleach/SPKG.rst @@ -1,17 +1,24 @@ -= bleach = +bleach +====== -== Description == +Description +----------- An easy safelist-based HTML-sanitizing tool. -== License == +License +------- Apache License v2 -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- Home Page: https://github.com/mozilla/bleach -== Dependencies == +Dependencies +------------ Python, html5lib, six diff --git a/build/pkgs/bliss/SPKG.rst b/build/pkgs/bliss/SPKG.rst new file mode 100644 index 00000000000..744e2ea9dc9 --- /dev/null +++ b/build/pkgs/bliss/SPKG.rst @@ -0,0 +1,34 @@ +.. _bliss_0.73debian_1: + +bliss 0.73+debian-1 +=================== + +Description +----------- + +bliss is an open source tool for computing automorphism groups and +canonical forms of graphs. + +License +------- + +LGPL + +.. _upstream_contact: + +Upstream Contact +---------------- + +Bliss is currently being maintained by Tommi Junttila and Petteri Kaski. + +http://www.tcs.tkk.fi/Software/bliss/index.html + +We apply patches generated from https://github.com/mkoeppe/bliss (branch +apply_debian_patches) as our upstream. This tracks the patches from the +Debian package, adding an autotools build system and adjusting the +include file locations. + +Dependencies +------------ + +None diff --git a/build/pkgs/bliss/SPKG.txt b/build/pkgs/bliss/SPKG.txt deleted file mode 100644 index cff1683e16e..00000000000 --- a/build/pkgs/bliss/SPKG.txt +++ /dev/null @@ -1,26 +0,0 @@ -= bliss 0.73+debian-1 = - -== Description == - -bliss is an open source tool for computing automorphism groups and canonical -forms of graphs. - -== License == - -LGPL - -== Upstream Contact == - -Bliss is currently being maintained by Tommi Junttila and Petteri Kaski. - -http://www.tcs.tkk.fi/Software/bliss/index.html - -We apply patches generated from https://github.com/mkoeppe/bliss -(branch apply_debian_patches) as our upstream. This tracks the -patches from the Debian package, adding an autotools build system -and adjusting the include file locations. - -== Dependencies == - -None - diff --git a/build/pkgs/boost/SPKG.txt b/build/pkgs/boost/SPKG.rst similarity index 51% rename from build/pkgs/boost/SPKG.txt rename to build/pkgs/boost/SPKG.rst index 950edcbbcea..619d9d04d25 100644 --- a/build/pkgs/boost/SPKG.txt +++ b/build/pkgs/boost/SPKG.rst @@ -1,17 +1,24 @@ -= boost = +boost +===== -== Description == +Description +----------- Boost provides free peer-reviewed portable C++ source libraries. -== License == +License +------- Boost software license (GPL compatible) -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- Home page: http://boost.org -== Dependencies == +Dependencies +------------ None diff --git a/build/pkgs/boost_cropped/SPKG.rst b/build/pkgs/boost_cropped/SPKG.rst new file mode 100644 index 00000000000..11625210007 --- /dev/null +++ b/build/pkgs/boost_cropped/SPKG.rst @@ -0,0 +1,39 @@ +Boost +===== + +Description +----------- + +Boost provides free peer-reviewed portable C++ source libraries. + +We emphasize libraries that work well with the C++ Standard Library. +Boost libraries are intended to be widely useful, and usable across a +broad spectrum of applications. The Boost license encourages both +commercial and non-commercial use. + +We aim to establish "existing practice" and provide reference +implementations so that Boost libraries are suitable for eventual +standardization. Ten Boost libraries are already included in the C++ +Standards Committee's Library Technical Report (TR1) and will be in the +new C++0x Standard now being finalized. C++0x will also include several +more Boost libraries in addition to those from TR1. More Boost libraries +are proposed for TR2. + +Website: http://www.boost.org/ + +License +------- + +Boost Software License - see http://www.boost.org/users/license.html + +.. _upstream_contact: + +Upstream Contact +---------------- + +See mailing list page at http://www.boost.org/community/groups.html + +Dependencies +------------ + +None diff --git a/build/pkgs/boost_cropped/SPKG.txt b/build/pkgs/boost_cropped/SPKG.txt deleted file mode 100644 index f23b9d5cc2c..00000000000 --- a/build/pkgs/boost_cropped/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= Boost = - -== Description == - -Boost provides free peer-reviewed portable C++ source libraries. - -We emphasize libraries that work well with the C++ Standard Library. Boost libraries are intended to be widely useful, and usable across a broad spectrum of applications. The Boost license encourages both commercial and non-commercial use. - -We aim to establish "existing practice" and provide reference implementations so that Boost libraries are suitable for eventual standardization. Ten Boost libraries are already included in the C++ Standards Committee's Library Technical Report (TR1) and will be in the new C++0x Standard now being finalized. C++0x will also include several more Boost libraries in addition to those from TR1. More Boost libraries are proposed for TR2. - -Website: http://www.boost.org/ - -== License == - -Boost Software License - see http://www.boost.org/users/license.html - -== Upstream Contact == - -See mailing list page at http://www.boost.org/community/groups.html - -== Dependencies == - -None diff --git a/build/pkgs/brial/SPKG.txt b/build/pkgs/brial/SPKG.rst similarity index 86% rename from build/pkgs/brial/SPKG.txt rename to build/pkgs/brial/SPKG.rst index 3525513c243..d16585ab57f 100644 --- a/build/pkgs/brial/SPKG.txt +++ b/build/pkgs/brial/SPKG.rst @@ -1,6 +1,8 @@ -= BRiAl = +BRiAl +===== -== Description == +Description +----------- BRiAl is the successor to PolyBoRi. @@ -14,10 +16,14 @@ complex polynomial systems, as well as sophisticated and extendable strategies for Gröbner base computation. PolyBoRi features a powerful reference implementation for Gröbner basis computation. -== License == +License +------- GPL version 2 or later -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- https://github.com/BRiAl/BRiAl diff --git a/build/pkgs/buckygen/SPKG.rst b/build/pkgs/buckygen/SPKG.rst new file mode 100644 index 00000000000..dd82768c260 --- /dev/null +++ b/build/pkgs/buckygen/SPKG.rst @@ -0,0 +1,29 @@ +Buckygen +======== + +Description +----------- + +Buckygen is a program for the efficient generation of all nonisomorphic +fullerenes. These are triangulations where all vertices have degree 5 or +6. Or if the dual representation is used: cubic plane graphs where all +faces are pentagons or hexagons. + +License +------- + +Buckygen is licensed under the GNU General Public License v3 ( June 2007 +) + +.. _upstream_contact: + +Upstream Contact +---------------- + +Buckygen was mainly written by Jan Goedgebeur, +jan.goedgebeur[at]ugent.be. http://caagt.ugent.be/buckygen/ + +Dependencies +------------ + +- None diff --git a/build/pkgs/buckygen/SPKG.txt b/build/pkgs/buckygen/SPKG.txt deleted file mode 100644 index 884f75d275d..00000000000 --- a/build/pkgs/buckygen/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= Buckygen = - -== Description == -Buckygen is a program for the efficient generation of all nonisomorphic fullerenes. These are triangulations where all vertices have degree 5 or 6. Or if the dual representation is used: cubic plane graphs where all faces are pentagons or hexagons. - -== License == -Buckygen is licensed under the GNU General Public License v3 ( June 2007 ) - -== Upstream Contact == -Buckygen was mainly written by Jan Goedgebeur, jan.goedgebeur[at]ugent.be. -http://caagt.ugent.be/buckygen/ - -== Dependencies == - * None - diff --git a/build/pkgs/bzip2/SPKG.txt b/build/pkgs/bzip2/SPKG.rst similarity index 54% rename from build/pkgs/bzip2/SPKG.txt rename to build/pkgs/bzip2/SPKG.rst index 63950e6014d..322fd411846 100644 --- a/build/pkgs/bzip2/SPKG.txt +++ b/build/pkgs/bzip2/SPKG.rst @@ -1,6 +1,8 @@ -= bzip2 = +bzip2 +===== -== Description == +Description +----------- bzip2 is a freely available, patent free, high-quality data compressor. It typically compresses files to within 10% to 15% of the best available @@ -8,25 +10,34 @@ techniques (the PPM family of statistical compressors), whilst being around twice as fast at compression and six times faster at decompression. -== License == +License +------- BSD-style -== Upstream Contact == +.. _upstream_contact: - * Website http://bzip.org/ - * Author: Julian Seward +Upstream Contact +---------------- -== Dependencies == +- Website http://bzip.org/ +- Author: Julian Seward + +Dependencies +------------ None -== Special Update/Build Instructions == +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- -This package must not be bzip2 compressed, so create it using -tar c bzip2-1.0.6 | gzip --best >bzip2-1.0.6.spkg +This package must not be bzip2 compressed, so create it using tar c +bzip2-1.0.6 \| gzip --best >bzip2-1.0.6.spkg -The build system has been autotoolized based on a patch by the Suse folk at +The build system has been autotoolized based on a patch by the Suse folk +at http://ftp.uni-kl.de/pub/linux/suse/people/sbrabec/bzip2/for_downstream/bzip2-1.0.6-autoconfiscated.patch See patches/autotools and spkg-src for details. diff --git a/build/pkgs/cbc/SPKG.rst b/build/pkgs/cbc/SPKG.rst new file mode 100644 index 00000000000..397f43f9b74 --- /dev/null +++ b/build/pkgs/cbc/SPKG.rst @@ -0,0 +1,38 @@ +.. _coin_or_cbc: + +COIN-OR / CBC +============= + +Description +----------- + +The Computational Infrastructure for Operations Research (COIN-OR**, or +simply COIN) project is an initiative to spur the development of +open-source software for the operations research community. + +The COIN Branch and Cut solver (CBC) is an open-source mixed-integer +program (MIP) solver written in C++. CBC is intended to be used +primarily as a callable library to create customized branch-and-cut +solvers. A basic, stand-alone executable version is also available. CBC +is an active open-source project led by John Forrest at www.coin-or.org. + +License +------- + +Eclipse Public License, Version 1.0 (EPL-1.0) +(http://opensource.org/licenses/eclipse-1.0) + +.. _upstream_contact: + +Upstream Contact +---------------- + +- John Forrest +- Robin Lougee-Heimer + +.. _project_home_page: + +Project Home Page +----------------- + +- https://projects.coin-or.org/Cbc diff --git a/build/pkgs/cbc/SPKG.txt b/build/pkgs/cbc/SPKG.txt deleted file mode 100644 index 5d0d63b3728..00000000000 --- a/build/pkgs/cbc/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= COIN-OR / CBC = - -== Description == - -The Computational Infrastructure for Operations Research (COIN-OR**, -or simply COIN) project is an initiative to spur the development of -open-source software for the operations research community. - -The COIN Branch and Cut solver (CBC) is an open-source -mixed-integer program (MIP) solver written in C++. CBC is intended to -be used primarily as a callable library to create customized -branch-and-cut solvers. A basic, stand-alone executable version is -also available. CBC is an active open-source project led by John -Forrest at www.coin-or.org. - -== License == - -Eclipse Public License, Version 1.0 (EPL-1.0) -(http://opensource.org/licenses/eclipse-1.0) - -== Upstream Contact == - - * John Forrest - * Robin Lougee-Heimer - -== Project Home Page == - - * https://projects.coin-or.org/Cbc diff --git a/build/pkgs/ccache/SPKG.rst b/build/pkgs/ccache/SPKG.rst new file mode 100644 index 00000000000..5f265fa9cbe --- /dev/null +++ b/build/pkgs/ccache/SPKG.rst @@ -0,0 +1,23 @@ +ccache +====== + +Description +----------- + +ccache is a compiler cache. It speeds up recompilation by caching +previous compilations and detecting when the same compilation is being +done again. Supported languages are C, C++, Objective-C and +Objective-C++. + +License +------- + +GNU General Public License version 3 or later + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Author: Andrew Tridgell +- Website: http://ccache.samba.org/ diff --git a/build/pkgs/ccache/SPKG.txt b/build/pkgs/ccache/SPKG.txt deleted file mode 100644 index f8abc4bb638..00000000000 --- a/build/pkgs/ccache/SPKG.txt +++ /dev/null @@ -1,17 +0,0 @@ -= ccache = - -== Description == - -ccache is a compiler cache. It speeds up recompilation by caching -previous compilations and detecting when the same compilation is being -done again. -Supported languages are C, C++, Objective-C and Objective-C++. - -== License == - -GNU General Public License version 3 or later - -== Upstream Contact == - - * Author: Andrew Tridgell - * Website: http://ccache.samba.org/ diff --git a/build/pkgs/cddlib/SPKG.rst b/build/pkgs/cddlib/SPKG.rst new file mode 100644 index 00000000000..aa356cdd1cd --- /dev/null +++ b/build/pkgs/cddlib/SPKG.rst @@ -0,0 +1,39 @@ +cddlib +====== + +Description +----------- + +The C-library cddlib is a C implementation of the Double Description +Method of Motzkin et al. for generating all vertices (i.e. extreme +points) and extreme rays of a general convex polyhedron in R^d given by +a system of linear inequalities: + + P = { x=(x1, ..., xd)^T : b - A x >= 0 } + +where A is a given m x d real matrix, b is a given m-vector and 0 is the +m-vector of all zeros. + +The program can be used for the reverse operation (i.e. convex hull +computation). This means that one can move back and forth between an +inequality representation and a generator (i.e. vertex and ray) +representation of a polyhedron with cdd. Also, cdd can solve a linear +programming problem, i.e. a problem of maximizing and minimizing a +linear function over P. + +License +------- + +GPL v2 + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://github.com/cddlib/cddlib + +Dependencies +------------ + +- gmp (or its fork mpir) diff --git a/build/pkgs/cddlib/SPKG.txt b/build/pkgs/cddlib/SPKG.txt deleted file mode 100644 index 3254e8cef89..00000000000 --- a/build/pkgs/cddlib/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= cddlib = - -== Description == -The C-library cddlib is a C implementation of the Double Description -Method of Motzkin et al. for generating all vertices (i.e. extreme points) -and extreme rays of a general convex polyhedron in R^d given by a system -of linear inequalities: - - P = { x=(x1, ..., xd)^T : b - A x >= 0 } - -where A is a given m x d real matrix, b is a given m-vector -and 0 is the m-vector of all zeros. - -The program can be used for the reverse operation (i.e. convex hull -computation). This means that one can move back and forth between -an inequality representation and a generator (i.e. vertex and ray) -representation of a polyhedron with cdd. Also, cdd can solve a linear -programming problem, i.e. a problem of maximizing and minimizing -a linear function over P. - -== License == -GPL v2 - -== Upstream Contact == -https://github.com/cddlib/cddlib - -== Dependencies == - * gmp (or its fork mpir) diff --git a/build/pkgs/certifi/SPKG.rst b/build/pkgs/certifi/SPKG.rst new file mode 100644 index 00000000000..0db5472aa61 --- /dev/null +++ b/build/pkgs/certifi/SPKG.rst @@ -0,0 +1,24 @@ +Certifi +======= + +Description +----------- + +Python package for providing Mozilla's CA Bundle. + +License +------- + +ISC + +.. _upstream_contact: + +Upstream Contact +---------------- + +Home page: https://pypi.python.org/pypi/certifi + +Dependencies +------------ + +Python, Setuptools diff --git a/build/pkgs/certifi/SPKG.txt b/build/pkgs/certifi/SPKG.txt deleted file mode 100644 index 3985ae82ea4..00000000000 --- a/build/pkgs/certifi/SPKG.txt +++ /dev/null @@ -1,18 +0,0 @@ -= Certifi = - -== Description == - -Python package for providing Mozilla's CA Bundle. - -== License == - -ISC - -== Upstream Contact == - -Home page: https://pypi.python.org/pypi/certifi - -== Dependencies == - -Python, Setuptools - diff --git a/build/pkgs/cliquer/SPKG.rst b/build/pkgs/cliquer/SPKG.rst new file mode 100644 index 00000000000..9445d46a51c --- /dev/null +++ b/build/pkgs/cliquer/SPKG.rst @@ -0,0 +1,32 @@ +Cliquer +======= + +Description +----------- + +Cliquer is a set of C routines for finding cliques in an arbitrary +weighted graph. It uses an exact branch-and-bound algorithm recently +developed by Patr Ostergard. + +License +------- + +GNU General Public License v2 + +.. _upstream_contact: + +Upstream Contact +---------------- + +Cliquer was mainly written by Sampo Niskanen, sampo.niskanenQiki.fi +(Q=@). http://users.tkk.fi/pat/cliquer.html + +Dependencies +------------ + +- None + +Patches +------- + +- autotoolized - see https://github.com/dimpase/autocliquer diff --git a/build/pkgs/cliquer/SPKG.txt b/build/pkgs/cliquer/SPKG.txt deleted file mode 100644 index 1dfd7d48e6d..00000000000 --- a/build/pkgs/cliquer/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= Cliquer = - -== Description == -Cliquer is a set of C routines for finding cliques in an arbitrary -weighted graph. It uses an exact branch-and-bound algorithm recently -developed by Patr Ostergard. - -== License == -GNU General Public License v2 - -== Upstream Contact == -Cliquer was mainly written by Sampo Niskanen, sampo.niskanenQiki.fi (Q=@). -http://users.tkk.fi/pat/cliquer.html - -== Dependencies == - * None - -== Patches == - * autotoolized - see https://github.com/dimpase/autocliquer diff --git a/build/pkgs/cmake/SPKG.rst b/build/pkgs/cmake/SPKG.rst new file mode 100644 index 00000000000..3654a5b0f35 --- /dev/null +++ b/build/pkgs/cmake/SPKG.rst @@ -0,0 +1,38 @@ +CMake +===== + +Description +----------- + +The "cmake" executable is the CMake command-line interface. It may be +used to configure projects in scripts. Project configuration settings +may be specified on the command line with the -D option. The -i option +will cause cmake to interactively prompt for such settings. + +CMake is a cross-platform build system generator. Projects specify their +build process with platform-independent CMake listfiles included in each +directory of a source tree with the name CMakeLists.txt. Users build a +project by using CMake to generate a build system for a native tool on +their platform. + +Website: www.cmake.org + +License +------- + +CMake is distributed under the OSI-approved BSD 3-clause License. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- cmake-developers@cmake.org + +Dependencies +------------ + +- curl +- zlib +- bzip2 +- xz diff --git a/build/pkgs/cmake/SPKG.txt b/build/pkgs/cmake/SPKG.txt deleted file mode 100644 index 57770de3604..00000000000 --- a/build/pkgs/cmake/SPKG.txt +++ /dev/null @@ -1,32 +0,0 @@ -= CMake = - -== Description == - -The "cmake" executable is the CMake command-line interface. It may be -used to configure projects in scripts. Project configuration settings -may be specified on the command line with the -D option. The -i -option will cause cmake to interactively prompt for such settings. - -CMake is a cross-platform build system generator. Projects specify -their build process with platform-independent CMake listfiles -included in each directory of a source tree with the name -CMakeLists.txt. Users build a project by using CMake to generate a -build system for a native tool on their platform. - -Website: www.cmake.org - -== License == - -CMake is distributed under the OSI-approved BSD 3-clause License. - -== Upstream Contact == - - * cmake-developers@cmake.org - -== Dependencies == - -* curl -* zlib -* bzip2 -* xz - diff --git a/build/pkgs/cocoalib/SPKG.rst b/build/pkgs/cocoalib/SPKG.rst new file mode 100644 index 00000000000..c958335a964 --- /dev/null +++ b/build/pkgs/cocoalib/SPKG.rst @@ -0,0 +1,34 @@ +cocoalib +======== + +Description +----------- + +CoCoA is a program to compute with numbers and polynomials. + +License +------- + +- GPL v3 + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Authors: http://cocoa.dima.unige.it/research/ +- Email: cocoa@dima.unige.it +- Website: http://cocoa.dima.unige.it/ +- Releases: http://cocoa.dima.unige.it/cocoalib/ + +Dependencies +------------ + +- GMP/MPIR + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/cocoalib/SPKG.txt b/build/pkgs/cocoalib/SPKG.txt deleted file mode 100644 index 153cf580470..00000000000 --- a/build/pkgs/cocoalib/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= cocoalib = - -== Description == - -CoCoA is a program to compute with numbers and polynomials. - -== License == - - * GPL v3 - -== Upstream Contact == - - * Authors: http://cocoa.dima.unige.it/research/ - * Email: cocoa@dima.unige.it - * Website: http://cocoa.dima.unige.it/ - * Releases: http://cocoa.dima.unige.it/cocoalib/ - -== Dependencies == - - * GMP/MPIR - -== Special Update/Build Instructions == - -None. diff --git a/build/pkgs/combinatorial_designs/SPKG.rst b/build/pkgs/combinatorial_designs/SPKG.rst new file mode 100644 index 00000000000..18d661e9fc2 --- /dev/null +++ b/build/pkgs/combinatorial_designs/SPKG.rst @@ -0,0 +1,31 @@ +.. _combinatorial_designs: + +Combinatorial Designs +===================== + +Description +----------- + +Data for Combinatorial Designs. Current content: + +- The table of MOLS (10 000 integers) from the Handbook of + Combinatorial + + Designs, 2ed. + +License +------- + +Public domain. + +.. _upstream_contact: + +Upstream Contact +---------------- + + None + +Dependencies +------------ + +N/A diff --git a/build/pkgs/combinatorial_designs/SPKG.txt b/build/pkgs/combinatorial_designs/SPKG.txt deleted file mode 100644 index 197b3cd928b..00000000000 --- a/build/pkgs/combinatorial_designs/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= Combinatorial Designs = - -== Description == - -Data for Combinatorial Designs. Current content: - -- The table of MOLS (10 000 integers) from the Handbook of Combinatorial - Designs, 2ed. - -== License == - -Public domain. - -== Upstream Contact == - - None - -== Dependencies == - -N/A - diff --git a/build/pkgs/compilerwrapper/SPKG.rst b/build/pkgs/compilerwrapper/SPKG.rst new file mode 100644 index 00000000000..9cb9735728b --- /dev/null +++ b/build/pkgs/compilerwrapper/SPKG.rst @@ -0,0 +1,38 @@ +.. _compiler_wrapper: + +Compiler Wrapper +================ + +Description +----------- + +A wrapper for compiler and binutils that sets rpath, removes +optimizations on broken archs and gcc versions, and generally helps to +compile Sage more easily. + +License +------- + +GPL v2+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://bitbucket.org/vbraun/compilerwrapper Volker Braun + + +Dependencies +------------ + +- None + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +The src/ subdirectory is a clone of my mercurial repository at +https://bitbucket.org/vbraun/compilerwrapper. You can update the source +tree with "hg pull -u". diff --git a/build/pkgs/compilerwrapper/SPKG.txt b/build/pkgs/compilerwrapper/SPKG.txt deleted file mode 100644 index 8f364a787ff..00000000000 --- a/build/pkgs/compilerwrapper/SPKG.txt +++ /dev/null @@ -1,26 +0,0 @@ -= Compiler Wrapper = - -== Description == - -A wrapper for compiler and binutils that sets rpath, removes -optimizations on broken archs and gcc versions, and generally helps to -compile Sage more easily. - -== License == - -GPL v2+ - -== Upstream Contact == - -https://bitbucket.org/vbraun/compilerwrapper -Volker Braun - -== Dependencies == - - * None - -== Special Update/Build Instructions == - -The src/ subdirectory is a clone of my mercurial repository at -https://bitbucket.org/vbraun/compilerwrapper. You can update the -source tree with "hg pull -u". diff --git a/build/pkgs/configparser/SPKG.txt b/build/pkgs/configparser/SPKG.rst similarity index 83% rename from build/pkgs/configparser/SPKG.txt rename to build/pkgs/configparser/SPKG.rst index 6c687197d7d..a059c92aa0e 100644 --- a/build/pkgs/configparser/SPKG.txt +++ b/build/pkgs/configparser/SPKG.rst @@ -1,8 +1,11 @@ -= configparser = +configparser +============ -== Description == +Description +----------- -This library brings the updated configparser from Python 3.5 to Python 2.6-3.5. +This library brings the updated configparser from Python 3.5 to Python +2.6-3.5. The ancient ConfigParser module available in the standard library 2.x has seen a major update in Python 3.2. This is a backport of those @@ -11,12 +14,12 @@ changes so that they can be used directly in Python 2.6 - 3.5. To use the configparser backport instead of the built-in version on both Python 2 and Python 3, simply import it explicitly as a backport: - from backports import configparser + from backports import configparser If you'd like to use the backport on Python 2 and the built-in version on Python 3, use that invocation instead: - import configparser + import configparser For detailed documentation consult the vanilla version at http://docs.python.org/3/library/configparser.html. diff --git a/build/pkgs/configure/SPKG.txt b/build/pkgs/configure/SPKG.rst similarity index 52% rename from build/pkgs/configure/SPKG.txt rename to build/pkgs/configure/SPKG.rst index 72f87196c77..437a9971436 100644 --- a/build/pkgs/configure/SPKG.txt +++ b/build/pkgs/configure/SPKG.rst @@ -1,25 +1,35 @@ -= Configure = +Configure +========= -== Description == +Description +----------- This package contains a tar archive of auto-generated files. They are shipped with Sage in case you do not have a sufficiently recent autotools version installed. -== License == +License +------- GPLv3+ -== Upstream Contact == +.. _upstream_contact: +Upstream Contact +---------------- -Automatically generated by Sage, use trac and/or sage-devel for questions. +Automatically generated by Sage, use trac and/or sage-devel for +questions. -== Dependencies == +Dependencies +------------ None -== Special Update/Build Instructions == +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- This tarball is automatically generated by Sage whenever you run the $SAGE_ROOT/bootstrap -s or the $SAGE_ROOT/src/bin/sage-update-version diff --git a/build/pkgs/conway_polynomials/SPKG.rst b/build/pkgs/conway_polynomials/SPKG.rst new file mode 100644 index 00000000000..0dc3da9cef2 --- /dev/null +++ b/build/pkgs/conway_polynomials/SPKG.rst @@ -0,0 +1,14 @@ +.. _conway_polynomials_database: + +Conway Polynomials Database +=========================== + +Description +----------- + + Contains a small database of Conway polynomials. + +Dependencies +------------ + +- Sage library diff --git a/build/pkgs/conway_polynomials/SPKG.txt b/build/pkgs/conway_polynomials/SPKG.txt deleted file mode 100644 index 7a2ddc1e5d2..00000000000 --- a/build/pkgs/conway_polynomials/SPKG.txt +++ /dev/null @@ -1,10 +0,0 @@ -= Conway Polynomials Database = - -== Description == - - Contains a small database of Conway polynomials. - -== Dependencies == - - * Sage library - diff --git a/build/pkgs/coxeter3/SPKG.rst b/build/pkgs/coxeter3/SPKG.rst new file mode 100644 index 00000000000..ce18a36c4db --- /dev/null +++ b/build/pkgs/coxeter3/SPKG.rst @@ -0,0 +1,55 @@ +coxeter3 +======== + +Description +----------- + +This package wraps Fokko Ducloux's Coxeter 3 C++ library + +Features: + +- General Coxeter groups, implemented through the combinatorics of + reduced words; +- Reduced expression and normal form computations; +- Bruhat ordering; +- Ordinary Kazhdan-Lusztig polynomials; +- Kazhdan-Lusztig polynomials with unequal parameters; +- Inverse Kazhdan-Lusztig polynomials; +- Cells and W-graphs; + +http://math.univ-lyon1.fr/~ducloux/coxeter/coxeter3/english/coxeter3_e.html + +This is a patched version done by Mike Hansen 2009-2013 and some fixes +by Nicolas M. Thiéry and Jean-Pierre Flori. + +License +------- + +GPL + +.. _upstream_contact: + +Upstream Contact +---------------- + +github: https://github.com/tscrim/coxeter + +Alas, Fokko Ducloux passed away in 2006. + +http://math.univ-lyon1.fr/~ducloux/du_Cloux.html + +Dependencies +------------ + +None + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +The source package was created by running + +commit=8ac9c71723c8ca57a836d6381aed125261e44e9e git clone +https://github.com/tscrim/coxeter.git cd coxeter git archive $commit +\|bzip2 --best >coxeter-$commit.tar.bz2 diff --git a/build/pkgs/coxeter3/SPKG.txt b/build/pkgs/coxeter3/SPKG.txt deleted file mode 100644 index 773bfc87ab8..00000000000 --- a/build/pkgs/coxeter3/SPKG.txt +++ /dev/null @@ -1,45 +0,0 @@ -= coxeter3 = - -== Description == - -This package wraps Fokko Ducloux's Coxeter 3 C++ library - -Features: - -- General Coxeter groups, implemented through the combinatorics of reduced words; -- Reduced expression and normal form computations; -- Bruhat ordering; -- Ordinary Kazhdan-Lusztig polynomials; -- Kazhdan-Lusztig polynomials with unequal parameters; -- Inverse Kazhdan-Lusztig polynomials; -- Cells and W-graphs; - -http://math.univ-lyon1.fr/~ducloux/coxeter/coxeter3/english/coxeter3_e.html - -This is a patched version done by Mike Hansen 2009-2013 and some fixes -by Nicolas M. Thiéry and Jean-Pierre Flori. - -== License == - -GPL - -== Upstream Contact == - -github: https://github.com/tscrim/coxeter - -Alas, Fokko Ducloux passed away in 2006. - -http://math.univ-lyon1.fr/~ducloux/du_Cloux.html - -== Dependencies == - -None - -== Special Update/Build Instructions == - -The source package was created by running - -commit=8ac9c71723c8ca57a836d6381aed125261e44e9e -git clone https://github.com/tscrim/coxeter.git -cd coxeter -git archive $commit |bzip2 --best >coxeter-$commit.tar.bz2 diff --git a/build/pkgs/cryptominisat/SPKG.rst b/build/pkgs/cryptominisat/SPKG.rst new file mode 100644 index 00000000000..253e71a2798 --- /dev/null +++ b/build/pkgs/cryptominisat/SPKG.rst @@ -0,0 +1,39 @@ +CryptoMiniSat +============= + +Description +----------- + + CryptoMiniSat is a SAT solver that aims to become a premiere SAT + solver with all the features and speed of successful SAT solvers, + such as MiniSat and PrecoSat. The long-term goals of CryptoMiniSat + are to be an efficient sequential, parallel and distributed + solver. There are solvers that are good at one or the other, + e.g. ManySat (parallel) or PSolver (distributed), but we wish to + excel at all. + + CryptoMiniSat 2.5 won the SAT Race 2010 among 20 solvers submitted + by researchers and industry. + +License +------- + +MIT License + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Authors: Mate Soos +- Email: soos.mate@gmail.com +- Website: http://www.msoos.org/ +- Releases: https://github.com/msoos/cryptominisat/releases + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +CryptoMiniSat's tarball downloaded from github is called VERSION.tar.gz +and should be renamed to cryptominisat-VERSION.tar.gz diff --git a/build/pkgs/cryptominisat/SPKG.txt b/build/pkgs/cryptominisat/SPKG.txt deleted file mode 100644 index c1ee354a588..00000000000 --- a/build/pkgs/cryptominisat/SPKG.txt +++ /dev/null @@ -1,31 +0,0 @@ -= CryptoMiniSat = - -== Description == - - CryptoMiniSat is a SAT solver that aims to become a premiere SAT - solver with all the features and speed of successful SAT solvers, - such as MiniSat and PrecoSat. The long-term goals of CryptoMiniSat - are to be an efficient sequential, parallel and distributed - solver. There are solvers that are good at one or the other, - e.g. ManySat (parallel) or PSolver (distributed), but we wish to - excel at all. - - CryptoMiniSat 2.5 won the SAT Race 2010 among 20 solvers submitted - by researchers and industry. - -== License == - -MIT License - -== Upstream Contact == - - * Authors: Mate Soos - * Email: soos.mate@gmail.com - * Website: http://www.msoos.org/ - * Releases: https://github.com/msoos/cryptominisat/releases - -== Special Update/Build Instructions == - -CryptoMiniSat's tarball downloaded from github is called VERSION.tar.gz -and should be renamed to cryptominisat-VERSION.tar.gz - diff --git a/build/pkgs/csdp/SPKG.rst b/build/pkgs/csdp/SPKG.rst new file mode 100644 index 00000000000..571aaadd4c5 --- /dev/null +++ b/build/pkgs/csdp/SPKG.rst @@ -0,0 +1,55 @@ +csdp +==== + +Description +----------- + +This is a fast SDP solver written in C, with a callable library namely, +an autotool'ed version of CSDP, by Brian Borchers, see +https://projects.coin-or.org/Csdp + +License +------- + +Common Public License Version 1.0 + +.. _upstream_contact: + +Upstream Contact +---------------- + +Dmitrii Pasechnik + +Dependencies +------------ + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +csdp is an autotool'ed version of CSDP, see +https://projects.coin-or.org/Csdp, developed in its own repository at +http://github.org/dimpase/csdp. + +To update to a new version, you need to bump the version number in +configure.ac and rerun autotools (autoreconf -fiv). Any changes should +be merged to the upstream repo. + +The build is done with NOSHORTS variable defined; this makes it +compatible with packages, where NOSHORTS must be defined, e.g. +https://github.com/dimpase/pycsdp; also the Sage Cython interface needs +NOSHORTS defined. + +Detailed steps to build the spkg are as follows. You need + +- git +- autotools and libtool (the full autohell suite, version at least + 2.67) + +With these ready: + +- ./spkg-src +- copy the resulting csdp-.tar.gz to SAGE_ROOT/upstream, + + or somewhere else appropriate diff --git a/build/pkgs/csdp/SPKG.txt b/build/pkgs/csdp/SPKG.txt deleted file mode 100644 index 993a28bb3c0..00000000000 --- a/build/pkgs/csdp/SPKG.txt +++ /dev/null @@ -1,41 +0,0 @@ -= csdp = - -== Description == - -This is a fast SDP solver written in C, with a callable library -namely, an autotool'ed version of CSDP, by Brian Borchers, -see https://projects.coin-or.org/Csdp - -== License == - -Common Public License Version 1.0 - -== Upstream Contact == - -Dmitrii Pasechnik - -== Dependencies == - - -== Special Update/Build Instructions == - -csdp is an autotool'ed version of CSDP, see https://projects.coin-or.org/Csdp, -developed in its own repository at http://github.org/dimpase/csdp. - -To update to a new version, you need to bump the version number in -configure.ac and rerun autotools (autoreconf -fiv). -Any changes should be merged to the upstream repo. - -The build is done with NOSHORTS variable defined; this makes it compatible -with packages, where NOSHORTS must be defined, e.g. -https://github.com/dimpase/pycsdp; -also the Sage Cython interface needs NOSHORTS defined. - -Detailed steps to build the spkg are as follows. You need - * git - * autotools and libtool (the full autohell suite, version at least 2.67) - -With these ready: - * ./spkg-src - * copy the resulting csdp-.tar.gz to SAGE_ROOT/upstream, - or somewhere else appropriate diff --git a/build/pkgs/curl/SPKG.rst b/build/pkgs/curl/SPKG.rst new file mode 100644 index 00000000000..bbc2ba69836 --- /dev/null +++ b/build/pkgs/curl/SPKG.rst @@ -0,0 +1,33 @@ +curl +==== + +Description +----------- + +Multiprotocols data transfer library (and utility). + +License +------- + +"MIT style license" : see file "COPYING" at the root of the source +tarball, explanations at https://curl.haxx.se/docs/copyright.html. + +.. _upstream_contact: + +Upstream Contact +---------------- + +According to the file README at the root of the tarball, contact is done +by mailing https://curl.haxx.se/mail/ + +Dependencies +------------ + +None listed. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/curl/SPKG.txt b/build/pkgs/curl/SPKG.txt deleted file mode 100644 index 682d4e60574..00000000000 --- a/build/pkgs/curl/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= curl = - -== Description == - -Multiprotocols data transfer library (and utility). - -== License == - -"MIT style license" : see file "COPYING" at the root of the source -tarball, explanations at https://curl.haxx.se/docs/copyright.html. - -== Upstream Contact == - -According to the file README at the root of the tarball, contact is -done by mailing https://curl.haxx.se/mail/ - -== Dependencies == - -None listed. - -== Special Update/Build Instructions == - -None. diff --git a/build/pkgs/cvxopt/SPKG.rst b/build/pkgs/cvxopt/SPKG.rst new file mode 100644 index 00000000000..7533a2303ac --- /dev/null +++ b/build/pkgs/cvxopt/SPKG.rst @@ -0,0 +1,61 @@ +CVXOPT +====== + +Description +----------- + +CVXOPT is a free software package for convex optimization based on the +Python programming language. It can be used with the interactive Python +interpreter, on the command line by executing Python scripts, or +integrated in other software via Python extension modules. Its main +purpose is to make the development of software for convex optimization +applications straightforward by building on Python's extensive standard +library and on the strengths of Python as a high-level programming +language. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- J. Dahl +- L. Vandenberghe + +Downloaded from http://cvxopt.org + +License +------- + +GPLv3 or later. Includes parts under GPLv2, GNU Lesser General Public +License, v2.1. See src/LICENSE for more details. (Sage-compatible) + +Dependencies +------------ + +- GNU patch +- GSL +- GLPK + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- cvxopt.h.patch: Fix building with GCC on Solaris. + +- setup.py.patch: look for libraries and includes in $SAGE_LOCAL + + instead of /usr. Add fortran, blas,... libraries if needed. + Build with GSL and GLPK support. + +- remove doc/html/, as it can be rebuild by invoking 'sage -sh' and + + running 'make html' in doc/ + +- TODO: Add more tests in spkg-check + +- TODO: one might want to enhance the code to allow other Sage + + random sources, at the moment only GSL is used in CVXOPT-1.1.3 + spkg, apparently it will need an unclear to me "with seed(..)" + construct. diff --git a/build/pkgs/cvxopt/SPKG.txt b/build/pkgs/cvxopt/SPKG.txt deleted file mode 100644 index 1ca9865e016..00000000000 --- a/build/pkgs/cvxopt/SPKG.txt +++ /dev/null @@ -1,50 +0,0 @@ -= CVXOPT = - -== Description == - -CVXOPT is a free software package for convex optimization based on the -Python programming language. It can be used with the interactive -Python interpreter, on the command line by executing Python scripts, -or integrated in other software via Python extension modules. Its main -purpose is to make the development of software for convex optimization -applications straightforward by building on Python's extensive -standard library and on the strengths of Python as a high-level -programming language. - -== Upstream Contact == - - * J. Dahl - * L. Vandenberghe - -Downloaded from http://cvxopt.org - -== License == - -GPLv3 or later. Includes parts under GPLv2, -GNU Lesser General Public License, v2.1. See src/LICENSE for more details. -(Sage-compatible) - -== Dependencies == - - * GNU patch - * GSL - * GLPK - -== Special Update/Build Instructions == - - * cvxopt.h.patch: Fix building with GCC on Solaris. - - * setup.py.patch: look for libraries and includes in $SAGE_LOCAL - instead of /usr. Add fortran, blas,... libraries if needed. - Build with GSL and GLPK support. - - * remove doc/html/, as it can be rebuild by invoking 'sage -sh' and - running 'make html' in doc/ - - * TODO: Add more tests in spkg-check - - * TODO: one might want to enhance the code to allow other Sage - random sources, at the moment only GSL is used in CVXOPT-1.1.3 - spkg, apparently it will need an unclear to me "with seed(..)" - construct. - diff --git a/build/pkgs/cycler/SPKG.rst b/build/pkgs/cycler/SPKG.rst new file mode 100644 index 00000000000..aa98c36c280 --- /dev/null +++ b/build/pkgs/cycler/SPKG.rst @@ -0,0 +1,30 @@ +cycler +====== + +Description +----------- + +Cycler is a small break of of matplotlib to deal with "composable +cycles". It is a required dependency of matplotlib 1.5.0. + +License +------- + +BSD + +.. _upstream_contact: + +Upstream Contact +---------------- + +cycler is developed on github: https://github.com/matplotlib/cycler + +A more informative webpage about cycler, its motivation and usage is at +http://tacaswell.github.io/cycler/ + +Dependencies +------------ + +- python +- setuptools +- six diff --git a/build/pkgs/cycler/SPKG.txt b/build/pkgs/cycler/SPKG.txt deleted file mode 100644 index 2b8a4665363..00000000000 --- a/build/pkgs/cycler/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= cycler = - -== Description == - -Cycler is a small break of of matplotlib to -deal with "composable cycles". -It is a required dependency of matplotlib 1.5.0. - -== License == -BSD - -== Upstream Contact == - -cycler is developed on github: https://github.com/matplotlib/cycler - -A more informative webpage about cycler, its motivation and usage -is at http://tacaswell.github.io/cycler/ - -== Dependencies == - - * python - * setuptools - * six - diff --git a/build/pkgs/cypari/SPKG.rst b/build/pkgs/cypari/SPKG.rst new file mode 100644 index 00000000000..5dd839dfb56 --- /dev/null +++ b/build/pkgs/cypari/SPKG.rst @@ -0,0 +1,27 @@ +cypari2 +======= + +Description +----------- + +A Python interface to the number theory library libpari. + +License +------- + +GPL version 2 or later + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://github.com/defeo/cypari2 + +Dependencies +------------ + +- Python +- Cython +- PARI +- cysignals diff --git a/build/pkgs/cypari/SPKG.txt b/build/pkgs/cypari/SPKG.txt deleted file mode 100644 index a4a383d0dde..00000000000 --- a/build/pkgs/cypari/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= cypari2 = - -== Description == - -A Python interface to the number theory library libpari. - -== License == - -GPL version 2 or later - -== Upstream Contact == - -https://github.com/defeo/cypari2 - -== Dependencies == - -* Python -* Cython -* PARI -* cysignals diff --git a/build/pkgs/cysignals/SPKG.rst b/build/pkgs/cysignals/SPKG.rst new file mode 100644 index 00000000000..6bf1a1a4a2f --- /dev/null +++ b/build/pkgs/cysignals/SPKG.rst @@ -0,0 +1,26 @@ +cysignals +========= + +Description +----------- + +Interrupt and signal handling for Cython + +License +------- + +LGPL version 3 or later + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://github.com/sagemath/cysignals + +Dependencies +------------ + +- Python +- Cython +- PARI (optional) diff --git a/build/pkgs/cysignals/SPKG.txt b/build/pkgs/cysignals/SPKG.txt deleted file mode 100644 index acbf6169d3d..00000000000 --- a/build/pkgs/cysignals/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= cysignals = - -== Description == - -Interrupt and signal handling for Cython - -== License == - -LGPL version 3 or later - -== Upstream Contact == - -https://github.com/sagemath/cysignals - -== Dependencies == - -* Python -* Cython -* PARI (optional) diff --git a/build/pkgs/cython/SPKG.rst b/build/pkgs/cython/SPKG.rst new file mode 100644 index 00000000000..f452f9cd3ef --- /dev/null +++ b/build/pkgs/cython/SPKG.rst @@ -0,0 +1,37 @@ +Cython +====== + +Description +----------- + +Cython is a language that makes writing C extensions for the Python +language as easy as Python itself. Cython is based on the well-known +Pyrex, but supports more cutting edge functionality and optimizations. + +The Cython language is very close to the Python language, but Cython +additio- nally supports calling C functions and declaring C types on +variables and class attributes. This allows the compiler to generate +very efficient C code from Cython code. + +This makes Cython the ideal language for wrapping for external C +libraries, and for fast C modules that speed up the execution of Python +code. + +Website: http://www.cython.org/ + +License +------- + +Apache License, Version 2.0 + +.. _upstream_contact: + +Upstream Contact +---------------- + +- cython-devel@python.org + +Dependencies +------------ + +- Python diff --git a/build/pkgs/cython/SPKG.txt b/build/pkgs/cython/SPKG.txt deleted file mode 100644 index 6baffa31c41..00000000000 --- a/build/pkgs/cython/SPKG.txt +++ /dev/null @@ -1,27 +0,0 @@ -= Cython = - -== Description == - -Cython is a language that makes writing C extensions for the Python language as -easy as Python itself. Cython is based on the well-known Pyrex, but supports -more cutting edge functionality and optimizations. - -The Cython language is very close to the Python language, but Cython additio- -nally supports calling C functions and declaring C types on variables and class -attributes. This allows the compiler to generate very efficient C code from -Cython code. - -This makes Cython the ideal language for wrapping for external C libraries, and -for fast C modules that speed up the execution of Python code. - -Website: http://www.cython.org/ - -== License == - -Apache License, Version 2.0 - -== Upstream Contact == - * cython-devel@python.org - -== Dependencies == - * Python diff --git a/build/pkgs/d3js/SPKG.rst b/build/pkgs/d3js/SPKG.rst new file mode 100644 index 00000000000..72c758df5d5 --- /dev/null +++ b/build/pkgs/d3js/SPKG.rst @@ -0,0 +1,39 @@ +d3js +==== + +Description +----------- + +D3.js is a JavaScript library for manipulating documents based on data. +The file d3.min.js will be placed into the ${SAGE_SHARE}/d3js/ +directory. + +License +------- + +BSD 3-Clause License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Mike Bostock (http://bost.ocks.org/mike/) Home page: +http://d3js.org/ + +Dependencies +------------ + +None. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +Two kind of archives can be downloaded from d3.js website: one with all +source code and tests that weights 2,9M (both in zip and tar.gz formats) +and one with the final javascript scripts which weights 121K (zip format +only). Since testing requires node.js that is not shipped with Sage, we +currenlty ship the final js only. Hence we have to transform it from zip +to tar.gz format. Running sage-src should do all the repackaging job. diff --git a/build/pkgs/d3js/SPKG.txt b/build/pkgs/d3js/SPKG.txt deleted file mode 100644 index d7a80a3bc91..00000000000 --- a/build/pkgs/d3js/SPKG.txt +++ /dev/null @@ -1,29 +0,0 @@ -= d3js = - -== Description == - -D3.js is a JavaScript library for manipulating documents based on data. -The file d3.min.js will be placed into the ${SAGE_SHARE}/d3js/ directory. - -== License == - -BSD 3-Clause License - -== Upstream Contact == - -Author: Mike Bostock (http://bost.ocks.org/mike/) -Home page: http://d3js.org/ - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -Two kind of archives can be downloaded from d3.js website: one with all source -code and tests that weights 2,9M (both in zip and tar.gz formats) and one with -the final javascript scripts which weights 121K (zip format only). Since -testing requires node.js that is not shipped with Sage, we currenlty ship the -final js only. Hence we have to transform it from zip to tar.gz format. -Running sage-src should do all the repackaging job. - diff --git a/build/pkgs/database_cremona_ellcurve/SPKG.rst b/build/pkgs/database_cremona_ellcurve/SPKG.rst new file mode 100644 index 00000000000..f7d12916f2a --- /dev/null +++ b/build/pkgs/database_cremona_ellcurve/SPKG.rst @@ -0,0 +1,53 @@ +database_cremona_ellcurve +========================= + +Description +----------- + +John Cremona's database of elliptic curves + +See https://github.com/JohnCremona/ecdata + +This is an optional package, not included by default. + +License +------- + +Public Domain + +Dependencies +------------ + +None + +Patches +~~~~~~~ + +- None + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Author: John Cremona +- Email: john.cremona@gmail.com +- Website: http://homepages.warwick.ac.uk/staff/J.E.Cremona/ + +.. _update_instructions: + +Update Instructions +------------------- + +Get an up-to-date copy of the git repository ecdata from +https://github.com/JohnCremona/ecdata. + +If the cremona database has already been installed, remove +\`SAGE_DATA/cremona/cremona.db`. Then run + +The build script expects to find the files in subfolders allcurves, +allgens, degphi and allbsd of the ecdata folder. It extracts them and +builds the new cremona.db file from the contents. + +Finally, copy \`SAGE_DATA/cremona/cremona.db\` to the src directory of +the spkg. diff --git a/build/pkgs/database_cremona_ellcurve/SPKG.txt b/build/pkgs/database_cremona_ellcurve/SPKG.txt deleted file mode 100644 index 88b2ba0f6af..00000000000 --- a/build/pkgs/database_cremona_ellcurve/SPKG.txt +++ /dev/null @@ -1,44 +0,0 @@ -= database_cremona_ellcurve = - -== Description == -John Cremona's database of elliptic curves - -See https://github.com/JohnCremona/ecdata - -This is an optional package, not included by default. - -== License == -Public Domain - -== Dependencies == -None - -=== Patches === - * None - -== Upstream Contact == - - * Author: John Cremona - * Email: john.cremona@gmail.com - * Website: http://homepages.warwick.ac.uk/staff/J.E.Cremona/ - -== Update Instructions == - -Get an up-to-date copy of the git repository ecdata from -https://github.com/JohnCremona/ecdata. - -If the cremona database has already been installed, remove -`SAGE_DATA/cremona/cremona.db`. Then run - -{{{ -sage: C = sage.databases.cremona.LargeCremonaDatabase('cremona',False, True) -sage: C._init_from_ftpdata('path/to/ecdata/',0) -}}} - -The build script expects to find the files in subfolders allcurves, -allgens, degphi and allbsd of the ecdata folder. It extracts them and -builds the new cremona.db file from the contents. - -Finally, copy `SAGE_DATA/cremona/cremona.db` to the src directory of -the spkg. - diff --git a/build/pkgs/database_jones_numfield/SPKG.rst b/build/pkgs/database_jones_numfield/SPKG.rst new file mode 100644 index 00000000000..fd9077f52fd --- /dev/null +++ b/build/pkgs/database_jones_numfield/SPKG.rst @@ -0,0 +1,32 @@ +database_jones_numfield +======================= + +Description +----------- + +This is a table of number fields with bounded ramification and degree +≤6. + +License +------- + +GPLv2+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +sage-devel@googlegroups.com + +Dependencies +------------ + +None + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +Created by taking the original old-style spkg and removing crud from it. diff --git a/build/pkgs/database_jones_numfield/SPKG.txt b/build/pkgs/database_jones_numfield/SPKG.txt deleted file mode 100644 index 93d41c86cd3..00000000000 --- a/build/pkgs/database_jones_numfield/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= database_jones_numfield = - -== Description == - -This is a table of number fields with bounded ramification and degree ≤6. - -== License == - -GPLv2+ - -== Upstream Contact == - -sage-devel@googlegroups.com - -== Dependencies == - -None - -== Special Update/Build Instructions == - -Created by taking the original old-style spkg and removing crud from it. diff --git a/build/pkgs/database_kohel/SPKG.rst b/build/pkgs/database_kohel/SPKG.rst new file mode 100644 index 00000000000..6ecaee240db --- /dev/null +++ b/build/pkgs/database_kohel/SPKG.rst @@ -0,0 +1,16 @@ +.. _kohel_database: + +Kohel database +============== + +Description +----------- + +Database of modular and Hilbert polynomials. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- David Kohel diff --git a/build/pkgs/database_kohel/SPKG.txt b/build/pkgs/database_kohel/SPKG.txt deleted file mode 100644 index ee24b701d92..00000000000 --- a/build/pkgs/database_kohel/SPKG.txt +++ /dev/null @@ -1,10 +0,0 @@ -= Kohel database = - -== Description == - -Database of modular and Hilbert polynomials. - -== Upstream Contact == - - * David Kohel - diff --git a/build/pkgs/database_mutation_class/SPKG.rst b/build/pkgs/database_mutation_class/SPKG.rst new file mode 100644 index 00000000000..78d015ecad3 --- /dev/null +++ b/build/pkgs/database_mutation_class/SPKG.rst @@ -0,0 +1,36 @@ +.. _mutation_class_database: + +Mutation class database +======================= + +Description +----------- + + Contains a database of all exceptional mutation classes of quivers. + + Every file in the database is of the form + \``mutation_classes_n.dig6`\` for some \``n`\` and + +- contains a \``cPickle.dump`\` of a dictionary where +- the keys are tuples representing irreducible exceptional quiver + mutation types of rank \``n``, and +- the values are all quivers in the given mutation class stored in + canonical form as \``(dig6,edges)`\` where +- \``dig6`\` is the dig6 data of the given \``DiGraph``, and +- \``edges`\` are the non-simply-laced edges thereof. +- is obtained by running the function + + \``sage.combinat.cluster_algebra_quiver.quiver_mutation_type._save_data_dig6(n, + types='Exceptional', verbose=False)`\` + +.. _spkg_maintainers: + +SPKG Maintainers +---------------- + +- C. Stump + +Dependencies +------------ + +- None diff --git a/build/pkgs/database_mutation_class/SPKG.txt b/build/pkgs/database_mutation_class/SPKG.txt deleted file mode 100644 index ae3facd5d3d..00000000000 --- a/build/pkgs/database_mutation_class/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= Mutation class database = - -== Description == - - Contains a database of all exceptional mutation classes of quivers. - - Every file in the database is of the form ``mutation_classes_n.dig6`` for some ``n`` and - - contains a ``cPickle.dump`` of a dictionary where - - the keys are tuples representing irreducible exceptional quiver mutation types of rank ``n``, and - - the values are all quivers in the given mutation class stored in canonical form as ``(dig6,edges)`` where - - ``dig6`` is the dig6 data of the given ``DiGraph``, and - - ``edges`` are the non-simply-laced edges thereof. - - is obtained by running the function - ``sage.combinat.cluster_algebra_quiver.quiver_mutation_type._save_data_dig6(n, types='Exceptional', verbose=False)`` - -== SPKG Maintainers == - - * C. Stump - -== Dependencies == - - * None - diff --git a/build/pkgs/database_odlyzko_zeta/SPKG.txt b/build/pkgs/database_odlyzko_zeta/SPKG.rst similarity index 52% rename from build/pkgs/database_odlyzko_zeta/SPKG.txt rename to build/pkgs/database_odlyzko_zeta/SPKG.rst index 9103d0bd468..68d649f61b3 100644 --- a/build/pkgs/database_odlyzko_zeta/SPKG.txt +++ b/build/pkgs/database_odlyzko_zeta/SPKG.rst @@ -1,12 +1,17 @@ -= Zeros of the Riemann zeta function = +.. _zeros_of_the_riemann_zeta_function: -== Description == +Zeros of the Riemann zeta function +================================== + +Description +----------- Table of zeros of the Riemann zeta function by Andrew Odlyzko. This package contains the file 'zeros6' with the first 2,001,052 zeros of the Riemann zeta function, accurate to within 4*10^(-9). -== Dependencies == +Dependencies +------------ - * Sage library +- Sage library diff --git a/build/pkgs/database_stein_watkins/SPKG.txt b/build/pkgs/database_stein_watkins/SPKG.rst similarity index 59% rename from build/pkgs/database_stein_watkins/SPKG.txt rename to build/pkgs/database_stein_watkins/SPKG.rst index ee6ecb4349f..735c9d2da5f 100644 --- a/build/pkgs/database_stein_watkins/SPKG.txt +++ b/build/pkgs/database_stein_watkins/SPKG.rst @@ -1,17 +1,26 @@ -= database_stein_watkins = +database_stein_watkins +====================== + +Description +----------- -== Description == The Stein-Watkins database of elliptic curves (full version) See http://modular.math.washington.edu/papers/stein-watkins/ This is an optional (huge) package, not included by default. -== License == +License +------- + Public Domain -== Dependencies == +Dependencies +------------ + None -=== Patches === - * None +Patches +~~~~~~~ + +- None diff --git a/build/pkgs/database_stein_watkins_mini/SPKG.txt b/build/pkgs/database_stein_watkins_mini/SPKG.rst similarity index 57% rename from build/pkgs/database_stein_watkins_mini/SPKG.txt rename to build/pkgs/database_stein_watkins_mini/SPKG.rst index 41c575c9a9e..c6563440103 100644 --- a/build/pkgs/database_stein_watkins_mini/SPKG.txt +++ b/build/pkgs/database_stein_watkins_mini/SPKG.rst @@ -1,17 +1,26 @@ -= database_stein_watkins_mini = +database_stein_watkins_mini +=========================== + +Description +----------- -== Description == The Stein-Watkins database of elliptic curves (small version) See http://modular.math.washington.edu/papers/stein-watkins/ This is an optional package, not included by default. -== License == +License +------- + Public Domain -== Dependencies == +Dependencies +------------ + None -=== Patches === - * None +Patches +~~~~~~~ + +- None diff --git a/build/pkgs/database_symbolic_data/SPKG.rst b/build/pkgs/database_symbolic_data/SPKG.rst new file mode 100644 index 00000000000..217729482e6 --- /dev/null +++ b/build/pkgs/database_symbolic_data/SPKG.rst @@ -0,0 +1,49 @@ +database_symbolic_data +====================== + +Description +----------- + +The SymbolicData project is set out + +- to develop concepts and tools for profiling, testing and benchmarking + Computer Algebra Software + + (CAS) and + +- to collect and interlink relevant data and activities from different + Computer Algebra Communities. + +SymbolicData is an + +- inter-community project that has its roots in the activities of + different Computer Algebra Communities and +- aims at interlinking these activities using modern Semantic Web + concepts. + +Tools and data are designed to be used both + +- on a local site for special testing and profiling purposes +- and to manage a central repository at www.symbolicdata.org. + +License +------- + +GNU General Public License + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Andreas Nareike + +Dependencies +------------ + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +List patches that need to be applied and what they do diff --git a/build/pkgs/database_symbolic_data/SPKG.txt b/build/pkgs/database_symbolic_data/SPKG.txt deleted file mode 100644 index 65c410df2a2..00000000000 --- a/build/pkgs/database_symbolic_data/SPKG.txt +++ /dev/null @@ -1,34 +0,0 @@ -= database_symbolic_data = - -== Description == - -The SymbolicData project is set out - -* to develop concepts and tools for profiling, testing and benchmarking Computer Algebra Software - (CAS) and -* to collect and interlink relevant data and activities from different Computer Algebra Communities. - -SymbolicData is an - -* inter-community project that has its roots in the activities of different Computer Algebra Communities and -* aims at interlinking these activities using modern Semantic Web concepts. - -Tools and data are designed to be used both - -* on a local site for special testing and profiling purposes -* and to manage a central repository at www.symbolicdata.org. - -== License == - -GNU General Public License - -== Upstream Contact == - -* Andreas Nareike - -== Dependencies == - -== Special Update/Build Instructions == - -List patches that need to be applied and what they do - diff --git a/build/pkgs/dateutil/SPKG.rst b/build/pkgs/dateutil/SPKG.rst new file mode 100644 index 00000000000..4270e471662 --- /dev/null +++ b/build/pkgs/dateutil/SPKG.rst @@ -0,0 +1,27 @@ +dateutil +======== + +Description +----------- + +The dateutil module provides powerful extensions to the standard +datetime module. + +License +------- + +Simplified BSD License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Gustavo Niemeyer Home page: +http://labix.org/python-dateutil + +Dependencies +------------ + +- Python +- Six diff --git a/build/pkgs/dateutil/SPKG.txt b/build/pkgs/dateutil/SPKG.txt deleted file mode 100644 index becf1aff84a..00000000000 --- a/build/pkgs/dateutil/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= dateutil = - -== Description == - -The dateutil module provides powerful extensions to the standard -datetime module. - -== License == - -Simplified BSD License - -== Upstream Contact == - -Author: Gustavo Niemeyer -Home page: http://labix.org/python-dateutil - -== Dependencies == - -* Python -* Six - diff --git a/build/pkgs/decorator/SPKG.txt b/build/pkgs/decorator/SPKG.rst similarity index 51% rename from build/pkgs/decorator/SPKG.txt rename to build/pkgs/decorator/SPKG.rst index 52aa0271d0a..cbc1b166e6c 100644 --- a/build/pkgs/decorator/SPKG.txt +++ b/build/pkgs/decorator/SPKG.rst @@ -1,5 +1,7 @@ -= decorator = +decorator +========= -== Description == +Description +----------- Better living through Python with decorators diff --git a/build/pkgs/deformation/SPKG.rst b/build/pkgs/deformation/SPKG.rst new file mode 100644 index 00000000000..bba378f0a3c --- /dev/null +++ b/build/pkgs/deformation/SPKG.rst @@ -0,0 +1,20 @@ +deformation +=========== + +Description +----------- + +Deformation is a C library for counting points on hypersurfaces using +the deformation method, developed by Sebastian Pancratz. + +License +------- + +GLPv3 + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Sebastian Pancratz: sebastian.pancratz@gmail.com diff --git a/build/pkgs/deformation/SPKG.txt b/build/pkgs/deformation/SPKG.txt deleted file mode 100644 index 4381842c04f..00000000000 --- a/build/pkgs/deformation/SPKG.txt +++ /dev/null @@ -1,14 +0,0 @@ -= deformation = - -== Description == - -Deformation is a C library for counting points on hypersurfaces -using the deformation method, developed by Sebastian Pancratz. - -== License == - -GLPv3 - -== Upstream Contact == - -* Sebastian Pancratz: sebastian.pancratz@gmail.com diff --git a/build/pkgs/defusedxml/SPKG.rst b/build/pkgs/defusedxml/SPKG.rst new file mode 100644 index 00000000000..d829cac1c4e --- /dev/null +++ b/build/pkgs/defusedxml/SPKG.rst @@ -0,0 +1,33 @@ +defusedxml +========== + +Description +----------- + +defusedxml addresses vulnerabilities of XML parsers and XML libraries. + +It became a dependency of nbconvert starting with nbconvert 5.4. + +License +------- + +Python Software Foundation License (PSFL) + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://pypi.org/project/defusedxml/ + +Dependencies +------------ + +- pip + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/defusedxml/SPKG.txt b/build/pkgs/defusedxml/SPKG.txt deleted file mode 100644 index c3c8d65701d..00000000000 --- a/build/pkgs/defusedxml/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= defusedxml = - -== Description == - -defusedxml addresses vulnerabilities of XML parsers and XML libraries. - -It became a dependency of nbconvert starting with nbconvert 5.4. - -== License == - -Python Software Foundation License (PSFL) - -== Upstream Contact == - -https://pypi.org/project/defusedxml/ - -== Dependencies == - -* pip - -== Special Update/Build Instructions == - -None. diff --git a/build/pkgs/docutils/SPKG.rst b/build/pkgs/docutils/SPKG.rst new file mode 100644 index 00000000000..8f8e0bb7415 --- /dev/null +++ b/build/pkgs/docutils/SPKG.rst @@ -0,0 +1,34 @@ +docutils +======== + +Description +----------- + +Docutils is a modular system for processing documentation into useful +formats, such as HTML, XML, and LaTeX. For input Docutils supports +reStructuredText, an easy-to-read, what-you-see-is-what-you-get +plaintext markup syntax. + +License +------- + +Modified BSD + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: David Goodger Home Page: http://docutils.sourceforge.net/ + +Dependencies +------------ + +None + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None diff --git a/build/pkgs/docutils/SPKG.txt b/build/pkgs/docutils/SPKG.txt deleted file mode 100644 index 14e239e7537..00000000000 --- a/build/pkgs/docutils/SPKG.txt +++ /dev/null @@ -1,26 +0,0 @@ -= docutils = - -== Description == - -Docutils is a modular system for processing documentation into useful -formats, such as HTML, XML, and LaTeX. For input Docutils supports -reStructuredText, an easy-to-read, what-you-see-is-what-you-get -plaintext markup syntax. - -== License == - -Modified BSD - -== Upstream Contact == - -Author: David Goodger -Home Page: http://docutils.sourceforge.net/ - -== Dependencies == - -None - -== Special Update/Build Instructions == - -None - diff --git a/build/pkgs/dot2tex/SPKG.rst b/build/pkgs/dot2tex/SPKG.rst new file mode 100644 index 00000000000..70cae44d0c2 --- /dev/null +++ b/build/pkgs/dot2tex/SPKG.rst @@ -0,0 +1,56 @@ +dot2tex +======= + +Description +----------- + +dot2tex is a Python module, whose purpose is to give graphs generated by +Graphviz a more LaTeX friendly look and feel. This is accomplished by +converting xdot output from Graphviz to a series of PSTricks or PGF/TikZ +commands. + +See https://github.com/kjellmf/dot2tex/ + +License +------- + +- MIT + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Kjell Magne Fauske, km@fauskes.net + +Dependencies +------------ + +graphviz (www.graphviz.org) should be installed and in the path (for +example via the graphviz spkg). + +preview, a LaTeX package for extracting parts of a document. + +Self-tests dependencies: + +- graphviz +- texlive-latex-base +- texlive-pictures +- texlive-pstricks + +Patches +------- + +- remove_test_semicolon.patch: + + Remove the failing semicolon test for the open dot2tex + issue #5 - https://github.com/kjellmf/dot2tex/issues/5 + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +Make sure corresponding optional doctests still pass: + + sage -t --long --optional=dot2tex,graphviz,sage src/ diff --git a/build/pkgs/dot2tex/SPKG.txt b/build/pkgs/dot2tex/SPKG.txt deleted file mode 100644 index 4cbf60564e5..00000000000 --- a/build/pkgs/dot2tex/SPKG.txt +++ /dev/null @@ -1,42 +0,0 @@ -= dot2tex = - -== Description == - -dot2tex is a Python module, whose purpose is to give graphs generated -by Graphviz a more LaTeX friendly look and feel. This is accomplished -by converting xdot output from Graphviz to a series of PSTricks or -PGF/TikZ commands. - -See https://github.com/kjellmf/dot2tex/ - -== License == - * MIT - -== Upstream Contact == - * Kjell Magne Fauske, km@fauskes.net - -== Dependencies == - -graphviz (www.graphviz.org) should be installed and in the path (for -example via the graphviz spkg). - -preview, a LaTeX package for extracting parts of a document. - -Self-tests dependencies: - * graphviz - * texlive-latex-base - * texlive-pictures - * texlive-pstricks - -== Patches == - - * remove_test_semicolon.patch: - Remove the failing semicolon test for the open dot2tex - issue #5 - https://github.com/kjellmf/dot2tex/issues/5 - -== Special Update/Build Instructions == - -Make sure corresponding optional doctests still pass: - - sage -t --long --optional=dot2tex,graphviz,sage src/ - diff --git a/build/pkgs/e_antic/SPKG.rst b/build/pkgs/e_antic/SPKG.rst new file mode 100644 index 00000000000..c298b7c79a9 --- /dev/null +++ b/build/pkgs/e_antic/SPKG.rst @@ -0,0 +1,31 @@ +.. _e_antic: + +e-antic +======= + +Description +----------- + +e-antic is a C library for exact computations with real embedded number +field maintained by Vincent Delecroix. + +Website: https://github.com/videlec/e-antic + +License +------- + +e-antic is licensed GPL v3. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- https://github.com/videlec/e-antic + +Dependencies +------------ + +- GMP/MPIR +- FLINT +- ARB diff --git a/build/pkgs/e_antic/SPKG.txt b/build/pkgs/e_antic/SPKG.txt deleted file mode 100644 index e13b4c97c94..00000000000 --- a/build/pkgs/e_antic/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= e-antic = - -== Description == - -e-antic is a C library for exact computations with real embedded number field -maintained by Vincent Delecroix. - -Website: https://github.com/videlec/e-antic - -== License == - -e-antic is licensed GPL v3. - -== Upstream Contact == - - * https://github.com/videlec/e-antic - -== Dependencies == - - * GMP/MPIR - * FLINT - * ARB diff --git a/build/pkgs/ecl/SPKG.rst b/build/pkgs/ecl/SPKG.rst new file mode 100644 index 00000000000..a4a701ff803 --- /dev/null +++ b/build/pkgs/ecl/SPKG.rst @@ -0,0 +1,77 @@ +ECL +=== + +Description +----------- + +ECL is an implementation of the Common Lisp language as defined by the +ANSI X3J13 specification. The most relevant features: + +- A bytecodes compiler and interpreter. +- Compiles Lisp also with any C/C++ compiler. +- It can build standalone executables and libraries. +- ASDF, Sockets, Gray streams, MOP, and other useful components. +- Extremely portable. +- A reasonable license. + +ECL supports the operating systems Linux, FreeBSD, NetBSD, OpenBSD, +Solaris and Windows, running on top of the Intel, Sparc, Alpha and +PowerPC processors. Porting to other architectures should be rather +easy. + +Website: http://ecls.sourceforge.net/ + +License +------- + +- LGPL V2+ or compatible - for details see + + http://ecls.sourceforge.net/license.html + +.. _upstream_contact: + +Upstream Contact +---------------- + +- the ECL mailing list - see http://ecls.sourceforge.net/resources.html + +Dependencies +------------ + +- mpir +- boehm_gc + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- As autotools need to be run after most of the patches are applied, + + we do all the patching in spkg-source. + +- Deleting the following directories saves space: without doing + + this, the tarball can grow from under 3 megabytes to more than 7 + megabytes. Deleting these files is done automatically by the + \`spkg-src\` script. + +- The directory msvc +- The directory src/gc-unstable +- The directory src/gmp +- The directory src/libffi +- Note: for the time being, ECL is built single threaded library as it + + seems to interact badly with the pexpect interface and Sage's signal + handling when built multithreaded. + +- Do NOT quote SAGE_LOCAL when setting CPPFLAGS and/or LDFLAGS, + + in spkg-install as this caused the build to break. See + http://trac.sagemath.org/sage_trac/ticket/10187#comment:117 + +- TODO: Add the ECL test suite, and an spkg-check file to run it. +- TODO: Make ECL use Sage's Boehm GC on MacOS X as well (but perhaps + + put some changes from ECL's into Sage's Boehm GC), then remove + the src/src/gc directory, too. diff --git a/build/pkgs/ecl/SPKG.txt b/build/pkgs/ecl/SPKG.txt deleted file mode 100644 index be945bb2319..00000000000 --- a/build/pkgs/ecl/SPKG.txt +++ /dev/null @@ -1,56 +0,0 @@ -= ECL = - -== Description == - -ECL is an implementation of the Common Lisp language as defined by the -ANSI X3J13 specification. The most relevant features: - - * A bytecodes compiler and interpreter. - * Compiles Lisp also with any C/C++ compiler. - * It can build standalone executables and libraries. - * ASDF, Sockets, Gray streams, MOP, and other useful components. - * Extremely portable. - * A reasonable license. - -ECL supports the operating systems Linux, FreeBSD, NetBSD, OpenBSD, -Solaris and Windows, running on top of the Intel, Sparc, Alpha and -PowerPC processors. Porting to other architectures should be rather -easy. - -Website: http://ecls.sourceforge.net/ - -== License == - - * LGPL V2+ or compatible - for details see - http://ecls.sourceforge.net/license.html - -== Upstream Contact == - - * the ECL mailing list - see http://ecls.sourceforge.net/resources.html - -== Dependencies == - - * mpir - * boehm_gc - -== Special Update/Build Instructions == - * As autotools need to be run after most of the patches are applied, - we do all the patching in spkg-source. - * Deleting the following directories saves space: without doing - this, the tarball can grow from under 3 megabytes to more than 7 - megabytes. Deleting these files is done automatically by the - `spkg-src` script. - - The directory msvc - - The directory src/gc-unstable - - The directory src/gmp - - The directory src/libffi - * Note: for the time being, ECL is built single threaded library as it - seems to interact badly with the pexpect interface and Sage's signal - handling when built multithreaded. - * Do NOT quote SAGE_LOCAL when setting CPPFLAGS and/or LDFLAGS, - in spkg-install as this caused the build to break. See - http://trac.sagemath.org/sage_trac/ticket/10187#comment:117 - * TODO: Add the ECL test suite, and an spkg-check file to run it. - * TODO: Make ECL use Sage's Boehm GC on MacOS X as well (but perhaps - put some changes from ECL's into Sage's Boehm GC), then remove - the src/src/gc directory, too. diff --git a/build/pkgs/eclib/SPKG.txt b/build/pkgs/eclib/SPKG.rst similarity index 62% rename from build/pkgs/eclib/SPKG.txt rename to build/pkgs/eclib/SPKG.rst index dfbd7424a9b..13c6155767d 100644 --- a/build/pkgs/eclib/SPKG.txt +++ b/build/pkgs/eclib/SPKG.rst @@ -1,6 +1,8 @@ -= eclib = +eclib +===== -== Description == +Description +----------- mwrank is a program written in C++ for computing Mordell-Weil groups of elliptic curves over Q via 2-descent. It is available as source code in @@ -13,19 +15,25 @@ to install Sage (which also of course gives you much much more). I no longer provide a source code distribution of mwrank by itself: use eclib instead. -== License == +License +------- eclib is licensed GPL v2+. -== Upstream Contact == +.. _upstream_contact: - * Author: John Cremona - * Email: john.cremona@gmail.com - * Website: http://homepages.warwick.ac.uk/staff/J.E.Cremona/mwrank/index.html - * Repository: https://github.com/JohnCremona/eclib +Upstream Contact +---------------- -== Dependencies == +- Author: John Cremona +- Email: john.cremona@gmail.com +- Website: + http://homepages.warwick.ac.uk/staff/J.E.Cremona/mwrank/index.html +- Repository: https://github.com/JohnCremona/eclib - * PARI - * NTL - * FLINT +Dependencies +------------ + +- PARI +- NTL +- FLINT diff --git a/build/pkgs/ecm/SPKG.txt b/build/pkgs/ecm/SPKG.rst similarity index 53% rename from build/pkgs/ecm/SPKG.txt rename to build/pkgs/ecm/SPKG.rst index 78c9dacbfa3..93490d6ee5d 100644 --- a/build/pkgs/ecm/SPKG.txt +++ b/build/pkgs/ecm/SPKG.rst @@ -1,35 +1,52 @@ -= ecm = +ecm +=== -== Description == +Description +----------- GMP-ECM - Elliptic Curve Method for Integer Factorization Sources can be obtained from http://gforge.inria.fr/projects/ecm/ -== License == +License +------- LGPL V3+ -== Upstream Contact == +.. _upstream_contact: - * ecm-discuss@lists.gforge.inria.fr (requires subscription) +Upstream Contact +---------------- -== Dependencies == +- ecm-discuss@lists.gforge.inria.fr (requires subscription) - * GMP/MPIR (Note: Python is *not* required for ordinary builds.) - * GNU patch +Dependencies +------------ -== Special Update/Build Instructions == +- GMP/MPIR (Note: Python is \*not\* required for ordinary builds.) +- GNU patch + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- GMP-ECM comes with a self-tuning feature; we could support - * GMP-ECM comes with a self-tuning feature; we could support that as an option ($SAGE_TUNE_*=yes) in the future. - * ECM currently does not (by itself) use the CC and CFLAGS settings + +- ECM currently does not (by itself) use the CC and CFLAGS settings + from 'gmp.h' since we pass (other) options in CFLAGS, and CC is set - by Sage and might got set by the user. We now at least partially fix that - such that "optimized" code generation options ('-mcpu=...', '-mtune=...') + by Sage and might got set by the user. We now at least partially fix + that + such that "optimized" code generation options ('-mcpu=...', + '-mtune=...') are used by gcc. - Of course a user can also manually enable them by setting the "global" - CFLAGS to e.g. '-march=native' on x86[_64] systems, or '-mcpu=...' and + Of course a user can also manually enable them by setting the + "global" + CFLAGS to e.g. '-march=native' on x86[_64] systems, or '-mcpu=...' + and '-mtune=...' on other architectures where "native" isn't supported. Note that this doesn't affect the packages' selection of processor- specific optimized [assembly] code. @@ -39,9 +56,15 @@ LGPL V3+ "-mcpu=...", and perhaps pass a more generic "--host=..." to 'configure'. (MPIR honors '--enable-fat' to some extent, but this option isn't used on anything other than x86 / x86_64.) - * We currently work around a linker bug on MacOS X 10.5 PPC (with + +- We currently work around a linker bug on MacOS X 10.5 PPC (with + GCC 4.2.1) which breaks 'configure' if debug symbols are enabled. - This *might* get fixed in later upstream releases. - * We could save some space by removing the `src/build.vc10/` directory which - isn't used in Sage. (It gets probably more worth in case also directories / + This \*might\* get fixed in later upstream releases. + +- We could save some space by removing the \`src/build.vc10/\` + directory which + + isn't used in Sage. (It gets probably more worth in case also + directories / files for later versions of Microsoft Visual C get added.) diff --git a/build/pkgs/elliptic_curves/SPKG.rst b/build/pkgs/elliptic_curves/SPKG.rst new file mode 100644 index 00000000000..0bdacbc65cf --- /dev/null +++ b/build/pkgs/elliptic_curves/SPKG.rst @@ -0,0 +1,37 @@ +elliptic_curves +=============== + +Description +----------- + +Includes two databases: + +- A small subset of John Cremona's database of elliptic curves up + + to conductor 10000. + +- William Stein's database of interesting curves + +.. _upstream_contact: + +Upstream Contact +---------------- + +cremona_mini +~~~~~~~~~~~~ + +- Author: John Cremona +- Email: john.cremona@gmail.com +- Website: http://johncremona.github.io/ecdata/ + +ellcurves +~~~~~~~~~ + +- Author: William Stein +- Email: wstein@gmail.com + +Dependencies +------------ + +- sqlite +- python diff --git a/build/pkgs/elliptic_curves/SPKG.txt b/build/pkgs/elliptic_curves/SPKG.txt deleted file mode 100644 index 5c5ac942b06..00000000000 --- a/build/pkgs/elliptic_curves/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= elliptic_curves = - -== Description == - -Includes two databases: - - * A small subset of John Cremona's database of elliptic curves up - to conductor 10000. - * William Stein's database of interesting curves - -== Upstream Contact == - -=== cremona_mini === - - * Author: John Cremona - * Email: john.cremona@gmail.com - * Website: http://johncremona.github.io/ecdata/ - -=== ellcurves === - - * Author: William Stein - * Email: wstein@gmail.com - -== Dependencies == - - * sqlite - * python - diff --git a/build/pkgs/entrypoints/SPKG.txt b/build/pkgs/entrypoints/SPKG.rst similarity index 57% rename from build/pkgs/entrypoints/SPKG.txt rename to build/pkgs/entrypoints/SPKG.rst index 89b2078a05a..45a491489a2 100644 --- a/build/pkgs/entrypoints/SPKG.txt +++ b/build/pkgs/entrypoints/SPKG.rst @@ -1,14 +1,22 @@ -= entrypoints = +entrypoints +=========== -== Description == +Description +----------- Discover and load entry points from installed packages. -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- https://github.com/takluyver/entrypoints -== Special Update/Build Instructions == +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- Upstream does not provide a source tarball, so the tarball was taken from github and renamed. diff --git a/build/pkgs/enum34/SPKG.txt b/build/pkgs/enum34/SPKG.rst similarity index 87% rename from build/pkgs/enum34/SPKG.txt rename to build/pkgs/enum34/SPKG.rst index 4deba1b8d21..98df0d9b429 100644 --- a/build/pkgs/enum34/SPKG.txt +++ b/build/pkgs/enum34/SPKG.rst @@ -1,6 +1,8 @@ -= enum34 = +enum34 +====== -== Description == +Description +----------- Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4 diff --git a/build/pkgs/fflas_ffpack/SPKG.rst b/build/pkgs/fflas_ffpack/SPKG.rst new file mode 100644 index 00000000000..4cdae414e0d --- /dev/null +++ b/build/pkgs/fflas_ffpack/SPKG.rst @@ -0,0 +1,40 @@ +FFLAS/FFPACK +============ + +Description +----------- + +FFLAS-FFPACK is a LGPL-2.1+ source code library for dense linear algebra +over word-size finite fields. + +http://linalg.org/projects/fflas-ffpack + +License +------- + +LGPL V2.1 or later + +.. _spkg_repository: + +SPKG Repository +--------------- + + https://bitbucket.org/malb/fflas-ffpack-spkg + +.. _upstream_contact: + +Upstream Contact +---------------- + +- + +Dependencies +------------ + +- Givaro +- ATLAS (non-OSX)/The Accelerate FrameWork (on OSX) + +Patches +------- + +- bash.patch: fix shebang line to "#!/usr/bin/env bash" diff --git a/build/pkgs/fflas_ffpack/SPKG.txt b/build/pkgs/fflas_ffpack/SPKG.txt deleted file mode 100644 index b09520745c0..00000000000 --- a/build/pkgs/fflas_ffpack/SPKG.txt +++ /dev/null @@ -1,30 +0,0 @@ -= FFLAS/FFPACK = - -== Description == - -FFLAS-FFPACK is a LGPL-2.1+ source code library for dense linear -algebra over word-size finite fields. - -http://linalg.org/projects/fflas-ffpack - -== License == - -LGPL V2.1 or later - -== SPKG Repository == - - https://bitbucket.org/malb/fflas-ffpack-spkg - -== Upstream Contact == - - * - -== Dependencies == - - * Givaro - * ATLAS (non-OSX)/The Accelerate FrameWork (on OSX) - -== Patches == - - * bash.patch: fix shebang line to "#!/usr/bin/env bash" - diff --git a/build/pkgs/flask/SPKG.txt b/build/pkgs/flask/SPKG.rst similarity index 84% rename from build/pkgs/flask/SPKG.txt rename to build/pkgs/flask/SPKG.rst index cf46f1da69e..2b80d810b4b 100644 --- a/build/pkgs/flask/SPKG.txt +++ b/build/pkgs/flask/SPKG.rst @@ -1,6 +1,8 @@ -= Flask = +Flask +===== -== Description == +Description +----------- A microframework based on Werkzeug, Jinja2 and good intentions diff --git a/build/pkgs/flask_autoindex/SPKG.txt b/build/pkgs/flask_autoindex/SPKG.rst similarity index 69% rename from build/pkgs/flask_autoindex/SPKG.txt rename to build/pkgs/flask_autoindex/SPKG.rst index 6ef8325067a..b83dee98c9c 100644 --- a/build/pkgs/flask_autoindex/SPKG.txt +++ b/build/pkgs/flask_autoindex/SPKG.rst @@ -1,6 +1,10 @@ -= Flask-AutoIndex = +.. _flask_autoindex: -== Description == +Flask-AutoIndex +=============== + +Description +----------- The mod_autoindex for Flask diff --git a/build/pkgs/flask_babel/SPKG.txt b/build/pkgs/flask_babel/SPKG.rst similarity index 55% rename from build/pkgs/flask_babel/SPKG.txt rename to build/pkgs/flask_babel/SPKG.rst index f96f6411918..4676433718d 100644 --- a/build/pkgs/flask_babel/SPKG.txt +++ b/build/pkgs/flask_babel/SPKG.rst @@ -1,6 +1,10 @@ -= Flask-Babel = +.. _flask_babel: -== Description == +Flask-Babel +=========== + +Description +----------- Adds i18n/l10n support to Flask applications with the help of the Babel library. diff --git a/build/pkgs/flask_oldsessions/SPKG.rst b/build/pkgs/flask_oldsessions/SPKG.rst new file mode 100644 index 00000000000..eff9a20741d --- /dev/null +++ b/build/pkgs/flask_oldsessions/SPKG.rst @@ -0,0 +1,9 @@ +.. _flask_oldsessions: + +Flask-OldSessions +================= + +Description +----------- + +Provides a session class that works like the one in Flask before 0.10. diff --git a/build/pkgs/flask_oldsessions/SPKG.txt b/build/pkgs/flask_oldsessions/SPKG.txt deleted file mode 100644 index 2af9b2ebb23..00000000000 --- a/build/pkgs/flask_oldsessions/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= Flask-OldSessions = - -== Description == - -Provides a session class that works like the one in Flask before 0.10. diff --git a/build/pkgs/flask_openid/SPKG.rst b/build/pkgs/flask_openid/SPKG.rst new file mode 100644 index 00000000000..4da174844d4 --- /dev/null +++ b/build/pkgs/flask_openid/SPKG.rst @@ -0,0 +1,9 @@ +.. _flask_openid: + +Flask-OpenID +============ + +Description +----------- + +OpenID support for Flask diff --git a/build/pkgs/flask_openid/SPKG.txt b/build/pkgs/flask_openid/SPKG.txt deleted file mode 100644 index 77aa5b1c152..00000000000 --- a/build/pkgs/flask_openid/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= Flask-OpenID = - -== Description == - -OpenID support for Flask diff --git a/build/pkgs/flask_silk/SPKG.txt b/build/pkgs/flask_silk/SPKG.rst similarity index 53% rename from build/pkgs/flask_silk/SPKG.txt rename to build/pkgs/flask_silk/SPKG.rst index 92d3009a886..094cbbdc40b 100644 --- a/build/pkgs/flask_silk/SPKG.txt +++ b/build/pkgs/flask_silk/SPKG.rst @@ -1,5 +1,9 @@ -= Flask-Silk = +.. _flask_silk: -== Description == +Flask-Silk +========== + +Description +----------- Adds silk icons to your Flask application or blueprint, or extension. diff --git a/build/pkgs/flint/SPKG.rst b/build/pkgs/flint/SPKG.rst new file mode 100644 index 00000000000..2106706b866 --- /dev/null +++ b/build/pkgs/flint/SPKG.rst @@ -0,0 +1,31 @@ +flint +===== + +Description +----------- + +FLINT is a C library for doing number theory, maintained by William +Hart. + +Website: www.flintlib.org + +License +------- + +FLINT is licensed GPL v2+. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- flint-devel Gougle Group + (http://groups.google.co.uk/group/flint-devel) +- William Hart + +Dependencies +------------ + +- MPIR +- MPFR +- NTL diff --git a/build/pkgs/flint/SPKG.txt b/build/pkgs/flint/SPKG.txt deleted file mode 100644 index 935850e3888..00000000000 --- a/build/pkgs/flint/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= flint = - -== Description == - -FLINT is a C library for doing number theory, maintained by William Hart. - -Website: www.flintlib.org - -== License == - -FLINT is licensed GPL v2+. - -== Upstream Contact == - - * flint-devel Gougle Group (http://groups.google.co.uk/group/flint-devel) - * William Hart - -== Dependencies == - - * MPIR - * MPFR - * NTL diff --git a/build/pkgs/flintqs/SPKG.rst b/build/pkgs/flintqs/SPKG.rst new file mode 100644 index 00000000000..be97a17a8ae --- /dev/null +++ b/build/pkgs/flintqs/SPKG.rst @@ -0,0 +1,8 @@ +This is William Hart's GPL'd highly optimized multi-polynomial quadratic +sieve for integer factorization: + + http://www.friedspace.com/QS/ + +See also http://www.maths.warwick.ac.uk/~masfaw/preprint.html + +See also the repository: https://github.com/sagemath/FlintQS diff --git a/build/pkgs/flintqs/SPKG.txt b/build/pkgs/flintqs/SPKG.txt deleted file mode 100644 index 037997b5595..00000000000 --- a/build/pkgs/flintqs/SPKG.txt +++ /dev/null @@ -1,9 +0,0 @@ -This is William Hart's GPL'd highly optimized multi-polynomial -quadratic sieve for integer factorization: - - http://www.friedspace.com/QS/ - -See also http://www.maths.warwick.ac.uk/~masfaw/preprint.html - -See also the repository: https://github.com/sagemath/FlintQS - diff --git a/build/pkgs/fplll/SPKG.rst b/build/pkgs/fplll/SPKG.rst new file mode 100644 index 00000000000..9c9d161435f --- /dev/null +++ b/build/pkgs/fplll/SPKG.rst @@ -0,0 +1,30 @@ +fplll +===== + +Description +----------- + +fplll contains implementations of several lattice algorithms. The +implementation relies on floating-point orthogonalization, and LLL is +central to the code, hence the name. + +Website: https://github.com/fplll/fplll + +License +------- + +- LGPL V2.1+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Martin Albrecht +- Mailing List https://groups.google.com/forum/#!forum/fplll-devel + +Dependencies +------------ + +- gmp +- mpfr diff --git a/build/pkgs/fplll/SPKG.txt b/build/pkgs/fplll/SPKG.txt deleted file mode 100644 index 5d806daf910..00000000000 --- a/build/pkgs/fplll/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= fplll = - -== Description == - -fplll contains implementations of several lattice algorithms. The -implementation relies on floating-point orthogonalization, and LLL is -central to the code, hence the name. - -Website: https://github.com/fplll/fplll - -== License == - * LGPL V2.1+ - -== Upstream Contact == - - * Martin Albrecht - * Mailing List https://groups.google.com/forum/#!forum/fplll-devel - -== Dependencies == - * gmp - * mpfr diff --git a/build/pkgs/fpylll/SPKG.rst b/build/pkgs/fpylll/SPKG.rst new file mode 100644 index 00000000000..441ba667e7f --- /dev/null +++ b/build/pkgs/fpylll/SPKG.rst @@ -0,0 +1,27 @@ +fpylll +====== + +Description +----------- + +A Python interface for https://github.com/fplll/fplll + +License +------- + +GPL version 2 or later + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://github.com/fplll/fpylll + +Dependencies +------------ + +- Cython +- fplll +- Sage (optional) +- NumPy (optional) diff --git a/build/pkgs/fpylll/SPKG.txt b/build/pkgs/fpylll/SPKG.txt deleted file mode 100644 index 54c48ca58d3..00000000000 --- a/build/pkgs/fpylll/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= fpylll = - -== Description == - -A Python interface for https://github.com/fplll/fplll - -== License == - -GPL version 2 or later - -== Upstream Contact == - -https://github.com/fplll/fpylll - -== Dependencies == - -* Cython -* fplll -* Sage (optional) -* NumPy (optional) diff --git a/build/pkgs/freetype/SPKG.rst b/build/pkgs/freetype/SPKG.rst new file mode 100644 index 00000000000..8d7fd4f28ec --- /dev/null +++ b/build/pkgs/freetype/SPKG.rst @@ -0,0 +1,52 @@ +FreeType +======== + +Description +----------- + +From the documentation: + +> FreeType is a software font engine that is designed to be small, > +efficient, highly customizable, and portable while capable of > +producing high-quality output (glyph images). It can be used in > +graphics libraries, display servers, font conversion tools, > text image +generation tools, and many other products as well. + +> Note that FreeType is a font service and doesn't provide APIs to > +perform higher-level features like text layout or graphics processing > +(e.g., colored text rendering, ‘hollowing’, etc.). However, it greatly > +simplifies these tasks by providing a simple, easy to use, and uniform > +interface to access the content of font files. + +> Please note that ‘FreeType’ is also called ‘FreeType 2’, to > +distinguish it from the old, deprecated ‘FreeType 1’ library, > a +predecessor no longer maintained and supported. + +The package in Sage is called freetype (in lowercase). + +License +------- + +- FreeType (BSD-like) +- GNU Public License v2 + +From the documentation: + +> FreeType is released under two open-source licenses: our own BSD-like +> FreeType License and the GNU Public License, Version 2. It can thus > +be used by any kind of projects, be they proprietary or not. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- home: https://www.freetype.org +- repo: +- official: http://git.savannah.gnu.org/cgit/freetype +- mirror: https://github.com/aseprite/freetype2/ + +Dependencies +------------ + +See the \`dependencies\` file. diff --git a/build/pkgs/freetype/SPKG.txt b/build/pkgs/freetype/SPKG.txt deleted file mode 100644 index 51773022212..00000000000 --- a/build/pkgs/freetype/SPKG.txt +++ /dev/null @@ -1,46 +0,0 @@ -= FreeType = - -== Description == - -From the documentation: - -> FreeType is a software font engine that is designed to be small, -> efficient, highly customizable, and portable while capable of -> producing high-quality output (glyph images). It can be used in -> graphics libraries, display servers, font conversion tools, -> text image generation tools, and many other products as well. - -> Note that FreeType is a font service and doesn't provide APIs to -> perform higher-level features like text layout or graphics processing -> (e.g., colored text rendering, ‘hollowing’, etc.). However, it greatly -> simplifies these tasks by providing a simple, easy to use, and uniform -> interface to access the content of font files. - -> Please note that ‘FreeType’ is also called ‘FreeType 2’, to -> distinguish it from the old, deprecated ‘FreeType 1’ library, -> a predecessor no longer maintained and supported. - -The package in Sage is called freetype (in lowercase). - -== License == - - * FreeType (BSD-like) - * GNU Public License v2 - -From the documentation: - -> FreeType is released under two open-source licenses: our own BSD-like -> FreeType License and the GNU Public License, Version 2. It can thus -> be used by any kind of projects, be they proprietary or not. - -== Upstream Contact == - - * home: https://www.freetype.org - * repo: - * official: http://git.savannah.gnu.org/cgit/freetype - * mirror: https://github.com/aseprite/freetype2/ - -== Dependencies == - -See the `dependencies` file. - diff --git a/build/pkgs/fricas/SPKG.rst b/build/pkgs/fricas/SPKG.rst new file mode 100644 index 00000000000..6d944a96ebf --- /dev/null +++ b/build/pkgs/fricas/SPKG.rst @@ -0,0 +1,24 @@ +fricas +====== + +Description +----------- + +FriCAS is a general purpose computer algebra system. + +License +------- + +Modified BSD license. + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://fricas.sourceforge.net/ + +Dependencies +------------ + +- ecl diff --git a/build/pkgs/fricas/SPKG.txt b/build/pkgs/fricas/SPKG.txt deleted file mode 100644 index 753f7318252..00000000000 --- a/build/pkgs/fricas/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= fricas = - -== Description == - -FriCAS is a general purpose computer algebra system. - -== License == - -Modified BSD license. - -== Upstream Contact == - -http://fricas.sourceforge.net/ - -== Dependencies == - - * ecl - - diff --git a/build/pkgs/frobby/SPKG.rst b/build/pkgs/frobby/SPKG.rst new file mode 100644 index 00000000000..f78e5cc6e1e --- /dev/null +++ b/build/pkgs/frobby/SPKG.rst @@ -0,0 +1,46 @@ +Frobby +====== + +Description +----------- + +The software package Frobby provides a number of computations on +monomial ideals. The current main feature is the socle of a monomial +ideal, which is largely equivalent to computing the maximal standard +monomials, the Alexander dual or the irreducible decomposition. + +Operations on monomial ideals are much faster than algorithms designed +for ideals in general, which is what makes a specialized library for +these operations on monomial ideals useful. + +License +------- + +- GPL version 2.0 or later + +Maintainers +----------- + +- Bjarke Hammersholt Roune (www.broune.com) + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Bjarke Hammersholt Roune (www.broune.com) + +Dependencies +------------ + +- GMP built with support for C++ + +.. _special_updatebuild_instructions: + +Special Update/Build instructions +--------------------------------- + +Download Frobby at www.broune.com/ and then type "make spkg VER=blah" +which wil create an spkg named frobby-VER.spkg in bin/. The files +related to doing this is in the sage/ sub-directory of the Frobby source +distribution. diff --git a/build/pkgs/frobby/SPKG.txt b/build/pkgs/frobby/SPKG.txt deleted file mode 100644 index 56abd52173f..00000000000 --- a/build/pkgs/frobby/SPKG.txt +++ /dev/null @@ -1,29 +0,0 @@ -= Frobby = - -== Description == -The software package Frobby provides a number of computations on -monomial ideals. The current main feature is the socle of a monomial -ideal, which is largely equivalent to computing the maximal standard -monomials, the Alexander dual or the irreducible decomposition. - -Operations on monomial ideals are much faster than algorithms designed -for ideals in general, which is what makes a specialized library for -these operations on monomial ideals useful. - -== License == - * GPL version 2.0 or later - -== Maintainers == - * Bjarke Hammersholt Roune (www.broune.com) - -== Upstream Contact == - * Bjarke Hammersholt Roune (www.broune.com) - -== Dependencies == - * GMP built with support for C++ - -== Special Update/Build instructions == -Download Frobby at www.broune.com/ and then type "make spkg VER=blah" which wil create an spkg -named frobby-VER.spkg in bin/. The files related to doing this is in the sage/ sub-directory of the -Frobby source distribution. - diff --git a/build/pkgs/functools32/SPKG.txt b/build/pkgs/functools32/SPKG.rst similarity index 53% rename from build/pkgs/functools32/SPKG.txt rename to build/pkgs/functools32/SPKG.rst index 8cab3c8ca44..1f5d27e9122 100644 --- a/build/pkgs/functools32/SPKG.txt +++ b/build/pkgs/functools32/SPKG.rst @@ -1,18 +1,25 @@ -= functools32 = +functools32 +=========== -== Description == +Description +----------- -Backport of the functools module from Python 3.2.3 for use on 2.7 and PyPy. +Backport of the functools module from Python 3.2.3 for use on 2.7 and +PyPy. -== License == +License +------- Python Software Foundation License -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- Home page: https://pypi.python.org/pypi/functools32 -== Dependencies == +Dependencies +------------ Python, Setuptools - diff --git a/build/pkgs/future/SPKG.txt b/build/pkgs/future/SPKG.rst similarity index 53% rename from build/pkgs/future/SPKG.txt rename to build/pkgs/future/SPKG.rst index c3fd24e9b50..92c1254f8e1 100644 --- a/build/pkgs/future/SPKG.txt +++ b/build/pkgs/future/SPKG.rst @@ -1,22 +1,27 @@ -= future = +future +====== -== Description == +Description +----------- Clean single-source support for Python 3 and 2 -future is the missing compatibility layer between Python 2 and Python -3. It allows you to use a single, clean Python 3.x-compatible codebase -to support both Python 2 and Python 3 with minimal overhead. +future is the missing compatibility layer between Python 2 and Python 3. +It allows you to use a single, clean Python 3.x-compatible codebase to +support both Python 2 and Python 3 with minimal overhead. It is designed to be used as follows: -from __future__ import (absolute_import, division, - print_function, unicode_literals) +from \__future_\_ import (absolute_import, division, + + print_function, unicode_literals) + from builtins import ( - bytes, dict, int, list, object, range, str, - ascii, chr, hex, input, next, oct, open, - pow, round, super, - filter, map, zip) + + bytes, dict, int, list, object, range, str, + ascii, chr, hex, input, next, oct, open, + pow, round, super, + filter, map, zip) followed by predominantly standard, idiomatic Python 3 code that then runs similarly on Python 2.6/2.7 and Python 3.3+. @@ -24,4 +29,3 @@ runs similarly on Python 2.6/2.7 and Python 3.3+. The imports have no effect on Python 3. On Python 2, they shadow the corresponding builtins, which normally have different semantics on Python 3 versus 2, to provide their Python 3 semantics. - diff --git a/build/pkgs/gambit/SPKG.rst b/build/pkgs/gambit/SPKG.rst new file mode 100644 index 00000000000..91af81e0a10 --- /dev/null +++ b/build/pkgs/gambit/SPKG.rst @@ -0,0 +1,31 @@ +gambit +====== + +Description +----------- + +Gambit is a set of software tools for doing computation on finite, +noncooperative games. The Gambit Project was founded in the mid-1980s by +Richard McKelvey at the California Institute of Technology. + +License +------- + +GPL v2+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Website: http://www.gambit-project.org/ +- Mailing List: http://sourceforge.net/p/gambit/mailman/gambit-devel/ + +Dependencies +------------ + +- python +- cython +- setuptools +- IPython +- scipy diff --git a/build/pkgs/gambit/SPKG.txt b/build/pkgs/gambit/SPKG.txt deleted file mode 100644 index 01710e57d06..00000000000 --- a/build/pkgs/gambit/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= gambit = - -== Description == - -Gambit is a set of software tools for doing computation on finite, -noncooperative games. The Gambit Project was founded in the mid-1980s by -Richard McKelvey at the California Institute of Technology. - -== License == - -GPL v2+ - -== Upstream Contact == - -* Website: http://www.gambit-project.org/ -* Mailing List: http://sourceforge.net/p/gambit/mailman/gambit-devel/ - -== Dependencies == - -* python -* cython -* setuptools -* IPython -* scipy diff --git a/build/pkgs/gap/SPKG.txt b/build/pkgs/gap/SPKG.rst similarity index 53% rename from build/pkgs/gap/SPKG.txt rename to build/pkgs/gap/SPKG.rst index 021c1578fb1..19f6111f279 100644 --- a/build/pkgs/gap/SPKG.txt +++ b/build/pkgs/gap/SPKG.rst @@ -1,6 +1,8 @@ -= GAP = +GAP +=== -== Description == +Description +----------- GAP is a system for computational discrete algebra, with particular emphasis on Computational Group Theory. GAP provides a programming @@ -10,38 +12,52 @@ of algebraic objects. See also the overview and the description of the mathematical capabilities. GAP is used in research and teaching for studying groups and their representations, rings, vector spaces, algebras, combinatorial structures, and more. The system, including -source, is distributed freely. You can study and easily modify or -extend it for your special use. +source, is distributed freely. You can study and easily modify or extend +it for your special use. -This is a stripped-down version of GAP. The databases, which are +This is a stripped-down version of GAP. The databases, which are architecture-independent, are in a separate package. -== Upstream Contact == +.. _upstream_contact: -David Joyner, wdjoyner@gmail.com (on the GAP team, but -Steve Linton, sal@dcs.st-and.ac.uk, is basically the lead developer) +Upstream Contact +---------------- -== Dependencies == +David Joyner, wdjoyner@gmail.com (on the GAP team, but Steve Linton, +sal@dcs.st-and.ac.uk, is basically the lead developer) - * Readline - * MPIR +Dependencies +------------ -== Special Update/Build Instructions == +- Readline +- MPIR + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- This is a stripped-down version of GAP. The downloading of the sources and removal of unneeded parts is done by the script spkg-src. When you update GAP, please also update and use the spkg-src script. - * Do we really want to copy everything from the build directory??? +- Do we really want to copy everything from the build directory??? + You need the full GAP tree to compile/install many GAP packages. - * There's apparently a command missing (in `spkg-install`) building the - (HTML?) documentation. Earlier changelog entries as well as the description - above state the documentation was removed from the upstream sources... +- There's apparently a command missing (in \`spkg-install`) building + the + + (HTML?) documentation. Earlier changelog entries as well as the + description + above state the documentation was removed from the upstream + sources... Since the (pre-)built HTML documentation is currently included, I've - commented out some lines in that part of `spkg-install`. -leif + commented out some lines in that part of \`spkg-install`. -leif + +Patches +~~~~~~~ -=== Patches === +- writeandcheck.patch: fix infinite loop in writeandcheck() when - * writeandcheck.patch: fix infinite loop in writeandcheck() when writing an error message fails. diff --git a/build/pkgs/gap3/SPKG.rst b/build/pkgs/gap3/SPKG.rst new file mode 100644 index 00000000000..1a276ec17ff --- /dev/null +++ b/build/pkgs/gap3/SPKG.rst @@ -0,0 +1,92 @@ +.. _jean_michels_gap_3_distribution: + +Jean Michel's GAP 3 distribution +================================ + +Description +----------- + +This package installs Jean Michel's pre-packaged GAP3, which is a +minimal GAP3 distribution containing packages that have no equivalent in +GAP4. + +Below is the full description from Jean Michel's webpage (accessed 23 +July 2015). + + A pre-packaged GAP3 with everything you need + + To help people who are just interested in GAP3 because they need a + package + which has not been ported to GAP4, I have prepared an easy-to install + minimal GAP3 distribution containing an up-to-date versions of the + packages: + + anusq, arep, autag, chevie, cryst, dce, grim, matrix, meataxe, + monoid, + nq, pcqa, sisyphos, specht, ve, vkcurve. + + These packages have been chosen since most have no equivalent in + GAP4. They + are autoloaded when starting gap. + + This distribution includes only partial lists of small groups, + 2-groups, + 3-groups, character tables from the Atlas and tables of marks. It + does not + include either the packages: + + anupq, grape, kbmag, xgap, cohomolo, gliss, guava, xmod + + which have some equivalent in GAP4. You can get these extra features + at + + http://www.math.rwth-aachen.de/~Frank.Luebeck/gap/GAP3 + + In this distribution: + +- The on-line help includes the documentation of the included packages. +- The html documentation (htm/index.html) also does. +- The manual (manual.pdf) also does. + +License +------- + +Most parts of the GAP distribution, including the core part of the GAP +system, are distributed under the terms of the GNU General Public +License (see http://www.gnu.org/licenses/gpl.html or the file GPL in the +etc directory of the GAP installation). + +.. _spkg_maintainers: + +SPKG Maintainers +---------------- + +- Christian Stump + +.. _upstream_contact: + +Upstream Contact +---------------- + +Jean Michel +http://webusers.imj-prg.fr/~jean.michel/ + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +The difference between the distributed tarball and Jean Michel's +original tarball also contains the binaries + +Patches +~~~~~~~ + +None + +Dependencies +------------ + += + +None diff --git a/build/pkgs/gap3/SPKG.txt b/build/pkgs/gap3/SPKG.txt deleted file mode 100644 index aee3bc3fe0f..00000000000 --- a/build/pkgs/gap3/SPKG.txt +++ /dev/null @@ -1,67 +0,0 @@ -= Jean Michel's GAP 3 distribution = - -== Description == - -This package installs Jean Michel's pre-packaged GAP3, which is a minimal GAP3 -distribution containing packages that have no equivalent in GAP4. - -Below is the full description from Jean Michel's webpage -(accessed 23 July 2015). - - A pre-packaged GAP3 with everything you need - - To help people who are just interested in GAP3 because they need a package - which has not been ported to GAP4, I have prepared an easy-to install - minimal GAP3 distribution containing an up-to-date versions of the - packages: - - anusq, arep, autag, chevie, cryst, dce, grim, matrix, meataxe, monoid, - nq, pcqa, sisyphos, specht, ve, vkcurve. - - These packages have been chosen since most have no equivalent in GAP4. They - are autoloaded when starting gap. - - This distribution includes only partial lists of small groups, 2-groups, - 3-groups, character tables from the Atlas and tables of marks. It does not - include either the packages: - - anupq, grape, kbmag, xgap, cohomolo, gliss, guava, xmod - - which have some equivalent in GAP4. You can get these extra features at - - http://www.math.rwth-aachen.de/~Frank.Luebeck/gap/GAP3 - - In this distribution: - - - The on-line help includes the documentation of the included packages. - - The html documentation (htm/index.html) also does. - - The manual (manual.pdf) also does. - -== License == - -Most parts of the GAP distribution, including the core part of the GAP system, -are distributed under the terms of the GNU General Public License (see -http://www.gnu.org/licenses/gpl.html or the file GPL in the etc directory of -the GAP installation). - -== SPKG Maintainers == - -* Christian Stump - -== Upstream Contact == - -Jean Michel -http://webusers.imj-prg.fr/~jean.michel/ - -== Special Update/Build Instructions == - -The difference between the distributed tarball and Jean Michel's -original tarball also contains the binaries - -=== Patches === - -None - -== Dependencies === - -None diff --git a/build/pkgs/gap_jupyter/SPKG.rst b/build/pkgs/gap_jupyter/SPKG.rst new file mode 100644 index 00000000000..ddc34974de4 --- /dev/null +++ b/build/pkgs/gap_jupyter/SPKG.rst @@ -0,0 +1,24 @@ +.. _jupyter_kernel_gap: + +jupyter-kernel-gap +================== + +Description +----------- + +Jupyter kernel for GAP + +This wrapper-kernel is a Jupyter kernel for the GAP Computer Algebra +System based on the same ideas as the bash wrapper kernel. + +License +------- + +3-Clause BSD License + +.. _upstream_contact: + +Upstream Contact +---------------- + +- https://github.com/gap-packages/jupyter-gap diff --git a/build/pkgs/gap_jupyter/SPKG.txt b/build/pkgs/gap_jupyter/SPKG.txt deleted file mode 100644 index 4e136a47c1c..00000000000 --- a/build/pkgs/gap_jupyter/SPKG.txt +++ /dev/null @@ -1,16 +0,0 @@ -= jupyter-kernel-gap = - -== Description == - -Jupyter kernel for GAP - -This wrapper-kernel is a Jupyter kernel for the GAP Computer Algebra System -based on the same ideas as the bash wrapper kernel. - -== License == - -3-Clause BSD License - -== Upstream Contact == - -* https://github.com/gap-packages/jupyter-gap diff --git a/build/pkgs/gap_packages/SPKG.rst b/build/pkgs/gap_packages/SPKG.rst new file mode 100644 index 00000000000..46863df2e58 --- /dev/null +++ b/build/pkgs/gap_packages/SPKG.rst @@ -0,0 +1,149 @@ +gap_packages +============ + +Description +----------- + +Several "official" and "undeposited" GAP packages available from +http://www.gap-system.org/Packages/packages.html + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Dmitrii Pasechnik, dimpase@gmail.com +- David Joyner, wdjoyner@gmail.com (on the GAP team) +- Steve Linton, sal@dcs.st-and.ac.uk (basically the GAP lead developer) + +Dependencies +------------ + +- GAP (a standard spkg) + +TODO +---- + +The crystallographic group packages are untested/untestable. They rely +on polymake and the dependency "cryst" is missing. This needs to be +cleaned up. + +Notes +----- + +A brief description of each package follows: + +cohomolo - The cohomolo package is a GAP interface to some \`C' programs +for computing Schur multipliers and covering groups of finite groups and +first and second cohomology groups of finite groups acting on finite +modules. (Author: Max Horn, Markus Pfeiffer) + +CoReLG - Contains functionality for working with real semisimple Lie +algebras. (Author: Heiko Dietrich, Paolo Faccin, Willem Adriaan de +Graaf) + +crime - package to compute the cohomology ring of finite p-groups, +induced maps, and Massey products. (Author: Marcus Bishop) + +cryst - Computing with crystallographic groups (Authors: Bettina Eick, +Franz Gähler, Werner Nickel) + +CTblLib - The GAP Character Table Library (Author: Thomas Breuer) + +DESIGN is a package for classifying, partitioning and studying block +designs. (Author: Leonard H. Soicher) + +FactInt is a package providing routines for factoring integers, in +particular: + +- Pollard's p-1 +- Williams' p+1 +- Elliptic Curves Method (ECM) +- Continued Fraction Algorithm (CFRAC) +- Multiple Polynomial Quadratic Sieve (MPQS) + +(Author: Stefan Kohl) + +GAPDoc is a package containing a definition of a structure for GAP +documentation, based on XML. It also contains conversion programs for +producing text-, DVI-, PDF- or HTML-versions of such documents, with +hyperlinks if possible. (Authors: Frank Luebeck, Max Neunhoeffer) + +GBNP - The GBNP package provides algorithms for computing Grobner bases +of noncommutative polynomials with coefficients from a field implemented +in GAP and with respect to the "total degree first then lexicographical" +ordering. Further provided are some variations, such as a weighted and +truncated version and a tracing facility. The word "algorithm" is to be +interpreted loosely here: in general one cannot expect such an algorithm +to terminate, as it would imply solvability of the word problem for +finitely presented (semi)groups. (Authors: A.M. Cohen, J.W. Knopper) + +GRAPE is a package for computing with graphs and groups, and is +primarily designed for constructing and analysing graphs related to +groups, finite geometries, and designs. (Author: Leonard H. Soicher) + +GUAVA is included here, and with Sage standard. + +HAP (Homological Algebra Programming) is a GAP package providing some +functions for group cohomology computation. (Author: Graham Ellis) + +HAPcryst - an extension package for HAP, which allows for group +cohomology computation for a wider class of groups. (Author: Marc +Roeder) + +hecke - Provides functions for calculating decomposition matrices of +Hecke algebras of the symmetric groups and q-Schur algebras. Hecke is a +port of the GAP 3 package Specht 2.4 to GAP 4. (Author: Dmitriy Traytel) + +LAGUNA - this package provides functionality for calculation of the +normalized unit group of the modular group algebra of the finite p-group +and for investigation of Lie algebra associated with group algebras and +other associative algebras. (Authors :Victor Bovdi, Alexander Konovalov, +Richard Rossmanith, Csaba Schneider) + +liealgdb - A database of Lie algebras (Author: Serena Cicalo', Willem +Adriaan de Graaf, Csaba Schneider) + +LiePRing - Database and algorithms for Lie p-rings (Author: Michael +Vaughan-Lee, Bettina Eick) + +LieRing - contains functionality for working with finitely presented Lie +rings and the Lazard correspondence. (Author: Serena Cicalo', Willem +Adriaan de Graaf) + +loops - Provides researchers in nonassociative algebra with a +computational tool that integrates standard notions of loop theory with +libraries of loops and group-theoretical algorithms of GAP. The package +also expands GAP toward nonassociative structures. (Authors: Gabor Nagy, +Petr Vojtechovsky) + +mapclass - The package calculates the mapping class group orbits for a +given finite group. (Authors: Adam James, Kay Magaard, Sergey +Shpectorov, Helmut Volklein) + +polymake - an interface with the (standalone) polymake program used by +HAPcryst. (Author: Marc Roeder) + +qpa - Quivers and Path Algebras provides data structures and algorithms +for doing computations with finite dimensional quotients of path +algebras, and finitely generated modules over such algebras. The current +version of the QPA package has data structures for quivers, quotients of +path algebras, and modules, homomorphisms and complexes of modules over +quotients of path algebras. (Authors: Edward Green, Oeyvind Solberg) + +quagroup - Contains functionality for working with quantized enveloping +algebras of finite-dimensional semisimple Lie algebras. (Author: Willem +Adriaan de Graaf) + +repsn - The package provides GAP functions for computing characteristic +zero matrix representations of finite groups. (Author: Vahid Dabbaghian) + +sla - a package for doing computations with simple Lie algebras (Author: +Willem Adriaan de Graaf) + +SONATA ("System Of Nearrings And Their Applications") is a package which +constructs finite nearrings and related objects. (Authors: Erhard +Aichinger, Franz Binder, Jürgen Ecker, Peter Mayr, Christof Noebauer) + +TORIC is a GAP package for computing with toric varieties. (Author: +David Joyner) diff --git a/build/pkgs/gap_packages/SPKG.txt b/build/pkgs/gap_packages/SPKG.txt deleted file mode 100644 index b50a4430aff..00000000000 --- a/build/pkgs/gap_packages/SPKG.txt +++ /dev/null @@ -1,152 +0,0 @@ -= gap_packages = - -== Description == - -Several "official" and "undeposited" GAP packages available from -http://www.gap-system.org/Packages/packages.html - -== Upstream Contact == - - * Dmitrii Pasechnik, dimpase@gmail.com - * David Joyner, wdjoyner@gmail.com (on the GAP team) - * Steve Linton, sal@dcs.st-and.ac.uk (basically the GAP lead developer) - -== Dependencies == - - * GAP (a standard spkg) - -== TODO == - -The crystallographic group packages are untested/untestable. They rely -on polymake and the dependency "cryst" is missing. This needs to be -cleaned up. - -== Notes == - -A brief description of each package follows: - -cohomolo - The cohomolo package is a GAP interface to some -`C' programs for computing Schur multipliers and covering groups -of finite groups and first and second cohomology groups of finite -groups acting on finite modules. -(Author: Max Horn, Markus Pfeiffer) - -CoReLG - Contains functionality for working with real semisimple -Lie algebras. -(Author: Heiko Dietrich, Paolo Faccin, Willem Adriaan de Graaf) - -crime - package to compute the cohomology ring of finite -p-groups, induced maps, and Massey products. -(Author: Marcus Bishop) - -cryst - Computing with crystallographic groups -(Authors: Bettina Eick, Franz Gähler, Werner Nickel) - -CTblLib - The GAP Character Table Library -(Author: Thomas Breuer) - -DESIGN is a package for classifying, partitioning and studying block designs. -(Author: Leonard H. Soicher) - -FactInt is a package providing routines for factoring integers, in particular: - * Pollard's p-1 - * Williams' p+1 - * Elliptic Curves Method (ECM) - * Continued Fraction Algorithm (CFRAC) - * Multiple Polynomial Quadratic Sieve (MPQS) -(Author: Stefan Kohl) - -GAPDoc is a package containing a definition of a structure for -GAP documentation, based on XML. It also contains conversion -programs for producing text-, DVI-, PDF- or HTML-versions of such -documents, with hyperlinks if possible. -(Authors: Frank Luebeck, Max Neunhoeffer) - -GBNP - The GBNP package provides algorithms for computing Grobner bases -of noncommutative polynomials with coefficients from a field implemented -in GAP and with respect to the "total degree first then lexicographical" -ordering. Further provided are some variations, such as a weighted and -truncated version and a tracing facility. The word "algorithm" is to be -interpreted loosely here: in general one cannot expect such an algorithm -to terminate, as it would imply solvability of the word problem for -finitely presented (semi)groups. -(Authors: A.M. Cohen, J.W. Knopper) - -GRAPE is a package for computing with graphs and groups, and is primarily -designed for constructing and analysing graphs related to groups, -finite geometries, and designs. -(Author: Leonard H. Soicher) - -GUAVA is included here, and with Sage standard. - -HAP (Homological Algebra Programming) is a GAP package -providing some functions for group cohomology computation. -(Author: Graham Ellis) - -HAPcryst - an extension package for HAP, which allows for -group cohomology computation for a wider class of groups. -(Author: Marc Roeder) - -hecke - Provides functions for calculating decomposition matrices -of Hecke algebras of the symmetric groups and q-Schur algebras. -Hecke is a port of the GAP 3 package Specht 2.4 to GAP 4. -(Author: Dmitriy Traytel) - -LAGUNA - this package provides functionality for calculation of the -normalized unit group of the modular group algebra of the finite -p-group and for investigation of Lie algebra associated with group -algebras and other associative algebras. -(Authors :Victor Bovdi, Alexander Konovalov, Richard Rossmanith, -Csaba Schneider) - -liealgdb - A database of Lie algebras -(Author: Serena Cicalo', Willem Adriaan de Graaf, Csaba Schneider) - -LiePRing - Database and algorithms for Lie p-rings -(Author: Michael Vaughan-Lee, Bettina Eick) - -LieRing - contains functionality for working with finitely -presented Lie rings and the Lazard correspondence. -(Author: Serena Cicalo', Willem Adriaan de Graaf) - -loops - Provides researchers in nonassociative algebra with a -computational tool that integrates standard notions of loop theory -with libraries of loops and group-theoretical algorithms of GAP. -The package also expands GAP toward nonassociative structures. -(Authors: Gabor Nagy, Petr Vojtechovsky) - -mapclass - The package calculates the mapping class group orbits -for a given finite group. -(Authors: Adam James, Kay Magaard, Sergey Shpectorov, Helmut Volklein) - -polymake - an interface with the (standalone) polymake program -used by HAPcryst. -(Author: Marc Roeder) - -qpa - Quivers and Path Algebras provides data structures and -algorithms for doing computations with finite dimensional quotients -of path algebras, and finitely generated modules over such algebras. -The current version of the QPA package has data structures for quivers, -quotients of path algebras, and modules, homomorphisms and complexes -of modules over quotients of path algebras. -(Authors: Edward Green, Oeyvind Solberg) - -quagroup - Contains functionality for working with quantized -enveloping algebras of finite-dimensional semisimple Lie algebras. -(Author: Willem Adriaan de Graaf) - -repsn - The package provides GAP functions for computing -characteristic zero matrix representations of finite groups. -(Author: Vahid Dabbaghian) - -sla - a package for doing computations with simple Lie algebras -(Author: Willem Adriaan de Graaf) - -SONATA ("System Of Nearrings And Their Applications") is a package -which constructs finite nearrings and related objects. -(Authors: Erhard Aichinger, Franz Binder, Jürgen Ecker, Peter Mayr, -Christof Noebauer) - -TORIC is a GAP package for computing with toric varieties. -(Author: David Joyner) - diff --git a/build/pkgs/gc/SPKG.rst b/build/pkgs/gc/SPKG.rst new file mode 100644 index 00000000000..7ba6cb2da90 --- /dev/null +++ b/build/pkgs/gc/SPKG.rst @@ -0,0 +1,37 @@ +gc +== + +Description +----------- + +The Boehm-Demers-Weiser conservative garbage collector. + +License +------- + +- Permissive BSD + GPL 2.0+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +Webpage: http://www.hboehm.info/gc/ Email List: +bdwgc@lists.opendylan.org + +Dependencies +------------ + +None. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. + +Patches +~~~~~~~ + +- cygwin64.patch: let libgc build on Cygwin64. diff --git a/build/pkgs/gc/SPKG.txt b/build/pkgs/gc/SPKG.txt deleted file mode 100644 index fc72c50600f..00000000000 --- a/build/pkgs/gc/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= gc = - -== Description == - -The Boehm-Demers-Weiser conservative garbage collector. - -== License == - -* Permissive BSD + GPL 2.0+ - -== Upstream Contact == - -Webpage: http://www.hboehm.info/gc/ -Email List: bdwgc@lists.opendylan.org - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -None. - -=== Patches === - * cygwin64.patch: let libgc build on Cygwin64. diff --git a/build/pkgs/gcc/SPKG.rst b/build/pkgs/gcc/SPKG.rst new file mode 100644 index 00000000000..fec25c23522 --- /dev/null +++ b/build/pkgs/gcc/SPKG.rst @@ -0,0 +1,34 @@ +gcc +=== + +Description +----------- + +The GNU Compiler Collection, including the C, C++ and Fortran compiler. + +License +------- + +GPL version 2 or version 3 + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://gcc.gnu.org/ + +Dependencies +------------ + +- zlib +- MPIR +- MPFR +- MPC + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/gcc/SPKG.txt b/build/pkgs/gcc/SPKG.txt deleted file mode 100644 index 3af5759c43c..00000000000 --- a/build/pkgs/gcc/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= gcc = - -== Description == - -The GNU Compiler Collection, including the C, C++ and Fortran compiler. - -== License == - -GPL version 2 or version 3 - -== Upstream Contact == - -http://gcc.gnu.org/ - -== Dependencies == - - * zlib - * MPIR - * MPFR - * MPC - -== Special Update/Build Instructions == - -None. diff --git a/build/pkgs/gdb/SPKG.rst b/build/pkgs/gdb/SPKG.rst new file mode 100644 index 00000000000..33e1599a6e1 --- /dev/null +++ b/build/pkgs/gdb/SPKG.rst @@ -0,0 +1,38 @@ +GDB +=== + +Description +----------- + +GDB, the GNU Project debugger, allows you to see what is going on +"inside" another program while it executes -- or what another program +was doing at the moment it crashed. + +License +------- + +GPL v3+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://www.gnu.org/software/gdb/ + +Dependencies +------------ + +- python +- mpc +- mpfr +- ppl +- gmp/mpir +- makeinfo (external) + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +Current version needs makeinfo installed to build successfully. diff --git a/build/pkgs/gdb/SPKG.txt b/build/pkgs/gdb/SPKG.txt deleted file mode 100644 index 865c08f30ac..00000000000 --- a/build/pkgs/gdb/SPKG.txt +++ /dev/null @@ -1,29 +0,0 @@ -= GDB = - -== Description == - -GDB, the GNU Project debugger, allows you to see what is going on -"inside" another program while it executes -- or what another program -was doing at the moment it crashed. - -== License == - -GPL v3+ - -== Upstream Contact == - -http://www.gnu.org/software/gdb/ - -== Dependencies == - -* python -* mpc -* mpfr -* ppl -* gmp/mpir -* makeinfo (external) - -== Special Update/Build Instructions == - -Current version needs makeinfo installed -to build successfully. diff --git a/build/pkgs/gf2x/SPKG.rst b/build/pkgs/gf2x/SPKG.rst new file mode 100644 index 00000000000..ae93d6ceae8 --- /dev/null +++ b/build/pkgs/gf2x/SPKG.rst @@ -0,0 +1,70 @@ +gf2x +==== + +Description +----------- + +gf2x is a C/C++ software package containing routines for fast arithmetic +in GF(2)[x] (multiplication, squaring, GCD) and searching for +irreducible/primitive trinomials. + +Website: http://gf2x.gforge.inria.fr/ + +License +------- + +- GNU GPLv2+. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Richard Brent +- Pierrick Gaudry +- Emmanuel Thomé +- Paul Zimmermann + +Dependencies +------------ + +- None + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- As some patches touch config/acinclude.m4, we have to touch + aclocal.m4, + + configure, Makefile.in and gf2x/gf2x-config.h.in to prevent autotools + to try to regenerate these files. + +Patches +~~~~~~~ + +- 0001-Trac-15014-Let-gf2x-build-a-shared-library-on-Cygwin.patch: pass +- no-undefined flag to libtool. +- 0002-tr-portability.patch: backport upstream fix for non-portable tr + use +- 0003-Improve-detection-of-sse2-support.patch: backport upstream + improved + + check for sse2 + +- 0004-Add-disable-hardware-specific-code.patch: add option +- -disable-hardware-specific-code to build system. This is partly + + backported from upstream. + +- 0005-Update-autotooled-files.patch: the above patches make changes to + + code used by autotools for generation of the build system. This + patches + those files, so that autotools need not be installed. + +- 0006-Fix_make_check_not_failing_on_errors.patch: (upstream patch) + + Fix bug in shell script such that 'make check' always fails upon + errors. diff --git a/build/pkgs/gf2x/SPKG.txt b/build/pkgs/gf2x/SPKG.txt deleted file mode 100644 index f383bef530c..00000000000 --- a/build/pkgs/gf2x/SPKG.txt +++ /dev/null @@ -1,40 +0,0 @@ -= gf2x = - -== Description == -gf2x is a C/C++ software package containing routines for fast arithmetic -in GF(2)[x] (multiplication, squaring, GCD) and searching for -irreducible/primitive trinomials. - -Website: http://gf2x.gforge.inria.fr/ - -== License == - * GNU GPLv2+. - -== Upstream Contact == - * Richard Brent - * Pierrick Gaudry - * Emmanuel Thomé - * Paul Zimmermann - -== Dependencies == - * None - -== Special Update/Build Instructions == - * As some patches touch config/acinclude.m4, we have to touch aclocal.m4, - configure, Makefile.in and gf2x/gf2x-config.h.in to prevent autotools - to try to regenerate these files. - -=== Patches === - * 0001-Trac-15014-Let-gf2x-build-a-shared-library-on-Cygwin.patch: pass - -no-undefined flag to libtool. - * 0002-tr-portability.patch: backport upstream fix for non-portable tr use - * 0003-Improve-detection-of-sse2-support.patch: backport upstream improved - check for sse2 - * 0004-Add-disable-hardware-specific-code.patch: add option - --disable-hardware-specific-code to build system. This is partly - backported from upstream. - * 0005-Update-autotooled-files.patch: the above patches make changes to - code used by autotools for generation of the build system. This patches - those files, so that autotools need not be installed. - * 0006-Fix_make_check_not_failing_on_errors.patch: (upstream patch) - Fix bug in shell script such that 'make check' always fails upon errors. diff --git a/build/pkgs/gfan/SPKG.rst b/build/pkgs/gfan/SPKG.rst new file mode 100644 index 00000000000..a78f232e1f6 --- /dev/null +++ b/build/pkgs/gfan/SPKG.rst @@ -0,0 +1,48 @@ +gfan +==== + +Description +----------- + +Gfan is a software package for computing Groebner fans and tropical +varieties. These are polyhedral fans associated to polynomial ideals. +The maximal cones of a Groebner fan are in bijection with the marked +reduced Groebner bases of its defining ideal. The software computes all +marked reduced Groebner bases of an ideal. Their union is a universal +Groebner basis. The tropical variety of a polynomial ideal is a certain +subcomplex of the Groebner fan. Gfan contains algorithms for computing +this complex for general ideals and specialized algorithms for tropical +curves, tropical hypersurfaces and tropical varieties of prime ideals. +In addition to the above core functions the package contains many tools +which are useful in the study of Groebner bases, initial ideals and +tropical geometry. The full list of commands can be found in Appendix B +of the manual. For ordinary Groebner basis computations Gfan is not +competitive in speed compared to programs such as CoCoA, Singular and +Macaulay2. + +License +------- + +- GPL version 2 or version 3 (according to the gfan website) + +.. _upstream_contact: + +Upstream Contact +---------------- + +Anders Nedergaard Jensen; for contact info check out +http://home.imf.au.dk/jensen/software/gfan/gfan.html + +Dependencies +------------ + +- GMP/MPIR +- CDDLIB + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +Remove the doc, homepage, and examples subdirectories, which take up +most of the space. diff --git a/build/pkgs/gfan/SPKG.txt b/build/pkgs/gfan/SPKG.txt deleted file mode 100644 index 022c47d1c0b..00000000000 --- a/build/pkgs/gfan/SPKG.txt +++ /dev/null @@ -1,36 +0,0 @@ -= gfan = - -== Description == - -Gfan is a software package for computing Groebner fans and tropical varieties. -These are polyhedral fans associated to polynomial ideals. The maximal cones -of a Groebner fan are in bijection with the marked reduced Groebner bases of -its defining ideal. The software computes all marked reduced Groebner bases of -an ideal. Their union is a universal Groebner basis. The tropical variety of a -polynomial ideal is a certain subcomplex of the Groebner fan. Gfan contains -algorithms for computing this complex for general ideals and specialized -algorithms for tropical curves, tropical hypersurfaces and tropical varieties -of prime ideals. In addition to the above core functions the package contains -many tools which are useful in the study of Groebner bases, initial ideals and -tropical geometry. The full list of commands can be found in Appendix B of the -manual. For ordinary Groebner basis computations Gfan is not competitive in -speed compared to programs such as CoCoA, Singular and Macaulay2. - -== License == - - * GPL version 2 or version 3 (according to the gfan website) - -== Upstream Contact == - -Anders Nedergaard Jensen; for contact info check out -http://home.imf.au.dk/jensen/software/gfan/gfan.html - -== Dependencies == - - * GMP/MPIR - * CDDLIB - -== Special Update/Build Instructions == - -Remove the doc, homepage, and examples subdirectories, which take up -most of the space. diff --git a/build/pkgs/gfortran/SPKG.rst b/build/pkgs/gfortran/SPKG.rst new file mode 100644 index 00000000000..c9fa89477d9 --- /dev/null +++ b/build/pkgs/gfortran/SPKG.rst @@ -0,0 +1,35 @@ +gfortran +======== + +Description +----------- + +The GNU Compiler Collection, including the C, C++ and Fortran compiler. +This particular package is meant to only make gfortran available. + +License +------- + +GPL version 2 or version 3 + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://gcc.gnu.org/ + +Dependencies +------------ + +- zlib +- MPIR +- MPFR +- MPC + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/gfortran/SPKG.txt b/build/pkgs/gfortran/SPKG.txt deleted file mode 100644 index 0f9c79bf9dc..00000000000 --- a/build/pkgs/gfortran/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= gfortran = - -== Description == - -The GNU Compiler Collection, including the C, C++ and Fortran compiler. -This particular package is meant to only make gfortran available. - -== License == - -GPL version 2 or version 3 - -== Upstream Contact == - -http://gcc.gnu.org/ - -== Dependencies == - - * zlib - * MPIR - * MPFR - * MPC - -== Special Update/Build Instructions == - -None. diff --git a/build/pkgs/giac/SPKG.rst b/build/pkgs/giac/SPKG.rst new file mode 100644 index 00000000000..d4518c0aa22 --- /dev/null +++ b/build/pkgs/giac/SPKG.rst @@ -0,0 +1,59 @@ +GIAC +==== + +Description +----------- + +- Giac is a general purpose Computer algebra system by Bernard Parisse. + It consists of: +- a C++ library (libgiac). +- a command line interpreter (icas or giac). +- the built of the FLTK-based GUI (xcas) has been disabled in the + spkg-install file. + +- The english documentation will be installed in: + + $SAGE_LOCAL/share/giac/doc/en/cascmd_en/index.html + +- -Author's website with debian, ubuntu, macosx, windows package: + + http://www-fourier.ujf-grenoble.fr/~parisse/giac.html + +- The Freebsd port is math/giacxcas + +Licence +------- + +GPLv3+ + +Note: except the french html documentation which is freely +redistributable for non commercial only purposes. This doc has been +removed in the Sage package, see spkg-src + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Bernard Parisse: + http://www-fourier.ujf-grenoble.fr/~parisse/giac.html +- Source file (giac-x.y.z-t.tar.gz) in: + + http://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/ + +Dependencies +------------ + +- gettext, readline +- giac will benefit of ntl, pari, mpfr, gsl, lapack but they should be + already installed by sage. +- giac can also benefit of mpfi for arithmetic on intervals. +- The Documentation is pre-built, hevea or latex or ... are not needed + to install the package. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- Use spkg-src to update this package diff --git a/build/pkgs/giac/SPKG.txt b/build/pkgs/giac/SPKG.txt deleted file mode 100644 index d4d0a35ba5b..00000000000 --- a/build/pkgs/giac/SPKG.txt +++ /dev/null @@ -1,40 +0,0 @@ -= GIAC = - -== Description == - - * Giac is a general purpose Computer algebra system by Bernard Parisse. It consists of: - - a C++ library (libgiac). - - a command line interpreter (icas or giac). - - the built of the FLTK-based GUI (xcas) has been disabled in the spkg-install file. - - * The english documentation will be installed in: - $SAGE_LOCAL/share/giac/doc/en/cascmd_en/index.html - - * -Author's website with debian, ubuntu, macosx, windows package: - http://www-fourier.ujf-grenoble.fr/~parisse/giac.html - -The Freebsd port is math/giacxcas - -== Licence == - -GPLv3+ - -Note: except the french html documentation which is freely -redistributable for non commercial only purposes. This doc has been -removed in the Sage package, see spkg-src - -== Upstream Contact == - - * Bernard Parisse: http://www-fourier.ujf-grenoble.fr/~parisse/giac.html - * Source file (giac-x.y.z-t.tar.gz) in: - http://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/ - -== Dependencies == - - * gettext, readline - * giac will benefit of ntl, pari, mpfr, gsl, lapack but they should be already installed by sage. - * giac can also benefit of mpfi for arithmetic on intervals. - * The Documentation is pre-built, hevea or latex or ... are not needed to install the package. - -== Special Update/Build Instructions == - - * Use spkg-src to update this package diff --git a/build/pkgs/giacpy_sage/SPKG.rst b/build/pkgs/giacpy_sage/SPKG.rst new file mode 100644 index 00000000000..a3634e2ea62 --- /dev/null +++ b/build/pkgs/giacpy_sage/SPKG.rst @@ -0,0 +1,33 @@ +GIACPY +====== + +Description +----------- + +- Giacpy is a cython frontend to the c++ library giac. This is the sage + version. +- The sage version of giacpy after 0.6 is renamed to giacpy_sage + +Licence +------- + +GPLv2 or above + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Han Frederic: frederic.han@imj-prg.fr + + https://www.imj-prg.fr/~frederic.han/xcas/giacpy/ + +Dependencies +------------ + +- gmp, giac (the C++ library libgiac and headers) + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/giacpy_sage/SPKG.txt b/build/pkgs/giacpy_sage/SPKG.txt deleted file mode 100644 index 37a49a2ec9a..00000000000 --- a/build/pkgs/giacpy_sage/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= GIACPY = - -== Description == - - * Giacpy is a cython frontend to the c++ library giac. This is the sage version. - * The sage version of giacpy after 0.6 is renamed to giacpy_sage - -== Licence == - -GPLv2 or above - -== Upstream Contact == - - * Han Frederic: frederic.han@imj-prg.fr - https://www.imj-prg.fr/~frederic.han/xcas/giacpy/ - -== Dependencies == - - * gmp, giac (the C++ library libgiac and headers) - -== Special Update/Build Instructions == - diff --git a/build/pkgs/git/SPKG.rst b/build/pkgs/git/SPKG.rst new file mode 100644 index 00000000000..21e60a6692d --- /dev/null +++ b/build/pkgs/git/SPKG.rst @@ -0,0 +1,30 @@ +.. _git___the_stupid_content_tracker: + +git - the stupid content tracker +================================ + +Description +----------- + + Git is a fast, scalable, distributed revision control system with an + unusually rich command set that provides both high-operations and + full access to internals. + +- - \`man git\` + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Maintainer: Junio C. Hamano +- Website: http://git-scm.com/ + +Dependencies +------------ + +- zlib + +Note: excluding libcurl and expat because they are large and only +required if you're communicating with repositories over HTTP. If you +need to do so, please use an external version of git. diff --git a/build/pkgs/git/SPKG.txt b/build/pkgs/git/SPKG.txt deleted file mode 100644 index a2c8e31260a..00000000000 --- a/build/pkgs/git/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= git - the stupid content tracker = - -== Description == - - Git is a fast, scalable, distributed revision control system with an - unusually rich command set that provides both high-operations and - full access to internals. - - -- `man git` - -== Upstream Contact == - - * Maintainer: Junio C. Hamano - * Website: http://git-scm.com/ - -== Dependencies == - - * zlib - -Note: excluding libcurl and expat because they are large and only -required if you're communicating with repositories over HTTP. If you -need to do so, please use an external version of git. - diff --git a/build/pkgs/git_trac/SPKG.rst b/build/pkgs/git_trac/SPKG.rst new file mode 100644 index 00000000000..968a9465d03 --- /dev/null +++ b/build/pkgs/git_trac/SPKG.rst @@ -0,0 +1,35 @@ +.. _git_trac: + +Git-Trac +======== + +Description +----------- + +This module implements a "git trac" subcommand of the git suite that +interfaces with trac over XMLRPC. + +License +------- + +GPLv3+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://github.com/sagemath/git-trac-command Volker Braun + + +Dependencies +------------ + +- python 2.7 or 3.3+ + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +Nothing special, just use the provided setup.py diff --git a/build/pkgs/git_trac/SPKG.txt b/build/pkgs/git_trac/SPKG.txt deleted file mode 100644 index 08c3b2b7683..00000000000 --- a/build/pkgs/git_trac/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= Git-Trac = - -== Description == - -This module implements a "git trac" subcommand of the git suite that -interfaces with trac over XMLRPC. - -== License == - -GPLv3+ - -== Upstream Contact == - -https://github.com/sagemath/git-trac-command -Volker Braun - -== Dependencies == - -* python 2.7 or 3.3+ - -== Special Update/Build Instructions == - -Nothing special, just use the provided setup.py - diff --git a/build/pkgs/givaro/SPKG.rst b/build/pkgs/givaro/SPKG.rst new file mode 100644 index 00000000000..0e95bc5ccd5 --- /dev/null +++ b/build/pkgs/givaro/SPKG.rst @@ -0,0 +1,37 @@ +Givaro +====== + +Description +----------- + +Givaro is a C++ library for arithmetic and algebraic computations. Its +main features are implementations of the basic arithmetic of many +mathematical entities: Primes fields, Extensions Fields, Finite Fields, +Finite Rings, Polynomials, Algebraic numbers, Arbitrary precision +integers and rationals (C++ wrappers over gmp) It also provides +data-structures and templated classes for the manipulation of basic +algebraic objects, such as vectors, matrices (dense, sparse, +structured), univariate polynomials (and therefore recursive +multivariate). + +Website: http://www-lmc.imag.fr/CASYS/LOGICIELS/givaro/ + +SPKG Repository: https://bitbucket.org/malb/givaro-spkg + +License +------- + +- GNU GPL + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Clement Pernet + +Dependencies +------------ + +- GNU patch +- GMP/MPIR diff --git a/build/pkgs/givaro/SPKG.txt b/build/pkgs/givaro/SPKG.txt deleted file mode 100644 index 276d555dc03..00000000000 --- a/build/pkgs/givaro/SPKG.txt +++ /dev/null @@ -1,31 +0,0 @@ -= Givaro = - -== Description == - -Givaro is a C++ library for arithmetic and algebraic computations. Its -main features are implementations of the basic arithmetic of many -mathematical entities: Primes fields, Extensions Fields, Finite -Fields, Finite Rings, Polynomials, Algebraic numbers, Arbitrary -precision integers and rationals (C++ wrappers over gmp) It also -provides data-structures and templated classes for the manipulation of -basic algebraic objects, such as vectors, matrices (dense, sparse, -structured), univariate polynomials (and therefore recursive -multivariate). - -Website: http://www-lmc.imag.fr/CASYS/LOGICIELS/givaro/ - -SPKG Repository: https://bitbucket.org/malb/givaro-spkg - -== License == - - * GNU GPL - -== Upstream Contact == - - * Clement Pernet - -== Dependencies == - - * GNU patch - * GMP/MPIR - diff --git a/build/pkgs/glpk/SPKG.rst b/build/pkgs/glpk/SPKG.rst new file mode 100644 index 00000000000..4c0a0ff4e10 --- /dev/null +++ b/build/pkgs/glpk/SPKG.rst @@ -0,0 +1,77 @@ +GLPK +==== + +Description +----------- + +The GLPK (GNU Linear Programming Kit) package is intended for solving +large-scale linear programming (LP), mixed integer programming (MIP), +and other related problems. It is a set of routines written in ANSI C +and organized in the form of a callable library. + +GLPK supports the GNU MathProg modelling language, which is a subset of +the AMPL language. + +The GLPK package includes the following main components: + +- primal and dual simplex methods +- primal-dual interior-point method +- branch-and-cut method +- translator for GNU MathProg +- application program interface (API) +- stand-alone LP/MIP solver + +License +------- + +The GLPK package is GPL version 3. + +.. _upstream_contact: + +Upstream Contact +---------------- + +GLPK is currently being maintained by: + +- Andrew Makhorin (mao@gnu.org, mao@mai2.rcnet.ru) + +http://www.gnu.org/software/glpk/#maintainer + +Dependencies +------------ + +- GMP/MPIR +- zlib + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- \`configure\` doesn't support specifying the location of the GMP + + library to use; only \`--with-gmp[=yes]\` or \`--with-gmp=no\` + are valid options. (So we \*have to\* add Sage's include and + library directories to \`CPPFLAGS\` and \`LDFLAGS`, respectively.) + +- Do we need the \`--disable-static`? The stand-alone solver presumably + + runs faster when built with a static library; also other + (stand-alone) + programs using it would. + (Instead, we should perhaps use \`--enable-static --enable-shared\` + to + go safe.) + +Patches +~~~~~~~ + +- All patches below are currently used by spkg-src +- src/01-zlib.patch: don't build the included zlib library. +- src/02-cygwin_sharedlib.patch: Let a shared library be built on + Cygwin by + + passing the -no-undefined flag to libtool. + + The numbering reflect the order in which they have been created from + glpk pristine's sources diff --git a/build/pkgs/glpk/SPKG.txt b/build/pkgs/glpk/SPKG.txt deleted file mode 100644 index 5dfc5a169e0..00000000000 --- a/build/pkgs/glpk/SPKG.txt +++ /dev/null @@ -1,59 +0,0 @@ -= GLPK = - -== Description == - -The GLPK (GNU Linear Programming Kit) package is intended for solving -large-scale linear programming (LP), mixed integer programming (MIP), -and other related problems. It is a set of routines written in ANSI C -and organized in the form of a callable library. - -GLPK supports the GNU MathProg modelling language, which is a subset of -the AMPL language. - -The GLPK package includes the following main components: - - * primal and dual simplex methods - * primal-dual interior-point method - * branch-and-cut method - * translator for GNU MathProg - * application program interface (API) - * stand-alone LP/MIP solver - -== License == - -The GLPK package is GPL version 3. - -== Upstream Contact == - -GLPK is currently being maintained by: - - * Andrew Makhorin (mao@gnu.org, mao@mai2.rcnet.ru) - -http://www.gnu.org/software/glpk/#maintainer - -== Dependencies == - - * GMP/MPIR - * zlib - -== Special Update/Build Instructions == - - * `configure` doesn't support specifying the location of the GMP - library to use; only `--with-gmp[=yes]` or `--with-gmp=no` - are valid options. (So we *have to* add Sage's include and - library directories to `CPPFLAGS` and `LDFLAGS`, respectively.) - * Do we need the `--disable-static`? The stand-alone solver presumably - runs faster when built with a static library; also other (stand-alone) - programs using it would. - (Instead, we should perhaps use `--enable-static --enable-shared` to - go safe.) - -=== Patches === - - * All patches below are currently used by spkg-src - * src/01-zlib.patch: don't build the included zlib library. - * src/02-cygwin_sharedlib.patch: Let a shared library be built on Cygwin by - passing the -no-undefined flag to libtool. - - The numbering reflect the order in which they have been created from - glpk pristine's sources diff --git a/build/pkgs/glucose/SPKG.rst b/build/pkgs/glucose/SPKG.rst new file mode 100644 index 00000000000..d97e616757d --- /dev/null +++ b/build/pkgs/glucose/SPKG.rst @@ -0,0 +1,47 @@ +glucose +======= + +Description +----------- + +Glucose is a SAT solver. + +Citing its website: \*The name of the solver is a contraction of the +concept of "glue clauses", a particular kind of clauses that glucose +detects and preserves during search. Glucose is heavily based on +Minisat, so please do cite Minisat also if you want to cite Glucose.\* + +License +------- + +- nonparallel glucose: MIT + +- parallel glucose-syrup: MIT modified with: + + The parallel version of Glucose (all files modified since Glucose 3.0 + releases, 2013) cannot be used in any competitive event (sat + competitions/evaluations) without the express permission of the + authors + (Gilles Audemard / Laurent Simon). This is also the case for any + competitive + event using Glucose Parallel as an embedded SAT engine (single core + or not). + +.. _upstream_contact: + +Upstream Contact +---------------- + +Website: http://www.labri.fr/perso/lsimon/glucose/ + +Dependencies +------------ + +zlib + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/glucose/SPKG.txt b/build/pkgs/glucose/SPKG.txt deleted file mode 100644 index e2871477ba4..00000000000 --- a/build/pkgs/glucose/SPKG.txt +++ /dev/null @@ -1,35 +0,0 @@ -= glucose = - -== Description == - -Glucose is a SAT solver. - -Citing its website: *The name of the solver is a contraction of the concept of -"glue clauses", a particular kind of clauses that glucose detects and preserves -during search. Glucose is heavily based on Minisat, so please do cite Minisat -also if you want to cite Glucose.* - -== License == - -- nonparallel glucose: MIT - -- parallel glucose-syrup: MIT modified with: - - The parallel version of Glucose (all files modified since Glucose 3.0 - releases, 2013) cannot be used in any competitive event (sat - competitions/evaluations) without the express permission of the authors - (Gilles Audemard / Laurent Simon). This is also the case for any competitive - event using Glucose Parallel as an embedded SAT engine (single core or not). - -== Upstream Contact == - -Website: http://www.labri.fr/perso/lsimon/glucose/ - -== Dependencies == - -zlib - -== Special Update/Build Instructions == - -None. - diff --git a/build/pkgs/gmp/SPKG.rst b/build/pkgs/gmp/SPKG.rst new file mode 100644 index 00000000000..c78329ef301 --- /dev/null +++ b/build/pkgs/gmp/SPKG.rst @@ -0,0 +1,23 @@ +GMP +=== + +Description +----------- + +GMP is a free library for arbitrary precision arithmetic, operating on +signed integers, rational numbers, and floating-point numbers. There is +no practical limit to the precision except the ones implied by the +available memory in the machine GMP runs on. GMP has a rich set of +functions, and the functions have a regular interface. + +License +------- + +- LGPL V3 + +.. _upstream_contact: + +Upstream Contact +---------------- + +- http://gmplib.org diff --git a/build/pkgs/gmp/SPKG.txt b/build/pkgs/gmp/SPKG.txt deleted file mode 100644 index 2d0a54911db..00000000000 --- a/build/pkgs/gmp/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= GMP = - -== Description == - -GMP is a free library for arbitrary precision arithmetic, operating on signed -integers, rational numbers, and floating-point numbers. -There is no practical limit to the precision except the ones implied by the available memory in the machine GMP runs on. -GMP has a rich set of functions, and the functions have a regular interface. - -== License == - * LGPL V3 - -== Upstream Contact == - * http://gmplib.org - diff --git a/build/pkgs/gmpy2/SPKG.rst b/build/pkgs/gmpy2/SPKG.rst new file mode 100644 index 00000000000..a31c7512872 --- /dev/null +++ b/build/pkgs/gmpy2/SPKG.rst @@ -0,0 +1,13 @@ +gmpy2 +===== + +Description +----------- + +GMP/MPIR, MPFR, and MPC interface to Python 2.6+ and 3.x + +gmpy2 is a C-coded Python extension module that supports +multiple-precision arithmetic. In addition to supporting GMP or MPIR for +multiple-precision integer and rational arithmetic, gmpy2 adds support +for the MPFR (correctly rounded real floating-point arithmetic) and MPC +(correctly rounded complex floating-point arithmetic) libraries. diff --git a/build/pkgs/gmpy2/SPKG.txt b/build/pkgs/gmpy2/SPKG.txt deleted file mode 100644 index 8e8d7d35327..00000000000 --- a/build/pkgs/gmpy2/SPKG.txt +++ /dev/null @@ -1,11 +0,0 @@ -= gmpy2 = - -== Description == - -GMP/MPIR, MPFR, and MPC interface to Python 2.6+ and 3.x - -gmpy2 is a C-coded Python extension module that supports multiple-precision -arithmetic. In addition to supporting GMP or MPIR for multiple-precision -integer and rational arithmetic, gmpy2 adds support for the MPFR (correctly -rounded real floating-point arithmetic) and MPC (correctly rounded complex -floating-point arithmetic) libraries. diff --git a/build/pkgs/gp2c/SPKG.rst b/build/pkgs/gp2c/SPKG.rst new file mode 100644 index 00000000000..4859b41225d --- /dev/null +++ b/build/pkgs/gp2c/SPKG.rst @@ -0,0 +1,27 @@ +gp2c +==== + +Description +----------- + +The gp2c compiler is a package for translating GP routines into the C +programming language, so that they can be compiled and used with the +PARI system or the GP calculator. + +License +------- + +GPL version 2+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +- http://pari.math.u-bordeaux.fr/ + +Dependencies +------------ + +- PARI +- Perl diff --git a/build/pkgs/gp2c/SPKG.txt b/build/pkgs/gp2c/SPKG.txt deleted file mode 100644 index 984b63c7865..00000000000 --- a/build/pkgs/gp2c/SPKG.txt +++ /dev/null @@ -1,18 +0,0 @@ -= gp2c = - -== Description == - -The gp2c compiler is a package for translating GP routines into the C -programming language, so that they can be compiled and used with the PARI -system or the GP calculator. - -== License == - -GPL version 2+ - -== Upstream Contact == - * http://pari.math.u-bordeaux.fr/ - -== Dependencies == - * PARI - * Perl diff --git a/build/pkgs/graphs/SPKG.txt b/build/pkgs/graphs/SPKG.rst similarity index 51% rename from build/pkgs/graphs/SPKG.txt rename to build/pkgs/graphs/SPKG.rst index 17e12fb75e9..a381a88422e 100644 --- a/build/pkgs/graphs/SPKG.txt +++ b/build/pkgs/graphs/SPKG.rst @@ -1,26 +1,33 @@ -= graphs = +graphs +====== -== Description == +Description +----------- -A database of graphs. Created by Emily Kirkman based on the work of Jason -Grout. Since April 2012 it also contains the ISGCI graph database. +A database of graphs. Created by Emily Kirkman based on the work of +Jason Grout. Since April 2012 it also contains the ISGCI graph database. -== Upstream Contact == +.. _upstream_contact: - * For ISGCI: +Upstream Contact +---------------- + +- For ISGCI: H.N. de Ridder (hnridder@graphclasses.org) - * For Andries Brouwer's database: +- For Andries Brouwer's database: The data is taken from from Andries E. Brouwer's website - (https://www.win.tue.nl/~aeb/). Anything related to the data should be + (https://www.win.tue.nl/~aeb/). Anything related to the data should + be reported to him directly (aeb@cwi.nl) - The code used to parse the data and create the .json file is available at + The code used to parse the data and create the .json file is + available at https://github.com/nathanncohen/strongly_regular_graphs_database. -== Dependencies == +Dependencies +------------ N/A - diff --git a/build/pkgs/gsl/SPKG.rst b/build/pkgs/gsl/SPKG.rst new file mode 100644 index 00000000000..2fd0a56dcc1 --- /dev/null +++ b/build/pkgs/gsl/SPKG.rst @@ -0,0 +1,64 @@ +gsl +=== + +Description +----------- + +Website: http://www.gnu.org/software/gsl/ + +From the website above: The GNU Scientific Library (GSL) is a numerical +library for C and C++ programmers. It is free software under the GNU +General Public License. + +The library provides a wide range of mathematical routines such as +random number generators, special functions and least-squares fitting. +There are over 1000 functions in total with an extensive test suite. If +the variable SAGE_CHECK is exported to the value "yes" when building +Sage, GSL's test suite is run. + +License +------- + +- GPL V3 + +.. _upstream_contact: + +Upstream Contact +---------------- + +- http://www.gnu.org/software/gsl/ + +GSL mailing lists: + +- Bug-gsl mailing list -- bug reports for the GNU + + Scientific Library should be sent to bug-gsl@gnu.org + +- Help-gsl users mailing list -- for questions about + + installation, how GSL works and how it is used, or general questions + concerning GSL. + +- Info-gsl mailing list -- announcements of new + releases + + are made there. + +Dependencies +------------ + +- None - GSL does not depend on any other Sage package to compile, link + + and pass all of GSL's self-tests. Despite that fact, BLAS is listed + as + a dependency. (It comes with its own CBLAS implementation that is + e.g. + used when running the GSL test suite during installation; however, + the + Sage library only uses it as a fall-back, if e.g. BLAS library is not + present.) + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/gsl/SPKG.txt b/build/pkgs/gsl/SPKG.txt deleted file mode 100644 index cd433ab7954..00000000000 --- a/build/pkgs/gsl/SPKG.txt +++ /dev/null @@ -1,45 +0,0 @@ -= gsl = - -== Description == - -Website: http://www.gnu.org/software/gsl/ - -From the website above: The GNU Scientific Library (GSL) is a numerical -library for C and C++ programmers. It is free software under the GNU General -Public License. - -The library provides a wide range of mathematical routines such as random -number generators, special functions and least-squares fitting. There are -over 1000 functions in total with an extensive test suite. If the variable -SAGE_CHECK is exported to the value "yes" when building Sage, GSL's test suite -is run. - -== License == - - * GPL V3 - -== Upstream Contact == - - * http://www.gnu.org/software/gsl/ - -GSL mailing lists: - - * Bug-gsl mailing list -- bug reports for the GNU - Scientific Library should be sent to bug-gsl@gnu.org - * Help-gsl users mailing list -- for questions about - installation, how GSL works and how it is used, or general questions - concerning GSL. - * Info-gsl mailing list -- announcements of new releases - are made there. - -== Dependencies == - - * None - GSL does not depend on any other Sage package to compile, link - and pass all of GSL's self-tests. Despite that fact, BLAS is listed as - a dependency. (It comes with its own CBLAS implementation that is e.g. - used when running the GSL test suite during installation; however, the - Sage library only uses it as a fall-back, if e.g. BLAS library is not - present.) - -== Special Update/Build Instructions == - diff --git a/build/pkgs/html5lib/SPKG.txt b/build/pkgs/html5lib/SPKG.rst similarity index 53% rename from build/pkgs/html5lib/SPKG.txt rename to build/pkgs/html5lib/SPKG.rst index cb3191bac15..39dcde6512c 100644 --- a/build/pkgs/html5lib/SPKG.txt +++ b/build/pkgs/html5lib/SPKG.rst @@ -1,17 +1,24 @@ -= html5lib = +html5lib +======== -== Description == +Description +----------- HTML parser based on the WHATWG HTML specification. -== License == +License +------- MIT License -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- Home Page: https://github.com/html5lib/html5lib-python/issues -== Dependencies == +Dependencies +------------ Python, webencodings, six diff --git a/build/pkgs/iconv/SPKG.rst b/build/pkgs/iconv/SPKG.rst new file mode 100644 index 00000000000..a022b01083c --- /dev/null +++ b/build/pkgs/iconv/SPKG.rst @@ -0,0 +1,36 @@ +iconv +===== + +Description +----------- + +GNU libiconv is a library that is used to enable different languages, +with different characters to be handled properly. + +License +------- + +- GPL 3 and LGPL 3. So we can safely link against the library in Sage. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- http://www.gnu.org/software/libiconv/ +- Bug reports to bug-gnu-libiconv@gnu.org + +Dependencies +------------ + +- None for the purposes of Sage, but in general gettext. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- None, other than anyone updating this package should be familiar with + how + + to write shell scripts. diff --git a/build/pkgs/iconv/SPKG.txt b/build/pkgs/iconv/SPKG.txt deleted file mode 100644 index 3b15e243885..00000000000 --- a/build/pkgs/iconv/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= iconv = - -== Description == -GNU libiconv is a library that is used to enable different -languages, with different characters to be handled properly. - -== License == - * GPL 3 and LGPL 3. So we can safely link against the library in Sage. - -== Upstream Contact == - * http://www.gnu.org/software/libiconv/ - * Bug reports to bug-gnu-libiconv@gnu.org - -== Dependencies == - * None for the purposes of Sage, but in general gettext. - -== Special Update/Build Instructions == - * None, other than anyone updating this package should be familiar with how - to write shell scripts. - diff --git a/build/pkgs/igraph/SPKG.rst b/build/pkgs/igraph/SPKG.rst new file mode 100644 index 00000000000..dfaeeab6945 --- /dev/null +++ b/build/pkgs/igraph/SPKG.rst @@ -0,0 +1,35 @@ +igraph +====== + +Description +----------- + +igraph is a library for creating and manipulating graphs. It is intended +to be as powerful (ie. fast) as possible to enable the analysis of large +graphs. + +License +------- + +GPL version 2 + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://igraph.org/c/ + +Dependencies +------------ + +- GMP/MPIR +- libxml2, but this is not shipped with Sage, so the user has to + install + + libxml2-dev from her distro. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/igraph/SPKG.txt b/build/pkgs/igraph/SPKG.txt deleted file mode 100644 index e70329d56a4..00000000000 --- a/build/pkgs/igraph/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= igraph = - -== Description == - -igraph is a library for creating and manipulating graphs. -It is intended to be as powerful (ie. fast) as possible to enable the -analysis of large graphs. - -== License == - -GPL version 2 - -== Upstream Contact == - -http://igraph.org/c/ - -== Dependencies == - -* GMP/MPIR -* libxml2, but this is not shipped with Sage, so the user has to install - libxml2-dev from her distro. - -== Special Update/Build Instructions == diff --git a/build/pkgs/imagesize/SPKG.txt b/build/pkgs/imagesize/SPKG.rst similarity index 55% rename from build/pkgs/imagesize/SPKG.txt rename to build/pkgs/imagesize/SPKG.rst index 2ec0272eda7..8bd0d46070b 100644 --- a/build/pkgs/imagesize/SPKG.txt +++ b/build/pkgs/imagesize/SPKG.rst @@ -1,5 +1,7 @@ -= imagesize = +imagesize +========= -== Description == +Description +----------- It parses image files' header and return image size. diff --git a/build/pkgs/iml/SPKG.txt b/build/pkgs/iml/SPKG.rst similarity index 50% rename from build/pkgs/iml/SPKG.txt rename to build/pkgs/iml/SPKG.rst index 88c3e68ab00..d52b1e5e407 100644 --- a/build/pkgs/iml/SPKG.txt +++ b/build/pkgs/iml/SPKG.rst @@ -1,36 +1,49 @@ -= IML = +IML +=== -== Description == +Description +----------- IML is a free library of C source code which implements algorithms for computing exact solutions to dense systems of linear equations over the -integers. IML is designed to be used with the ATLAS/BLAS library and -GMP bignum library. +integers. IML is designed to be used with the ATLAS/BLAS library and GMP +bignum library. Written in portable C, IML can be used on both 32-bit and 64-bit machines. It can be called from C++. Website: http://www.cs.uwaterloo.ca/~astorjoh/iml.html -== License == +License +------- - * GPLv2+ +- GPLv2+ -== Upstream Contact == +.. _upstream_contact: - * Zhuliang Chen z4chen@uwaterloo.ca - * Arne Storjohann astorjoh@uwaterloo.ca +Upstream Contact +---------------- -== Dependencies == - * GMP - * ATLAS +- Zhuliang Chen z4chen@uwaterloo.ca +- Arne Storjohann astorjoh@uwaterloo.ca -== Special Update/Build Instructions == +Dependencies +------------ + +- GMP +- ATLAS + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- As of version 1.0.4, you need to repackage the upstream tarball - * As of version 1.0.4, you need to repackage the upstream tarball using the spkg-src script because there was a bugfix version of 1.0.4 reposted upstream without version number bump. -=== Patches === +Patches +~~~~~~~ - * examples.patch: Modified some of the examples. +- examples.patch: Modified some of the examples. diff --git a/build/pkgs/ipaddress/SPKG.txt b/build/pkgs/ipaddress/SPKG.rst similarity index 54% rename from build/pkgs/ipaddress/SPKG.txt rename to build/pkgs/ipaddress/SPKG.rst index e9c9755006b..ee9b69be864 100644 --- a/build/pkgs/ipaddress/SPKG.txt +++ b/build/pkgs/ipaddress/SPKG.rst @@ -1,5 +1,7 @@ -= ipaddress = +ipaddress +========= -== Description == +Description +----------- Python 3.3+'s ipaddress for Python 2.6, 2.7, 3.2. diff --git a/build/pkgs/ipykernel/SPKG.txt b/build/pkgs/ipykernel/SPKG.rst similarity index 65% rename from build/pkgs/ipykernel/SPKG.txt rename to build/pkgs/ipykernel/SPKG.rst index de67f28d0b2..15fd660b6aa 100644 --- a/build/pkgs/ipykernel/SPKG.txt +++ b/build/pkgs/ipykernel/SPKG.rst @@ -1,6 +1,8 @@ -= ipykernel = +ipykernel +========= -== Description == +Description +----------- IPython Kernel for Jupyter diff --git a/build/pkgs/ipython/SPKG.txt b/build/pkgs/ipython/SPKG.rst similarity index 60% rename from build/pkgs/ipython/SPKG.txt rename to build/pkgs/ipython/SPKG.rst index c342a637a18..7b6d5fbf51c 100644 --- a/build/pkgs/ipython/SPKG.txt +++ b/build/pkgs/ipython/SPKG.rst @@ -1,25 +1,38 @@ -= IPython = +IPython +======= + +Description +----------- -== Description == From the IPython website: -IPython is a multiplatform, Free Software project (BSD licensed) that offers: +IPython is a multiplatform, Free Software project (BSD licensed) that +offers: + +- An enhanced Python shell designed for efficient interactive - * An enhanced Python shell designed for efficient interactive work. It includes many enhancements over the default Python shell, including the ability for controlling interactively all major GUI toolkits in a non-blocking manner. - * A library to build customized interactive environments using Python + +- A library to build customized interactive environments using Python + as the basic language (but with the possibility of having extended or alternate syntaxes). - * A system for interactive distributed and parallel computing (this is + +- A system for interactive distributed and parallel computing (this is + part of IPython's new development). -== License == +License +------- BSD -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- http://ipython.scipy.org/ diff --git a/build/pkgs/ipython_genutils/SPKG.rst b/build/pkgs/ipython_genutils/SPKG.rst new file mode 100644 index 00000000000..ae072987fbc --- /dev/null +++ b/build/pkgs/ipython_genutils/SPKG.rst @@ -0,0 +1,7 @@ +ipython_genutils +================ + +Description +----------- + +Vestigial utilities from IPython diff --git a/build/pkgs/ipython_genutils/SPKG.txt b/build/pkgs/ipython_genutils/SPKG.txt deleted file mode 100644 index e6b7acbe301..00000000000 --- a/build/pkgs/ipython_genutils/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= ipython_genutils = - -== Description == - -Vestigial utilities from IPython diff --git a/build/pkgs/ipywidgets/SPKG.txt b/build/pkgs/ipywidgets/SPKG.rst similarity index 61% rename from build/pkgs/ipywidgets/SPKG.txt rename to build/pkgs/ipywidgets/SPKG.rst index 7fd95c0eddd..92343dbe112 100644 --- a/build/pkgs/ipywidgets/SPKG.txt +++ b/build/pkgs/ipywidgets/SPKG.rst @@ -1,5 +1,7 @@ -= ipywidgets = +ipywidgets +========== -== Description == +Description +----------- Interactive HTML widgets for Jupyter notebooks and the IPython kernel. diff --git a/build/pkgs/isl/SPKG.txt b/build/pkgs/isl/SPKG.rst similarity index 58% rename from build/pkgs/isl/SPKG.txt rename to build/pkgs/isl/SPKG.rst index d0ea17aa5e3..5f7a59d66d4 100644 --- a/build/pkgs/isl/SPKG.txt +++ b/build/pkgs/isl/SPKG.rst @@ -1,33 +1,43 @@ -= isl = +isl +=== -== Description == +Description +----------- -isl is a thread-safe C library for manipulating sets and relations -of integer points bounded by affine constraints. The descriptions of -the sets and relations may involve both parameters and existentially -quantified variables. All computations are performed in exact integer +isl is a thread-safe C library for manipulating sets and relations of +integer points bounded by affine constraints. The descriptions of the +sets and relations may involve both parameters and existentially +quantified variables. All computations are performed in exact integer arithmetic using GMP. -== License == +License +------- -isl is released under the MIT license, but depends on the LGPL GMP library. +isl is released under the MIT license, but depends on the LGPL GMP +library. -== Upstream Contact == +.. _upstream_contact: - * http://groups.google.com/group/isl-development +Upstream Contact +---------------- -== Citation == +- http://groups.google.com/group/isl-development + +Citation +-------- @incollection{Verdoolaege2010isl, + author = {Verdoolaege, Sven}, title = {isl: An Integer Set Library for the Polyhedral Model}, booktitle = {Mathematical Software - ICMS 2010}, series = {Lecture Notes in Computer Science}, editor = {Fukuda, Komei and Hoeven, Joris and Joswig, Michael and - Takayama, Nobuki}, + Takayama, Nobuki}, publisher = {Springer}, isbn = {978-3-642-15581-9}, pages = {299-302}, volume = {6327}, year = {2010} + } diff --git a/build/pkgs/itsdangerous/SPKG.rst b/build/pkgs/itsdangerous/SPKG.rst new file mode 100644 index 00000000000..51e0b6f16c9 --- /dev/null +++ b/build/pkgs/itsdangerous/SPKG.rst @@ -0,0 +1,8 @@ +itsdangerous +============ + +Description +----------- + +Various helpers to pass data to untrusted environments and to get it +back safe and sound. diff --git a/build/pkgs/itsdangerous/SPKG.txt b/build/pkgs/itsdangerous/SPKG.txt deleted file mode 100644 index 32264811471..00000000000 --- a/build/pkgs/itsdangerous/SPKG.txt +++ /dev/null @@ -1,6 +0,0 @@ -= itsdangerous = - -== Description == - -Various helpers to pass data to untrusted environments and to get it back -safe and sound. diff --git a/build/pkgs/jinja2/SPKG.rst b/build/pkgs/jinja2/SPKG.rst new file mode 100644 index 00000000000..0d06893aa49 --- /dev/null +++ b/build/pkgs/jinja2/SPKG.rst @@ -0,0 +1,41 @@ +Jinja2 +====== + +Description +----------- + +Jinja2 is a library for Python 2.4 and onwards that is designed to be +flexible, fast and secure. + +If you have any exposure to other text-based template languages, such as +Smarty or Django, you should feel right at home with Jinja2. It's both +designer and developer friendly by sticking to Python's principles and +adding functionality useful for templating environments. + +License +------- + +Modified BSD License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Pocoo Team Homepage: http://jinja.pocoo.org/ + +Dependencies +------------ + +- Python (>= 2.4) +- setuptools (or distribute) +- Pygments (according to 'spkg/standard/deps') +- docutils (dito, as a note only) + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. (Just make sure its prerequisites are new enough in Sage, to avoid +downloads during the build / installation.) diff --git a/build/pkgs/jinja2/SPKG.txt b/build/pkgs/jinja2/SPKG.txt deleted file mode 100644 index 3ff6cd895b5..00000000000 --- a/build/pkgs/jinja2/SPKG.txt +++ /dev/null @@ -1,34 +0,0 @@ -= Jinja2 = - -== Description == - -Jinja2 is a library for Python 2.4 and onwards that is designed to be -flexible, fast and secure. - -If you have any exposure to other text-based template languages, such -as Smarty or Django, you should feel right at home with Jinja2. It's -both designer and developer friendly by sticking to Python's -principles and adding functionality useful for templating -environments. - -== License == - -Modified BSD License - -== Upstream Contact == - -Author: Pocoo Team -Homepage: http://jinja.pocoo.org/ - -== Dependencies == - - * Python (>= 2.4) - * setuptools (or distribute) - * Pygments (according to 'spkg/standard/deps') - * docutils (dito, as a note only) - -== Special Update/Build Instructions == - -None. (Just make sure its prerequisites are new enough in Sage, to avoid -downloads during the build / installation.) - diff --git a/build/pkgs/jmol/SPKG.rst b/build/pkgs/jmol/SPKG.rst new file mode 100644 index 00000000000..46ad240a003 --- /dev/null +++ b/build/pkgs/jmol/SPKG.rst @@ -0,0 +1,45 @@ +.. _jmol_for_sage: + +Jmol for Sage +============= + +Description +----------- + +This provides files necessary for Jmol(java) and JSmol (javascript) to +operate from the command line and the Notebook. It does not contain the +Notebook javascript library jmol_lib.js or changes to Notebook or Sage +code. + +License +------- + +GPLv2+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Bob Hanson +- e-mail: hansonr@stolaf.edu +- Homepage: https://www.stolaf.edu/people/hansonr/ +- Development page: https://github.com/BobHanson/Jmol-SwingJS +- Download page: https://sourceforge.net/projects/jmol/files/Jmol/ + +Dependencies +------------ + +No build-time dependencies. + +The commandline jmol requires java at runtime. + +.. _special_build_instructions: + +Special Build Instructions +-------------------------- + +To avoid depending on \`unzip\` at build time, we have to repack the +tarball, see \`spkg-src`. We take the opportunity to remove some +unnecessary subdirectories, see +http://wiki.jmol.org/index.php/Jmol_JavaScript_Object#In_detail diff --git a/build/pkgs/jmol/SPKG.txt b/build/pkgs/jmol/SPKG.txt deleted file mode 100644 index 4f7e555186c..00000000000 --- a/build/pkgs/jmol/SPKG.txt +++ /dev/null @@ -1,33 +0,0 @@ -= Jmol for Sage = - -== Description == - -This provides files necessary for Jmol(java) and JSmol -(javascript) to operate from the command line and the -Notebook. It does not contain the Notebook javascript -library jmol_lib.js or changes to Notebook or Sage code. - -== License == - -GPLv2+ - -== Upstream Contact == - - * Bob Hanson - * e-mail: hansonr@stolaf.edu - * Homepage: https://www.stolaf.edu/people/hansonr/ - * Development page: https://github.com/BobHanson/Jmol-SwingJS - * Download page: https://sourceforge.net/projects/jmol/files/Jmol/ - -== Dependencies == - -No build-time dependencies. - -The commandline jmol requires java at runtime. - -== Special Build Instructions == - -To avoid depending on `unzip` at build time, we have to repack the tarball, see -`spkg-src`. We take the opportunity to remove some unnecessary subdirectories, -see http://wiki.jmol.org/index.php/Jmol_JavaScript_Object#In_detail - diff --git a/build/pkgs/jsonschema/SPKG.txt b/build/pkgs/jsonschema/SPKG.rst similarity index 50% rename from build/pkgs/jsonschema/SPKG.txt rename to build/pkgs/jsonschema/SPKG.rst index 168b4052940..791297dbd5d 100644 --- a/build/pkgs/jsonschema/SPKG.txt +++ b/build/pkgs/jsonschema/SPKG.rst @@ -1,19 +1,24 @@ -= jsonschema = +jsonschema +========== -== Description == +Description +----------- jsonschema is an implementation of JSON Schema for Python -== License == +License +------- MIT License -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- Home page: http://github.com/Julian/jsonschema -== Dependencies == +Dependencies +------------ Python, Setuptools - - diff --git a/build/pkgs/jupymake/SPKG.rst b/build/pkgs/jupymake/SPKG.rst new file mode 100644 index 00000000000..ca7ff9c676a --- /dev/null +++ b/build/pkgs/jupymake/SPKG.rst @@ -0,0 +1,30 @@ +jupymake +======== + +Description +----------- + +The Python module JuPyMake provides an interface to polymake. + +License +------- + +- GPL v2 + +.. _upstream_contact: + +Upstream Contact +---------------- + + https://github.com/polymake/JuPyMake + +Dependencies +------------ + +- pip +- polymake + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/jupymake/SPKG.txt b/build/pkgs/jupymake/SPKG.txt deleted file mode 100644 index f5a98bf06fc..00000000000 --- a/build/pkgs/jupymake/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= jupymake = - -== Description == - -The Python module JuPyMake provides an interface to polymake. - -== License == - - * GPL v2 - -== Upstream Contact == - - https://github.com/polymake/JuPyMake - -== Dependencies == - - * pip - * polymake - -== Special Update/Build Instructions == diff --git a/build/pkgs/jupyter_client/SPKG.txt b/build/pkgs/jupyter_client/SPKG.rst similarity index 85% rename from build/pkgs/jupyter_client/SPKG.txt rename to build/pkgs/jupyter_client/SPKG.rst index 3fedb1e4efd..a9348a28d55 100644 --- a/build/pkgs/jupyter_client/SPKG.txt +++ b/build/pkgs/jupyter_client/SPKG.rst @@ -1,6 +1,8 @@ -= jupyter_client = +jupyter_client +============== -== Description == +Description +----------- Jupyter protocol implementation and client libraries diff --git a/build/pkgs/jupyter_core/SPKG.txt b/build/pkgs/jupyter_core/SPKG.rst similarity index 58% rename from build/pkgs/jupyter_core/SPKG.txt rename to build/pkgs/jupyter_core/SPKG.rst index dbed147e7af..934ee810110 100644 --- a/build/pkgs/jupyter_core/SPKG.txt +++ b/build/pkgs/jupyter_core/SPKG.rst @@ -1,5 +1,7 @@ -= jupyter_core = +jupyter_core +============ -== Description == +Description +----------- Jupyter core package. A base package on which Jupyter projects rely. diff --git a/build/pkgs/kenzo/SPKG.rst b/build/pkgs/kenzo/SPKG.rst new file mode 100644 index 00000000000..e8eb8450d83 --- /dev/null +++ b/build/pkgs/kenzo/SPKG.rst @@ -0,0 +1,26 @@ +Kenzo +===== + +Description +----------- + +Kenzo is a package to compute properties (mainly homology groups) of +topological spaces. It allows defining spaces created from others by +constuctions like loop spaces, classifying spaces and so on. + +License +------- + +GPL + +.. _upstream_contact: + +Upstream Contact +---------------- + +- https://github.com/gheber/kenzo + +Dependencies +------------ + +- ECL (Embedded Common Lisp) diff --git a/build/pkgs/kenzo/SPKG.txt b/build/pkgs/kenzo/SPKG.txt deleted file mode 100644 index e0f96ea81c6..00000000000 --- a/build/pkgs/kenzo/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= Kenzo = - -== Description == - -Kenzo is a package to compute properties (mainly homology groups) -of topological spaces. It allows defining spaces created from others -by constuctions like loop spaces, classifying spaces and so on. - - -== License == - -GPL - -== Upstream Contact == - - * https://github.com/gheber/kenzo - -== Dependencies == - - * ECL (Embedded Common Lisp) - diff --git a/build/pkgs/kiwisolver/SPKG.rst b/build/pkgs/kiwisolver/SPKG.rst new file mode 100644 index 00000000000..d5f118a71da --- /dev/null +++ b/build/pkgs/kiwisolver/SPKG.rst @@ -0,0 +1,38 @@ +kiwisolver +========== + +Description +----------- + +From https://pypi.org/project/kiwisolver/ + +A fast implementation of the Cassowary constraint solver + +Kiwi is an efficient C++ implementation of the Cassowary constraint +solving algorithm. Kiwi is an implementation of the algorithm based on +the seminal Cassowary paper. It is not a refactoring of the original C++ +solver. Kiwi has been designed from the ground up to be lightweight and +fast. Kiwi ranges from 10x to 500x faster than the original Cassowary +solver with typical use cases gaining a 40x improvement. Memory savings +are consistently > 5x. + +In addition to the C++ solver, Kiwi ships with hand-rolled Python +bindings. + +License +------- + +Modified BSD License + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://github.com/nucleic/kiwi + +Dependencies +------------ + +- python +- setuptools diff --git a/build/pkgs/kiwisolver/SPKG.txt b/build/pkgs/kiwisolver/SPKG.txt deleted file mode 100644 index 537b9aae123..00000000000 --- a/build/pkgs/kiwisolver/SPKG.txt +++ /dev/null @@ -1,31 +0,0 @@ -= kiwisolver = - -== Description == - -From https://pypi.org/project/kiwisolver/ - -A fast implementation of the Cassowary constraint solver - -Kiwi is an efficient C++ implementation of the Cassowary constraint -solving algorithm. Kiwi is an implementation of the algorithm based -on the seminal Cassowary paper. It is not a refactoring of the -original C++ solver. Kiwi has been designed from the ground up to be -lightweight and fast. Kiwi ranges from 10x to 500x faster than the -original Cassowary solver with typical use cases gaining a 40x -improvement. Memory savings are consistently > 5x. - -In addition to the C++ solver, Kiwi ships with hand-rolled Python -bindings. - -== License == - -Modified BSD License - -== Upstream Contact == - -https://github.com/nucleic/kiwi - -== Dependencies == - - * python - * setuptools diff --git a/build/pkgs/latte_int/SPKG.rst b/build/pkgs/latte_int/SPKG.rst new file mode 100644 index 00000000000..d9bc723120f --- /dev/null +++ b/build/pkgs/latte_int/SPKG.rst @@ -0,0 +1,25 @@ +LattE_Integrale +=============== + +Description +----------- + +LattE (Lattice point Enumeration) Integrale solves the problems of +counting lattice points in and integration over convex polytopes. + +License +------- + +GPLv2 + +.. _upstream_contact: + +Upstream Contact +---------------- + +Matthias Köppe, UC Davis, CA, USA + +Dependencies +------------ + +GMP (MPIR), 4ti2, NTL, cddlib. diff --git a/build/pkgs/latte_int/SPKG.txt b/build/pkgs/latte_int/SPKG.txt deleted file mode 100644 index 24a6da7e78b..00000000000 --- a/build/pkgs/latte_int/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= LattE_Integrale = - -== Description == - -LattE (Lattice point Enumeration) Integrale solves the problems of counting -lattice points in and integration over convex polytopes. - -== License == - -GPLv2 - -== Upstream Contact == - -Matthias Köppe, UC Davis, CA, USA - -== Dependencies == - -GMP (MPIR), 4ti2, NTL, cddlib. - diff --git a/build/pkgs/lcalc/SPKG.rst b/build/pkgs/lcalc/SPKG.rst new file mode 100644 index 00000000000..bba2786b7cb --- /dev/null +++ b/build/pkgs/lcalc/SPKG.rst @@ -0,0 +1,130 @@ +lcalc +===== + +Description +----------- + +Michael Rubinstein's L-function calculator. + +License +------- + +- LGPL V2+ + +.. _upstream_contact: + +Upstream contact +---------------- + +Michael Rubinstein + +Sources: http://oto.math.uwaterloo.ca/~mrubinst/L_function_public/L.html + +Newer beta version 1.3 (not yet in Sage): +http://code.google.com/p/l-calc/ + +Dependencies +------------ + +- GMP/MPIR +- MPFR +- PARI +- GNU patch + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- There is some garbage in the upstream sources which should be + removed: + + src/include/.Lexplicit_formula.h.swp + src/include/.Lvalue.h.swp + src/include/._.DS_Store + src/include/.DS_Store + src/include/Lexplicit_formula.h.swap.crap + src/include/Lvalue.h.bak + src/src/Makefile.old + src/src/.Makefile.old.swp + src/src/._.DS_Store + src/src/.DS_Store + src/src/.Lcommandline.ggo.swp + src/src/libLfunction.a + +- We (and apparently also upstream) currently don't build Lcalc's tests + + (see Makefile), hence there's no spkg-check. + This might change in newer upstream versions. + +- The original Makefile uses $(CC) to compile C++ (also using + $(CCFLAGS)), + + which it defines to 'g++', and hardcodes 'g++' when linking the + shared + library. (It should use $(CXX) instead, which might \*default\* to + 'g++'.) + We now (lcalc-1.23.p10) patch the Makefile also to use $(CXX) for + compiling + and linking C++; $(CXX) now \*defaults\* to 'g++', and $(CC) to + 'gcc', but + both can be overridden by simply setting their respective environment + variables. (Same for $(INSTALL_DIR) btw.) + +Patches +------- + +- Makefile.patch: + + We change a lot there, since Lcalc doesn't have a 'configure' script, + and hence the Makefile is supposed to be edited to customize Lcalc + (build + options, locations of headers and libraries etc.). + Besides that, we + +- put CXXFLAGS into Lcalc's "CCFLAGS" used for compiling C++, +- remove some stuff involving LDFLAGS1 and LDFLAGS2, setting just + LDFLAGS, +- use $(MAKE) instead of 'make' in the crude build receipts, +- use CXXFLAG64 when linking the shared library, +- now use $(CXX) for compiling and linking C++, which \*defaults\* to + 'g++', + + but can be overridden by setting the environment variable of the same + name. ($(CC) now \*defaults\* to 'gcc', although currently not really + used as far as I can see.) + +- $(INSTALL_DIR) can now be overridden by simply setting the + environment + + variable of the same name. + +- Lcommon.h.patch: + + Uncomment the definition of lcalc_to_double(const long double& x). + (Necessary for GCC >= 4.6.0, cf. #10892.) + Comment from there: + The reason is the following code horror from + src/src/include/Lcommon.h: + [...] + But somebody who is familiar with the codebase should really rewrite + lcalc + to not redefine the double() cast, thats just fragile and will sooner + or + later again fail inside some system headers. + +- pari-2.7.patch: + + Various changes to port to newer versions of PARI. + +- time.h.patch: + + (Patches src/include/Lcommandline_numbertheory.h) + Include also in Lcommandline_numbertheory.h (at least + required + on Cygwin, cf. #9845). + This should get reported upstream. + +- lcalc-1.23_default_parameters_1.patch: Make Lcalc (1.23) build with + + GCC 4.9 diff --git a/build/pkgs/lcalc/SPKG.txt b/build/pkgs/lcalc/SPKG.txt deleted file mode 100644 index 2958ec6d12c..00000000000 --- a/build/pkgs/lcalc/SPKG.txt +++ /dev/null @@ -1,91 +0,0 @@ -= lcalc = - -== Description == - -Michael Rubinstein's L-function calculator. - -== License == - - * LGPL V2+ - -== Upstream contact == - -Michael Rubinstein - -Sources: http://oto.math.uwaterloo.ca/~mrubinst/L_function_public/L.html - -Newer beta version 1.3 (not yet in Sage): -http://code.google.com/p/l-calc/ - -== Dependencies == - - * GMP/MPIR - * MPFR - * PARI - * GNU patch - -== Special Update/Build Instructions == - - * There is some garbage in the upstream sources which should be removed: - src/include/.Lexplicit_formula.h.swp - src/include/.Lvalue.h.swp - src/include/._.DS_Store - src/include/.DS_Store - src/include/Lexplicit_formula.h.swap.crap - src/include/Lvalue.h.bak - src/src/Makefile.old - src/src/.Makefile.old.swp - src/src/._.DS_Store - src/src/.DS_Store - src/src/.Lcommandline.ggo.swp - src/src/libLfunction.a - * We (and apparently also upstream) currently don't build Lcalc's tests - (see Makefile), hence there's no spkg-check. - This might change in newer upstream versions. - * The original Makefile uses $(CC) to compile C++ (also using $(CCFLAGS)), - which it defines to 'g++', and hardcodes 'g++' when linking the shared - library. (It should use $(CXX) instead, which might *default* to 'g++'.) - We now (lcalc-1.23.p10) patch the Makefile also to use $(CXX) for compiling - and linking C++; $(CXX) now *defaults* to 'g++', and $(CC) to 'gcc', but - both can be overridden by simply setting their respective environment - variables. (Same for $(INSTALL_DIR) btw.) - -== Patches == - - * Makefile.patch: - We change a lot there, since Lcalc doesn't have a 'configure' script, - and hence the Makefile is supposed to be edited to customize Lcalc (build - options, locations of headers and libraries etc.). - Besides that, we - - put CXXFLAGS into Lcalc's "CCFLAGS" used for compiling C++, - - remove some stuff involving LDFLAGS1 and LDFLAGS2, setting just LDFLAGS, - - use $(MAKE) instead of 'make' in the crude build receipts, - - use CXXFLAG64 when linking the shared library, - - now use $(CXX) for compiling and linking C++, which *defaults* to 'g++', - but can be overridden by setting the environment variable of the same - name. ($(CC) now *defaults* to 'gcc', although currently not really - used as far as I can see.) - - $(INSTALL_DIR) can now be overridden by simply setting the environment - variable of the same name. - - * Lcommon.h.patch: - Uncomment the definition of lcalc_to_double(const long double& x). - (Necessary for GCC >= 4.6.0, cf. #10892.) - Comment from there: - The reason is the following code horror from src/src/include/Lcommon.h: - [...] - But somebody who is familiar with the codebase should really rewrite lcalc - to not redefine the double() cast, thats just fragile and will sooner or - later again fail inside some system headers. - - * pari-2.7.patch: - Various changes to port to newer versions of PARI. - - * time.h.patch: - (Patches src/include/Lcommandline_numbertheory.h) - Include also in Lcommandline_numbertheory.h (at least required - on Cygwin, cf. #9845). - This should get reported upstream. - - * lcalc-1.23_default_parameters_1.patch: Make Lcalc (1.23) build with - GCC 4.9 diff --git a/build/pkgs/libatomic_ops/SPKG.rst b/build/pkgs/libatomic_ops/SPKG.rst new file mode 100644 index 00000000000..5060aa08d61 --- /dev/null +++ b/build/pkgs/libatomic_ops/SPKG.rst @@ -0,0 +1,32 @@ +libatomic_ops +============= + +Description +----------- + +A part of the Boehm-Demers-Weiser conservative garbage collector. + +License +------- + +- Permissive BSD + GPL 2.0+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +Webpage: http://www.hboehm.info/gc/ Email List: +bdwgc@lists.opendylan.org + +Dependencies +------------ + +None. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/libatomic_ops/SPKG.txt b/build/pkgs/libatomic_ops/SPKG.txt deleted file mode 100644 index 9f1cd0ffd91..00000000000 --- a/build/pkgs/libatomic_ops/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= libatomic_ops = - -== Description == - -A part of the Boehm-Demers-Weiser conservative garbage collector. - -== License == - -* Permissive BSD + GPL 2.0+ - -== Upstream Contact == - -Webpage: http://www.hboehm.info/gc/ -Email List: bdwgc@lists.opendylan.org - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -None. diff --git a/build/pkgs/libbraiding/SPKG.rst b/build/pkgs/libbraiding/SPKG.rst new file mode 100644 index 00000000000..cf397c048f3 --- /dev/null +++ b/build/pkgs/libbraiding/SPKG.rst @@ -0,0 +1,27 @@ +LIBBRAIDING +=========== + +Description +----------- + +libbraiding is a library to compute several properties of braids, +including centralizer and conjugacy check. + +License +------- + +GPLv3+ + +.. _spkg_maintainers: + +SPKG Maintainers +---------------- + +- Miguel Marco + +.. _upstream_contact: + +Upstream Contact +---------------- + +Miguel Marco (mmarco@unizar.es) diff --git a/build/pkgs/libbraiding/SPKG.txt b/build/pkgs/libbraiding/SPKG.txt deleted file mode 100644 index 4afec494530..00000000000 --- a/build/pkgs/libbraiding/SPKG.txt +++ /dev/null @@ -1,17 +0,0 @@ -= LIBBRAIDING = - -== Description == - -libbraiding is a library to compute several properties of braids, including centralizer and conjugacy check. - -== License == - -GPLv3+ - -== SPKG Maintainers == - -* Miguel Marco - -== Upstream Contact == - -Miguel Marco (mmarco@unizar.es) diff --git a/build/pkgs/libffi/SPKG.txt b/build/pkgs/libffi/SPKG.rst similarity index 80% rename from build/pkgs/libffi/SPKG.txt rename to build/pkgs/libffi/SPKG.rst index aea62b6fbc7..e914b3c1580 100644 --- a/build/pkgs/libffi/SPKG.txt +++ b/build/pkgs/libffi/SPKG.rst @@ -1,6 +1,8 @@ -= libffi = +libffi +====== -== Description == +Description +----------- Compilers for high level languages generate code that follow certain conventions. These conventions are necessary, in part, for separate @@ -28,20 +30,21 @@ featured foreign function interface. A layer must exist above libffi that handles type conversions for values passed between the two languages. -== License == +License +------- -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -``Software''), to deal in the Software without restriction, including +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +\``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +THE SOFTWARE IS PROVIDED \``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY @@ -49,7 +52,9 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -== Upstream Contact == +.. _upstream_contact: -https://sourceware.org/libffi/ -https://github.com/libffi/libffi +Upstream Contact +---------------- + +https://sourceware.org/libffi/ https://github.com/libffi/libffi diff --git a/build/pkgs/libgd/SPKG.rst b/build/pkgs/libgd/SPKG.rst new file mode 100644 index 00000000000..9e80b22e10e --- /dev/null +++ b/build/pkgs/libgd/SPKG.rst @@ -0,0 +1,40 @@ +gd +== + +Description +----------- + +GD is an open source code library for the dynamic creation of images by +programmers. GD is written in C, and "wrappers" are available for Perl, +PHP and other languages. GD creates PNG, JPEG, GIF, WebP, XPM, BMP +images, among other formats. GD is commonly used to generate charts, +graphics, thumbnails, and most anything else, on the fly. While not +restricted to use on the web, the most common applications of GD involve +website development. + +License +------- + +- Custom (BSD-ish) + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Pierre Joye (http://blog.thepimp.net) +- http://libgd.bitbucket.org/ + +Dependencies +------------ + +- libpng +- freetype +- iconv + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +See spkg-src script. diff --git a/build/pkgs/libgd/SPKG.txt b/build/pkgs/libgd/SPKG.txt deleted file mode 100644 index ba400fdb876..00000000000 --- a/build/pkgs/libgd/SPKG.txt +++ /dev/null @@ -1,30 +0,0 @@ -= gd = - -== Description == - -GD is an open source code library for the dynamic creation of images -by programmers. GD is written in C, and "wrappers" are available for -Perl, PHP and other languages. GD creates PNG, JPEG, GIF, WebP, XPM, BMP -images, among other formats. GD is commonly used to generate charts, -graphics, thumbnails, and most anything else, on the fly. -While not restricted to use on the web, the most common applications of -GD involve website development. - -== License == - -* Custom (BSD-ish) - -== Upstream Contact == - -* Pierre Joye (http://blog.thepimp.net) -* http://libgd.bitbucket.org/ - -== Dependencies == - -* libpng -* freetype -* iconv - -== Special Update/Build Instructions == - -See spkg-src script. diff --git a/build/pkgs/libhomfly/SPKG.rst b/build/pkgs/libhomfly/SPKG.rst new file mode 100644 index 00000000000..8a4aa793c94 --- /dev/null +++ b/build/pkgs/libhomfly/SPKG.rst @@ -0,0 +1,32 @@ +LIBHOMFLY +========= + +Description +----------- + +libhomfly is a library to compute the homfly polynomial of knots and +links. + +License +------- + +Public domain + +.. _spkg_maintainers: + +SPKG Maintainers +---------------- + +- Miguel Marco + +.. _upstream_contact: + +Upstream Contact +---------------- + +Miguel Marco (mmarco@unizar.es) + +Dependencies +------------ + +- gc diff --git a/build/pkgs/libhomfly/SPKG.txt b/build/pkgs/libhomfly/SPKG.txt deleted file mode 100644 index 895be6c645e..00000000000 --- a/build/pkgs/libhomfly/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= LIBHOMFLY = - -== Description == - -libhomfly is a library to compute the homfly polynomial of knots and links. - -== License == - -Public domain - -== SPKG Maintainers == - -* Miguel Marco - -== Upstream Contact == - -Miguel Marco (mmarco@unizar.es) - -== Dependencies == - -* gc diff --git a/build/pkgs/libogg/SPKG.rst b/build/pkgs/libogg/SPKG.rst new file mode 100644 index 00000000000..7e0006b9dad --- /dev/null +++ b/build/pkgs/libogg/SPKG.rst @@ -0,0 +1,68 @@ +libogg +====== + +Description +----------- + +libogg is the official reference library for the Ogg multimedia +container format, and the native file and stream format for the Xiph.org +multimedia codecs. As with all Xiph.org technology is it an open format +free for anyone to use. + +Website: http://www.xiph.org/ogg + +License +------- + +Copyright (c) 2002, Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +- Redistributions of source code must retain the above copyright + +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its + +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +\``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +.. _upstream_contact: + +Upstream Contact +---------------- + +The Xiph.org mailing lists - see http://lists.xiph.org/mailman/listinfo + +Dependencies +------------ + +This spkg provides dependencies for + +- the Sage library + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- No changes went into src. diff --git a/build/pkgs/libogg/SPKG.txt b/build/pkgs/libogg/SPKG.txt deleted file mode 100644 index d6c01f19e11..00000000000 --- a/build/pkgs/libogg/SPKG.txt +++ /dev/null @@ -1,55 +0,0 @@ -= libogg = - -== Description == - -libogg is the official reference library for the Ogg multimedia container format, and the native file and -stream format for the Xiph.org multimedia codecs. As with all Xiph.org technology is it an open format free -for anyone to use. - -Website: http://www.xiph.org/ogg - -== License == - -Copyright (c) 2002, Xiph.org Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -- Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -- Neither the name of the Xiph.org Foundation nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -== Upstream Contact == - -The Xiph.org mailing lists - see http://lists.xiph.org/mailman/listinfo - -== Dependencies == - -This spkg provides dependencies for - - * the Sage library - -== Special Update/Build Instructions == - - * No changes went into src. - diff --git a/build/pkgs/libpng/SPKG.rst b/build/pkgs/libpng/SPKG.rst new file mode 100644 index 00000000000..994a2899231 --- /dev/null +++ b/build/pkgs/libpng/SPKG.rst @@ -0,0 +1,72 @@ +libpng +====== + +Description +----------- + +libpng is the official PNG reference library. It supports almost all PNG +features, is extensible, and has been extensively tested for over 13 +years. The home site for development versions (i.e., may be buggy or +subject to change or include experimental features) is +http://libpng.sourceforge.net/, and the place to go for questions about +the library is the png-mng-implement mailing list. + +Website: http://www.libpng.org/pub/png/libpng.html + +License +------- + +The libpng license - see +http://www.libpng.org/pub/png/src/libpng-LICENSE.txt + +.. _upstream_contact: + +Upstream Contact +---------------- + +The png mailing lists - see +http://www.libpng.org/pub/png/pngmisc.html#lists + +Dependencies +------------ + +This spkg depends on: + +- libz + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- On old versions of Darwin, the symbolic links libpng.\* created by + libpng16 may + + interfere with a system-wide libPng.dylib. + +- -- the following is very likely to be obsolete in 2014 --- + + This system-wide library is likely to be a different version and on + top of that, the symbols exported there are prefixed with "_cg" + (for "Core Graphics"). So even if by chance the functionalities of + the two libraries were interchangeable, libraries or applications + looking for one and being presented the other won't find the symbols + they expect. Note the uppercase "P" which could prevent this + conflict; unfortunately, the default filesystem used by Apple is + case-insensitive. + + Note there would be no problem if the system-wide library was not + looked for when Sage is being built or run, but that's not the case + either; it is at least looked for by the "ImageIO" framework: + +- when Python is built with Mac OS extensions, fixed in #4008; +- when Mercurial is built because it uses $EDITOR, cf. #4678; +- when R is built and it finds -lpng, cf. #4409 and #11696. + +- -- this is no longer done, as of #27186 --- + + As not all of these problems are easily dealt with and new ones may + arise, we chose to delete the $SAGE_LOCAL/lib/libpng.\* symlinks. + Therefore, some packages like Tachyon, which by default look for + +- lpng are patched to look for -lpng16 instead. diff --git a/build/pkgs/libpng/SPKG.txt b/build/pkgs/libpng/SPKG.txt deleted file mode 100644 index 177fd285291..00000000000 --- a/build/pkgs/libpng/SPKG.txt +++ /dev/null @@ -1,56 +0,0 @@ -= libpng = - -== Description == - -libpng is the official PNG reference library. It supports almost all PNG -features, is extensible, and has been extensively tested for over 13 years. -The home site for development versions (i.e., may be buggy or subject to -change or include experimental features) is http://libpng.sourceforge.net/, -and the place to go for questions about the library is the png-mng-implement -mailing list. - -Website: http://www.libpng.org/pub/png/libpng.html - -== License == - -The libpng license - see http://www.libpng.org/pub/png/src/libpng-LICENSE.txt - -== Upstream Contact == - -The png mailing lists - see http://www.libpng.org/pub/png/pngmisc.html#lists - -== Dependencies == - -This spkg depends on: - - * libz - -== Special Update/Build Instructions == - - * On old versions of Darwin, the symbolic links libpng.* created by libpng16 may - interfere with a system-wide libPng.dylib. - - --- the following is very likely to be obsolete in 2014 --- - - This system-wide library is likely to be a different version and on - top of that, the symbols exported there are prefixed with "_cg" - (for "Core Graphics"). So even if by chance the functionalities of - the two libraries were interchangeable, libraries or applications - looking for one and being presented the other won't find the symbols - they expect. Note the uppercase "P" which could prevent this - conflict; unfortunately, the default filesystem used by Apple is - case-insensitive. - - Note there would be no problem if the system-wide library was not - looked for when Sage is being built or run, but that's not the case - either; it is at least looked for by the "ImageIO" framework: - - when Python is built with Mac OS extensions, fixed in #4008; - - when Mercurial is built because it uses $EDITOR, cf. #4678; - - when R is built and it finds -lpng, cf. #4409 and #11696. - - --- this is no longer done, as of #27186 --- - - As not all of these problems are easily dealt with and new ones may - arise, we chose to delete the $SAGE_LOCAL/lib/libpng.* symlinks. - Therefore, some packages like Tachyon, which by default look for - -lpng are patched to look for -lpng16 instead. diff --git a/build/pkgs/libsemigroups/SPKG.rst b/build/pkgs/libsemigroups/SPKG.rst new file mode 100644 index 00000000000..32b93be17e6 --- /dev/null +++ b/build/pkgs/libsemigroups/SPKG.rst @@ -0,0 +1,21 @@ +libffi +====== + +Description +----------- + +C++ library for semigroups and monoids; used in GAP's package +Semigroups. + +License +------- + +GPL-3.0 + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://james-d-mitchell.github.io/libsemigroups +https://github.com/james-d-mitchell/libsemigroups diff --git a/build/pkgs/libsemigroups/SPKG.txt b/build/pkgs/libsemigroups/SPKG.txt deleted file mode 100644 index 3d4c9478a9b..00000000000 --- a/build/pkgs/libsemigroups/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= libffi = - -== Description == - -C++ library for semigroups and monoids; -used in GAP's package Semigroups. - -== License == - -GPL-3.0 - -== Upstream Contact == - -http://james-d-mitchell.github.io/libsemigroups -https://github.com/james-d-mitchell/libsemigroups diff --git a/build/pkgs/libtheora/SPKG.rst b/build/pkgs/libtheora/SPKG.rst new file mode 100644 index 00000000000..58d704b7e40 --- /dev/null +++ b/build/pkgs/libtheora/SPKG.rst @@ -0,0 +1,72 @@ +libtheora +========= + +Description +----------- + +libtheora is the official reference library for the Theora video codec. +Theora is a free and open video compression format from the Xiph.org +Foundation. + +Website: http://www.xiph.org/theora + +License +------- + +Copyright (c) 2002, Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +- Redistributions of source code must retain the above copyright + +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its + +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +\``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +.. _upstream_contact: + +Upstream Contact +---------------- + +The Xiph.org mailing lists - see http://lists.xiph.org/mailman/listinfo + +Dependencies +------------ + +This spkg depends on + +- libogg +- libpng + +This spkg provides dependencies for + +- the Sage library + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- No changes went into src. diff --git a/build/pkgs/libtheora/SPKG.txt b/build/pkgs/libtheora/SPKG.txt deleted file mode 100644 index 259f162066d..00000000000 --- a/build/pkgs/libtheora/SPKG.txt +++ /dev/null @@ -1,59 +0,0 @@ -= libtheora = - -== Description == - -libtheora is the official reference library for the Theora video codec. -Theora is a free and open video compression format from the Xiph.org Foundation. - -Website: http://www.xiph.org/theora - -== License == - -Copyright (c) 2002, Xiph.org Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -- Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -- Neither the name of the Xiph.org Foundation nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -== Upstream Contact == - -The Xiph.org mailing lists - see http://lists.xiph.org/mailman/listinfo - -== Dependencies == - -This spkg depends on - - * libogg - * libpng - -This spkg provides dependencies for - - * the Sage library - -== Special Update/Build Instructions == - - * No changes went into src. - diff --git a/build/pkgs/lidia/SPKG.txt b/build/pkgs/lidia/SPKG.rst similarity index 58% rename from build/pkgs/lidia/SPKG.txt rename to build/pkgs/lidia/SPKG.rst index 412345cd8a7..98160accb31 100644 --- a/build/pkgs/lidia/SPKG.txt +++ b/build/pkgs/lidia/SPKG.rst @@ -1,25 +1,33 @@ -= lidia = +lidia +===== -== Description == +Description +----------- A library for computational number theory. Abandoned upstream and has disappeared from the web at TU Darmstadt. -We use as our new upstream a version minimally maintained for the -LattE project. +We use as our new upstream a version minimally maintained for the LattE +project. https://www.math.ucdavis.edu/~latte/software/packages/lidia/current/lidia-2.3.0+latte-patches-2014-10-04.tar.gz -== License == -lidia is released under the GPL, or so it is claimed. -See https://groups.google.com/forum/#!msg/sage-devel/kTxgPSqrbUM/5Txj3_IKhlQJ +License +------- + +lidia is released under the GPL, or so it is claimed. See +https://groups.google.com/forum/#!msg/sage-devel/kTxgPSqrbUM/5Txj3_IKhlQJ and https://lists.debian.org/debian-legal/2007/07/msg00120.html -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- Matthias Köppe, UC Davis, CA, USA -== Dependencies == +Dependencies +------------ GMP. diff --git a/build/pkgs/lie/SPKG.txt b/build/pkgs/lie/SPKG.rst similarity index 86% rename from build/pkgs/lie/SPKG.txt rename to build/pkgs/lie/SPKG.rst index dba5cbdc69f..5ad0495f76d 100644 --- a/build/pkgs/lie/SPKG.txt +++ b/build/pkgs/lie/SPKG.rst @@ -1,6 +1,8 @@ -= LiE = +LiE +=== -== Description == +Description +----------- LiE is the name of a software package that enables mathematicians and physicists to perform computations of a Lie group theoretic nature. It @@ -32,17 +34,21 @@ and about currently valid definitions and values. (from http://www-math.univ-poitiers.fr/~maavl/LiE/description.html ) -== License == +License +------- GNU Lesser General Public License (LGPL), version unspecified -== Upstream Contact == +.. _upstream_contact: - * Marc van Leeuwen, http://www-math.univ-poitiers.fr/~maavl/ +Upstream Contact +---------------- -== Dependencies == +- Marc van Leeuwen, http://www-math.univ-poitiers.fr/~maavl/ - * readline - * ncurses - * bison (not included in this package or in Sage!) +Dependencies +------------ +- readline +- ncurses +- bison (not included in this package or in Sage!) diff --git a/build/pkgs/linbox/SPKG.rst b/build/pkgs/linbox/SPKG.rst new file mode 100644 index 00000000000..956c2704b5f --- /dev/null +++ b/build/pkgs/linbox/SPKG.rst @@ -0,0 +1,62 @@ +LinBox +====== + +Description +----------- + +From http://linalg.org/: LinBox is a C++ template library for exact, +high-performance linear algebra computation with dense, sparse, and +structured matrices over the integers and over finite fields. + +License +------- + +LGPL V2 or later + +.. _upstream_contact: + +Upstream Contact +---------------- + +- +- + +.. _spkg_repository: + +SPKG Repository +--------------- + + https://bitbucket.org/malb/linbox-spkg + +Dependencies +------------ + +- GNU patch +- GMP/MPIR +- MPFR +- NTL +- fpLLL +- IML +- M4RI +- M4RIE +- Givaro +- FFLAS/FFPACK +- ATLAS (non-OSX)/The Accelerate FrameWork (on OSX) +- ATLAS (non-MacOS X) / The Accelerate FrameWork (on MacOS X), or GSL's + CBLAS + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +TODO: + +- spkg-check is disabled for now, should work in the next release + + after 1.3.2. + +- Check whether \`make fullcheck\` works/builds, is worth running, and + doesn't + + take ages. (Version 1.1.6 doesn't seem to have such a target.) diff --git a/build/pkgs/linbox/SPKG.txt b/build/pkgs/linbox/SPKG.txt deleted file mode 100644 index d4d5bbbecc0..00000000000 --- a/build/pkgs/linbox/SPKG.txt +++ /dev/null @@ -1,44 +0,0 @@ -= LinBox = - -== Description == - -From http://linalg.org/: LinBox is a C++ template library for exact, -high-performance linear algebra computation with dense, sparse, and -structured matrices over the integers and over finite fields. - -== License == - -LGPL V2 or later - -== Upstream Contact == - - * - * - -== SPKG Repository == - - https://bitbucket.org/malb/linbox-spkg - -== Dependencies == - - * GNU patch - * GMP/MPIR - * MPFR - * NTL - * fpLLL - * IML - * M4RI - * M4RIE - * Givaro - * FFLAS/FFPACK - * ATLAS (non-OSX)/The Accelerate FrameWork (on OSX) - * ATLAS (non-MacOS X) / The Accelerate FrameWork (on MacOS X), or GSL's CBLAS - -== Special Update/Build Instructions == - -TODO: - - spkg-check is disabled for now, should work in the next release - after 1.3.2. - - Check whether `make fullcheck` works/builds, is worth running, and doesn't - take ages. (Version 1.1.6 doesn't seem to have such a target.) - diff --git a/build/pkgs/lrcalc/SPKG.txt b/build/pkgs/lrcalc/SPKG.rst similarity index 63% rename from build/pkgs/lrcalc/SPKG.txt rename to build/pkgs/lrcalc/SPKG.rst index 2ac951c59fd..66529d7d9d9 100644 --- a/build/pkgs/lrcalc/SPKG.txt +++ b/build/pkgs/lrcalc/SPKG.rst @@ -1,16 +1,22 @@ -= lrcalc = +lrcalc +====== -== Description == +Description +----------- Littlewood-Richardson Calculator http://math.rutgers.edu/~asbuch/lrcalc/ -== License == +License +------- GNU General Public License V2+ -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- Anders S. Buch (asbuch@math.rutgers.edu) diff --git a/build/pkgs/lrslib/SPKG.txt b/build/pkgs/lrslib/SPKG.rst similarity index 53% rename from build/pkgs/lrslib/SPKG.txt rename to build/pkgs/lrslib/SPKG.rst index a940babecbb..9e79bce7d34 100644 --- a/build/pkgs/lrslib/SPKG.txt +++ b/build/pkgs/lrslib/SPKG.rst @@ -1,30 +1,41 @@ -= lrslib = +lrslib +====== -== Description == +Description +----------- -lrslib implements the linear reverse search algorithm of Avis and Fukuda. +lrslib implements the linear reverse search algorithm of Avis and +Fukuda. See the homepage (http://cgm.cs.mcgill.ca/~avis/C/lrs.html) for details. -We use an autotoolized version from https://github.com/mkoeppe/lrslib/tree/autoconfiscation +We use an autotoolized version from +https://github.com/mkoeppe/lrslib/tree/autoconfiscation + +License +------- -== License == lrslib is released under a GPL v2+ license. -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- David Avis, avis at cs dot mcgill dot edu. -== Dependencies == +Dependencies +------------ To build and install the "plrs" binary, a multi-thread version of lrs, need to first install the full Boost package ("sage -i boost"). -If the package finds an MPI C++ compiler script (mpic++), it also -builds and installs the "mplrs" binary, a distributed version of lrs -using MPI. +If the package finds an MPI C++ compiler script (mpic++), it also builds +and installs the "mplrs" binary, a distributed version of lrs using MPI. (Sage currently does not make use of plrs and mplrs.) -== Special Update/Build Instructions == +.. _special_updatebuild_instructions: +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/m4ri/SPKG.rst b/build/pkgs/m4ri/SPKG.rst new file mode 100644 index 00000000000..e77dfff0ef1 --- /dev/null +++ b/build/pkgs/m4ri/SPKG.rst @@ -0,0 +1,38 @@ +M4RI +==== + +Description +----------- + +M4RI: Library for matrix multiplication, reduction and inversion over +GF(2). (See also m4ri/README for a brief overview.) + +License +------- + +- GNU General Public License Version 2 or later (see src/COPYING) + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Authors: Martin Albrecht et al. +- Email: +- Website: https://bitbucket.org/malb/m4ri + +Dependencies +------------ + +- libPNG + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- Delete the upstream Mercurial repositories (file m4ri/.hgtags, + directory m4ri/.hg). +- Delete the directory m4ri/autom4te.cache (if present). +- Delete m4ri.vcproj (and perhaps other unnecessary baggage). +- Touch m4ri/configure to make sure it is newer than its sources. diff --git a/build/pkgs/m4ri/SPKG.txt b/build/pkgs/m4ri/SPKG.txt deleted file mode 100644 index cfade2147e1..00000000000 --- a/build/pkgs/m4ri/SPKG.txt +++ /dev/null @@ -1,27 +0,0 @@ -= M4RI = - -== Description == - -M4RI: Library for matrix multiplication, reduction and inversion over -GF(2). (See also m4ri/README for a brief overview.) - -== License == - - * GNU General Public License Version 2 or later (see src/COPYING) - -== Upstream Contact == - - * Authors: Martin Albrecht et al. - * Email: - * Website: https://bitbucket.org/malb/m4ri - -== Dependencies == - - * libPNG - -== Special Update/Build Instructions == - * Delete the upstream Mercurial repositories (file m4ri/.hgtags, directory m4ri/.hg). - * Delete the directory m4ri/autom4te.cache (if present). - * Delete m4ri.vcproj (and perhaps other unnecessary baggage). - * Touch m4ri/configure to make sure it is newer than its sources. - diff --git a/build/pkgs/m4rie/SPKG.rst b/build/pkgs/m4rie/SPKG.rst new file mode 100644 index 00000000000..504b6e32d98 --- /dev/null +++ b/build/pkgs/m4rie/SPKG.rst @@ -0,0 +1,28 @@ +M4RIE +===== + +Description +----------- + +M4RIE: Library for matrix multiplication, reduction and inversion over +GF(2^k) for 2 <= k <= 10. + +License +------- + +- GNU General Public License Version 2 or later (see src/COPYING) + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Authors: Martin Albrecht +- Email: +- Website: http://m4ri.sagemath.org + +Dependencies +------------ + +- M4RI +- Givaro diff --git a/build/pkgs/m4rie/SPKG.txt b/build/pkgs/m4rie/SPKG.txt deleted file mode 100644 index 8aa21cd846a..00000000000 --- a/build/pkgs/m4rie/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= M4RIE = - -== Description == - -M4RIE: Library for matrix multiplication, reduction and inversion over -GF(2^k) for 2 <= k <= 10. - -== License == - - * GNU General Public License Version 2 or later (see src/COPYING) - -== Upstream Contact == - - * Authors: Martin Albrecht - * Email: - * Website: http://m4ri.sagemath.org - -== Dependencies == - - * M4RI - * Givaro - diff --git a/build/pkgs/markupsafe/SPKG.txt b/build/pkgs/markupsafe/SPKG.rst similarity index 51% rename from build/pkgs/markupsafe/SPKG.txt rename to build/pkgs/markupsafe/SPKG.rst index e0b5a22e19f..69f3f8f06e9 100644 --- a/build/pkgs/markupsafe/SPKG.txt +++ b/build/pkgs/markupsafe/SPKG.rst @@ -1,19 +1,24 @@ -= markupsafe = +markupsafe +========== -== Description == +Description +----------- Implements a XML/HTML/XHTML Markup safe string for Python -== License == +License +------- Simplified BSD -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- Home page: http://github.com/mitsuhiko/markupsafe -== Dependencies == +Dependencies +------------ Python, setuptools - - diff --git a/build/pkgs/mathjax/SPKG.rst b/build/pkgs/mathjax/SPKG.rst new file mode 100644 index 00000000000..646b1743bc2 --- /dev/null +++ b/build/pkgs/mathjax/SPKG.rst @@ -0,0 +1,40 @@ +MathJax +======= + +Description +----------- + +MathJax is a JavaScript library for displaying mathematical formulas. +Mathjax is used by both sagenb and ipython notebooks. + +License +------- + +Apache License, version 2.0 + +.. _upstream_contact: + +Upstream Contact +---------------- + +Home page: http://www.mathjax.org/ + +Dependencies +------------ + +None. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. + +Patches +------- + +- nopng_config.patch: prevent font warning messages since png files are + + removed. See section "Trimming II -- not strictly necessary" of + https://github.com/mathjax/MathJax-docs/wiki/Guide%3A-reducing-size-of-a-mathjax-installation diff --git a/build/pkgs/mathjax/SPKG.txt b/build/pkgs/mathjax/SPKG.txt deleted file mode 100644 index ae499963726..00000000000 --- a/build/pkgs/mathjax/SPKG.txt +++ /dev/null @@ -1,29 +0,0 @@ -= MathJax = - -== Description == - -MathJax is a JavaScript library for displaying mathematical formulas. -Mathjax is used by both sagenb and ipython notebooks. - -== License == - -Apache License, version 2.0 - -== Upstream Contact == - -Home page: http://www.mathjax.org/ - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -None. - -== Patches == - -* nopng_config.patch: prevent font warning messages since png files are - removed. See section "Trimming II -- not strictly necessary" of - https://github.com/mathjax/MathJax-docs/wiki/Guide%3A-reducing-size-of-a-mathjax-installation - diff --git a/build/pkgs/matplotlib/SPKG.rst b/build/pkgs/matplotlib/SPKG.rst new file mode 100644 index 00000000000..efe670d93cf --- /dev/null +++ b/build/pkgs/matplotlib/SPKG.rst @@ -0,0 +1,65 @@ +matplotlib +========== + +Description +----------- + +From the Matplotlib website: matplotlib is a python 2D plotting library +which produces publication quality figures in a variety of hardcopy +formats and interactive environments across platforms. matplotlib can be +used in python scripts, the python and ipython shell (ala matlab or +mathematica), web application servers, and six graphical user interface +toolkits. + +License +------- + +The Matplotlib license - see +http://matplotlib.sourceforge.net/users/license.html: Matplotlib only +uses BSD compatible code, and its license is based on the PSF license. +See the Open Source Initiative licenses page for details on individual +licenses. Non-BSD compatible licenses (eg LGPL) are acceptable in +matplotlib Toolkits. For a discussion of the motivations behind the +licencing choice, see Licenses. + +.. _upstream_contact: + +Upstream Contact +---------------- + +The matplotlib mailing lists: see +http://sourceforge.net/projects/matplotlib + +Dependencies +------------ + +- python +- numpy +- setuptools (>= 0.7) +- freetype +- patch (used in spkg-install) +- dateutil +- pyparsing +- tornado +- kiwisolver + +.. _build_instructionschanges: + +Build Instructions/Changes +-------------------------- + +- NOTE: To drastically cut down on spkg size, we delete the internal + + testing images. To do this, we repackage the tarball by removing + the contents of lib/matplotlib/tests/baseline_images/*, this is + done by the spkg-src script. + +- setup.py.patch: disable loading of Tests. Otherwise, setup.py + + raises an error because it can't find the deleted files + from src/lib/matplotlib/tests/baseline_images/\* + +- NOTE: as of matplotlib-1.0.0 and Sage 4.6, Sage does not use + + $HOME/.matplotlib by default. Instead, it sets MPLCONFIGDIR to + a subdirectory in $DOT_SAGE, see src/bin/sage-env diff --git a/build/pkgs/matplotlib/SPKG.txt b/build/pkgs/matplotlib/SPKG.txt deleted file mode 100644 index 5b8e0e6ea63..00000000000 --- a/build/pkgs/matplotlib/SPKG.txt +++ /dev/null @@ -1,51 +0,0 @@ -= matplotlib = - -== Description == - -From the Matplotlib website: matplotlib is a python 2D plotting -library which produces publication quality figures in a variety of -hardcopy formats and interactive environments across -platforms. matplotlib can be used in python scripts, the python and -ipython shell (ala matlab or mathematica), web application servers, -and six graphical user interface toolkits. - -== License == - -The Matplotlib license - see -http://matplotlib.sourceforge.net/users/license.html: Matplotlib only -uses BSD compatible code, and its license is based on the PSF -license. See the Open Source Initiative licenses page for details on -individual licenses. Non-BSD compatible licenses (eg LGPL) are -acceptable in matplotlib Toolkits. For a discussion of the motivations -behind the licencing choice, see Licenses. - -== Upstream Contact == - -The matplotlib mailing lists: see http://sourceforge.net/projects/matplotlib - -== Dependencies == - - * python - * numpy - * setuptools (>= 0.7) - * freetype - * patch (used in spkg-install) - * dateutil - * pyparsing - * tornado - * kiwisolver - -== Build Instructions/Changes == - - * NOTE: To drastically cut down on spkg size, we delete the internal - testing images. To do this, we repackage the tarball by removing - the contents of lib/matplotlib/tests/baseline_images/*, this is - done by the spkg-src script. - - * setup.py.patch: disable loading of Tests. Otherwise, setup.py - raises an error because it can't find the deleted files - from src/lib/matplotlib/tests/baseline_images/* - - * NOTE: as of matplotlib-1.0.0 and Sage 4.6, Sage does not use - $HOME/.matplotlib by default. Instead, it sets MPLCONFIGDIR to - a subdirectory in $DOT_SAGE, see src/bin/sage-env diff --git a/build/pkgs/maxima/SPKG.rst b/build/pkgs/maxima/SPKG.rst new file mode 100644 index 00000000000..45b4ced62e7 --- /dev/null +++ b/build/pkgs/maxima/SPKG.rst @@ -0,0 +1,87 @@ +Maxima +====== + +Description +----------- + +Maxima is a system for the manipulation of symbolic and numerical +expressions, including differentiation, integration, Taylor series, +Laplace transforms, ordinary differential equations, systems of linear +equations, polynomials, and sets, lists, vectors, matrices, and tensors. +Maxima yields high precision numeric results by using exact fractions, +arbitrary precision integers, and variable precision floating point +numbers. Maxima can plot functions and data in two and three dimensions. + +For more information, see the Maxima web site + +http://maxima.sourceforge.net + +License +------- + +Maxima is distributed under the GNU General Public License, with some +export restrictions from the U.S. Department of Energy. See the file +COPYING. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- The Maxima mailing list - see + http://maxima.sourceforge.net/maximalist.html + +Dependencies +------------ + +- ECL (Embedded Common Lisp) + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +1. Go to http://sourceforge.net/projects/maxima/files/Maxima-source/ + + and download the source tarball maxima-x.y.z.tar.gz; place it in + the upstream/ directory. + +2. Update package-version.txt and run sage-fix-pkg-checksums. + +3. Make sure the patches still apply cleanly, and update them if + + necessary. + +4. Test the resulting package. + +All patch files in the patches/ directory are applied. Descriptions of +these patches are either in the patch files themselves or below. + +- 0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch: + + Fix for Maxima bug #2520 (abs_integrate fails on abs(sin(x)) and + abs(cos(x))). Introduced in Trac #13364 (Upgrade Maxima to + 5.29.1). + +- build-fasl.patch: Build a fasl library for ecl in addition to an + + executable program. Introduced in Trac #16178 (Build maxima fasl + without asdf). + +- infodir.patch: Correct the path to the Info directory. Introduced + + in Trac #11348 (maxima test fails when install tree is moved). + +- matrixexp.patch: Fix matrixexp(matrix([%i*%pi])), which broke after + + Maxima 5.29.1. Introduced in Trac #13973. + +- maxima.system.patch: Set c::*compile-in-constants\* to t. + + Introduced in Trac #11966 (OS X 10.7 Lion: Maxima fails to build). + +- undoing_true_false_printing_patch.patch: Revert an upstream change + + causing '?' to be printed around some words. Introduced in Trac + + #. 13364 (Upgrade Maxima to 5.29.1). diff --git a/build/pkgs/maxima/SPKG.txt b/build/pkgs/maxima/SPKG.txt deleted file mode 100644 index 9c8827a4dc0..00000000000 --- a/build/pkgs/maxima/SPKG.txt +++ /dev/null @@ -1,68 +0,0 @@ -= Maxima = - -== Description == - -Maxima is a system for the manipulation of symbolic and numerical -expressions, including differentiation, integration, Taylor series, -Laplace transforms, ordinary differential equations, systems of linear -equations, polynomials, and sets, lists, vectors, matrices, and -tensors. Maxima yields high precision numeric results by using exact -fractions, arbitrary precision integers, and variable precision -floating point numbers. Maxima can plot functions and data in two and -three dimensions. - -For more information, see the Maxima web site - -http://maxima.sourceforge.net - -== License == - -Maxima is distributed under the GNU General Public License, with some -export restrictions from the U.S. Department of Energy. See the file -COPYING. - -== Upstream Contact == - - * The Maxima mailing list - see http://maxima.sourceforge.net/maximalist.html - -== Dependencies == - - * ECL (Embedded Common Lisp) - -== Special Update/Build Instructions == - -1. Go to http://sourceforge.net/projects/maxima/files/Maxima-source/ - and download the source tarball maxima-x.y.z.tar.gz; place it in - the upstream/ directory. - -2. Update package-version.txt and run sage-fix-pkg-checksums. - -3. Make sure the patches still apply cleanly, and update them if - necessary. - -4. Test the resulting package. - -All patch files in the patches/ directory are applied. Descriptions -of these patches are either in the patch files themselves or below. - - * 0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch: - Fix for Maxima bug #2520 (abs_integrate fails on abs(sin(x)) and - abs(cos(x))). Introduced in Trac #13364 (Upgrade Maxima to - 5.29.1). - - * build-fasl.patch: Build a fasl library for ecl in addition to an - executable program. Introduced in Trac #16178 (Build maxima fasl - without asdf). - - * infodir.patch: Correct the path to the Info directory. Introduced - in Trac #11348 (maxima test fails when install tree is moved). - - * matrixexp.patch: Fix matrixexp(matrix([%i*%pi])), which broke after - Maxima 5.29.1. Introduced in Trac #13973. - - * maxima.system.patch: Set c::*compile-in-constants* to t. - Introduced in Trac #11966 (OS X 10.7 Lion: Maxima fails to build). - - * undoing_true_false_printing_patch.patch: Revert an upstream change - causing '?' to be printed around some words. Introduced in Trac - #13364 (Upgrade Maxima to 5.29.1). diff --git a/build/pkgs/mcqd/SPKG.rst b/build/pkgs/mcqd/SPKG.rst new file mode 100644 index 00000000000..2de2876e489 --- /dev/null +++ b/build/pkgs/mcqd/SPKG.rst @@ -0,0 +1,28 @@ +.. _mcqd_1.0: + +MCQD 1.0 +======== + +Description +----------- + +MaxCliqueDyn is a fast exact algorithm for finding a maximum clique in +an undirected graph. + +License +------- + +GPL 3 + +.. _upstream_contact: + +Upstream Contact +---------------- + +MCQD is currently being maintained by Janez Konc. +https://gitlab.com/janezkonc/mcqd + +Dependencies +------------ + +None diff --git a/build/pkgs/mcqd/SPKG.txt b/build/pkgs/mcqd/SPKG.txt deleted file mode 100644 index 0e973a54623..00000000000 --- a/build/pkgs/mcqd/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= MCQD 1.0 = - -== Description == - -MaxCliqueDyn is a fast exact algorithm for finding a maximum clique in an -undirected graph. - -== License == - -GPL 3 - -== Upstream Contact == - -MCQD is currently being maintained by Janez Konc. -https://gitlab.com/janezkonc/mcqd - -== Dependencies == - -None - diff --git a/build/pkgs/meataxe/SPKG.rst b/build/pkgs/meataxe/SPKG.rst new file mode 100644 index 00000000000..89e8cbcfe71 --- /dev/null +++ b/build/pkgs/meataxe/SPKG.rst @@ -0,0 +1,28 @@ +SharedMeatAxe +============= + +Description +----------- + +SharedMeatAxe 1.0 is an autotoolized shared library version of C MeatAxe +2.4.24, a set of programs for computing with modular representations. +The package comprises a shared library "libmtx", as well as several +executables. + +See http://users.minet.uni-jena.de/~king/SharedMeatAxe/ for the package +documentation. + +Licence +------- + +The Shared Meat-Axe is free software: you can redistribute it and/or +modify it under the terms of the GNU General Public License as published +by the Free Software Foundation, either version 2 of the License, or (at +your option) any later version. See the file COPYING. + +.. _upstream_contact: + +Upstream contact +---------------- + +- Simon King diff --git a/build/pkgs/meataxe/SPKG.txt b/build/pkgs/meataxe/SPKG.txt deleted file mode 100644 index 0c073a400f7..00000000000 --- a/build/pkgs/meataxe/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= SharedMeatAxe = - -== Description == - -SharedMeatAxe 1.0 is an autotoolized shared library version of C MeatAxe 2.4.24, -a set of programs for computing with modular representations. -The package comprises a shared library "libmtx", as well as several -executables. - -See http://users.minet.uni-jena.de/~king/SharedMeatAxe/ for the package -documentation. - -== Licence == - -The Shared Meat-Axe is free software: you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation, either version 2 of the License, or (at your option) any later -version. See the file COPYING. - -== Upstream contact == - - * Simon King diff --git a/build/pkgs/mistune/SPKG.rst b/build/pkgs/mistune/SPKG.rst new file mode 100644 index 00000000000..4e21fc42ebc --- /dev/null +++ b/build/pkgs/mistune/SPKG.rst @@ -0,0 +1,24 @@ +mistune +======= + +Description +----------- + +The fastest markdown parser in pure Python + +License +------- + +BSD License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Home Page: https://github.com/lepture/mistune + +Dependencies +------------ + +Python, Cython, Pip diff --git a/build/pkgs/mistune/SPKG.txt b/build/pkgs/mistune/SPKG.txt deleted file mode 100644 index bc0f9192cae..00000000000 --- a/build/pkgs/mistune/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= mistune = - -== Description == - -The fastest markdown parser in pure Python - -== License == - -BSD License - -== Upstream Contact == - -Home Page: https://github.com/lepture/mistune - -== Dependencies == - -Python, Cython, Pip - - diff --git a/build/pkgs/modular_decomposition/SPKG.rst b/build/pkgs/modular_decomposition/SPKG.rst new file mode 100644 index 00000000000..bdfde451229 --- /dev/null +++ b/build/pkgs/modular_decomposition/SPKG.rst @@ -0,0 +1,35 @@ +.. _modular_decomposition: + +modular decomposition +===================== + +Description +----------- + +This is an implementation of a modular decomposition algorithm. + +http://www.liafa.jussieu.fr/~fm/ (in french) + +License +------- + +GPL + +.. _upstream_contact: + +Upstream Contact +---------------- + +Fabien de Montgolfier + +http://www.liafa.jussieu.fr/~fm/ + +Dependencies +------------ + +None + +Patches +------- + +None diff --git a/build/pkgs/modular_decomposition/SPKG.txt b/build/pkgs/modular_decomposition/SPKG.txt deleted file mode 100644 index 929836f4336..00000000000 --- a/build/pkgs/modular_decomposition/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= modular decomposition = - -== Description == - -This is an implementation of a modular decomposition algorithm. - -http://www.liafa.jussieu.fr/~fm/ (in french) - -== License == - -GPL - -== Upstream Contact == - -Fabien de Montgolfier - -http://www.liafa.jussieu.fr/~fm/ - -== Dependencies == - -None - -== Patches == - -None diff --git a/build/pkgs/mpc/SPKG.rst b/build/pkgs/mpc/SPKG.rst new file mode 100644 index 00000000000..119b205046a --- /dev/null +++ b/build/pkgs/mpc/SPKG.rst @@ -0,0 +1,46 @@ +MPC +=== + +Description +----------- + +From http://www.multiprecision.org/mpc: GNU MPC is a C library for the +arithmetic of complex numbers with arbitrarily high precision and +correct rounding of the result. It extends the principles of the +IEEE-754 standard for fixed precision real floating point numbers to +complex numbers, providing well-defined semantics for every operation. +At the same time, speed of operation at high precision is a major design +goal. + +License +------- + +LGPLv3+ for the code and GFDLv1.3+ (with no invariant sections) for the +documentation. + +.. _upstream_contact: + +Upstream Contact +---------------- + +The MPC website is located at http://www.multiprecision.org/mpc . + +The MPC team can be contact via the MPC mailing list: + + mpc-discuss@lists.gforge.inria.fr + +Dependencies +------------ + +- MPIR +- MPFR + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- mpc_mul_faster.patch: Patch from Paul Zimmermann to speed up MPC + + multiplication (for small precisions) by reducing overhead in MPFR + operations. diff --git a/build/pkgs/mpc/SPKG.txt b/build/pkgs/mpc/SPKG.txt deleted file mode 100644 index 13dcd59e94c..00000000000 --- a/build/pkgs/mpc/SPKG.txt +++ /dev/null @@ -1,34 +0,0 @@ -= MPC = - -== Description == - -From http://www.multiprecision.org/mpc: -GNU MPC is a C library for the arithmetic of complex numbers with -arbitrarily high precision and correct rounding of the result. It -extends the principles of the IEEE-754 standard for fixed precision real -floating point numbers to complex numbers, providing well-defined -semantics for every operation. At the same time, speed of operation at -high precision is a major design goal. - -== License == - -LGPLv3+ for the code and GFDLv1.3+ (with no invariant sections) -for the documentation. - -== Upstream Contact == - -The MPC website is located at http://www.multiprecision.org/mpc . - -The MPC team can be contact via the MPC mailing list: - mpc-discuss@lists.gforge.inria.fr - -== Dependencies == - - * MPIR - * MPFR - -== Special Update/Build Instructions == - -* mpc_mul_faster.patch: Patch from Paul Zimmermann to speed up MPC - multiplication (for small precisions) by reducing overhead in MPFR - operations. diff --git a/build/pkgs/mpfi/SPKG.txt b/build/pkgs/mpfi/SPKG.rst similarity index 67% rename from build/pkgs/mpfi/SPKG.txt rename to build/pkgs/mpfi/SPKG.rst index d51bf510171..400fa38c259 100644 --- a/build/pkgs/mpfi/SPKG.txt +++ b/build/pkgs/mpfi/SPKG.rst @@ -1,6 +1,8 @@ -= MPFI = +MPFI +==== -== Description == +Description +----------- MPFI is a library for interval arithmetic, which is built upon the MPFR multiple precision floating-point arithmetic. @@ -8,31 +10,35 @@ multiple precision floating-point arithmetic. MPFI is intended to be a portable library written in C for arbitrary precision interval arithmetic with intervals represented using MPFR reliable floating-point numbers. It is based on the GNU MP library and -on the MPFR library. The purpose of an arbitrary precision interval +on the MPFR library. The purpose of an arbitrary precision interval arithmetic is on the one hand to get "guaranteed" results, thanks to interval computation, and on the other hand to obtain accurate results, thanks to multiple precision arithmetic. The MPFI library is built upon MPFR in order to benefit from the correct rounding provided, for each -operation or function, by MPFR. Further advantages of using MPFR are -its portability and compliance with the IEEE 754 standard for -floating-point arithmetic. +operation or function, by MPFR. Further advantages of using MPFR are its +portability and compliance with the IEEE 754 standard for floating-point +arithmetic. -== License == +License +------- This version of MPFI is released under the GNU Lesser General Public -License. It is permitted to link MPFI to non-free programs, as long as +License. It is permitted to link MPFI to non-free programs, as long as when distributing them the MPFI source code and a means to re-link with a modified MPFI is provided. -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- The MPFI website is located at http://mpfi.gforge.inria.fr/ The MPFI team can be contacted via the MPFI mailing list: mpfi-users@lists.gforge.inria.fr -== Dependencies == - - * GMP - * MPFR +Dependencies +------------ +- GMP +- MPFR diff --git a/build/pkgs/mpfr/SPKG.rst b/build/pkgs/mpfr/SPKG.rst new file mode 100644 index 00000000000..50796922e49 --- /dev/null +++ b/build/pkgs/mpfr/SPKG.rst @@ -0,0 +1,70 @@ +MPFR +==== + +Description +----------- + +The MPFR library is a C library for multiple-precision floating-point +computations with correct rounding. MPFR has continuously been supported +by the INRIA and the current main authors come from the Caramba and AriC +project-teams at Loria (Nancy, France) and LIP (Lyon, France) +respectively; see more on the credit page. MPFR is based on the GMP +multiple-precision library. + +The main goal of MPFR is to provide a library for multiple-precision +floating-point computation which is both efficient and has a +well-defined semantics. It copies the good ideas from the ANSI/IEEE-754 +standard for double-precision floating-point arithmetic (53-bit +significand). + +License +------- + +MPFR is free. It is distributed under the GNU Lesser General Public +License (GNU Lesser GPL), version 3 or later (2.1 or later for MPFR +versions until 2.4.x). The library has been registered in France by the +Agence de Protection des Programmes under the number IDDN FR 001 120020 +00 R P 2000 000 10800, on 15 March 2000. This license guarantees your +freedom to share and change MPFR, to make sure MPFR is free for all its +users. Unlike the ordinary General Public License, the Lesser GPL +enables developers of non-free programs to use MPFR in their programs. +If you have written a new function for MPFR or improved an existing one, +please share your work! + +.. _upstream_contact: + +Upstream Contact +---------------- + +The MPFR website is located at http://mpfr.org/ + +The MPFR team can be contacted via the MPFR mailing list: mpfr@loria.fr + +Dependencies +------------ + +- GMP/MPIR +- GNU patch + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- Make sure MPFR's settings of \`CC\` and \`CFLAGS\` still get properly + extracted, + + currently from its \`config.log\` in the \`src/\` directory. + +- We should remove the \`configure\` option \`--disable-thread-safe\` + in case + + the issues without that have meanwhile been fixed. (Then we should + actually pass \`--enable-thread-safe`.) + +TODO +---- + +- --disable-thread-safe should be switched to --enable-thread-safe, + + need to check that this works on the buildbot machines diff --git a/build/pkgs/mpfr/SPKG.txt b/build/pkgs/mpfr/SPKG.txt deleted file mode 100644 index c2a1bc11fa6..00000000000 --- a/build/pkgs/mpfr/SPKG.txt +++ /dev/null @@ -1,51 +0,0 @@ -= MPFR = - -== Description == - -The MPFR library is a C library for multiple-precision floating-point -computations with correct rounding. MPFR has continuously been supported by -the INRIA and the current main authors come from the Caramba and AriC -project-teams at Loria (Nancy, France) and LIP (Lyon, France) respectively; -see more on the credit page. MPFR is based on the GMP multiple-precision -library. - -The main goal of MPFR is to provide a library for multiple-precision -floating-point computation which is both efficient and has a well-defined -semantics. It copies the good ideas from the ANSI/IEEE-754 standard for -double-precision floating-point arithmetic (53-bit significand). - -== License == - -MPFR is free. It is distributed under the GNU Lesser General Public License -(GNU Lesser GPL), version 3 or later (2.1 or later for MPFR versions until -2.4.x). The library has been registered in France by the Agence de Protection -des Programmes under the number IDDN FR 001 120020 00 R P 2000 000 10800, on -15 March 2000. This license guarantees your freedom to share and change MPFR, -to make sure MPFR is free for all its users. Unlike the ordinary General -Public License, the Lesser GPL enables developers of non-free programs to use -MPFR in their programs. If you have written a new function for MPFR or -improved an existing one, please share your work! - -== Upstream Contact == - -The MPFR website is located at http://mpfr.org/ - -The MPFR team can be contacted via the MPFR mailing list: mpfr@loria.fr - -== Dependencies == - - * GMP/MPIR - * GNU patch - -== Special Update/Build Instructions == - - * Make sure MPFR's settings of `CC` and `CFLAGS` still get properly extracted, - currently from its `config.log` in the `src/` directory. - * We should remove the `configure` option `--disable-thread-safe` in case - the issues without that have meanwhile been fixed. (Then we should - actually pass `--enable-thread-safe`.) - -== TODO == - -* --disable-thread-safe should be switched to --enable-thread-safe, - need to check that this works on the buildbot machines diff --git a/build/pkgs/mpfrcx/SPKG.rst b/build/pkgs/mpfrcx/SPKG.rst new file mode 100644 index 00000000000..24f2d607e7f --- /dev/null +++ b/build/pkgs/mpfrcx/SPKG.rst @@ -0,0 +1,27 @@ +MPFRCX +====== + +Description +----------- + +Mpfrcx is a library for the arithmetic of univariate polynomials over +arbitrary precision real (Mpfr) or complex (Mpc) numbers, without +control on the rounding. For the time being, only the few functions +needed to implement the floating point approach to complex +multiplication are implemented. On the other hand, these comprise +asymptotically fast multiplication routines such as Toom–Cook and the +FFT. + +License +------- + +MPFRCX is distributed under the Gnu Lesser General Public License, +either version 2.1 of the licence, or (at your option) any later version +(LGPLv2.1+). + +.. _upstream_contact: + +Upstream Contact +---------------- + +The MPFRCX website is located at http://www.multiprecision.org/mpfrcx . diff --git a/build/pkgs/mpfrcx/SPKG.txt b/build/pkgs/mpfrcx/SPKG.txt deleted file mode 100644 index 0188cfda2b9..00000000000 --- a/build/pkgs/mpfrcx/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= MPFRCX = - -== Description == - -Mpfrcx is a library for the arithmetic of univariate polynomials over arbitrary -precision real (Mpfr) or complex (Mpc) numbers, without control on the -rounding. For the time being, only the few functions needed to implement the -floating point approach to complex multiplication are implemented. On the other -hand, these comprise asymptotically fast multiplication routines such as -Toom–Cook and the FFT. - -== License == - -MPFRCX is distributed under the Gnu Lesser General Public License, either -version 2.1 of the licence, or (at your option) any later version (LGPLv2.1+). - -== Upstream Contact == - -The MPFRCX website is located at http://www.multiprecision.org/mpfrcx . diff --git a/build/pkgs/mpir/SPKG.rst b/build/pkgs/mpir/SPKG.rst new file mode 100644 index 00000000000..2037868680d --- /dev/null +++ b/build/pkgs/mpir/SPKG.rst @@ -0,0 +1,48 @@ +MPIR +==== + +Description +----------- + +MPIR is an open source multiprecision integer library derived from +version 5.0.1 of the GMP (GNU Multi Precision) project (which was +licensed LGPL v2+). + +See http://www.mpir.org + +License +------- + +- LGPL V3+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +- The Google group mpir-devel +- thempirteam@googlemail.com + +Dependencies +------------ + +- iconv +- GNU patch + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- TODO: +- Perhaps also modify CXXFLAGS (and/or CPPFLAGS). +- We currently don't use anything of GMP's/MPIR's CC setting, and + matching + + with the current compiler (`$CC`) is perhaps suboptimal. + +- Remove some files / directories not needed for Sage from upstream: +- build.vc\* directories (Microsoft Visual C build files) +- 3.0.0-644faf502c56f97d9accd301965fc57d6ec70868 + + was created by running the spkg-src script. diff --git a/build/pkgs/mpir/SPKG.txt b/build/pkgs/mpir/SPKG.txt deleted file mode 100644 index c836e975233..00000000000 --- a/build/pkgs/mpir/SPKG.txt +++ /dev/null @@ -1,30 +0,0 @@ -= MPIR = - -== Description == - -MPIR is an open source multiprecision integer library derived from -version 5.0.1 of the GMP (GNU Multi Precision) project (which was -licensed LGPL v2+). - -See http://www.mpir.org - -== License == - * LGPL V3+ - -== Upstream Contact == - * The Google group mpir-devel - * thempirteam@googlemail.com - -== Dependencies == - * iconv - * GNU patch - -== Special Update/Build Instructions == - * TODO: - - Perhaps also modify CXXFLAGS (and/or CPPFLAGS). - - We currently don't use anything of GMP's/MPIR's CC setting, and matching - with the current compiler (`$CC`) is perhaps suboptimal. - * Remove some files / directories not needed for Sage from upstream: - - build.vc* directories (Microsoft Visual C build files) - * 3.0.0-644faf502c56f97d9accd301965fc57d6ec70868 - was created by running the spkg-src script. diff --git a/build/pkgs/mpmath/SPKG.rst b/build/pkgs/mpmath/SPKG.rst new file mode 100644 index 00000000000..2bd7795d534 --- /dev/null +++ b/build/pkgs/mpmath/SPKG.rst @@ -0,0 +1,29 @@ +mpmath +====== + +Description +----------- + +Mpmath is a pure-Python library for multiprecision floating-point +arithmetic. It provides an extensive set of transcendental functions, +unlimited exponent sizes, complex numbers, interval arithmetic, +numerical integration and differentiation, root-finding, linear algebra, +and much more. Almost any calculation can be performed just as well at +10-digit or 1000-digit precision, and in many cases mpmath implements +asymptotically fast algorithms that scale well for extremely high +precision work. If available, mpmath will (optionally) use gmpy to speed +up high precision operations. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Author: Fredrik Johansson +- Email: fredrik.johansson@gmail.com +- Website: https://github.com/fredrik-johansson/mpmath/ + +Dependencies +------------ + +- Python diff --git a/build/pkgs/mpmath/SPKG.txt b/build/pkgs/mpmath/SPKG.txt deleted file mode 100644 index e6d841c6097..00000000000 --- a/build/pkgs/mpmath/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= mpmath = - -== Description == - -Mpmath is a pure-Python library for multiprecision floating-point arithmetic. It provides an extensive set of transcendental functions, unlimited exponent sizes, complex numbers, interval arithmetic, numerical integration and differentiation, root-finding, linear algebra, and much more. Almost any calculation can be performed just as well at 10-digit or 1000-digit precision, and in many cases mpmath implements asymptotically fast algorithms that scale well for extremely high precision work. If available, mpmath will (optionally) use gmpy to speed up high precision operations. - -== Upstream Contact == - - * Author: Fredrik Johansson - * Email: fredrik.johansson@gmail.com - * Website: https://github.com/fredrik-johansson/mpmath/ - -== Dependencies == - - * Python diff --git a/build/pkgs/nauty/SPKG.rst b/build/pkgs/nauty/SPKG.rst new file mode 100644 index 00000000000..15d1256a8db --- /dev/null +++ b/build/pkgs/nauty/SPKG.rst @@ -0,0 +1,39 @@ +Nauty +===== + +Description +----------- + +Nauty has various tools for finding the automorphism group of a graph, +generating non-isomorphic graphs with certain properties, etc. + +License +------- + +Since version 2.6, nauty license is GPL-compatible, see + +http://users.cecs.anu.edu.au/~bdm/nauty/COPYRIGHT.txt + +(a copy of this file, called COPYRIGHT, is also present in the tarball) + +.. _special_packaging_instruction: + +Special Packaging Instruction +----------------------------- + +Upstream distribute tarball named nauty${version}.tar.gz. We cannot deal +with that so rename it nauty-${version}.tar.gz (notice the "-") without +any changes. + +.. _upstream_contact: + +Upstream Contact +---------------- + +Brendan D. McKay Computer Science Department Australian National +University bdm@cs.anu.edu.au + +Adolfo Piperno Dipartimento di Informatica Sapienza - Università di Roma +piperno@di.uniroma1.it + +See http://cs.anu.edu.au/~bdm/nauty/ Or http://pallini.di.uniroma1.it/ diff --git a/build/pkgs/nauty/SPKG.txt b/build/pkgs/nauty/SPKG.txt deleted file mode 100644 index d471d16a4aa..00000000000 --- a/build/pkgs/nauty/SPKG.txt +++ /dev/null @@ -1,35 +0,0 @@ -= Nauty = - -== Description == - -Nauty has various tools for finding the automorphism group of a graph, -generating non-isomorphic graphs with certain properties, etc. - -== License == - -Since version 2.6, nauty license is GPL-compatible, see - -http://users.cecs.anu.edu.au/~bdm/nauty/COPYRIGHT.txt - -(a copy of this file, called COPYRIGHT, is also present in the tarball) - -== Special Packaging Instruction == - -Upstream distribute tarball named nauty${version}.tar.gz. We cannot -deal with that so rename it nauty-${version}.tar.gz (notice the "-") -without any changes. - -== Upstream Contact == - -Brendan D. McKay -Computer Science Department -Australian National University -bdm@cs.anu.edu.au - -Adolfo Piperno -Dipartimento di Informatica -Sapienza - Università di Roma -piperno@di.uniroma1.it - -See http://cs.anu.edu.au/~bdm/nauty/ -Or http://pallini.di.uniroma1.it/ diff --git a/build/pkgs/nbconvert/SPKG.txt b/build/pkgs/nbconvert/SPKG.rst similarity index 72% rename from build/pkgs/nbconvert/SPKG.txt rename to build/pkgs/nbconvert/SPKG.rst index 362c21c9e5f..b3f9dbdb44c 100644 --- a/build/pkgs/nbconvert/SPKG.txt +++ b/build/pkgs/nbconvert/SPKG.rst @@ -1,6 +1,8 @@ -= nbconvert = +nbconvert +========= -== Description == +Description +----------- Converting Jupyter Notebooks diff --git a/build/pkgs/nbformat/SPKG.txt b/build/pkgs/nbformat/SPKG.rst similarity index 78% rename from build/pkgs/nbformat/SPKG.txt rename to build/pkgs/nbformat/SPKG.rst index a6c91aa1966..de42d912de6 100644 --- a/build/pkgs/nbformat/SPKG.txt +++ b/build/pkgs/nbformat/SPKG.rst @@ -1,6 +1,8 @@ -= nbformat = +nbformat +======== -== Description == +Description +----------- The Jupyter Notebook format diff --git a/build/pkgs/ncurses/SPKG.rst b/build/pkgs/ncurses/SPKG.rst new file mode 100644 index 00000000000..c6b60e92858 --- /dev/null +++ b/build/pkgs/ncurses/SPKG.rst @@ -0,0 +1,51 @@ +Ncurses +======= + +Description +----------- + +Ncurses (new curses, pronounced "enn-curses") started as a freely +distributable "clone" of System V Release 4.0 (SVr4) curses. It has +outgrown the "clone" description, and now contains many features which +are not in SVr4 curses. Curses is a pun on the term "cursor +optimization". It is a library of functions that manage an application's +display on character-cell terminals (e.g., VT100). + +The name "ncurses" was first used as the name of the curses library in +Pavel Curtis's pcurses, dated 1982. It was apparently developed on a BSD +4.4 system, at Cornell. Parts of pcurses are readily identifiable in +ncurses, including the basics for the terminfo compiler (named compile +in that package): + +- the Caps, used to define the terminfo capabilities +- awk scripts MKcaptab.awk, MKnames.awk +- the library modules used for the terminfo compiler. + +Besides ncurses, parts of pcurses still survive in 2010, in recognizable +form in Solaris. + +Website: http://invisible-island.net/ncurses + +License +------- + +- MIT-style + +.. _upstream_contact: + +Upstream Contact +---------------- + +- bug-ncurses@gnu.org + +Dependencies +------------ + +None + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None diff --git a/build/pkgs/ncurses/SPKG.txt b/build/pkgs/ncurses/SPKG.txt deleted file mode 100644 index 9b8f450a1c7..00000000000 --- a/build/pkgs/ncurses/SPKG.txt +++ /dev/null @@ -1,41 +0,0 @@ -= Ncurses = - -== Description == - -Ncurses (new curses, pronounced "enn-curses") started as a freely -distributable "clone" of System V Release 4.0 (SVr4) curses. It has -outgrown the "clone" description, and now contains many features which -are not in SVr4 curses. Curses is a pun on the term "cursor -optimization". It is a library of functions that manage an -application's display on character-cell terminals (e.g., VT100). - -The name "ncurses" was first used as the name of the curses library in -Pavel Curtis's pcurses, dated 1982. It was apparently developed on a -BSD 4.4 system, at Cornell. Parts of pcurses are readily identifiable -in ncurses, including the basics for the terminfo compiler (named -compile in that package): - - * the Caps, used to define the terminfo capabilities - * awk scripts MKcaptab.awk, MKnames.awk - * the library modules used for the terminfo compiler. - -Besides ncurses, parts of pcurses still survive in 2010, in -recognizable form in Solaris. - -Website: http://invisible-island.net/ncurses - -== License == - - * MIT-style - -== Upstream Contact == - - * bug-ncurses@gnu.org - -== Dependencies == - -None - -== Special Update/Build Instructions == - -None diff --git a/build/pkgs/networkx/SPKG.rst b/build/pkgs/networkx/SPKG.rst new file mode 100644 index 00000000000..2da1a3ff0ae --- /dev/null +++ b/build/pkgs/networkx/SPKG.rst @@ -0,0 +1,20 @@ +NetworkX +======== + +Description +----------- + +NetworkX (NX) is a Python package for the creation, manipulation, and +study of the structure, dynamics, and functions of complex networks. + +License +------- + +BSD + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://networkx.github.io/ diff --git a/build/pkgs/networkx/SPKG.txt b/build/pkgs/networkx/SPKG.txt deleted file mode 100644 index ca598bbad47..00000000000 --- a/build/pkgs/networkx/SPKG.txt +++ /dev/null @@ -1,13 +0,0 @@ -= NetworkX = - -== Description == - -NetworkX (NX) is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks. - -== License == - -BSD - -== Upstream Contact == - -https://networkx.github.io/ diff --git a/build/pkgs/ninja_build/SPKG.rst b/build/pkgs/ninja_build/SPKG.rst new file mode 100644 index 00000000000..7bc5bba4598 --- /dev/null +++ b/build/pkgs/ninja_build/SPKG.rst @@ -0,0 +1,24 @@ +ninja_build +=========== + +Description +----------- + +Ninja is a small build system with a focus on speed. + +License +------- + +Apache License 2.0 + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://ninja-build.org/ + +Dependencies +------------ + +None diff --git a/build/pkgs/ninja_build/SPKG.txt b/build/pkgs/ninja_build/SPKG.txt deleted file mode 100644 index caa6b5698a9..00000000000 --- a/build/pkgs/ninja_build/SPKG.txt +++ /dev/null @@ -1,17 +0,0 @@ -= ninja_build = - -== Description == - -Ninja is a small build system with a focus on speed. - -== License == - -Apache License 2.0 - -== Upstream Contact == - -https://ninja-build.org/ - -== Dependencies == - -None diff --git a/build/pkgs/normaliz/SPKG.rst b/build/pkgs/normaliz/SPKG.rst new file mode 100644 index 00000000000..1925ee6e637 --- /dev/null +++ b/build/pkgs/normaliz/SPKG.rst @@ -0,0 +1,42 @@ +normaliz +======== + +Description +----------- + +Normaliz is a tool for computations in affine monoids, vector +configurations, lattice polytopes, and rational cones. + +For more details see http://www.mathematik.uni-osnabrueck.de/normaliz/ + +License +------- + +- GPL v3 + +.. _upstream_contact: + +Upstream Contact +---------------- + +- normaliz@uos.de +- Winfried Bruns +- Christof Söger +- see also https://www.normaliz.uni-osnabrueck.de/home/contact/ + + and https://github.com/Normaliz + +Dependencies +------------ + +- GMP/MPIR +- boost + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- The spkg currently disables features that require packages SCIP and + + CoCoA, for which we don't have packages (yet). diff --git a/build/pkgs/normaliz/SPKG.txt b/build/pkgs/normaliz/SPKG.txt deleted file mode 100644 index e7fbd64b373..00000000000 --- a/build/pkgs/normaliz/SPKG.txt +++ /dev/null @@ -1,29 +0,0 @@ -= normaliz = - -== Description == - -Normaliz is a tool for computations in affine monoids, vector configurations, lattice polytopes, and rational cones. - -For more details see http://www.mathematik.uni-osnabrueck.de/normaliz/ - -== License == - - * GPL v3 - -== Upstream Contact == - - * normaliz@uos.de - * Winfried Bruns - * Christof Söger - * see also https://www.normaliz.uni-osnabrueck.de/home/contact/ - and https://github.com/Normaliz - -== Dependencies == - - * GMP/MPIR - * boost - -== Special Update/Build Instructions == - - * The spkg currently disables features that require packages SCIP and - CoCoA, for which we don't have packages (yet). diff --git a/build/pkgs/nose/SPKG.rst b/build/pkgs/nose/SPKG.rst new file mode 100644 index 00000000000..3d1d34b411d --- /dev/null +++ b/build/pkgs/nose/SPKG.rst @@ -0,0 +1,36 @@ +nose +==== + +Description +----------- + +nose extends the test loading and running features of unittest, making +it easier to write, find and run tests. + +License +------- + +GNU LGPL + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Jason Pellerin Home Page: http://readthedocs.org/docs/nose/ + + see also https://github.com/nose-devs/nose + +Dependencies +------------ + +- setuptools / distribute +- Python +- GNU patch (shipped with Sage) + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/nose/SPKG.txt b/build/pkgs/nose/SPKG.txt deleted file mode 100644 index e978029b47a..00000000000 --- a/build/pkgs/nose/SPKG.txt +++ /dev/null @@ -1,26 +0,0 @@ -= nose = - -== Description == - -nose extends the test loading and running features of unittest, making -it easier to write, find and run tests. - -== License == - -GNU LGPL - -== Upstream Contact == - -Author: Jason Pellerin -Home Page: http://readthedocs.org/docs/nose/ - see also https://github.com/nose-devs/nose - -== Dependencies == - - * setuptools / distribute - * Python - * GNU patch (shipped with Sage) - -== Special Update/Build Instructions == - -None. diff --git a/build/pkgs/notebook/SPKG.txt b/build/pkgs/notebook/SPKG.rst similarity index 68% rename from build/pkgs/notebook/SPKG.txt rename to build/pkgs/notebook/SPKG.rst index af2253acd9f..92efe65018a 100644 --- a/build/pkgs/notebook/SPKG.txt +++ b/build/pkgs/notebook/SPKG.rst @@ -1,6 +1,8 @@ -= notebook = +notebook +======== -== Description == +Description +----------- The Jupyter HTML notebook is a web-based notebook environment for interactive computing. diff --git a/build/pkgs/notedown/SPKG.rst b/build/pkgs/notedown/SPKG.rst new file mode 100644 index 00000000000..7b909217702 --- /dev/null +++ b/build/pkgs/notedown/SPKG.rst @@ -0,0 +1,29 @@ +notedown +======== + +Description +----------- + +Notedown is a simple tool to create IPython notebooks from markdown. + +License +------- + +BSD 2-Clause License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Aaron O'Leary Home page: https://github.com/aaren/notedown + +Dependencies +------------ + +- Python +- setuptools +- nbformat +- nbconvert +- six +- pandoc_attributes diff --git a/build/pkgs/notedown/SPKG.txt b/build/pkgs/notedown/SPKG.txt deleted file mode 100644 index f22216f0f51..00000000000 --- a/build/pkgs/notedown/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= notedown = - -== Description == - -Notedown is a simple tool to create IPython notebooks from markdown. - -== License == - -BSD 2-Clause License - -== Upstream Contact == - -Author: Aaron O'Leary -Home page: https://github.com/aaren/notedown - -== Dependencies == - -* Python -* setuptools -* nbformat -* nbconvert -* six -* pandoc_attributes diff --git a/build/pkgs/ntl/SPKG.rst b/build/pkgs/ntl/SPKG.rst new file mode 100644 index 00000000000..59eb14ca094 --- /dev/null +++ b/build/pkgs/ntl/SPKG.rst @@ -0,0 +1,37 @@ +NTL +=== + +Description +----------- + +NTL is a high-performance, portable C++ library providing data +structures and algorithms for manipulating signed, arbitrary length +integers, and for vectors, matrices, and polynomials over the integers +and over finite fields. + +Website: http://www.shoup.net/ntl/ + +License +------- + +- GNU LGPLv2.1+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Victor Shoup - for contact info see http://www.shoup.net/ + +Dependencies +------------ + +- gmp +- gf2x + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- None diff --git a/build/pkgs/ntl/SPKG.txt b/build/pkgs/ntl/SPKG.txt deleted file mode 100644 index 49e02e2a8a1..00000000000 --- a/build/pkgs/ntl/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= NTL = - -== Description == -NTL is a high-performance, portable C++ library providing data structures and -algorithms for manipulating signed, arbitrary length integers, and for vectors, -matrices, and polynomials over the integers and over finite fields. - -Website: http://www.shoup.net/ntl/ - -== License == - * GNU LGPLv2.1+ - -== Upstream Contact == - * Victor Shoup - for contact info see http://www.shoup.net/ - -== Dependencies == - * gmp - * gf2x - -== Special Update/Build Instructions == - * None diff --git a/build/pkgs/numpy/SPKG.rst b/build/pkgs/numpy/SPKG.rst new file mode 100644 index 00000000000..b6124dcdcdf --- /dev/null +++ b/build/pkgs/numpy/SPKG.rst @@ -0,0 +1,38 @@ +numpy +===== + +Description +----------- + +This package adds numerical linear algebra and other numerical computing +capabilities to python. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Travis Oliphant +- Fernando Perez +- Brian Granger + +Dependencies +------------ + +- GNU patch +- Python +- Lapack +- Blas +- Atlas +- Fortran + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- Scipy uses numpy's distutils to control its compilation of fortran + code. + + Whenever numpy is updated it is necessary to make sure that scipy + still builds ok. diff --git a/build/pkgs/numpy/SPKG.txt b/build/pkgs/numpy/SPKG.txt deleted file mode 100644 index c7da9b2fdce..00000000000 --- a/build/pkgs/numpy/SPKG.txt +++ /dev/null @@ -1,27 +0,0 @@ -= numpy = - -== Description == - -This package adds numerical linear algebra and other numerical computing -capabilities to python. - -== Upstream Contact == - * Travis Oliphant - * Fernando Perez - * Brian Granger - -== Dependencies == - * GNU patch - * Python - * Lapack - * Blas - * Atlas - * Fortran - -== Special Update/Build Instructions == - * Scipy uses numpy's distutils to control its compilation of fortran code. - Whenever numpy is updated it is necessary to make sure that scipy still builds ok. - - - - diff --git a/build/pkgs/openblas/SPKG.rst b/build/pkgs/openblas/SPKG.rst new file mode 100644 index 00000000000..5d66d0dd01f --- /dev/null +++ b/build/pkgs/openblas/SPKG.rst @@ -0,0 +1,35 @@ +OpenBLAS +======== + +Description +----------- + +OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD +version. + +License +------- + +3-clause BSD license + +.. _spkg_repository: + +SPKG Repository +--------------- + +GitHub page: https://github.com/xianyi/OpenBLAS + +Releases: https://github.com/xianyi/OpenBLAS/releases + +.. _upstream_contact: + +Upstream Contact +---------------- + +- OpenBLAS users mailing list: + + https://groups.google.com/forum/#!forum/openblas-users + +- OpenBLAS developers mailing list: + + https://groups.google.com/forum/#!forum/openblas-dev diff --git a/build/pkgs/openblas/SPKG.txt b/build/pkgs/openblas/SPKG.txt deleted file mode 100644 index b152a3007ec..00000000000 --- a/build/pkgs/openblas/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= OpenBLAS = - -== Description == - -OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. - -== License == - -3-clause BSD license - -== SPKG Repository == - -GitHub page: https://github.com/xianyi/OpenBLAS - -Releases: https://github.com/xianyi/OpenBLAS/releases - -== Upstream Contact == - -* OpenBLAS users mailing list: - https://groups.google.com/forum/#!forum/openblas-users - -* OpenBLAS developers mailing list: - https://groups.google.com/forum/#!forum/openblas-dev diff --git a/build/pkgs/openssl/SPKG.rst b/build/pkgs/openssl/SPKG.rst new file mode 100644 index 00000000000..f51aa5500fe --- /dev/null +++ b/build/pkgs/openssl/SPKG.rst @@ -0,0 +1,29 @@ +OpenSSL +======= + +Description +----------- + +From wikipedia: OpenSSL is an open source implementation of the SSL and +TLS protocols. The core library (written in the C programming language) +implements the basic cryptographic functions and provides various +utility functions. Wrappers allowing the use of the OpenSSL library in a +variety of computer languages are available. + +License +------- + +- Custom GPL-incompatible license + +.. _upstream_contact: + +Upstream Contact +---------------- + +- http://openssl.org/ +- http://openssl.org/support/community.html + +Patches +~~~~~~~ + +- src/config: patched to fix a problem on Solaris. diff --git a/build/pkgs/openssl/SPKG.txt b/build/pkgs/openssl/SPKG.txt deleted file mode 100644 index 0711b536f7b..00000000000 --- a/build/pkgs/openssl/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= OpenSSL = - -== Description == - -From wikipedia: OpenSSL is an open source implementation of the SSL -and TLS protocols. The core library (written in the C programming -language) implements the basic cryptographic functions and provides -various utility functions. Wrappers allowing the use of the OpenSSL -library in a variety of computer languages are available. - -== License == - - * Custom GPL-incompatible license - -== Upstream Contact == - - * http://openssl.org/ - * http://openssl.org/support/community.html - -=== Patches === - - * src/config: patched to fix a problem on Solaris. - diff --git a/build/pkgs/p_group_cohomology/SPKG.rst b/build/pkgs/p_group_cohomology/SPKG.rst new file mode 100644 index 00000000000..3f175e70071 --- /dev/null +++ b/build/pkgs/p_group_cohomology/SPKG.rst @@ -0,0 +1,117 @@ +p_group_cohomology +================== + +Description +----------- + +Modular Cohomology Rings of Finite Groups + +The package is located at http://users.fmi.uni-jena.de/cohomology/, +that's to say the tarball p_group_cohomology-x.y.tar.xz can be found +there and the documentation of the package is provided at +http://users.fmi.uni-jena.de/cohomology/documentation/ + +License +------- + +Copyright (C) 2018 Simon A. King Copyright (C) +2011 Simon A. King Copyright (C) 2009 Simon A. +King and + + David J. Green + +Distributed under the terms of the GNU General Public License (GPL), +version 2 or later (at your choice). + + This code is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +The full text of the GPL is available at: + + http://www.gnu.org/licenses/ + +The package includes a data base of cohomology rings of the groups of +order 64 and provides access to a data base of cohomology rings of the +groups of order 128 and 243, located at + + http://cohomology.uni-jena.de/db/ + +These data bases are distributed under the Creative Commons +Attribution-Share Alike 3.0 License. The full text of this licence is +available at + + http://creativecommons.org/licenses/by-sa/3.0/ + +.. _spkg_maintainers: + +SPKG Maintainers +---------------- + +Simon A. King + +.. _upstream_contact: + +Upstream Contact +---------------- + +Simon A. King David J. Green + + +Acknowledgements +---------------- + +The development of the initial version of this SPKG was funded by the +German Science Foundation, DFG project GR 1585/4.1, and was accomplished +at the Friedrich Schiller University Jena. + +Since version 1.0.1, the further work on this SPKG was funded by Marie +Curie grant MTKD-CT-2006-042685 and was pursued at the National +University of Ireland, Galway. Since Novermber 2010, it is moved back to +Jena. + +We thank William Stein for giving us access to various computers on +which we could build test the SPKG and on which some huge computations +could be completed, and acknowledge the support by National Science +Foundation Grant No. DMS-0821725. + +We thank Mathieu Dutour Sikirić for hints on how to use GAP more +efficiently. + +We owe Peter Symonds the idea of using the Poincaré series in a rather +efficient completeness criterion. + +We are greatful to John Palmieri for his help on making +p_group_cohomology work with python-3. + +Dependencies +------------ + +- The SharedMeatAxe needs to be installed, as a build time dependency. + + This can be met by installing the meataxe spkg + +Testing +------- + +Our package provides a very short test suite for David Green's routines +for the computation of minimal projective resolutions. The majority of +this package's tests is formed by doc tests in the Cython code. In fact, +any class, method and function is covered by tests. + +Note that internet access is required for these tests, as it is +attempted to download cohomology rings from a public data base in the +web. + +The script \``spkg-check`\` calls \`sage -t --force_lib\` on the files +in \`pGroupCohomology`. + +Documentation +------------- + +The documentation of this package is automatically built, if the +environment variable SAGE_SPKG_INSTALL_DOCS is yes (do "export +SAGE_SPKG_INSTALL_DOCS=yes" on the command line before installation). +The documents are put into +SAGE_ROOT/local/share/doc/p_group_cohomology/. diff --git a/build/pkgs/p_group_cohomology/SPKG.txt b/build/pkgs/p_group_cohomology/SPKG.txt deleted file mode 100644 index 42bd0ccc36d..00000000000 --- a/build/pkgs/p_group_cohomology/SPKG.txt +++ /dev/null @@ -1,98 +0,0 @@ -= p_group_cohomology = - -== Description == - -Modular Cohomology Rings of Finite Groups - -The package is located at http://users.fmi.uni-jena.de/cohomology/, -that's to say the tarball p_group_cohomology-x.y.tar.xz can be found -there and the documentation of the package is provided at -http://users.fmi.uni-jena.de/cohomology/documentation/ - -== License == - -Copyright (C) 2018 Simon A. King -Copyright (C) 2011 Simon A. King -Copyright (C) 2009 Simon A. King and - David J. Green - -Distributed under the terms of the GNU General Public License (GPL), -version 2 or later (at your choice). - - This code is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - -The full text of the GPL is available at: - - http://www.gnu.org/licenses/ - -The package includes a data base of cohomology rings of the groups of -order 64 and provides access to a data base of cohomology rings of the -groups of order 128 and 243, located at - http://cohomology.uni-jena.de/db/ -These data bases are distributed under the Creative Commons -Attribution-Share Alike 3.0 License. The full text of this licence is -available at - http://creativecommons.org/licenses/by-sa/3.0/ - -== SPKG Maintainers == - -Simon A. King - -== Upstream Contact == - -Simon A. King -David J. Green - -== Acknowledgements == - -The development of the initial version of this SPKG was funded by -the German Science Foundation, DFG project GR 1585/4.1, and was -accomplished at the Friedrich Schiller University Jena. - -Since version 1.0.1, the further work on this SPKG was funded -by Marie Curie grant MTKD-CT-2006-042685 and was pursued at -the National University of Ireland, Galway. Since Novermber 2010, -it is moved back to Jena. - -We thank William Stein for giving us access to various computers -on which we could build test the SPKG and on which some huge computations -could be completed, and acknowledge the support by National Science -Foundation Grant No. DMS-0821725. - -We thank Mathieu Dutour Sikirić for hints on how to use GAP -more efficiently. - -We owe Peter Symonds the idea of using the Poincaré series in a -rather efficient completeness criterion. - -We are greatful to John Palmieri for his help on making p_group_cohomology -work with python-3. - -== Dependencies == - -- The SharedMeatAxe needs to be installed, as a build time dependency. - This can be met by installing the meataxe spkg - -== Testing == - -Our package provides a very short test suite for David Green's routines -for the computation of minimal projective resolutions. The majority of -this package's tests is formed by doc tests in the Cython code. In -fact, any class, method and function is covered by tests. - -Note that internet access is required for these tests, as it is attempted to -download cohomology rings from a public data base in the web. - -The script ``spkg-check`` calls `sage -t --force_lib` on the files -in `pGroupCohomology`. - -== Documentation == - -The documentation of this package is automatically built, if the environment -variable SAGE_SPKG_INSTALL_DOCS is yes (do "export SAGE_SPKG_INSTALL_DOCS=yes" -on the command line before installation). The documents are put into -SAGE_ROOT/local/share/doc/p_group_cohomology/. - diff --git a/build/pkgs/packaging/SPKG.rst b/build/pkgs/packaging/SPKG.rst new file mode 100644 index 00000000000..ad493c1202e --- /dev/null +++ b/build/pkgs/packaging/SPKG.rst @@ -0,0 +1,7 @@ +packaging +========= + +Description +----------- + +Core utilities for Python packages diff --git a/build/pkgs/packaging/SPKG.txt b/build/pkgs/packaging/SPKG.txt deleted file mode 100644 index 617de3d95a5..00000000000 --- a/build/pkgs/packaging/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= packaging = - -== Description == - -Core utilities for Python packages diff --git a/build/pkgs/palp/SPKG.rst b/build/pkgs/palp/SPKG.rst new file mode 100644 index 00000000000..ae39ebb26e3 --- /dev/null +++ b/build/pkgs/palp/SPKG.rst @@ -0,0 +1,45 @@ +PALP +==== + +Description +----------- + +A Package for Analyzing Lattice Polytopes (PALP) is a set of C programs +for calculations with lattice polytopes and applications to toric +geometry. + +It contains routines for vertex and facet enumeration, computation of +incidences and symmetries, as well as completion of the set of lattice +points in the convex hull of a given set of points. In addition, there +are procedures specialised to reflexive polytopes such as the +enumeration of reflexive subpolytopes, and applications to toric +geometry and string theory, like the computation of Hodge data and +fibration structures for toric Calabi-Yau varieties. The package is well +tested and optimised in speed as it was used for time consuming tasks +such as the classification of reflexive polyhedra in 4 dimensions and +the creation and manipulation of very large lists of 5-dimensional +polyhedra. + +While originally intended for low-dimensional applications, the +algorithms work in any dimension and our key routine for vertex and +facet enumeration compares well with existing packages. + +License +------- + +- When released, GPL 2 was in force. +- There is a link to a web page, which now points to GPL 3, but would + + have pointed to GPL 2 at the time the package was released. + +- Therefore one can deduce the authors were happy for this to be + + released under GPL 2 or a later version. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Author: Harald Skarke (skarke@maths.ox.ac.uk) +- Home page: http://hep.itp.tuwien.ac.at/~kreuzer/CY/CYpalp.html diff --git a/build/pkgs/palp/SPKG.txt b/build/pkgs/palp/SPKG.txt deleted file mode 100644 index 1add1810ed5..00000000000 --- a/build/pkgs/palp/SPKG.txt +++ /dev/null @@ -1,36 +0,0 @@ -= PALP = - -== Description == - -A Package for Analyzing Lattice Polytopes (PALP) is a set of C -programs for calculations with lattice polytopes and applications to -toric geometry. - -It contains routines for vertex and facet enumeration, computation of -incidences and symmetries, as well as completion of the set of lattice -points in the convex hull of a given set of points. In addition, there -are procedures specialised to reflexive polytopes such as the -enumeration of reflexive subpolytopes, and applications to toric -geometry and string theory, like the computation of Hodge data and -fibration structures for toric Calabi-Yau varieties. The package is -well tested and optimised in speed as it was used for time consuming -tasks such as the classification of reflexive polyhedra in 4 -dimensions and the creation and manipulation of very large lists of -5-dimensional polyhedra. - -While originally intended for low-dimensional applications, the -algorithms work in any dimension and our key routine for vertex and -facet enumeration compares well with existing packages. - -== License == - - * When released, GPL 2 was in force. - * There is a link to a web page, which now points to GPL 3, but would - have pointed to GPL 2 at the time the package was released. - * Therefore one can deduce the authors were happy for this to be - released under GPL 2 or a later version. - -== Upstream Contact == - - * Author: Harald Skarke (skarke@maths.ox.ac.uk) - * Home page: http://hep.itp.tuwien.ac.at/~kreuzer/CY/CYpalp.html diff --git a/build/pkgs/pandoc/SPKG.rst b/build/pkgs/pandoc/SPKG.rst new file mode 100644 index 00000000000..7ef13ccebf2 --- /dev/null +++ b/build/pkgs/pandoc/SPKG.rst @@ -0,0 +1,10 @@ +Pandoc +====== + +Description +----------- + +This script package represents the document converter pandoc. + +We do not have an SPKG for it. The purpose of this script package is to +associate system package lists with it. diff --git a/build/pkgs/pandoc/SPKG.txt b/build/pkgs/pandoc/SPKG.txt deleted file mode 100644 index 72e13739e28..00000000000 --- a/build/pkgs/pandoc/SPKG.txt +++ /dev/null @@ -1,8 +0,0 @@ -= Pandoc = - -== Description == - -This script package represents the document converter pandoc. - -We do not have an SPKG for it. The purpose of this script -package is to associate system package lists with it. diff --git a/build/pkgs/pandoc_attributes/SPKG.rst b/build/pkgs/pandoc_attributes/SPKG.rst new file mode 100644 index 00000000000..18f9c0e0383 --- /dev/null +++ b/build/pkgs/pandoc_attributes/SPKG.rst @@ -0,0 +1,37 @@ +pandoc_attributes +================= + +Description +----------- + +This is a simple parser / emitter for pandoc block attributes, intended +for use with pandocfilters. + +License +------- + +BSD 2-Clause License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Aaron O'Leary Home page: +https://github.com/aaren/pandoc-attributes + +Dependencies +------------ + +- Python +- setuptools +- pandocfilters + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +There are no release numbers, hence find the latest commit, download +https://github.com/aaren/pandoc-attributes/archive/$%7BCOMMIT%7D.zip and +rename it pandoc_attributes-${COMMIT:0:8}.zip diff --git a/build/pkgs/pandoc_attributes/SPKG.txt b/build/pkgs/pandoc_attributes/SPKG.txt deleted file mode 100644 index a06869d52f6..00000000000 --- a/build/pkgs/pandoc_attributes/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= pandoc_attributes = - -== Description == - -This is a simple parser / emitter for pandoc block attributes, intended -for use with pandocfilters. - -== License == - -BSD 2-Clause License - -== Upstream Contact == - -Author: Aaron O'Leary -Home page: https://github.com/aaren/pandoc-attributes - -== Dependencies == - -* Python -* setuptools -* pandocfilters - -== Special Update/Build Instructions == - -There are no release numbers, hence find the latest commit, download -https://github.com/aaren/pandoc-attributes/archive/${COMMIT}.zip and -rename it pandoc_attributes-${COMMIT:0:8}.zip - diff --git a/build/pkgs/pandocfilters/SPKG.rst b/build/pkgs/pandocfilters/SPKG.rst new file mode 100644 index 00000000000..77ad7412356 --- /dev/null +++ b/build/pkgs/pandocfilters/SPKG.rst @@ -0,0 +1,32 @@ +pandocfilters +============= + +Description +----------- + +A python module for writing pandoc filters. + +License +------- + +BSD 3-Clause License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: John MacFarlane Home page: https://github.com/jgm/pandocfilters + +Dependencies +------------ + +- Python + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +Download the last release from +https://pypi.python.org/pypi/pandocfilters diff --git a/build/pkgs/pandocfilters/SPKG.txt b/build/pkgs/pandocfilters/SPKG.txt deleted file mode 100644 index d35dfd575e1..00000000000 --- a/build/pkgs/pandocfilters/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= pandocfilters = - -== Description == - -A python module for writing pandoc filters. - -== License == - -BSD 3-Clause License - -== Upstream Contact == - -Author: John MacFarlane -Home page: https://github.com/jgm/pandocfilters - -== Dependencies == - -* Python - -== Special Update/Build Instructions == - -Download the last release from -https://pypi.python.org/pypi/pandocfilters diff --git a/build/pkgs/pari/SPKG.rst b/build/pkgs/pari/SPKG.rst new file mode 100644 index 00000000000..a9bf6c81c84 --- /dev/null +++ b/build/pkgs/pari/SPKG.rst @@ -0,0 +1,47 @@ +pari +==== + +Description +----------- + +PARI/GP is a widely used computer algebra system designed for fast +computations in number theory (factorizations, algebraic number theory, +elliptic curves...), but also contains a large number of other useful +functions to compute with mathematical entities such as matrices, +polynomials, power series, algebraic numbers etc., and a lot of +transcendental functions. PARI is also available as a C library to allow +for faster computations. + +Originally developed by Henri Cohen and his co-workers (Université +Bordeaux I, France), PARI is now under the GPL and maintained by Karim +Belabas with the help of many volunteer contributors. + +License +------- + +GPL version 2+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +- http://pari.math.u-bordeaux.fr/ + +Dependencies +------------ + +- Perl +- MPIR or GMP +- Readline +- GNU patch (shipped with Sage) + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +See patches/README.txt for a list of patches. + +The current upstream tarball was created from the PARI git repository by +running "make snapshot". diff --git a/build/pkgs/pari/SPKG.txt b/build/pkgs/pari/SPKG.txt deleted file mode 100644 index a83829520db..00000000000 --- a/build/pkgs/pari/SPKG.txt +++ /dev/null @@ -1,35 +0,0 @@ -= pari = - -== Description == - -PARI/GP is a widely used computer algebra system designed for fast -computations in number theory (factorizations, algebraic number -theory, elliptic curves...), but also contains a large number of other -useful functions to compute with mathematical entities such as -matrices, polynomials, power series, algebraic numbers etc., and a lot -of transcendental functions. PARI is also available as a C library to -allow for faster computations. - -Originally developed by Henri Cohen and his co-workers (Université -Bordeaux I, France), PARI is now under the GPL and maintained by Karim -Belabas with the help of many volunteer contributors. - -== License == - -GPL version 2+ - -== Upstream Contact == - * http://pari.math.u-bordeaux.fr/ - -== Dependencies == - * Perl - * MPIR or GMP - * Readline - * GNU patch (shipped with Sage) - -== Special Update/Build Instructions == - -See patches/README.txt for a list of patches. - -The current upstream tarball was created from the PARI git repository -by running "make snapshot". diff --git a/build/pkgs/pari_elldata/SPKG.rst b/build/pkgs/pari_elldata/SPKG.rst new file mode 100644 index 00000000000..931d6bda9fc --- /dev/null +++ b/build/pkgs/pari_elldata/SPKG.rst @@ -0,0 +1,26 @@ +pari_elldata +============ + +Description +----------- + +PARI/GP version of J. E. Cremona Elliptic Curve Data, needed by +ellsearch and ellidentify. + +License +------- + +GNU General Public License (GPL version 2 or any later version). + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://pari.math.u-bordeaux.fr/ + +Dependencies +------------ + +- Installation: None +- Runtime: PARI/GP diff --git a/build/pkgs/pari_elldata/SPKG.txt b/build/pkgs/pari_elldata/SPKG.txt deleted file mode 100644 index a51f439e39e..00000000000 --- a/build/pkgs/pari_elldata/SPKG.txt +++ /dev/null @@ -1,18 +0,0 @@ -= pari_elldata = - -== Description == - -PARI/GP version of J. E. Cremona Elliptic Curve Data, needed by ellsearch and ellidentify. - -== License == - -GNU General Public License (GPL version 2 or any later version). - -== Upstream Contact == - -http://pari.math.u-bordeaux.fr/ - -== Dependencies == - -* Installation: None -* Runtime: PARI/GP diff --git a/build/pkgs/pari_galdata/SPKG.txt b/build/pkgs/pari_galdata/SPKG.rst similarity index 55% rename from build/pkgs/pari_galdata/SPKG.txt rename to build/pkgs/pari_galdata/SPKG.rst index 049f93df73f..a60a71c0052 100644 --- a/build/pkgs/pari_galdata/SPKG.txt +++ b/build/pkgs/pari_galdata/SPKG.rst @@ -1,18 +1,25 @@ -= pari_galdata = +pari_galdata +============ -== Description == +Description +----------- PARI package "galdata": Needed by polgalois to compute Galois group in degrees 8 through 11. -== License == +License +------- GPL version 2+ -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- http://pari.math.u-bordeaux.fr/ -== Dependencies == +Dependencies +------------ None (package contains data files only) diff --git a/build/pkgs/pari_galpol/SPKG.txt b/build/pkgs/pari_galpol/SPKG.rst similarity index 57% rename from build/pkgs/pari_galpol/SPKG.txt rename to build/pkgs/pari_galpol/SPKG.rst index a05341cd1bd..472e2463481 100644 --- a/build/pkgs/pari_galpol/SPKG.txt +++ b/build/pkgs/pari_galpol/SPKG.rst @@ -1,20 +1,27 @@ -= pari_galpol = +pari_galpol +=========== -== Description == +Description +----------- PARI package of the GALPOL database of polynomials defining Galois extensions of the rationals, accessed by galoisgetpol, galoisgetgroup, galoisgetname. -== License == +License +------- GNU General Public License (GPL version 2 or any later version). -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- http://pari.math.u-bordeaux.fr/ -== Dependencies == +Dependencies +------------ -* Installation: None -* Runtime: PARI/GP +- Installation: None +- Runtime: PARI/GP diff --git a/build/pkgs/pari_jupyter/SPKG.rst b/build/pkgs/pari_jupyter/SPKG.rst new file mode 100644 index 00000000000..42756a30cba --- /dev/null +++ b/build/pkgs/pari_jupyter/SPKG.rst @@ -0,0 +1,29 @@ +pari_jupyter +============ + +Description +----------- + +A Jupyter kernel for PARI/GP + +License +------- + +GPL version 3 or later + +.. _upstream_contact: + +Upstream Contact +---------------- + +- https://github.com/jdemeyer/pari_jupyter +- Jeroen Demeyer + +Dependencies +------------ + +- Python (tested with version 2.7.14 and 3.6.1) +- Jupyter 4 +- PARI version 2.8.0 or later +- Readline (any version which works with PARI) +- Optional: Cython version 0.25 or later diff --git a/build/pkgs/pari_jupyter/SPKG.txt b/build/pkgs/pari_jupyter/SPKG.txt deleted file mode 100644 index 3a6ad00273c..00000000000 --- a/build/pkgs/pari_jupyter/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= pari_jupyter = - -== Description == - -A Jupyter kernel for PARI/GP - -== License == - -GPL version 3 or later - -== Upstream Contact == - -* https://github.com/jdemeyer/pari_jupyter -* Jeroen Demeyer - -== Dependencies == - -* Python (tested with version 2.7.14 and 3.6.1) -* Jupyter 4 -* PARI version 2.8.0 or later -* Readline (any version which works with PARI) -* Optional: Cython version 0.25 or later diff --git a/build/pkgs/pari_nftables/SPKG.rst b/build/pkgs/pari_nftables/SPKG.rst new file mode 100644 index 00000000000..dfd040f8d77 --- /dev/null +++ b/build/pkgs/pari_nftables/SPKG.rst @@ -0,0 +1,26 @@ +pari_elldata +============ + +Description +----------- + +Repackaging of the historical megrez number field tables (errors fixed, +1/10th the size, easier to use). + +License +------- + +GNU General Public License (GPL version 2 or any later version). + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://pari.math.u-bordeaux.fr/ + +Dependencies +------------ + +- Installation: None +- Runtime: PARI/GP diff --git a/build/pkgs/pari_nftables/SPKG.txt b/build/pkgs/pari_nftables/SPKG.txt deleted file mode 100644 index 310faf0a446..00000000000 --- a/build/pkgs/pari_nftables/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= pari_elldata = - -== Description == - -Repackaging of the historical megrez number field tables -(errors fixed, 1/10th the size, easier to use). - -== License == - -GNU General Public License (GPL version 2 or any later version). - -== Upstream Contact == - -http://pari.math.u-bordeaux.fr/ - -== Dependencies == - -* Installation: None -* Runtime: PARI/GP diff --git a/build/pkgs/pari_seadata/SPKG.rst b/build/pkgs/pari_seadata/SPKG.rst new file mode 100644 index 00000000000..a6c439a587d --- /dev/null +++ b/build/pkgs/pari_seadata/SPKG.rst @@ -0,0 +1,29 @@ +pari_seadata +============ + +Description +----------- + +Needed by ellap for large primes. These polynomials were extracted from +the ECHIDNA databases and computed by David R. Kohel. This covers finite +fields of cardinality q up to 750 bits. PARI/GP 2.9 contains fallback +code to go on when all modular polynomials in the database have been +exhausted and can handle larger fields (with an important slowdown). + +License +------- + +GNU General Public License (GPL version 2 or any later version). + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://pari.math.u-bordeaux.fr/ + +Dependencies +------------ + +- Installation: None +- Runtime: PARI/GP diff --git a/build/pkgs/pari_seadata/SPKG.txt b/build/pkgs/pari_seadata/SPKG.txt deleted file mode 100644 index ececd8350a0..00000000000 --- a/build/pkgs/pari_seadata/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= pari_seadata = - -== Description == - -Needed by ellap for large primes. -These polynomials were extracted from the ECHIDNA databases and computed -by David R. Kohel. This covers finite fields of cardinality q up to 750 -bits. PARI/GP 2.9 contains fallback code to go on when all modular -polynomials in the database have been exhausted and can handle larger -fields (with an important slowdown). - -== License == - -GNU General Public License (GPL version 2 or any later version). - -== Upstream Contact == - -http://pari.math.u-bordeaux.fr/ - -== Dependencies == - -* Installation: None -* Runtime: PARI/GP diff --git a/build/pkgs/pari_seadata_small/SPKG.txt b/build/pkgs/pari_seadata_small/SPKG.rst similarity index 53% rename from build/pkgs/pari_seadata_small/SPKG.txt rename to build/pkgs/pari_seadata_small/SPKG.rst index 081dd5738b5..669a16d7b94 100644 --- a/build/pkgs/pari_seadata_small/SPKG.txt +++ b/build/pkgs/pari_seadata_small/SPKG.rst @@ -1,20 +1,27 @@ -= pari_seadata_small = +pari_seadata_small +================== -== Description == +Description +----------- PARI package "seadata_small": Needed by ellap for large primes. This -"small" one is a much smaller version that should be suitable for -primes up to 350 bits. These polynomials were extracted from the ECHIDNA +"small" one is a much smaller version that should be suitable for primes +up to 350 bits. These polynomials were extracted from the ECHIDNA databases and computed by David R. Kohel. -== License == +License +------- GPL version 2+ -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- http://pari.math.u-bordeaux.fr/ -== Dependencies == +Dependencies +------------ None (package contains data files only) diff --git a/build/pkgs/patch/SPKG.rst b/build/pkgs/patch/SPKG.rst new file mode 100644 index 00000000000..8c372f856f5 --- /dev/null +++ b/build/pkgs/patch/SPKG.rst @@ -0,0 +1,45 @@ +patch +===== + +Description +----------- + +'patch' takes a patch file containing a difference listing produced by +the 'diff' program and applies those differences to one or more original +files, producing patched versions. + +The version of 'patch' included is the GNU one. Some of the 'diff' files +produced by GNU 'diff' are not acceptble to some versions of the 'patch' +command, such as the 'patch' command that comes with Solaris. + +License +------- + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +.. _upstream_contact: + +Upstream Contact +---------------- + +Main web site: http://savannah.gnu.org/projects/patch/ Bug database at +http://savannah.gnu.org/bugs/?group=patch Submit bugs at +http://savannah.gnu.org/bugs/?func=additem&group=patch Mailing lists +bug-patch@gnu.org + +Dependencies +------------ + +None + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +In the event patches ever need to be made to this package, the method of +applying the patches should not rely on the 'patch' existing on the +system. diff --git a/build/pkgs/patch/SPKG.txt b/build/pkgs/patch/SPKG.txt deleted file mode 100644 index 1d20977f4ee..00000000000 --- a/build/pkgs/patch/SPKG.txt +++ /dev/null @@ -1,34 +0,0 @@ -= patch = - -== Description == - -'patch' takes a patch file containing a difference listing produced -by the 'diff' program and applies those differences to one -or more original files, producing patched versions. - -The version of 'patch' included is the GNU one. Some of the 'diff' files -produced by GNU 'diff' are not acceptble to some versions of the 'patch' -command, such as the 'patch' command that comes with Solaris. - -== License == - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -== Upstream Contact == - -Main web site: http://savannah.gnu.org/projects/patch/ -Bug database at http://savannah.gnu.org/bugs/?group=patch -Submit bugs at http://savannah.gnu.org/bugs/?func=additem&group=patch -Mailing lists bug-patch@gnu.org - -== Dependencies == - -None - -== Special Update/Build Instructions == - -In the event patches ever need to be made to this package, the method of -applying the patches should not rely on the 'patch' existing on the system. diff --git a/build/pkgs/pathlib2/SPKG.txt b/build/pkgs/pathlib2/SPKG.rst similarity index 66% rename from build/pkgs/pathlib2/SPKG.txt rename to build/pkgs/pathlib2/SPKG.rst index 3330269b541..6936a68aee3 100644 --- a/build/pkgs/pathlib2/SPKG.txt +++ b/build/pkgs/pathlib2/SPKG.rst @@ -1,11 +1,12 @@ -= pathlib = +pathlib +======= -== Description == +Description +----------- Object-oriented filesystem paths -The old pathlib module on bitbucket is in bugfix-only mode. The goal -of pathlib2 is to provide a backport of standard pathlib module which +The old pathlib module on bitbucket is in bugfix-only mode. The goal of +pathlib2 is to provide a backport of standard pathlib module which tracks the standard library module, so all the newest features of the standard pathlib can be used also on older Python versions. - diff --git a/build/pkgs/pathpy/SPKG.rst b/build/pkgs/pathpy/SPKG.rst new file mode 100644 index 00000000000..95dda5598b0 --- /dev/null +++ b/build/pkgs/pathpy/SPKG.rst @@ -0,0 +1,7 @@ +path.py +======= + +Description +----------- + +A module wrapper for os.path diff --git a/build/pkgs/pathpy/SPKG.txt b/build/pkgs/pathpy/SPKG.txt deleted file mode 100644 index 1aec14146ab..00000000000 --- a/build/pkgs/pathpy/SPKG.txt +++ /dev/null @@ -1,5 +0,0 @@ -= path.py = - -== Description == - -A module wrapper for os.path diff --git a/build/pkgs/pcre/SPKG.txt b/build/pkgs/pcre/SPKG.rst similarity index 51% rename from build/pkgs/pcre/SPKG.txt rename to build/pkgs/pcre/SPKG.rst index db08f9fa9c5..adafaa1f830 100644 --- a/build/pkgs/pcre/SPKG.txt +++ b/build/pkgs/pcre/SPKG.rst @@ -1,21 +1,31 @@ -= pcre = +pcre +==== -== Description == +Description +----------- Perl-compatible regular expressions library. -== License == +License +------- BSD License ; see LICENCE (sic) at the root of the original tarball. -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- Mailing list at https://lists.exim.org/mailman/listinfo/pcre-dev -== Dependencies == +Dependencies +------------ None listed. -== Special Update/Build Instructions == +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- None applicable (see README at tarball's root). diff --git a/build/pkgs/perl_cpan_polymake_prereq/SPKG.rst b/build/pkgs/perl_cpan_polymake_prereq/SPKG.rst new file mode 100644 index 00000000000..31cc724b335 --- /dev/null +++ b/build/pkgs/perl_cpan_polymake_prereq/SPKG.rst @@ -0,0 +1,13 @@ +perl_cpan_polymake_prereq +========================= + +Description +----------- + +This script package represents all Perl packages that are prerequisites +for polymake. + +License +------- + +Various free software licenses diff --git a/build/pkgs/perl_cpan_polymake_prereq/SPKG.txt b/build/pkgs/perl_cpan_polymake_prereq/SPKG.txt deleted file mode 100644 index 52d456d9c03..00000000000 --- a/build/pkgs/perl_cpan_polymake_prereq/SPKG.txt +++ /dev/null @@ -1,10 +0,0 @@ -= perl_cpan_polymake_prereq = - -== Description == - -This script package represents all Perl packages -that are prerequisites for polymake. - -== License == - -Various free software licenses diff --git a/build/pkgs/perl_term_readline_gnu/SPKG.rst b/build/pkgs/perl_term_readline_gnu/SPKG.rst new file mode 100644 index 00000000000..2370da31edb --- /dev/null +++ b/build/pkgs/perl_term_readline_gnu/SPKG.rst @@ -0,0 +1,26 @@ +perl_term_readline_gnu +====================== + +Description +----------- + +Perl extension for the GNU Readline/History Library + +Available on CPAN + +License +------- + +The Perl 5 License (Artistic 1 & GPL 1) + +.. _upstream_contact: + +Upstream Contact +---------------- + +Hiroo HAYASHI + +Dependencies +------------ + +readline diff --git a/build/pkgs/perl_term_readline_gnu/SPKG.txt b/build/pkgs/perl_term_readline_gnu/SPKG.txt deleted file mode 100644 index 02fd66662ef..00000000000 --- a/build/pkgs/perl_term_readline_gnu/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= perl_term_readline_gnu = - -== Description == - -Perl extension for the GNU Readline/History Library - -Available on CPAN - -== License == - -The Perl 5 License (Artistic 1 & GPL 1) - -== Upstream Contact == - -Hiroo HAYASHI - -== Dependencies == - -readline diff --git a/build/pkgs/pexpect/SPKG.rst b/build/pkgs/pexpect/SPKG.rst new file mode 100644 index 00000000000..1dd208edcca --- /dev/null +++ b/build/pkgs/pexpect/SPKG.rst @@ -0,0 +1,28 @@ +pexpect +======= + +Description +----------- + +Pexpect is a pure Python module for spawning child applications; +controlling them; and responding to expected patterns in their output. + +License +------- + +ISC license: http://opensource.org/licenses/isc-license.txt This license +is approved by the OSI and FSF as GPL-compatible. + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://pexpect.readthedocs.org/en/stable/ +https://github.com/pexpect/pexpect + +Dependencies +------------ + +- GNU patch +- Python diff --git a/build/pkgs/pexpect/SPKG.txt b/build/pkgs/pexpect/SPKG.txt deleted file mode 100644 index b2485eccedf..00000000000 --- a/build/pkgs/pexpect/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= pexpect = - -== Description == - -Pexpect is a pure Python module for spawning child applications; -controlling them; and responding to expected patterns in their output. - -== License == - -ISC license: http://opensource.org/licenses/isc-license.txt -This license is approved by the OSI and FSF as GPL-compatible. - -== Upstream Contact == - -http://pexpect.readthedocs.org/en/stable/ -https://github.com/pexpect/pexpect - -== Dependencies == - - * GNU patch - * Python diff --git a/build/pkgs/pickleshare/SPKG.txt b/build/pkgs/pickleshare/SPKG.rst similarity index 57% rename from build/pkgs/pickleshare/SPKG.txt rename to build/pkgs/pickleshare/SPKG.rst index 3e67a43c105..812cf0b930f 100644 --- a/build/pkgs/pickleshare/SPKG.txt +++ b/build/pkgs/pickleshare/SPKG.rst @@ -1,13 +1,15 @@ -= pickleshare = +pickleshare +=========== -== Description == +Description +----------- PickleShare - a small 'shelve' like datastore with concurrency support -Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike -shelve, many processes can access the database simultaneously. Changing a -value in database is immediately visible to other processes accessing the -same database. +Like shelve, a PickleShareDB object acts like a normal dictionary. +Unlike shelve, many processes can access the database simultaneously. +Changing a value in database is immediately visible to other processes +accessing the same database. Concurrency is possible because the values are stored in separate files. Hence the "database" is a directory where all files are governed by diff --git a/build/pkgs/pillow/SPKG.rst b/build/pkgs/pillow/SPKG.rst new file mode 100644 index 00000000000..7190cb96884 --- /dev/null +++ b/build/pkgs/pillow/SPKG.rst @@ -0,0 +1,28 @@ +Pillow +====== + +Description +----------- + +Pillow is the "friendly" PIL fork by Alex Clark and Contributors. + +The Python Imaging Library (PIL) adds powerful image processing and +graphics capabilities to Python. The library supports many file formats. + +License +------- + +Standard PIL License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Alex Clark Homepage: +http://python-imaging.github.io/ + +Dependencies +------------ + +- Python diff --git a/build/pkgs/pillow/SPKG.txt b/build/pkgs/pillow/SPKG.txt deleted file mode 100644 index 340b0cbc351..00000000000 --- a/build/pkgs/pillow/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= Pillow = - -== Description == - -Pillow is the "friendly" PIL fork by Alex Clark and Contributors. - -The Python Imaging Library (PIL) adds powerful image processing and -graphics capabilities to Python. The library supports many file -formats. - -== License == - -Standard PIL License - -== Upstream Contact == - -Author: Alex Clark -Homepage: http://python-imaging.github.io/ - -== Dependencies == - - * Python diff --git a/build/pkgs/pip/SPKG.rst b/build/pkgs/pip/SPKG.rst new file mode 100644 index 00000000000..81b37dfee1d --- /dev/null +++ b/build/pkgs/pip/SPKG.rst @@ -0,0 +1,32 @@ +pip +=== + +Description +----------- + +This package installs pip, the tool for installing and managing Python +packages, such as those found in the Python Package Index. It’s a +replacement for easy_install. + +License +------- + +MIT + +.. _upstream_contact: + +Upstream Contact +---------------- + +Project Page: https://github.com/pypa/pip Install howto: +https://pip.pypa.io/en/latest/installing.html Changelog: +https://pip.pypa.io/en/latest/news.html Bug Tracking: +https://github.com/pypa/pip/issues Mailing list: +http://groups.google.com/group/python-virtualenv Docs: +https://pip.pypa.io/ + +Dependencies +------------ + +- python +- setuptools diff --git a/build/pkgs/pip/SPKG.txt b/build/pkgs/pip/SPKG.txt deleted file mode 100644 index ebdd18450ed..00000000000 --- a/build/pkgs/pip/SPKG.txt +++ /dev/null @@ -1,26 +0,0 @@ -= pip = - -== Description == - -This package installs pip, the tool for installing and managing Python packages, -such as those found in the Python Package Index. It’s a replacement for -easy_install. - -== License == - -MIT - -== Upstream Contact == - -Project Page: https://github.com/pypa/pip -Install howto: https://pip.pypa.io/en/latest/installing.html -Changelog: https://pip.pypa.io/en/latest/news.html -Bug Tracking: https://github.com/pypa/pip/issues -Mailing list: http://groups.google.com/group/python-virtualenv -Docs: https://pip.pypa.io/ - -== Dependencies == - -* python -* setuptools - diff --git a/build/pkgs/pkgconf/SPKG.rst b/build/pkgs/pkgconf/SPKG.rst new file mode 100644 index 00000000000..724b4c81e15 --- /dev/null +++ b/build/pkgs/pkgconf/SPKG.rst @@ -0,0 +1,35 @@ +pkgconf +======= + +Description +----------- + +Pkgconf is an implementation of the pkg-config spec with minimal +dependencies. + +License +------- + +ISC License (equivalent to Simplified BSD) + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://github.com/pkgconf/pkgconf + +Dependencies +------------ + +- C compiler + toolchain + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- install.patch: Use install script from AC_PROG_INSTALL + +Pkgconf is used in bzip2, so we must not use the bzip2-compressed +tarball. diff --git a/build/pkgs/pkgconf/SPKG.txt b/build/pkgs/pkgconf/SPKG.txt deleted file mode 100644 index 1ba83f5b08a..00000000000 --- a/build/pkgs/pkgconf/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= pkgconf = - -== Description == - -Pkgconf is an implementation of the pkg-config spec with minimal -dependencies. - -== License == - -ISC License (equivalent to Simplified BSD) - -== Upstream Contact == - -https://github.com/pkgconf/pkgconf - -== Dependencies == - -* C compiler + toolchain - -== Special Update/Build Instructions == - -* install.patch: Use install script from AC_PROG_INSTALL - -Pkgconf is used in bzip2, so we must not use the bzip2-compressed -tarball. diff --git a/build/pkgs/pkgconfig/SPKG.rst b/build/pkgs/pkgconfig/SPKG.rst new file mode 100644 index 00000000000..b1696921a69 --- /dev/null +++ b/build/pkgs/pkgconfig/SPKG.rst @@ -0,0 +1,34 @@ +pkgconfig +========= + +Description +----------- + +Pkgconfig is a Python module to interface with the pkg-config command +line tool. + +License +------- + +MIT License + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://github.com/matze/pkgconfig + +Dependencies +------------ + +- Python 2.6+ + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +Standard setup.py + +- remove_nose.patch: Remove the nose dependency (not actually used) diff --git a/build/pkgs/pkgconfig/SPKG.txt b/build/pkgs/pkgconfig/SPKG.txt deleted file mode 100644 index 13b53ecbb6e..00000000000 --- a/build/pkgs/pkgconfig/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= pkgconfig = - -== Description == - -Pkgconfig is a Python module to interface with the pkg-config command -line tool. - -== License == - -MIT License - -== Upstream Contact == - -https://github.com/matze/pkgconfig - -== Dependencies == - -* Python 2.6+ - -== Special Update/Build Instructions == - -Standard setup.py - -* remove_nose.patch: Remove the nose dependency (not actually used) diff --git a/build/pkgs/planarity/SPKG.rst b/build/pkgs/planarity/SPKG.rst new file mode 100644 index 00000000000..02f586e4cdc --- /dev/null +++ b/build/pkgs/planarity/SPKG.rst @@ -0,0 +1,48 @@ +planarity +========= + +Description +----------- + +This code project provides a library for implementing graph algorithms +as well as implementations of several planarity-related graph +algorithms. The origin of this project is the reference implementation +for the Edge Addition Planarity Algorithm [1], which is now the fastest +and simplest linear-time method for planar graph embedding and planarity +obstruction isolation (i.e. Kuratowski subgraph isolation). + +[1] http://dx.doi.org/10.7155/jgaa.00091 + +License +------- + +New BSD License + +.. _upstream_contact: + +Upstream Contact +---------------- + +- https://github.com/graph-algorithms/edge-addition-planarity-suite/ + +- John Boyer + +Dependencies +------------ + +None + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +The tarballs can be found at, +https://github.com/graph-algorithms/edge-addition-planarity-suite/releases +sage tarball is repackaged after running autogen.sh + +One change was made to the upstream code: + +- extern.patch - declare variables declared in headers as extern. + + https://github.com/graph-algorithms/edge-addition-planarity-suite/pull/3 diff --git a/build/pkgs/planarity/SPKG.txt b/build/pkgs/planarity/SPKG.txt deleted file mode 100644 index 6f5a75eafd5..00000000000 --- a/build/pkgs/planarity/SPKG.txt +++ /dev/null @@ -1,36 +0,0 @@ -= planarity = - -== Description == - -This code project provides a library for implementing graph algorithms as well -as implementations of several planarity-related graph algorithms. The origin of -this project is the reference implementation for the Edge Addition Planarity -Algorithm [1], which is now the fastest and simplest linear-time method for -planar graph embedding and planarity obstruction isolation (i.e. Kuratowski -subgraph isolation). - -[1] http://dx.doi.org/10.7155/jgaa.00091 - -== License == - -New BSD License - -== Upstream Contact == - -* https://github.com/graph-algorithms/edge-addition-planarity-suite/ - -* John Boyer - -== Dependencies == - -None - -== Special Update/Build Instructions == - -The tarballs can be found at, -https://github.com/graph-algorithms/edge-addition-planarity-suite/releases -sage tarball is repackaged after running autogen.sh - -One change was made to the upstream code: -- extern.patch - declare variables declared in headers as extern. - https://github.com/graph-algorithms/edge-addition-planarity-suite/pull/3 diff --git a/build/pkgs/plantri/SPKG.rst b/build/pkgs/plantri/SPKG.rst new file mode 100644 index 00000000000..b73cca0a27a --- /dev/null +++ b/build/pkgs/plantri/SPKG.rst @@ -0,0 +1,43 @@ +Plantri +======= + +Description +----------- + +Plantri is a program that generates certain types of graphs that are +imbedded on the sphere. + +Exactly one member of each isomorphism class is output, using an amount +of memory almost independent of the number of graphs produced. This, +together with the exceptionally fast operation and careful validation, +makes the program suitable for processing very large numbers of graphs. + +Isomorphisms are defined with respect to the embeddings, so in some +cases outputs may be isomorphic as abstract graphs. + +License +------- + +Plantri is distributed without a license. + +.. _upstream_contact: + +Upstream Contact +---------------- + +Gunnar Brinkmann + + University of Ghent + Gunnar.Brinkmann@ugent.be + +Brendan McKay + + Australian National University + bdm@cs.anu.edu.au + +See http://cs.anu.edu.au/~bdm/plantri + +Dependencies +------------ + +- None diff --git a/build/pkgs/plantri/SPKG.txt b/build/pkgs/plantri/SPKG.txt deleted file mode 100644 index 5c4fe542614..00000000000 --- a/build/pkgs/plantri/SPKG.txt +++ /dev/null @@ -1,33 +0,0 @@ -= Plantri = - -== Description == - -Plantri is a program that generates certain types of graphs that are -imbedded on the sphere. - -Exactly one member of each isomorphism class is output, using an -amount of memory almost independent of the number of graphs produced. -This, together with the exceptionally fast operation and careful -validation, makes the program suitable for processing very large -numbers of graphs. - -Isomorphisms are defined with respect to the embeddings, so in some -cases outputs may be isomorphic as abstract graphs. - -== License == -Plantri is distributed without a license. - -== Upstream Contact == -Gunnar Brinkmann - University of Ghent - Gunnar.Brinkmann@ugent.be - -Brendan McKay - Australian National University - bdm@cs.anu.edu.au - -See http://cs.anu.edu.au/~bdm/plantri - -== Dependencies == - * None - diff --git a/build/pkgs/polylib/SPKG.rst b/build/pkgs/polylib/SPKG.rst new file mode 100644 index 00000000000..0eb86960ed7 --- /dev/null +++ b/build/pkgs/polylib/SPKG.rst @@ -0,0 +1,25 @@ +polylib +======= + +Description +----------- + +The Polyhedral Library (PolyLib for short) operates on objects made up +of unions of polyhedra of any dimension. polylib is a C library. + +License +------- + +GPL v3 + +.. _upstream_contact: + +Upstream Contact +---------------- + +- https://groups.google.com/forum/#!forum/isl-development + +Dependencies +------------ + +- GMP diff --git a/build/pkgs/polylib/SPKG.txt b/build/pkgs/polylib/SPKG.txt deleted file mode 100644 index 5e31ce96964..00000000000 --- a/build/pkgs/polylib/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= polylib = - -== Description == - -The Polyhedral Library (PolyLib for short) operates on objects made up of unions of polyhedra of any dimension. -polylib is a C library. - - -== License == - -GPL v3 - -== Upstream Contact == - -* https://groups.google.com/forum/#!forum/isl-development - -== Dependencies == - - * GMP diff --git a/build/pkgs/polymake/SPKG.rst b/build/pkgs/polymake/SPKG.rst new file mode 100644 index 00000000000..4e746be6ff8 --- /dev/null +++ b/build/pkgs/polymake/SPKG.rst @@ -0,0 +1,89 @@ +Polymake +======== + +Description +----------- + +polymake is open source software for research in polyhedral geometry. It +deals with polytopes, polyhedra and fans as well as simplicial +complexes, matroids, graphs, tropical hypersurfaces, and other objects. +Supported platforms include various flavors of Linux, Free BSD and Mac +OS. + +License +------- + +- GPL v3 + +.. _upstream_contact: + +Upstream Contact +---------------- + +- https://polymake.org/ + +Dependencies +------------ + +Polymake needs a working installation of Perl, including its shared +library and some modules (XML::Writer XML::LibXML XML::LibXSLT +Term::ReadLine::Gnu JSON SVG). The Polymake interface in Sage +additionally needs File::Slurp. For full functionality including +polymake's polyDB, also the Perl module MongoDB is required. + +These are not provided by a Sage package. The script package +perl_cpan_polymake_prereq will signal an error at build time if these +prerequisites are not met. + +The configure script will inform you about the equivalent system +packages that you should install. Otherwise, you can use CPAN (see +below). + +Sage might install the Term::ReadLine::Gnu module, however, when you +install polymake, if it is not provided by the system, or if Sage +installs its own readline library. + +On Mac OS X, to build Term::Readline::Gnu, on macOS 10.14 (Mojave), one +needs to do the following: + + sudo installer -pkg + /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg + -target / + +or a "fatal error: 'EXTERN.h' file not found" will be signalled. + +A distribution-independent way to install Perl modules (into a user's +home directory or /usr/local) is using CPAN. This is also the way to +install the modules on macOS. For this, if you don't have root access, +you will need the local::lib Perl module installed. + + cpan -i XML::Writer XML::LibXML XML::LibXSLT File::Slurp + Term::ReadLine::Gnu JSON SVG MongoDB + +Several Sage packages should be installed before installing the polymake +package to give a more featureful Polymake installation: + + sage -i 4ti2 latte_int topcom qhull + +Software that would need to be installed manually (no Sage package + + available) for a more featureful Polymake installation: + azove, + porta, + vinci, + SplitsTree4 + +Information on missing Polymake prerequisites after installing polymake: + + $ sage -sh + (sage-sh) $ polymake + polytope> show_unconfigured; + +.. _debugging_polymake_install_problems: + +Debugging polymake install problems +----------------------------------- + +#. apt-get install libdevel-trace-perl + +$ cd src $ perl -d:Trace support/configure.pl diff --git a/build/pkgs/polymake/SPKG.txt b/build/pkgs/polymake/SPKG.txt deleted file mode 100644 index 240b71807ae..00000000000 --- a/build/pkgs/polymake/SPKG.txt +++ /dev/null @@ -1,76 +0,0 @@ -= Polymake = - -== Description == - -polymake is open source software for research in polyhedral -geometry. It deals with polytopes, polyhedra and fans as -well as simplicial complexes, matroids, graphs, tropical -hypersurfaces, and other objects. Supported platforms -include various flavors of Linux, Free BSD and Mac OS. - -== License == - - * GPL v3 - -== Upstream Contact == - - * https://polymake.org/ - -== Dependencies == - -Polymake needs a working installation of Perl, including its shared -library and some modules (XML::Writer XML::LibXML XML::LibXSLT -Term::ReadLine::Gnu JSON SVG). The Polymake interface in Sage -additionally needs File::Slurp. For full functionality including -polymake's polyDB, also the Perl module MongoDB is required. - -These are not provided by a Sage package. The script package -perl_cpan_polymake_prereq will signal an error at build time if these -prerequisites are not met. - -The configure script will inform you about the equivalent system -packages that you should install. Otherwise, you can use CPAN -(see below). - -Sage might install the Term::ReadLine::Gnu module, however, when you -install polymake, if it is not provided by the system, or if Sage -installs its own readline library. - -On Mac OS X, to build Term::Readline::Gnu, on macOS 10.14 (Mojave), one -needs to do the following: - - sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / - -or a "fatal error: 'EXTERN.h' file not found" will be signalled. - - -A distribution-independent way to install Perl modules (into a user's -home directory or /usr/local) is using CPAN. This is also the way to -install the modules on macOS. For this, if you don't have root -access, you will need the local::lib Perl module installed. - - cpan -i XML::Writer XML::LibXML XML::LibXSLT File::Slurp Term::ReadLine::Gnu JSON SVG MongoDB - - -Several Sage packages should be installed before installing the -polymake package to give a more featureful Polymake installation: - sage -i 4ti2 latte_int topcom qhull - -Software that would need to be installed manually (no Sage package - available) for a more featureful Polymake installation: - azove, - porta, - vinci, - SplitsTree4 - -Information on missing Polymake prerequisites after installing -polymake: - $ sage -sh - (sage-sh) $ polymake - polytope> show_unconfigured; - -== Debugging polymake install problems == - -# apt-get install libdevel-trace-perl -$ cd src -$ perl -d:Trace support/configure.pl diff --git a/build/pkgs/polytopes_db/SPKG.rst b/build/pkgs/polytopes_db/SPKG.rst new file mode 100644 index 00000000000..c49b9dcbf05 --- /dev/null +++ b/build/pkgs/polytopes_db/SPKG.rst @@ -0,0 +1,28 @@ +.. _reflexive_polytopes_databases: + +Reflexive Polytopes Databases +============================= + +Description +----------- + +This package includes lists of 2- and 3-dimensional reflexive polytopes. + +The list of polygons is quite easy to get and it has been known for a +while. The list of 3-polytopes was originally obtained by Maximilian +Kreuzer and Harald Skarke using their software PALP, which is included +into the standard distribution of Sage. To work with lattice and +reflexive polytopes from Sage you can use sage.geometry.lattice_polytope +module, which relies on PALP for some of its functionality. To get +access to the databases of this package, use ReflexivePolytope and +ReflexivePolytopes commands. + +License +------- + +GPL + +Dependencies +------------ + +None diff --git a/build/pkgs/polytopes_db/SPKG.txt b/build/pkgs/polytopes_db/SPKG.txt deleted file mode 100644 index 3f2aae989ff..00000000000 --- a/build/pkgs/polytopes_db/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= Reflexive Polytopes Databases = - -== Description == - -This package includes lists of 2- and 3-dimensional reflexive polytopes. - -The list of polygons is quite easy to get and it has been known for a while. -The list of 3-polytopes was originally obtained by Maximilian Kreuzer and -Harald Skarke using their software PALP, which is included into the standard -distribution of Sage. To work with lattice and reflexive polytopes from Sage -you can use sage.geometry.lattice_polytope module, which relies on PALP for -some of its functionality. To get access to the databases of this package, use -ReflexivePolytope and ReflexivePolytopes commands. - -== License == - -GPL - -== Dependencies == - -None diff --git a/build/pkgs/ppl/SPKG.rst b/build/pkgs/ppl/SPKG.rst new file mode 100644 index 00000000000..1e83b945402 --- /dev/null +++ b/build/pkgs/ppl/SPKG.rst @@ -0,0 +1,62 @@ +.. _parma_polyhedra_library: + +Parma Polyhedra Library +======================= + +Description +----------- + +The Parma Polyhedra Library (PPL) provides numerical abstractions +especially targeted at applications in the field of analysis and +verification of complex systems. These abstractions include convex +polyhedra, defined as the intersection of a finite number of (open or +closed) halfspaces, each described by a linear inequality (strict or +non-strict) with rational coefficients; some special classes of +polyhedra shapes that offer interesting complexity/precision tradeoffs; +and grids which represent regularly spaced points that satisfy a set of +linear congruence relations. The library also supports finite powersets +and products of (any kind of) polyhedra and grids, a mixed integer +linear programming problem solver using an exact-arithmetic version of +the simplex algorithm, a parametric integer programming solver, and +primitives for the termination analysis via the automatic synthesis of +linear ranking functions. + +It is written in C++, but comes with interfaces to C, Java, OCaml, and +Prolog. PPL is one of the fastest implementations of polyhedral +computations. + +Benchmarks are included in this paper: https://arxiv.org/abs/cs/0612085 + +License +------- + +GPL v3+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://www.cs.unipr.it/ppl/ BUGSENG srl (http://bugseng.com) + +Core Development Team Roberto Bagnara (University of Parma) Patricia M. +Hill (University of Parma) Enea Zaffanella (University of Parma) + +Dependencies +------------ + +- gmp (or mpir) + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +Patches +~~~~~~~ + +- ptrdiff_t-ppl-1.1.patch: Fixes to compile with gcc 4.9; C++ name + + lookup issue. + +- weak.patch: disable use of weak symbols on Cygwin64. diff --git a/build/pkgs/ppl/SPKG.txt b/build/pkgs/ppl/SPKG.txt deleted file mode 100644 index cc857a87158..00000000000 --- a/build/pkgs/ppl/SPKG.txt +++ /dev/null @@ -1,45 +0,0 @@ -= Parma Polyhedra Library = - -== Description == -The Parma Polyhedra Library (PPL) provides numerical abstractions -especially targeted at applications in the field of analysis and -verification of complex systems. These abstractions include convex -polyhedra, defined as the intersection of a finite number of (open or -closed) halfspaces, each described by a linear inequality (strict or -non-strict) with rational coefficients; some special classes of -polyhedra shapes that offer interesting complexity/precision -tradeoffs; and grids which represent regularly spaced points that -satisfy a set of linear congruence relations. The library also -supports finite powersets and products of (any kind of) polyhedra and -grids, a mixed integer linear programming problem solver using an -exact-arithmetic version of the simplex algorithm, a parametric -integer programming solver, and primitives for the termination -analysis via the automatic synthesis of linear ranking functions. - -It is written in C++, but comes with interfaces to C, Java, OCaml, and -Prolog. PPL is one of the fastest implementations of polyhedral -computations. - -Benchmarks are included in this paper: https://arxiv.org/abs/cs/0612085 - -== License == -GPL v3+ - -== Upstream Contact == -http://www.cs.unipr.it/ppl/ -BUGSENG srl (http://bugseng.com) - -Core Development Team -Roberto Bagnara (University of Parma) -Patricia M. Hill (University of Parma) -Enea Zaffanella (University of Parma) - -== Dependencies == -* gmp (or mpir) - -== Special Update/Build Instructions == - -=== Patches === -* ptrdiff_t-ppl-1.1.patch: Fixes to compile with gcc 4.9; C++ name - lookup issue. -* weak.patch: disable use of weak symbols on Cygwin64. diff --git a/build/pkgs/pplpy/SPKG.txt b/build/pkgs/pplpy/SPKG.rst similarity index 52% rename from build/pkgs/pplpy/SPKG.txt rename to build/pkgs/pplpy/SPKG.rst index 2e486a634fe..fb8401437ae 100644 --- a/build/pkgs/pplpy/SPKG.txt +++ b/build/pkgs/pplpy/SPKG.rst @@ -1,17 +1,24 @@ -= pplpy = +pplpy +===== -== Description == +Description +----------- PPL Python wrapper -This Python package provides a wrapper to the C++ Parma Polyhedra Library (PPL). +This Python package provides a wrapper to the C++ Parma Polyhedra +Library (PPL). The whole package started as a fork of a tiny part of the Sage software. -== License == +License +------- GPL version 3 -== Upstream Contact == +.. _upstream_contact: -* https://github.com/videlec/pplpy +Upstream Contact +---------------- + +- https://github.com/videlec/pplpy diff --git a/build/pkgs/primecount/SPKG.rst b/build/pkgs/primecount/SPKG.rst new file mode 100644 index 00000000000..8ac15bf1be7 --- /dev/null +++ b/build/pkgs/primecount/SPKG.rst @@ -0,0 +1,22 @@ +primecount +========== + +Description +----------- + +primecount is a C++ implementation of several algorithms for counting +primes maintained by Kim Walisch. + +Website: https://github.com/kimwalisch/primecount/ + +License +------- + +primecount is licensed BSD 2 + +.. _upstream_contact: + +Upstream Contact +---------------- + +- https://github.com/kimwalisch/primecount/ diff --git a/build/pkgs/primecount/SPKG.txt b/build/pkgs/primecount/SPKG.txt deleted file mode 100644 index 4f2011fc8a6..00000000000 --- a/build/pkgs/primecount/SPKG.txt +++ /dev/null @@ -1,16 +0,0 @@ -= primecount = - -== Description == - -primecount is a C++ implementation of several algorithms for -counting primes maintained by Kim Walisch. - -Website: https://github.com/kimwalisch/primecount/ - -== License == - -primecount is licensed BSD 2 - -== Upstream Contact == - - * https://github.com/kimwalisch/primecount/ diff --git a/build/pkgs/prometheus_client/SPKG.rst b/build/pkgs/prometheus_client/SPKG.rst new file mode 100644 index 00000000000..802395ae58b --- /dev/null +++ b/build/pkgs/prometheus_client/SPKG.rst @@ -0,0 +1,9 @@ +prometheus_client +================= + +Description +----------- + +The official Python 2 and 3 client for Prometheus (see +https://prometheus.io), an open-source systems monitoring and alerting +toolkit. diff --git a/build/pkgs/prometheus_client/SPKG.txt b/build/pkgs/prometheus_client/SPKG.txt deleted file mode 100644 index 607e4e290cf..00000000000 --- a/build/pkgs/prometheus_client/SPKG.txt +++ /dev/null @@ -1,6 +0,0 @@ -= prometheus_client = - -== Description == - -The official Python 2 and 3 client for Prometheus (see https://prometheus.io), -an open-source systems monitoring and alerting toolkit. diff --git a/build/pkgs/prompt_toolkit/SPKG.txt b/build/pkgs/prompt_toolkit/SPKG.rst similarity index 67% rename from build/pkgs/prompt_toolkit/SPKG.txt rename to build/pkgs/prompt_toolkit/SPKG.rst index 3e530f4952a..38e45cd036f 100644 --- a/build/pkgs/prompt_toolkit/SPKG.txt +++ b/build/pkgs/prompt_toolkit/SPKG.rst @@ -1,6 +1,8 @@ -= prompt_toolkit = +prompt_toolkit +============== -== Description == +Description +----------- Library for building powerful interactive command lines in Python diff --git a/build/pkgs/psutil/SPKG.txt b/build/pkgs/psutil/SPKG.rst similarity index 62% rename from build/pkgs/psutil/SPKG.txt rename to build/pkgs/psutil/SPKG.rst index 7bcad7020b6..544d634e747 100644 --- a/build/pkgs/psutil/SPKG.txt +++ b/build/pkgs/psutil/SPKG.rst @@ -1,14 +1,21 @@ -= psutil = +psutil +====== -== Description == +Description +----------- psutil is a cross-platform library for retrieving information onrunning -processes and system utilization (CPU, memory, disks, network) in Python. +processes and system utilization (CPU, memory, disks, network) in +Python. -== License == +License +------- 3-clause BSD license -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- https://github.com/giampaolo/psutil/ diff --git a/build/pkgs/ptyprocess/SPKG.rst b/build/pkgs/ptyprocess/SPKG.rst new file mode 100644 index 00000000000..46dda6faf3d --- /dev/null +++ b/build/pkgs/ptyprocess/SPKG.rst @@ -0,0 +1,33 @@ +ptyprocess +========== + +Description +----------- + +Launch a subprocess in a pseudo terminal (pty), and interact with both +the process and its pty. + +Sometimes, piping stdin and stdout is not enough. There might be a +password prompt that doesn't read from stdin, output that changes when +it's going to a pipe rather than a terminal, or curses-style interfaces +that rely on a terminal. If you need to automate these things, running +the process in a pseudo terminal (pty) is the answer. + +License +------- + +Ptyprocess is under the ISC license, as code derived from Pexpect. + + http://opensource.org/licenses/ISC + +.. _upstream_contact: + +Upstream Contact +---------------- + +https://github.com/pexpect/ptyprocess + +Dependencies +------------ + +- Python diff --git a/build/pkgs/ptyprocess/SPKG.txt b/build/pkgs/ptyprocess/SPKG.txt deleted file mode 100644 index 173ccb9dee5..00000000000 --- a/build/pkgs/ptyprocess/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= ptyprocess = - -== Description == - -Launch a subprocess in a pseudo terminal (pty), and interact with both the -process and its pty. - -Sometimes, piping stdin and stdout is not enough. There might be a password -prompt that doesn't read from stdin, output that changes when it's going to a -pipe rather than a terminal, or curses-style interfaces that rely on a terminal. -If you need to automate these things, running the process in a pseudo terminal -(pty) is the answer. - -== License == - -Ptyprocess is under the ISC license, as code derived from Pexpect. - http://opensource.org/licenses/ISC - -== Upstream Contact == - -https://github.com/pexpect/ptyprocess - -== Dependencies == - - * Python diff --git a/build/pkgs/pycosat/SPKG.rst b/build/pkgs/pycosat/SPKG.rst new file mode 100644 index 00000000000..27ba9485f92 --- /dev/null +++ b/build/pkgs/pycosat/SPKG.rst @@ -0,0 +1,37 @@ +pycosat +======= + +Description +----------- + +PicoSAT is a popular SAT solver written by Armin Biere in pure C. This +package provides efficient Python bindings to picosat on the C level, +i.e. when importing pycosat, the picosat solver becomes part of the +Python process itself. For ease of deployment, the picosat source +(namely picosat.c and picosat.h) is included in this project. These +files have been extracted from the picosat source. + +License +------- + +MIT + +.. _upstream_contact: + +Upstream Contact +---------------- + +PicoSAT: http://fmv.jku.at/picosat/ pycosat: +https://github.com/ContinuumIO/pycosat + +Dependencies +------------ + +None. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/pycosat/SPKG.txt b/build/pkgs/pycosat/SPKG.txt deleted file mode 100644 index 0d99e44ba15..00000000000 --- a/build/pkgs/pycosat/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= pycosat = - -== Description == - -PicoSAT is a popular SAT solver written by Armin Biere in pure C. This package -provides efficient Python bindings to picosat on the C level, i.e. when -importing pycosat, the picosat solver becomes part of the Python process itself. -For ease of deployment, the picosat source (namely picosat.c and picosat.h) is -included in this project. These files have been extracted from the picosat -source. - -== License == - -MIT - -== Upstream Contact == - -PicoSAT: http://fmv.jku.at/picosat/ -pycosat: https://github.com/ContinuumIO/pycosat - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -None. - diff --git a/build/pkgs/pycygwin/SPKG.rst b/build/pkgs/pycygwin/SPKG.rst new file mode 100644 index 00000000000..2fa961c54ed --- /dev/null +++ b/build/pkgs/pycygwin/SPKG.rst @@ -0,0 +1,14 @@ +pycygwin +======== + +Description +----------- + +Python bindings for Cygwin's C API. Provides some utilities to help with +the Cygwin port. Naturally, this package should only be installed on +Cygwin--for other platforms its installation is a no-op. + +Website +------- + +https://github.com/embray/PyCygwin diff --git a/build/pkgs/pycygwin/SPKG.txt b/build/pkgs/pycygwin/SPKG.txt deleted file mode 100644 index 7f918edfd29..00000000000 --- a/build/pkgs/pycygwin/SPKG.txt +++ /dev/null @@ -1,11 +0,0 @@ -= pycygwin = - -== Description == - -Python bindings for Cygwin's C API. Provides some utilities to help with -the Cygwin port. Naturally, this package should only be installed on -Cygwin--for other platforms its installation is a no-op. - -== Website == - -https://github.com/embray/PyCygwin diff --git a/build/pkgs/pygments/SPKG.rst b/build/pkgs/pygments/SPKG.rst new file mode 100644 index 00000000000..621a2c3ab5a --- /dev/null +++ b/build/pkgs/pygments/SPKG.rst @@ -0,0 +1,56 @@ +Pygments +======== + +Description +----------- + +Pygments is a syntax highlighting package written in Python. + +It is a generic syntax highlighter suitable for use in code hosting, +forums, wikis or other applications that need to prettify source code. +Highlights are: + +- a wide range of over 300 languages and other text formats is + + supported + +- special attention is paid to details, increasing quality by a fair + + amount + +- support for new languages and formats are added easily +- a number of output formats, presently HTML, LaTeX, RTF, SVG, all + image + + formats that PIL supports and ANSI sequences + +- it is usable as a command-line tool and as a library + +License +------- + +Modified BSD + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Georg Brandl Home Page: http://pygments.org + +Dependencies +------------ + +Python + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +Patches included: + +- sage_prompt.patch: patch pygments/lexers/agile.py to treat the + + "sage:" prompt like Python's ">>>" prompt. This allows a very + kludgy patch to be removed from the Sphinx package (see #10118). diff --git a/build/pkgs/pygments/SPKG.txt b/build/pkgs/pygments/SPKG.txt deleted file mode 100644 index ae7f23d4cb9..00000000000 --- a/build/pkgs/pygments/SPKG.txt +++ /dev/null @@ -1,39 +0,0 @@ -= Pygments = - -== Description == - -Pygments is a syntax highlighting package written in Python. - -It is a generic syntax highlighter suitable for use in code hosting, -forums, wikis or other applications that need to prettify source code. -Highlights are: - -* a wide range of over 300 languages and other text formats is - supported -* special attention is paid to details, increasing quality by a fair - amount -* support for new languages and formats are added easily -* a number of output formats, presently HTML, LaTeX, RTF, SVG, all image - formats that PIL supports and ANSI sequences -* it is usable as a command-line tool and as a library - -== License == - -Modified BSD - -== Upstream Contact == - -Author: Georg Brandl -Home Page: http://pygments.org - -== Dependencies == - -Python - -== Special Update/Build Instructions == - -Patches included: - - * sage_prompt.patch: patch pygments/lexers/agile.py to treat the - "sage:" prompt like Python's ">>>" prompt. This allows a very - kludgy patch to be removed from the Sphinx package (see #10118). diff --git a/build/pkgs/pynac/SPKG.rst b/build/pkgs/pynac/SPKG.rst new file mode 100644 index 00000000000..6e9f9ac7bd1 --- /dev/null +++ b/build/pkgs/pynac/SPKG.rst @@ -0,0 +1,38 @@ +pynac +===== + +Description +----------- + +A modified version of GiNaC that replaces the dependency on CLN by +Python. + +License +------- + +GPL V2+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Burcin Erocal - burcin spam.erocal.org +- William Stein - wstein spam.gmail.com +- Mike Hansen - mhansen spam.gmail.com + +Dependencies +------------ + +Python + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +If build fails trying to run autoheader, run + + autoreconf -i --force + +in the src directory. diff --git a/build/pkgs/pynac/SPKG.txt b/build/pkgs/pynac/SPKG.txt deleted file mode 100644 index fe87c09f20c..00000000000 --- a/build/pkgs/pynac/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= pynac = - -== Description == - -A modified version of GiNaC that replaces the dependency on CLN by Python. - -== License == - -GPL V2+ - -== Upstream Contact == - - * Burcin Erocal - burcin spam.erocal.org - * William Stein - wstein spam.gmail.com - * Mike Hansen - mhansen spam.gmail.com - -== Dependencies == - -Python - -== Special Update/Build Instructions == - -If build fails trying to run autoheader, run - - autoreconf -i --force - -in the src directory. - diff --git a/build/pkgs/pynormaliz/SPKG.rst b/build/pkgs/pynormaliz/SPKG.rst new file mode 100644 index 00000000000..5d5e8f3bafe --- /dev/null +++ b/build/pkgs/pynormaliz/SPKG.rst @@ -0,0 +1,30 @@ +pynormaliz +========== + +Description +----------- + +The Python module PyNormaliz provides wrappers for normaliz. + +License +------- + +- GPL v2 or later + +.. _upstream_contact: + +Upstream Contact +---------------- + + https://github.com/sebasguts/PyNormaliz + +Dependencies +------------ + +- pip +- normaliz + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/pynormaliz/SPKG.txt b/build/pkgs/pynormaliz/SPKG.txt deleted file mode 100644 index 3de174ff111..00000000000 --- a/build/pkgs/pynormaliz/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= pynormaliz = - -== Description == - -The Python module PyNormaliz provides wrappers for normaliz. - -== License == - - * GPL v2 or later - -== Upstream Contact == - - https://github.com/sebasguts/PyNormaliz - -== Dependencies == - - * pip - * normaliz - -== Special Update/Build Instructions == - diff --git a/build/pkgs/pyparsing/SPKG.rst b/build/pkgs/pyparsing/SPKG.rst new file mode 100644 index 00000000000..b546f23a3e9 --- /dev/null +++ b/build/pkgs/pyparsing/SPKG.rst @@ -0,0 +1,24 @@ +pyparsing +========= + +Description +----------- + +A Python Parsing Module + +License +------- + +MIT License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Paul McGuire Home page: http://pyparsing.wikispaces.com + +Dependencies +------------ + +Python diff --git a/build/pkgs/pyparsing/SPKG.txt b/build/pkgs/pyparsing/SPKG.txt deleted file mode 100644 index 6fb6d64513e..00000000000 --- a/build/pkgs/pyparsing/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= pyparsing = - -== Description == - -A Python Parsing Module - -== License == - -MIT License - -== Upstream Contact == - -Author: Paul McGuire -Home page: http://pyparsing.wikispaces.com - -== Dependencies == - -Python - diff --git a/build/pkgs/pysingular/SPKG.rst b/build/pkgs/pysingular/SPKG.rst new file mode 100644 index 00000000000..d53c891f7ed --- /dev/null +++ b/build/pkgs/pysingular/SPKG.rst @@ -0,0 +1,21 @@ +PySingular +========== + +Description +----------- + +A basic interface to call Singular from python + +This python module is meant to be used in Singulars Jupyter interface. + +License +------- + +GPL version 2 or later + +.. _upstream_contact: + +Upstream Contact +---------------- + +- https://github.com/sebasguts/SingularPython diff --git a/build/pkgs/pysingular/SPKG.txt b/build/pkgs/pysingular/SPKG.txt deleted file mode 100644 index 1517ebb2677..00000000000 --- a/build/pkgs/pysingular/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= PySingular = - -== Description == - -A basic interface to call Singular from python - -This python module is meant to be used in Singulars Jupyter interface. - -== License == - -GPL version 2 or later - -== Upstream Contact == - -* https://github.com/sebasguts/SingularPython diff --git a/build/pkgs/python2/SPKG.rst b/build/pkgs/python2/SPKG.rst new file mode 100644 index 00000000000..22702cdf0ac --- /dev/null +++ b/build/pkgs/python2/SPKG.rst @@ -0,0 +1,103 @@ +python +====== + +Description +----------- + +Python is a dynamic object-oriented programming language that can be +used for many kinds of software development. It offers strong support +for integration with other languages and tools, comes with extensive +standard libraries, and can be learned in a few days. Many Python +programmers report substantial productivity gains and feel the language +encourages the development of higher quality, more maintainable code. + +For more details see http://www.python.org + +License +------- + +Python is licensed under the PSF LICENSE. The Python license imposes +very few restrictions on what you can do with Python. Most of the source +code is copyrighted by the Python Software Foundation (PSF). A few files +have a different copyright owner, but the same license applies to all of +them. Python's licensing is GPL compatible. + +For more details see http://www.python.org/psf/license/ + +.. _upstream_contact: + +Upstream Contact +---------------- + +There are a large number of community resources. For more details see +http://www.python.org/community/ + +Dependencies +------------ + +- GNU patch +- readline +- libpng +- SQLite + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- We keep a copy of the stdlib 'random' module in + + src/sage/cpython/_py2_random.py. Normally it shouldn't be necessary + to update this, but when upgrading Python make sure to bring over + any security updates from the upstream 'random' module in the + unlikely + chance there are any. This might mean updating any "random" test + results + that depend on the implementation details of the random module. + +- Spaces in SAGE_ROOT aren't yet fully supported by this package, + + since we put $SAGE_LOCAL/... into CPPFLAGS and LDFLAGS, which + wouldn't work then. + +Patches +~~~~~~~ + +- socket.patch: Work around an SSL issue. +- permissions.patch: Changes the permission of installed libraries + + to 0755 (like any other library) instead of 0555. + +- sys_path_security-issue_16202.patch: ensure that the current working + + directory or the script directory is prepended to sys.path only if + there is no security risk in doing so. + +- ncurses-issue_9665.patch: Fixes Python issue #9665 (by patching + configure + + and configure.in after running autotools). + +- ncurses-issue_14438.patch: Fixes Python issue #14438 (ncurses) +- disable_print_refs_debug.patch: Remove some unused debug output + + that breaks doctests. + +- no_strict_proto-issue_5755.patch: don't add -Wstrict-prototypes + compiler + + flag, which isn't valid for C++ (but Python uses the same compiler + flags + for C and C++). See http://bugs.python.org/issue5755. + +- hashlibfallbacks-issue_18000.patch: Fixed Python issue #18000. +- tinfo.patch: make sure tinfo is correctly linked in when needed on + Cygwin. +- uuid-issue_11063.patch: patch from Python issue 11063; reduce uuid + + module import side effects and fix thread related issues. + +- getcallargs-issue_20108.patch: fix inspect.getcallargs() when the + + function has a "func" keyword argument. Needed for @interact from + ipywidgets. diff --git a/build/pkgs/python2/SPKG.txt b/build/pkgs/python2/SPKG.txt deleted file mode 100644 index b0a72bfa09c..00000000000 --- a/build/pkgs/python2/SPKG.txt +++ /dev/null @@ -1,71 +0,0 @@ -= python = - -== Description == - -Python is a dynamic object-oriented programming language that can be -used for many kinds of software development. It offers strong support -for integration with other languages and tools, comes with extensive -standard libraries, and can be learned in a few days. Many Python -programmers report substantial productivity gains and feel the -language encourages the development of higher quality, more -maintainable code. - -For more details see http://www.python.org - -== License == - -Python is licensed under the PSF LICENSE. The Python license imposes -very few restrictions on what you can do with Python. Most of the -source code is copyrighted by the Python Software Foundation (PSF). A -few files have a different copyright owner, but the same license -applies to all of them. Python's licensing is GPL compatible. - -For more details see http://www.python.org/psf/license/ - -== Upstream Contact == - -There are a large number of community resources. For more details see -http://www.python.org/community/ - -== Dependencies == - - * GNU patch - * readline - * libpng - * SQLite - -== Special Update/Build Instructions == - - * We keep a copy of the stdlib 'random' module in - src/sage/cpython/_py2_random.py. Normally it shouldn't be necessary - to update this, but when upgrading Python make sure to bring over - any security updates from the upstream 'random' module in the unlikely - chance there are any. This might mean updating any "random" test results - that depend on the implementation details of the random module. - * Spaces in SAGE_ROOT aren't yet fully supported by this package, - since we put $SAGE_LOCAL/... into CPPFLAGS and LDFLAGS, which - wouldn't work then. - -=== Patches === - - * socket.patch: Work around an SSL issue. - * permissions.patch: Changes the permission of installed libraries - to 0755 (like any other library) instead of 0555. - * sys_path_security-issue_16202.patch: ensure that the current working - directory or the script directory is prepended to sys.path only if - there is no security risk in doing so. - * ncurses-issue_9665.patch: Fixes Python issue #9665 (by patching configure - and configure.in after running autotools). - * ncurses-issue_14438.patch: Fixes Python issue #14438 (ncurses) - * disable_print_refs_debug.patch: Remove some unused debug output - that breaks doctests. - * no_strict_proto-issue_5755.patch: don't add -Wstrict-prototypes compiler - flag, which isn't valid for C++ (but Python uses the same compiler flags - for C and C++). See http://bugs.python.org/issue5755. - * hashlibfallbacks-issue_18000.patch: Fixed Python issue #18000. - * tinfo.patch: make sure tinfo is correctly linked in when needed on Cygwin. - * uuid-issue_11063.patch: patch from Python issue 11063; reduce uuid - module import side effects and fix thread related issues. - * getcallargs-issue_20108.patch: fix inspect.getcallargs() when the - function has a "func" keyword argument. Needed for @interact from - ipywidgets. diff --git a/build/pkgs/python_igraph/SPKG.rst b/build/pkgs/python_igraph/SPKG.rst new file mode 100644 index 00000000000..fb5809424a4 --- /dev/null +++ b/build/pkgs/python_igraph/SPKG.rst @@ -0,0 +1,34 @@ +.. _python_igraph: + +python-igraph +============= + +Description +----------- + +igraph is a library for creating and manipulating graphs. It is intended +to be as powerful (ie. fast) as possible to enable the analysis of large +graphs. + +License +------- + +GPL version 2 + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://igraph.org/python/ + +Dependencies +------------ + +- python +- igraph + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- diff --git a/build/pkgs/python_igraph/SPKG.txt b/build/pkgs/python_igraph/SPKG.txt deleted file mode 100644 index 8a6721bb25d..00000000000 --- a/build/pkgs/python_igraph/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= python-igraph = - -== Description == - -igraph is a library for creating and manipulating graphs. -It is intended to be as powerful (ie. fast) as possible to enable the -analysis of large graphs. - -== License == - -GPL version 2 - -== Upstream Contact == - -http://igraph.org/python/ - -== Dependencies == - -* python -* igraph - -== Special Update/Build Instructions == diff --git a/build/pkgs/python_openid/SPKG.rst b/build/pkgs/python_openid/SPKG.rst new file mode 100644 index 00000000000..21c728375af --- /dev/null +++ b/build/pkgs/python_openid/SPKG.rst @@ -0,0 +1,15 @@ +.. _python_openid: + +python-openid +============= + +Description +----------- + +OpenID support for servers and consumers. + +This is a set of Python packages to support use of the OpenID +decentralized identity system in your application. Want to enable single +sign-on for your web site? Use the openid.consumer package. Want to run +your own OpenID server? Check out openid.server. Includes example code +and support for a variety of storage back-ends. diff --git a/build/pkgs/python_openid/SPKG.txt b/build/pkgs/python_openid/SPKG.txt deleted file mode 100644 index 390a18695b1..00000000000 --- a/build/pkgs/python_openid/SPKG.txt +++ /dev/null @@ -1,11 +0,0 @@ -= python-openid = - -== Description == - -OpenID support for servers and consumers. - -This is a set of Python packages to support use of the OpenID decentralized -identity system in your application. Want to enable single sign-on for your -web site? Use the openid.consumer package. Want to run your own OpenID server? -Check out openid.server. Includes example code and support for a variety of -storage back-ends. diff --git a/build/pkgs/pytz/SPKG.rst b/build/pkgs/pytz/SPKG.rst new file mode 100644 index 00000000000..3a2fd999785 --- /dev/null +++ b/build/pkgs/pytz/SPKG.rst @@ -0,0 +1,17 @@ +pytz +==== + +Description +----------- + +World Timezone Definitions for Python + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +The upstream tarball was repackaged after sanitizing the file +permissions with + +$ chmod go-w diff --git a/build/pkgs/pytz/SPKG.txt b/build/pkgs/pytz/SPKG.txt deleted file mode 100644 index 94190513f91..00000000000 --- a/build/pkgs/pytz/SPKG.txt +++ /dev/null @@ -1,12 +0,0 @@ -= pytz = - -== Description == - -World Timezone Definitions for Python - -== Special Update/Build Instructions == - -The upstream tarball was repackaged after sanitizing the file -permissions with - -$ chmod go-w diff --git a/build/pkgs/pyx/SPKG.txt b/build/pkgs/pyx/SPKG.rst similarity index 76% rename from build/pkgs/pyx/SPKG.txt rename to build/pkgs/pyx/SPKG.rst index 6f3e0998d88..f9a4a5b88d5 100644 --- a/build/pkgs/pyx/SPKG.txt +++ b/build/pkgs/pyx/SPKG.rst @@ -1,8 +1,9 @@ -= pyx = +pyx +=== -== Description == +Description +----------- Python package for the generation of PostScript, PDF, and SVG files https://pypi.python.org/pypi/PyX - diff --git a/build/pkgs/pyzmq/SPKG.rst b/build/pkgs/pyzmq/SPKG.rst new file mode 100644 index 00000000000..e165dd9a861 --- /dev/null +++ b/build/pkgs/pyzmq/SPKG.rst @@ -0,0 +1,33 @@ +pyzmq +===== + +Description +----------- + +Python bindings for the zeromq networking library. + +License +------- + +LGPLv3+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://www.zeromq.org + +Dependencies +------------ + +- Python +- Cython +- zeromq + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/pyzmq/SPKG.txt b/build/pkgs/pyzmq/SPKG.txt deleted file mode 100644 index 86903427d03..00000000000 --- a/build/pkgs/pyzmq/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= pyzmq = - -== Description == - -Python bindings for the zeromq networking library. - -== License == - -LGPLv3+ - -== Upstream Contact == - -http://www.zeromq.org - -== Dependencies == - -* Python -* Cython -* zeromq - -== Special Update/Build Instructions == - -None. - diff --git a/build/pkgs/qepcad/SPKG.rst b/build/pkgs/qepcad/SPKG.rst new file mode 100644 index 00000000000..05923ff7d0f --- /dev/null +++ b/build/pkgs/qepcad/SPKG.rst @@ -0,0 +1,51 @@ +qepcad +====== + +Description +----------- + +Qepcad is an implementation of quantifier elimination by partial +cylindrical algebraic decomposition + +License +------- + +QEPCAD B Copyright (c) 1990, 2008, Hoon Hong & Chris Brown (contact +wcbrown@usna.edu) + +Permission to use, copy, modify, and/or distribute this software, +including source files, README files, etc., for any purpose with or +without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Website: http://www.usna.edu/CS/qepcadweb/B/QEPCAD.html +- Alternative location (sometimes more up-to-date): + + https://www.usna.edu/Users/cs/wcbrown/qepcad/B/QEPCAD.html + +Dependencies +------------ + +- readline +- saclib + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +One might need to set MAKE to "make -j1" fo this to be built +successfully. diff --git a/build/pkgs/qepcad/SPKG.txt b/build/pkgs/qepcad/SPKG.txt deleted file mode 100644 index 33bf57d8d30..00000000000 --- a/build/pkgs/qepcad/SPKG.txt +++ /dev/null @@ -1,39 +0,0 @@ -= qepcad = - -== Description == - -Qepcad is an implementation of quantifier elimination by partial cylindrical -algebraic decomposition - -== License == - -QEPCAD B -Copyright (c) 1990, 2008, Hoon Hong & Chris Brown (contact wcbrown@usna.edu) - -Permission to use, copy, modify, and/or distribute this software, including -source files, README files, etc., for any purpose with or without fee is -hereby granted, provided that the above copyright notice and this permission -notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -== Upstream Contact == - -- Website: http://www.usna.edu/CS/qepcadweb/B/QEPCAD.html -- Alternative location (sometimes more up-to-date): - https://www.usna.edu/Users/cs/wcbrown/qepcad/B/QEPCAD.html - -== Dependencies == - -* readline -* saclib - -== Special Update/Build Instructions == - -One might need to set MAKE to "make -j1" fo this to be built successfully. diff --git a/build/pkgs/qhull/SPKG.rst b/build/pkgs/qhull/SPKG.rst new file mode 100644 index 00000000000..4e84a01e44d --- /dev/null +++ b/build/pkgs/qhull/SPKG.rst @@ -0,0 +1,49 @@ +Qhull +===== + +Description +----------- + +From the README.txt of Qhull: + +Qhull computes convex hulls, Delaunay triangulations, Voronoi diagrams, +furthest-site Voronoi diagrams, and halfspace intersections about a +point. It runs in 2-d, 3-d, 4-d, or higher. It implements the Quickhull +algorithm for computing convex hulls. Qhull handles round-off errors +from floating point arithmetic. It can approximate a convex hull. + +The program includes options for hull volume, facet area, partial hulls, +input transformations, randomization, tracing, multiple output formats, +and execution statistics. + +Further notes: + +The qhull library is already shipped with the Python library scipy (from +version 1.4), see + +- http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.ConvexHull.html +- http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.Delaunay.html +- http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.Voronoi.html + +There is also the Python interface Pyhull available on PyPI +https://pypi.python.org/pypi/pyhull (see also documentation at +http://pythonhosted.org/pyhull/). + +.. _upstream_contact: + +Upstream Contact +---------------- + +C. Bradford Barber bradb@shore.net or qhull@qhull.org + +Dependencies +------------ + +Can be compiled with Qt support, but the Sage version currently doesn't +try to do this. + +License +------- + +Not a standard license, but Sage compatible. See the COPYING.txt file in +the source directory for details. diff --git a/build/pkgs/qhull/SPKG.txt b/build/pkgs/qhull/SPKG.txt deleted file mode 100644 index ab514bc1f69..00000000000 --- a/build/pkgs/qhull/SPKG.txt +++ /dev/null @@ -1,43 +0,0 @@ -= Qhull = - -== Description == - -From the README.txt of Qhull: - -Qhull computes convex hulls, Delaunay triangulations, Voronoi diagrams, -furthest-site Voronoi diagrams, and halfspace intersections about a point. -It runs in 2-d, 3-d, 4-d, or higher. It implements the Quickhull algorithm -for computing convex hulls. Qhull handles round-off errors from floating -point arithmetic. It can approximate a convex hull. - -The program includes options for hull volume, facet area, partial hulls, -input transformations, randomization, tracing, multiple output formats, and -execution statistics. - - -Further notes: - -The qhull library is already shipped with the Python library scipy (from -version 1.4), see - -- http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.ConvexHull.html -- http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.Delaunay.html -- http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.Voronoi.html - -There is also the Python interface Pyhull available on PyPI -https://pypi.python.org/pypi/pyhull (see also documentation at http://pythonhosted.org/pyhull/). - -== Upstream Contact == - -C. Bradford Barber -bradb@shore.net -or qhull@qhull.org - -== Dependencies == - -Can be compiled with Qt support, but the Sage version currently doesn't try to do this. - -== License == - -Not a standard license, but Sage compatible. See the COPYING.txt file in the -source directory for details. diff --git a/build/pkgs/r/SPKG.txt b/build/pkgs/r/SPKG.rst similarity index 62% rename from build/pkgs/r/SPKG.txt rename to build/pkgs/r/SPKG.rst index a6b1e72ab2c..16b5587dd49 100644 --- a/build/pkgs/r/SPKG.txt +++ b/build/pkgs/r/SPKG.rst @@ -1,6 +1,9 @@ -= R = +R += + +Description +----------- -== Description == R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent @@ -10,20 +13,26 @@ much code written for S runs unaltered under R. (taken from http://www.r-project.org/) -== License == - * GPL v2 or GPL v3 +License +------- + +- GPL v2 or GPL v3 + +.. _upstream_contact: + +Upstream Contact +---------------- -== Upstream Contact == - * R mailing list, #R in IRC +- R mailing list, #R in IRC -== Dependencies == +Dependencies +------------ - * GNU patch - * iconv - * Readline - * BLAS/LAPACK - * xz - * pcre - * curl - * https-capable SSL - +- GNU patch +- iconv +- Readline +- BLAS/LAPACK +- xz +- pcre +- curl +- https-capable SSL diff --git a/build/pkgs/ratpoints/SPKG.rst b/build/pkgs/ratpoints/SPKG.rst new file mode 100644 index 00000000000..b74b5add4e6 --- /dev/null +++ b/build/pkgs/ratpoints/SPKG.rst @@ -0,0 +1,43 @@ +ratpoints +========= + +Description +----------- + +Michael Stoll's program which searches for rational points on +hyperelliptic curves. + +NOTE: the ratpoints package has been assimilated by PARI/GP. Therefore, +this package (as Sage package) is deprecated. In the future, it will be +removed from Sage. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Author: Michael Stoll +- Email: Michael.Stoll@uni-bayreuth.de +- Website: http://www.mathe2.uni-bayreuth.de/stoll/ + +Dependencies +------------ + +- GMP/MPIR +- (GNU) patch + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +.. _note_on_sse2_instructions: + +Note on SSE2 instructions +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- On several architectures, the SSE2 instructions used by ratpoints + cause + + compiler errors. In the case that ratpoints fails to build with SSE2 + instructions enabled, the build is repeated with SSE2 disabled. diff --git a/build/pkgs/ratpoints/SPKG.txt b/build/pkgs/ratpoints/SPKG.txt deleted file mode 100644 index c183090831a..00000000000 --- a/build/pkgs/ratpoints/SPKG.txt +++ /dev/null @@ -1,30 +0,0 @@ -= ratpoints = - -== Description == - -Michael Stoll's program which searches for rational points on hyperelliptic -curves. - -NOTE: the ratpoints package has been assimilated by PARI/GP. Therefore, -this package (as Sage package) is deprecated. In the future, it will be -removed from Sage. - -== Upstream Contact == - - * Author: Michael Stoll - * Email: Michael.Stoll@uni-bayreuth.de - * Website: http://www.mathe2.uni-bayreuth.de/stoll/ - -== Dependencies == - - * GMP/MPIR - * (GNU) patch - -== Special Update/Build Instructions == - -=== Note on SSE2 instructions === - - * On several architectures, the SSE2 instructions used by ratpoints cause - compiler errors. In the case that ratpoints fails to build with SSE2 - instructions enabled, the build is repeated with SSE2 disabled. - diff --git a/build/pkgs/readline/SPKG.rst b/build/pkgs/readline/SPKG.rst new file mode 100644 index 00000000000..1d77564b757 --- /dev/null +++ b/build/pkgs/readline/SPKG.rst @@ -0,0 +1,53 @@ +readline +======== + +Description +----------- + +The GNU Readline library provides a set of functions for use by +applications that allow users to edit command lines as they are typed +in. Both Emacs and vi editing modes are available. The Readline library +includes additional functions to maintain a list of previously-entered +command lines, to recall and perhaps reedit those lines, and perform +csh-like history expansion on previous commands. + +Website: http://tiswww.case.edu/php/chet/readline/rltop.html + +License +------- + +- GPL V3+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Chet Ramey at http://cnswww.cns.cwru.edu/~chet + +Dependencies +------------ + +- ncurses + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +We build readline using ncurses. Readline needs to be told to link with +libtinfo (part of ncurses), this is what the patch 0002-ltinfo.patch +does. + +Patches +------- + +- 0001-macports.patch: Changes to shobj.conf for OS/X, from macports: + + https://trac.macports.org/browser/trunk/dports/devel/readline/files/patch-shobj-conf.diff + +- 0002-ltinfo.patch: We build readline using ncurses, and for that it + + needs to be told to link with libtinfo (part of ncurses). + +- sigsetjmp.patch: Correctly define sigsetjmp and friends on Cygwin. diff --git a/build/pkgs/readline/SPKG.txt b/build/pkgs/readline/SPKG.txt deleted file mode 100644 index 800f7767002..00000000000 --- a/build/pkgs/readline/SPKG.txt +++ /dev/null @@ -1,39 +0,0 @@ -= readline = - -== Description == - -The GNU Readline library provides a set of functions for use by -applications that allow users to edit command lines as they are typed -in. Both Emacs and vi editing modes are available. The Readline -library includes additional functions to maintain a list of -previously-entered command lines, to recall and perhaps reedit those -lines, and perform csh-like history expansion on previous commands. - -Website: http://tiswww.case.edu/php/chet/readline/rltop.html - -== License == - - * GPL V3+ - -== Upstream Contact == - - * Chet Ramey at http://cnswww.cns.cwru.edu/~chet - -== Dependencies == - - * ncurses - -== Special Update/Build Instructions == - -We build readline using ncurses. Readline needs to be told to link -with libtinfo (part of ncurses), this is what the patch -0002-ltinfo.patch does. - - -== Patches == - - * 0001-macports.patch: Changes to shobj.conf for OS/X, from macports: - https://trac.macports.org/browser/trunk/dports/devel/readline/files/patch-shobj-conf.diff - * 0002-ltinfo.patch: We build readline using ncurses, and for that it - needs to be told to link with libtinfo (part of ncurses). - * sigsetjmp.patch: Correctly define sigsetjmp and friends on Cygwin. diff --git a/build/pkgs/requests/SPKG.txt b/build/pkgs/requests/SPKG.rst similarity index 66% rename from build/pkgs/requests/SPKG.txt rename to build/pkgs/requests/SPKG.rst index 5f5a73a5fc2..f06fc13952f 100644 --- a/build/pkgs/requests/SPKG.txt +++ b/build/pkgs/requests/SPKG.rst @@ -1,6 +1,8 @@ -= requests = +requests +======== -== Description == +Description +----------- Requests is the only Non-GMO HTTP library for Python, safe for human consumption. diff --git a/build/pkgs/rpy2/SPKG.rst b/build/pkgs/rpy2/SPKG.rst new file mode 100644 index 00000000000..928813e474d --- /dev/null +++ b/build/pkgs/rpy2/SPKG.rst @@ -0,0 +1,40 @@ +rpy2 +==== + +Description +----------- + +rpy2 is a redesign and rewrite of rpy. It is providing a low-level +interface to R, a proposed high-level interface, including wrappers to +graphical libraries, as well as R-like structures and functions. + +Website: http://rpy.sourceforge.net/rpy2.html + +License +------- + +- GPL 2+ +- Note that we have deleted references to Mozilla PL as an option, + which we are allowed to do by the full rpy2 license in order to + remain GPL-compatible + +.. _upstream_contact: + +Upstream Contact +---------------- + +- http://rpy.sourceforge.net/maillist.html + +Dependencies +------------ + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +Patches +~~~~~~~ + +- setup.patch: takes care of a few parsing issues. +- cygwin.patch: let rpy2 build on Cygwin. diff --git a/build/pkgs/rpy2/SPKG.txt b/build/pkgs/rpy2/SPKG.txt deleted file mode 100644 index 806f1c946cf..00000000000 --- a/build/pkgs/rpy2/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= rpy2 = - -== Description == -rpy2 is a redesign and rewrite of rpy. It is providing a low-level -interface to R, a proposed high-level interface, including wrappers to -graphical libraries, as well as R-like structures and functions. - -Website: http://rpy.sourceforge.net/rpy2.html - -== License == - * GPL 2+ - * Note that we have deleted references to Mozilla PL as an option, which we are allowed to do by the full rpy2 license in order to remain GPL-compatible - -== Upstream Contact == - * http://rpy.sourceforge.net/maillist.html - -== Dependencies == - -== Special Update/Build Instructions == - -=== Patches === - * setup.patch: takes care of a few parsing issues. - * cygwin.patch: let rpy2 build on Cygwin. - diff --git a/build/pkgs/rst2ipynb/SPKG.txt b/build/pkgs/rst2ipynb/SPKG.rst similarity index 61% rename from build/pkgs/rst2ipynb/SPKG.txt rename to build/pkgs/rst2ipynb/SPKG.rst index b10dc5acacb..41bc1f18fee 100644 --- a/build/pkgs/rst2ipynb/SPKG.txt +++ b/build/pkgs/rst2ipynb/SPKG.rst @@ -1,6 +1,8 @@ -= rst2ipynb = +rst2ipynb +========= -== Description == +Description +----------- The rst2pynb program converts a standalone reStructuredText file to a Jupyter notebook file. @@ -9,21 +11,29 @@ This is currently achieved by converting to markdown with pandoc and then to Jupyter notebook using notedown, plus some configuration and tweaks. -== License == +License +------- BSD 3-Clause License -== Upstream Contact == +.. _upstream_contact: -Authors: Scott Sievert and Nicolas M. Thiéry -Home page: https://github.com/nthiery/rst-to-ipynb +Upstream Contact +---------------- -== Dependencies == +Authors: Scott Sievert and Nicolas M. Thiéry Home page: +https://github.com/nthiery/rst-to-ipynb - * notedown - * pandoc +Dependencies +------------ -== Special Update/Build Instructions == +- notedown +- pandoc + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- Fetch tarball from https://pypi.python.org/pypi/rst2ipynb/ diff --git a/build/pkgs/rubiks/SPKG.rst b/build/pkgs/rubiks/SPKG.rst new file mode 100644 index 00000000000..998429217de --- /dev/null +++ b/build/pkgs/rubiks/SPKG.rst @@ -0,0 +1,27 @@ +rubiks.spkg +=========== + +Description +----------- + +There are several programs for working with Rubik's cubes, by three +different people. Look inside the directories under /src to see specific +info and licensing. In summary the three contributers are: + +Michael Reid (GPL) +http://www.math.ucf.edu/~reid/Rubik/optimal_solver.html + + optimal - uses many pre-computed tables to find an optimal + solution to the 3x3x3 Rubik's cube + +Dik T. Winter (MIT License) + + cube - uses Kociemba's algorithm to iteratively find a short + solution to the 3x3x3 Rubik's cube + size222 - solves a 2x2x2 Rubik's cube + +Eric Dietz (GPL) http://www.wrongway.org/?rubiksource + + cu2 - A fast, non-optimal 2x2x2 solver + cubex - A fast, non-optimal 3x3x3 solver + mcube - A fast, non-optimal 4x4x4 solver diff --git a/build/pkgs/rubiks/SPKG.txt b/build/pkgs/rubiks/SPKG.txt deleted file mode 100644 index af4e9a21bb9..00000000000 --- a/build/pkgs/rubiks/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= rubiks.spkg = - -== Description == - -There are several programs for working with Rubik's cubes, by three -different people. Look inside the directories under /src to see -specific info and licensing. In summary the three contributers are: - - -Michael Reid (GPL) http://www.math.ucf.edu/~reid/Rubik/optimal_solver.html - optimal - uses many pre-computed tables to find an optimal - solution to the 3x3x3 Rubik's cube - - -Dik T. Winter (MIT License) - cube - uses Kociemba's algorithm to iteratively find a short - solution to the 3x3x3 Rubik's cube - size222 - solves a 2x2x2 Rubik's cube - - -Eric Dietz (GPL) http://www.wrongway.org/?rubiksource - cu2 - A fast, non-optimal 2x2x2 solver - cubex - A fast, non-optimal 3x3x3 solver - mcube - A fast, non-optimal 4x4x4 solver - diff --git a/build/pkgs/rw/SPKG.txt b/build/pkgs/rw/SPKG.rst similarity index 69% rename from build/pkgs/rw/SPKG.txt rename to build/pkgs/rw/SPKG.rst index 7ab5243f2d4..a9c9e5a627f 100644 --- a/build/pkgs/rw/SPKG.txt +++ b/build/pkgs/rw/SPKG.rst @@ -1,15 +1,21 @@ -= rw = +rw +== -== Description == +Description +----------- rw is a program that calculates rank-width and rank-decompositions. http://pholia.tdi.informatik.uni-frankfurt.de/~philipp/software/rw.shtml -== License == +License +------- GPL version 2 or later -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- Philipp Klaus Krause (philipp@informatik.uni-frankfurt.de) diff --git a/build/pkgs/saclib/SPKG.rst b/build/pkgs/saclib/SPKG.rst new file mode 100644 index 00000000000..ceed4811bfe --- /dev/null +++ b/build/pkgs/saclib/SPKG.rst @@ -0,0 +1,42 @@ +saclib +====== + +Description +----------- + +Saclib is a library of C programs for computer algebra derived from the +SAC2 system. It is mainly used as a dependency of qepcad. + +License +------- + +Saclib 2.2 Copyright (c) 1993, 2008, RISC-Linz (contact +wcbrown@usna.edu) + +Permission to use, copy, modify, and/or distribute this software, +including source files, README files, etc., for any purpose with or +without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Website: http://www.usna.edu/CS/qepcadweb/B/QEPCAD.html +- Alternative location (sometimes more up-to-date): + + https://www.usna.edu/Users/cs/wcbrown/qepcad/B/QEPCAD.html + +Dependencies +------------ + +None. diff --git a/build/pkgs/saclib/SPKG.txt b/build/pkgs/saclib/SPKG.txt deleted file mode 100644 index d8f6c7baf44..00000000000 --- a/build/pkgs/saclib/SPKG.txt +++ /dev/null @@ -1,35 +0,0 @@ -= saclib = - -== Description == - -Saclib is a library of C programs for computer algebra derived from the SAC2 -system. It is mainly used as a dependency of qepcad. - -== License == - -Saclib 2.2 -Copyright (c) 1993, 2008, RISC-Linz (contact wcbrown@usna.edu) - -Permission to use, copy, modify, and/or distribute this software, including -source files, README files, etc., for any purpose with or without fee is -hereby granted, provided that the above copyright notice and this permission -notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -== Upstream Contact == - -- Website: http://www.usna.edu/CS/qepcadweb/B/QEPCAD.html -- Alternative location (sometimes more up-to-date): - https://www.usna.edu/Users/cs/wcbrown/qepcad/B/QEPCAD.html - -== Dependencies == - -None. - diff --git a/build/pkgs/sage_brial/SPKG.txt b/build/pkgs/sage_brial/SPKG.rst similarity index 79% rename from build/pkgs/sage_brial/SPKG.txt rename to build/pkgs/sage_brial/SPKG.rst index 2a84cad9c4f..26e04338ccc 100644 --- a/build/pkgs/sage_brial/SPKG.txt +++ b/build/pkgs/sage_brial/SPKG.rst @@ -1,6 +1,8 @@ -= BRiAl = +BRiAl +===== -== Description == +Description +----------- BRiAl is the successor to PolyBoRi. @@ -10,10 +12,14 @@ as for the underlying polynomial rings and subsets of the powerset of the Boolean variables. This SPKG is a (sage) python wrapper around the functionality of the C++ library. -== License == +License +------- GPL version 2 or later -== Upstream Contact == +.. _upstream_contact: + +Upstream Contact +---------------- https://github.com/BRiAl/BRiAl diff --git a/build/pkgs/sagenb/SPKG.rst b/build/pkgs/sagenb/SPKG.rst new file mode 100644 index 00000000000..591d4a41aa1 --- /dev/null +++ b/build/pkgs/sagenb/SPKG.rst @@ -0,0 +1,49 @@ +.. _sage_notebook: + +Sage Notebook +============= + +Description +----------- + +The Sage Notebook is a web-based graphical user interface for +mathematical software. + +License +------- + +GPLv3+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Keshav Kini +- Homepage: https://github.com/sagemath/sagenb + +Dependencies +------------ + +Build-time dependencies: + +- Python +- setuptools +- twisted +- flask +- flask-autoindex +- flask-babel +- flask-openid +- flask-oldsessions + +Run-time dependencies: + +- Sage +- jinja2 +- pexpect +- docutils +- sphinx + +Optional dependency: + +- OpenSSL (including headers) diff --git a/build/pkgs/sagenb/SPKG.txt b/build/pkgs/sagenb/SPKG.txt deleted file mode 100644 index 92ab236a0e8..00000000000 --- a/build/pkgs/sagenb/SPKG.txt +++ /dev/null @@ -1,40 +0,0 @@ -= Sage Notebook = - -== Description == - -The Sage Notebook is a web-based graphical user interface for -mathematical software. - -== License == - -GPLv3+ - -== Upstream Contact == - - * Keshav Kini - * Homepage: https://github.com/sagemath/sagenb - -== Dependencies == - -Build-time dependencies: - - * Python - * setuptools - * twisted - * flask - - flask-autoindex - - flask-babel - - flask-openid - - flask-oldsessions - -Run-time dependencies: - - * Sage - * jinja2 - * pexpect - * docutils - * sphinx - -Optional dependency: - - * OpenSSL (including headers) diff --git a/build/pkgs/sagenb_export/SPKG.txt b/build/pkgs/sagenb_export/SPKG.rst similarity index 72% rename from build/pkgs/sagenb_export/SPKG.txt rename to build/pkgs/sagenb_export/SPKG.rst index 4c471abd0ae..8f1a7e77dd7 100644 --- a/build/pkgs/sagenb_export/SPKG.txt +++ b/build/pkgs/sagenb_export/SPKG.rst @@ -1,11 +1,13 @@ -= sagenb_export = +sagenb_export +============= -== Description == +Description +----------- This is a tool to convert SageNB notebooks to other formats, in particular IPython/Jupyter notebooks. -It includes a Jupyter notebook extension to provide a UI for the -import of SageNB notebooks. +It includes a Jupyter notebook extension to provide a UI for the import +of SageNB notebooks. https://github.com/vbraun/ExportSageNB diff --git a/build/pkgs/sagetex/SPKG.rst b/build/pkgs/sagetex/SPKG.rst new file mode 100644 index 00000000000..8946aaa632e --- /dev/null +++ b/build/pkgs/sagetex/SPKG.rst @@ -0,0 +1,66 @@ +SageTeX +======= + +Description +----------- + +The SageTeX package allows you to embed code, results of computations, +and plots from Sage into LaTeX documents. + +License +------- + +The *source code* of the SageTeX package may be redistributed and/or +modified under the terms of the GNU General Public License as published +by the Free Software Foundation, either version 2 of the License, or (at +your option) any later version. To view a copy of this license, see +http://www.gnu.org/licenses/ or send a letter to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. + +The *documentation* of the SageTeX package is licensed under the +Creative Commons Attribution-Share Alike 3.0 License. To view a copy of +this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or +send a letter to Creative Commons, 171 Second Street, Suite 300, San +Francisco, California, 94105, USA. + +.. _spkg_maintainers: + +SPKG Maintainers +---------------- + +Dan Drake (dr.dan.drake at gmail) and SageMath developers +(sage-devel@googlegroups.com) + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Dan Drake. Web: https://github.com/sagemath/sagetex + +Dependencies +------------ + +To install, nothing more than a standard Sage install. The +\`spkg-check\` script will exit without actually testing anything if it +cannot find "latex" in your path. + +Notes +----- + +To use SageTeX, both Sage and LaTeX need to know about it. SageTeX comes +standard with Sage, so you only need to make sure LaTeX can find what it +needs. Full details are in the Sage installation guide at +http://doc.sagemath.org/html/en/installation/ and +http://doc.sagemath.org/html/en/tutorial/sagetex.html . + +The directory \`$SAGE_ROOT/local/share/doc/sagetex\` contains +documentation and an example file. See +\`$SAGE_ROOT/local/share/texmf/tex/latex/sagetex\` for the source code +and some possibly useful scripts. If you have problems or suggestions +see `the sage-support +group `__. + +If you want to help develop SageTeX, please clone the github repository +(see the "Upstream Contact" above) and send me patches based on that. diff --git a/build/pkgs/sagetex/SPKG.txt b/build/pkgs/sagetex/SPKG.txt deleted file mode 100644 index e4bb1dc683f..00000000000 --- a/build/pkgs/sagetex/SPKG.txt +++ /dev/null @@ -1,56 +0,0 @@ -= SageTeX = - -== Description == - -The SageTeX package allows you to embed code, results of computations, -and plots from Sage into LaTeX documents. - -== License == - -The ''source code'' of the SageTeX package may be redistributed and/or -modified under the terms of the GNU General Public License as published -by the Free Software Foundation, either version 2 of the License, or (at -your option) any later version. To view a copy of this license, see -[[http://www.gnu.org/licenses/]] or send a letter to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. - -The ''documentation'' of the SageTeX package is licensed under the -Creative Commons Attribution-Share Alike 3.0 License. To view a copy of -this license, visit [[http://creativecommons.org/licenses/by-sa/3.0/]] -or send a letter to Creative Commons, 171 Second Street, Suite 300, San -Francisco, California, 94105, USA. - -== SPKG Maintainers == - -Dan Drake (dr.dan.drake at gmail) -and -SageMath developers (sage-devel@googlegroups.com) - -== Upstream Contact == - -Author: Dan Drake. Web: [[https://github.com/sagemath/sagetex]] - -== Dependencies == - -To install, nothing more than a standard Sage install. The -`spkg-check` script will exit without actually testing anything if -it cannot find "latex" in your path. - -== Notes == - -To use SageTeX, both Sage and LaTeX need to know about it. SageTeX comes -standard with Sage, so you only need to make sure LaTeX can find what it -needs. Full details are in the Sage installation guide at -http://doc.sagemath.org/html/en/installation/ and -http://doc.sagemath.org/html/en/tutorial/sagetex.html . - -The directory `$SAGE_ROOT/local/share/doc/sagetex` contains -documentation and an example file. See -`$SAGE_ROOT/local/share/texmf/tex/latex/sagetex` for the source code and -some possibly useful scripts. If you have problems or suggestions see -[[http://groups.google.com/group/sage-support|the sage-support group]]. - -If you want to help develop SageTeX, please clone the github -repository (see the "Upstream Contact" above) and send me -patches based on that. diff --git a/build/pkgs/scandir/SPKG.txt b/build/pkgs/scandir/SPKG.rst similarity index 76% rename from build/pkgs/scandir/SPKG.txt rename to build/pkgs/scandir/SPKG.rst index 82ac2f24bb9..99ffec860a1 100644 --- a/build/pkgs/scandir/SPKG.txt +++ b/build/pkgs/scandir/SPKG.rst @@ -1,13 +1,14 @@ -= scandir = +scandir +======= -== Description == +Description +----------- scandir, a better directory iterator and faster os.walk() scandir() is a directory iteration function like os.listdir(), except that instead of returning a list of bare filenames, it yields DirEntry -objects that include file type and stat information along with the -name. Using scandir() increases the speed of os.walk() by 2-20 times +objects that include file type and stat information along with the name. +Using scandir() increases the speed of os.walk() by 2-20 times (depending on the platform and file system) by avoiding unnecessary calls to os.stat() in most cases. - diff --git a/build/pkgs/scipoptsuite/SPKG.rst b/build/pkgs/scipoptsuite/SPKG.rst new file mode 100644 index 00000000000..e8ba93ae626 --- /dev/null +++ b/build/pkgs/scipoptsuite/SPKG.rst @@ -0,0 +1,52 @@ +scipoptsuite +============ + +Description +----------- + +SCIP is currently one of the fastest non-commercial mixed integer +programming (MIP) solvers. It is also a framework for constraint integer +programming and branch-cut-and-price. It allows total control of the +solution process and the access of detailed information down to the guts +of the solver. + +License +------- + +ZIB Academic License + +The ZIB Academic License allows the use of software distributed under +this license without charge for research purposes as a member of a +non-commercial and academic institution, e.g., a university. The +software is available with its source code. + +http://scip.zib.de/academic.txt + +.. _spkg_maintainers: + +SPKG Maintainers +---------------- + +- Martin Albrecht (original spkg) +- Matthias Koeppe (updates for new spkg style) + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://scip.zib.de/doc/html/AUTHORS.shtml + +Dependencies +------------ + +cmake + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +We do not have permission to redistribute SCIP or SoPlex. Hence, you +must download it yourself from http://scip.zib.de and put the tarball +scipoptsuite-VERSION.tgz in $SAGE_ROOT/upstream diff --git a/build/pkgs/scipoptsuite/SPKG.txt b/build/pkgs/scipoptsuite/SPKG.txt deleted file mode 100644 index d37e355813f..00000000000 --- a/build/pkgs/scipoptsuite/SPKG.txt +++ /dev/null @@ -1,38 +0,0 @@ -= scipoptsuite = - -== Description == - -SCIP is currently one of the fastest non-commercial mixed integer programming -(MIP) solvers. It is also a framework for constraint integer programming and -branch-cut-and-price. It allows total control of the solution process and the -access of detailed information down to the guts of the solver. - -== License == - -ZIB Academic License - -The ZIB Academic License allows the use of software distributed under this -license without charge for research purposes as a member of a non-commercial and -academic institution, e.g., a university. The software is available with its -source code. - -http://scip.zib.de/academic.txt - -== SPKG Maintainers == - -* Martin Albrecht (original spkg) -* Matthias Koeppe (updates for new spkg style) - -== Upstream Contact == - -http://scip.zib.de/doc/html/AUTHORS.shtml - -== Dependencies == - -cmake - -== Special Update/Build Instructions == - -We do not have permission to redistribute SCIP or SoPlex. Hence, you -must download it yourself from http://scip.zib.de and put the tarball -scipoptsuite-VERSION.tgz in $SAGE_ROOT/upstream diff --git a/build/pkgs/scipy/SPKG.rst b/build/pkgs/scipy/SPKG.rst new file mode 100644 index 00000000000..916063b309f --- /dev/null +++ b/build/pkgs/scipy/SPKG.rst @@ -0,0 +1,43 @@ +scipy +===== + +Description +----------- + +SciPy (pronounced "Sigh Pie") is open-source software for mathematics, +science, and engineering. The SciPy library depends on NumPy, which +provides convenient and fast N-dimensional array manipulation. The SciPy +library is built to work with NumPy arrays, and provides many +user-friendly and efficient numerical routines such as routines for +numerical integration and optimization. Together, they run on all +popular operating systems, are quick to install, and are free of charge. +NumPy and SciPy are easy to use, but powerful enough to be depended upon +by some of the world's leading scientists and engineers. + +License +------- + +SciPy's license is free for both commercial and non-commercial use, +under the BSD terms. See http://www.scipy.org/License_Compatibility + +.. _upstream_contact: + +Upstream Contact +---------------- + + http://www.scipy.org/ + +Dependencies +------------ + +- Python, which in Sage has numerous dependencies +- Numpy +- Fortran +- GNU patch + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- None. diff --git a/build/pkgs/scipy/SPKG.txt b/build/pkgs/scipy/SPKG.txt deleted file mode 100644 index 9754f5f9f70..00000000000 --- a/build/pkgs/scipy/SPKG.txt +++ /dev/null @@ -1,28 +0,0 @@ -= scipy = - -== Description == -SciPy (pronounced "Sigh Pie") is open-source software for mathematics, -science, and engineering. The SciPy library depends on NumPy, which provides -convenient and fast N-dimensional array manipulation. The SciPy library is -built to work with NumPy arrays, and provides many user-friendly and efficient -numerical routines such as routines for numerical integration and optimization. -Together, they run on all popular operating systems, are quick to install, and -are free of charge. NumPy and SciPy are easy to use, but powerful enough to be -depended upon by some of the world's leading scientists and engineers. - -== License == -SciPy's license is free for both commercial and non-commercial use, under the -BSD terms. See http://www.scipy.org/License_Compatibility - -== Upstream Contact == - http://www.scipy.org/ - -== Dependencies == - * Python, which in Sage has numerous dependencies - * Numpy - * Fortran - * GNU patch - -== Special Update/Build Instructions == - * None. - diff --git a/build/pkgs/scons/SPKG.rst b/build/pkgs/scons/SPKG.rst new file mode 100644 index 00000000000..3ed849e9f6c --- /dev/null +++ b/build/pkgs/scons/SPKG.rst @@ -0,0 +1,31 @@ +SCons +===== + +Description +----------- + +SCons is an Open Source software construction tool—that is, a +next-generation build tool. Think of SCons as an improved, +cross-platform substitute for the classic Make utility with integrated +functionality similar to autoconf/automake and compiler caches such as +ccache. In short, SCons is an easier, more reliable and faster way to +build software. + +Website: http://www.scons.org/ + +License +------- + +X/MIT + +.. _upstream_contact: + +Upstream Contact +---------------- + +- SCons mailing lists - see http://www.scons.org/lists.php + +Dependencies +------------ + +- Python diff --git a/build/pkgs/scons/SPKG.txt b/build/pkgs/scons/SPKG.txt deleted file mode 100644 index bad9e3a9bf9..00000000000 --- a/build/pkgs/scons/SPKG.txt +++ /dev/null @@ -1,18 +0,0 @@ -= SCons = - -== Description == - -SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software. - -Website: http://www.scons.org/ - -== License == - -X/MIT - -== Upstream Contact == - * SCons mailing lists - see http://www.scons.org/lists.php - -== Dependencies == - * Python - diff --git a/build/pkgs/send2trash/SPKG.txt b/build/pkgs/send2trash/SPKG.rst similarity index 93% rename from build/pkgs/send2trash/SPKG.txt rename to build/pkgs/send2trash/SPKG.rst index d829cf1573b..83784265b8c 100644 --- a/build/pkgs/send2trash/SPKG.txt +++ b/build/pkgs/send2trash/SPKG.rst @@ -1,6 +1,8 @@ -= Send2Trash = +Send2Trash +========== -== Description == +Description +----------- Send file to trash natively under Mac OS X, Windows and Linux. diff --git a/build/pkgs/setuptools/SPKG.rst b/build/pkgs/setuptools/SPKG.rst new file mode 100644 index 00000000000..a70c2c53cd6 --- /dev/null +++ b/build/pkgs/setuptools/SPKG.rst @@ -0,0 +1,44 @@ +setuptools +========== + +Description +----------- + +setuptools is a collection of enhancements to the Python distutils (for +Python 2.6 and up) that allow you to more easily build and distribute +Python packages, especially ones that have dependencies on other +packages. + +Website: http://pypi.python.org/pypi/setuptools/ + +License +------- + +PSF or ZPL. i.e Python Software Foundation License or Zope Public +License + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Phillip J. Eby (distutils-sig@python org) + +Dependencies +------------ + +- python + +.. _build_instructionschanges: + +Build Instructions/Changes +-------------------------- + +The following patches are in the patches subdirectory. The patches are +applied during the build process. + +- pkg_resources.py.patch: silence warning about permissions. + +- easy_install_lock.patch: lock the easy_install.pth file to allow + + simultaneous installation diff --git a/build/pkgs/setuptools/SPKG.txt b/build/pkgs/setuptools/SPKG.txt deleted file mode 100644 index 39446467083..00000000000 --- a/build/pkgs/setuptools/SPKG.txt +++ /dev/null @@ -1,30 +0,0 @@ -= setuptools = - -== Description == - -setuptools is a collection of enhancements to the Python distutils (for -Python 2.6 and up) that allow you to more easily build and distribute -Python packages, especially ones that have dependencies on other packages. - -Website: http://pypi.python.org/pypi/setuptools/ - -== License == - -PSF or ZPL. i.e Python Software Foundation License or Zope Public License - -== Upstream Contact == - * Phillip J. Eby (distutils-sig@python org) - -== Dependencies == - * python - -== Build Instructions/Changes == - -The following patches are in the patches subdirectory. -The patches are applied during the build process. - - * pkg_resources.py.patch: silence warning about permissions. - - * easy_install_lock.patch: lock the easy_install.pth file to allow - simultaneous installation - diff --git a/build/pkgs/setuptools_scm/SPKG.txt b/build/pkgs/setuptools_scm/SPKG.rst similarity index 51% rename from build/pkgs/setuptools_scm/SPKG.txt rename to build/pkgs/setuptools_scm/SPKG.rst index 23567beee69..4ed3f3da711 100644 --- a/build/pkgs/setuptools_scm/SPKG.txt +++ b/build/pkgs/setuptools_scm/SPKG.rst @@ -1,5 +1,7 @@ -= setuptools_scm = +setuptools_scm +============== -== Description == +Description +----------- the blessed package to manage your versions by scm tags diff --git a/build/pkgs/simplegeneric/SPKG.txt b/build/pkgs/simplegeneric/SPKG.rst similarity index 50% rename from build/pkgs/simplegeneric/SPKG.txt rename to build/pkgs/simplegeneric/SPKG.rst index 0fa7cf0a667..82b468c52ff 100644 --- a/build/pkgs/simplegeneric/SPKG.txt +++ b/build/pkgs/simplegeneric/SPKG.rst @@ -1,15 +1,18 @@ -= simplegeneric = +simplegeneric +============= -== Description == +Description +----------- -Simple generic functions (similar to Python's own len(), pickle.dump(), etc.) +Simple generic functions (similar to Python's own len(), pickle.dump(), +etc.) The simplegeneric module lets you define simple single-dispatch generic -functions, akin to Python's built-in generic functions like len() -iter() and so on. However, instead of using specially-named methods, -these generic functions use simple lookup tables, akin to those used by -e.g. pickle.dump() and other generic functions found in the Python -standard library. +functions, akin to Python's built-in generic functions like len() iter() +and so on. However, instead of using specially-named methods, these +generic functions use simple lookup tables, akin to those used by e.g. +pickle.dump() and other generic functions found in the Python standard +library. As you can see from the above examples, generic functions are actually quite common in Python already, but there is no standard way to create @@ -17,9 +20,9 @@ simple ones. This library attempts to fill that gap, as generic functions are an excellent alternative to the Visitor pattern, as well as being a great substitute for most common uses of adaptation. -This library tries to be the simplest possible implementation of -generic functions, and it therefore eschews the use of multiple or -predicate dispatch, as well as avoiding speedup techniques such as C -dispatching or code generation. But it has absolutely no dependencies, -other than Python 2.4, and the implementation is just a single Python -module of less than 100 lines. +This library tries to be the simplest possible implementation of generic +functions, and it therefore eschews the use of multiple or predicate +dispatch, as well as avoiding speedup techniques such as C dispatching +or code generation. But it has absolutely no dependencies, other than +Python 2.4, and the implementation is just a single Python module of +less than 100 lines. diff --git a/build/pkgs/singledispatch/SPKG.rst b/build/pkgs/singledispatch/SPKG.rst new file mode 100644 index 00000000000..b280d9e4807 --- /dev/null +++ b/build/pkgs/singledispatch/SPKG.rst @@ -0,0 +1,26 @@ +singledispatch +============== + +Description +----------- + +This library brings functools.singledispatch from Python 3.4 to Python +2.6-3.3. + +License +------- + +MIT License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Łukasz Langa Home page: +http://docs.python.org/3/library/functools.html#functools.singledispatch + +Dependencies +------------ + +Python diff --git a/build/pkgs/singledispatch/SPKG.txt b/build/pkgs/singledispatch/SPKG.txt deleted file mode 100644 index b4e1bf97614..00000000000 --- a/build/pkgs/singledispatch/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= singledispatch = - -== Description == - -This library brings functools.singledispatch from Python 3.4 to -Python 2.6-3.3. - -== License == - -MIT License - -== Upstream Contact == - -Author: Łukasz Langa -Home page: http://docs.python.org/3/library/functools.html#functools.singledispatch - -== Dependencies == - -Python - diff --git a/build/pkgs/singular/SPKG.rst b/build/pkgs/singular/SPKG.rst new file mode 100644 index 00000000000..bbaa7366947 --- /dev/null +++ b/build/pkgs/singular/SPKG.rst @@ -0,0 +1,48 @@ +Singular +======== + +Description +----------- + +Singular is a computer algebra system for polynomial computations, with +special emphasis on commutative and non-commutative algebra, algebraic +geometry, and singularity theory. + +License +------- + +GPLv2 or GPLv3 + +.. _upstream_contact: + +Upstream Contact +---------------- + +libsingular-devel@mathematik.uni-kl.de + +http://www.singular.uni-kl.de/ + +Dependencies +------------ + +- GNU patch +- readline +- GMP/MPIR +- MPFR +- NTL +- FLINT + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +See spkg-src to create the source tarball. + +Other notes: + +- If the environment variable SAGE_DEBUG is set to "yes", then + + omalloc will be replaced by xalloc. The resulting Singular executable + and libsingular library will be slower than with omalloc, but allow + for easier debugging of memory corruptions. diff --git a/build/pkgs/singular/SPKG.txt b/build/pkgs/singular/SPKG.txt deleted file mode 100644 index 6dc588577ba..00000000000 --- a/build/pkgs/singular/SPKG.txt +++ /dev/null @@ -1,36 +0,0 @@ -= Singular = - -== Description == - -Singular is a computer algebra system for polynomial computations, -with special emphasis on commutative and non-commutative algebra, -algebraic geometry, and singularity theory. - -== License == - -GPLv2 or GPLv3 - -== Upstream Contact == - -libsingular-devel@mathematik.uni-kl.de - -http://www.singular.uni-kl.de/ - -== Dependencies == - -* GNU patch -* readline -* GMP/MPIR -* MPFR -* NTL -* FLINT - -== Special Update/Build Instructions == - -See spkg-src to create the source tarball. - -Other notes: - * If the environment variable SAGE_DEBUG is set to "yes", then - omalloc will be replaced by xalloc. The resulting Singular executable - and libsingular library will be slower than with omalloc, but allow - for easier debugging of memory corruptions. diff --git a/build/pkgs/singular_jupyter/SPKG.rst b/build/pkgs/singular_jupyter/SPKG.rst new file mode 100644 index 00000000000..644f88c69b3 --- /dev/null +++ b/build/pkgs/singular_jupyter/SPKG.rst @@ -0,0 +1,23 @@ +.. _jupyter_kernel_singular: + +jupyter-kernel-singular +======================= + +Description +----------- + +A Jupyter kernel for singular + +This is a beta version of a jupyter kernel for Singular. + +License +------- + +GPL version 2 or later + +.. _upstream_contact: + +Upstream Contact +---------------- + +- https://github.com/sebasguts/jupyter_kernel_singular diff --git a/build/pkgs/singular_jupyter/SPKG.txt b/build/pkgs/singular_jupyter/SPKG.txt deleted file mode 100644 index ced40f28a9e..00000000000 --- a/build/pkgs/singular_jupyter/SPKG.txt +++ /dev/null @@ -1,15 +0,0 @@ -= jupyter-kernel-singular = - -== Description == - -A Jupyter kernel for singular - -This is a beta version of a jupyter kernel for Singular. - -== License == - -GPL version 2 or later - -== Upstream Contact == - -* https://github.com/sebasguts/jupyter_kernel_singular diff --git a/build/pkgs/sip/SPKG.rst b/build/pkgs/sip/SPKG.rst new file mode 100644 index 00000000000..dff5a6590ca --- /dev/null +++ b/build/pkgs/sip/SPKG.rst @@ -0,0 +1,25 @@ +SIP +=== + +Description +----------- + +Python extension module generator for C and C++ libraries + +.. _upstream_contact: + +Upstream contact +---------------- + + https://www.riverbankcomputing.com/software/sip/ + https://pypi.python.org/pypi/SIP + +License +------- + + SIP is released under the GPL v2, GPL v3 licenses, and under a + license + similar to the BSD license. + + SIP is copyright (c) Riverbank Computing Limited. Its homepage is + https://www.riverbankcomputing.com/software/sip/. diff --git a/build/pkgs/sip/SPKG.txt b/build/pkgs/sip/SPKG.txt deleted file mode 100644 index d253236fc9b..00000000000 --- a/build/pkgs/sip/SPKG.txt +++ /dev/null @@ -1,18 +0,0 @@ -= SIP = - -== Description == - -Python extension module generator for C and C++ libraries - -== Upstream contact == - - https://www.riverbankcomputing.com/software/sip/ - https://pypi.python.org/pypi/SIP - -== License == - - SIP is released under the GPL v2, GPL v3 licenses, and under a license - similar to the BSD license. - - SIP is copyright (c) Riverbank Computing Limited. Its homepage is - https://www.riverbankcomputing.com/software/sip/. diff --git a/build/pkgs/sirocco/SPKG.rst b/build/pkgs/sirocco/SPKG.rst new file mode 100644 index 00000000000..61c659e3d7d --- /dev/null +++ b/build/pkgs/sirocco/SPKG.rst @@ -0,0 +1,32 @@ +SIROCCO +======= + +Description +----------- + +sirocco is a library to compute topologically certified root +continuation of bivariate polynomials. + +License +------- + +GPLv3+ + +.. _spkg_maintainers: + +SPKG Maintainers +---------------- + +- Miguel Marco + +.. _upstream_contact: + +Upstream Contact +---------------- + +Miguel Marco (mmarco@unizar.es) + +Dependencies +------------ + +- gcc diff --git a/build/pkgs/sirocco/SPKG.txt b/build/pkgs/sirocco/SPKG.txt deleted file mode 100644 index 7110501049d..00000000000 --- a/build/pkgs/sirocco/SPKG.txt +++ /dev/null @@ -1,21 +0,0 @@ -= SIROCCO = - -== Description == - -sirocco is a library to compute topologically certified root continuation of bivariate polynomials. - -== License == - -GPLv3+ - -== SPKG Maintainers == - -* Miguel Marco - -== Upstream Contact == - -Miguel Marco (mmarco@unizar.es) - -== Dependencies == - -* gcc diff --git a/build/pkgs/six/SPKG.rst b/build/pkgs/six/SPKG.rst new file mode 100644 index 00000000000..58ed0809857 --- /dev/null +++ b/build/pkgs/six/SPKG.rst @@ -0,0 +1,24 @@ +six +=== + +Description +----------- + +Python 2 and 3 compatibility utilities + +License +------- + +MIT License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Benjamin Peterson Home page: http://pypi.python.org/pypi/six/ + +Dependencies +------------ + +Python diff --git a/build/pkgs/six/SPKG.txt b/build/pkgs/six/SPKG.txt deleted file mode 100644 index e0601654686..00000000000 --- a/build/pkgs/six/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= six = - -== Description == - -Python 2 and 3 compatibility utilities - -== License == - -MIT License - -== Upstream Contact == - -Author: Benjamin Peterson -Home page: http://pypi.python.org/pypi/six/ - -== Dependencies == - -Python - diff --git a/build/pkgs/snowballstemmer/SPKG.rst b/build/pkgs/snowballstemmer/SPKG.rst new file mode 100644 index 00000000000..33e199a1b26 --- /dev/null +++ b/build/pkgs/snowballstemmer/SPKG.rst @@ -0,0 +1,29 @@ +snowballstemmer +=============== + +Description +----------- + +This package provides 16 stemmer algorithms (15 + Poerter English +stemmer) generated from Snowball algorithms. + +It includes following language algorithms: + + Danish + Dutch + English (Standard, Porter) + Finnish + French + German + Hungarian + Italian + Norwegian + Portuguese + Romanian + Russian + Spanish + Swedish + Turkish + +This is a pure Python stemming library. If PyStemmer is available, this +module uses it to accelerate. diff --git a/build/pkgs/snowballstemmer/SPKG.txt b/build/pkgs/snowballstemmer/SPKG.txt deleted file mode 100644 index 8a649d28043..00000000000 --- a/build/pkgs/snowballstemmer/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= snowballstemmer = - -== Description == - -This package provides 16 stemmer algorithms (15 + Poerter English stemmer) generated from Snowball algorithms. - -It includes following language algorithms: - - Danish - Dutch - English (Standard, Porter) - Finnish - French - German - Hungarian - Italian - Norwegian - Portuguese - Romanian - Russian - Spanish - Swedish - Turkish - -This is a pure Python stemming library. If PyStemmer is available, this module uses it to accelerate. diff --git a/build/pkgs/speaklater/SPKG.rst b/build/pkgs/speaklater/SPKG.rst new file mode 100644 index 00000000000..1427f283d7d --- /dev/null +++ b/build/pkgs/speaklater/SPKG.rst @@ -0,0 +1,14 @@ +speaklater +========== + +Description +----------- + +Implements a lazy string for python useful for use with gettext + +A module that provides lazy strings for translations. Basically you get +an object that appears to be a string but changes the value every time +the value is evaluated based on a callable you provide. + +For example you can have a global lazy_gettext function that returns a +lazy string with the value of the current set language. diff --git a/build/pkgs/speaklater/SPKG.txt b/build/pkgs/speaklater/SPKG.txt deleted file mode 100644 index 3143efa59f3..00000000000 --- a/build/pkgs/speaklater/SPKG.txt +++ /dev/null @@ -1,12 +0,0 @@ -= speaklater = - -== Description == - -Implements a lazy string for python useful for use with gettext - -A module that provides lazy strings for translations. Basically you get an -object that appears to be a string but changes the value every time the value -is evaluated based on a callable you provide. - -For example you can have a global lazy_gettext function that returns a lazy -string with the value of the current set language. diff --git a/build/pkgs/sphinx/SPKG.rst b/build/pkgs/sphinx/SPKG.rst new file mode 100644 index 00000000000..6de2f8af5c6 --- /dev/null +++ b/build/pkgs/sphinx/SPKG.rst @@ -0,0 +1,50 @@ +Sphinx +====== + +Description +----------- + +Sphinx is a tool that makes it easy to create intelligent and beautiful +documentation for Python projects (or other documents consisting of +multiple reStructuredText sources), written by Georg Brandl. It was +originally created to translate the new Python documentation, but has +now been cleaned up in the hope that it will be useful to many other +projects. + +License +------- + +Modified BSD; see e.g. its egg-info file for other options + +.. _upstream_contact: + +Upstream Contact +---------------- + +Author: Georg Brandl Home Page: http://sphinx.pocoo.org, + + see also http://pypi.python.org/pypi/Sphinx + +Dependencies +------------ + +- six >= 1.4 +- Jinja2 >= 2.3 +- Pygments >= 2.0 +- docutils >= 0.11 +- snowballstemmer >= 1.1 +- babel >= 1.3 +- setuptools / distribute +- Python +- GNU patch (shipped with Sage) + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- The script create_grammar_pickle.py creates the file + + Grammar2.7.pickle in site-packages/Sphinx-.../sphinx/pycode/. This + helps to avoid race conditions when building the documentation in + parallel. diff --git a/build/pkgs/sphinx/SPKG.txt b/build/pkgs/sphinx/SPKG.txt deleted file mode 100644 index fce17ba0963..00000000000 --- a/build/pkgs/sphinx/SPKG.txt +++ /dev/null @@ -1,38 +0,0 @@ -= Sphinx = - -== Description == - -Sphinx is a tool that makes it easy to create intelligent and -beautiful documentation for Python projects (or other documents -consisting of multiple reStructuredText sources), written by Georg -Brandl. It was originally created to translate the new Python -documentation, but has now been cleaned up in the hope that it will be -useful to many other projects. - -== License == - -Modified BSD; see e.g. its egg-info file for other options - -== Upstream Contact == - -Author: Georg Brandl -Home Page: http://sphinx.pocoo.org, - see also http://pypi.python.org/pypi/Sphinx - -== Dependencies == - * six >= 1.4 - * Jinja2 >= 2.3 - * Pygments >= 2.0 - * docutils >= 0.11 - * snowballstemmer >= 1.1 - * babel >= 1.3 - * setuptools / distribute - * Python - * GNU patch (shipped with Sage) - -== Special Update/Build Instructions == - - * The script create_grammar_pickle.py creates the file - Grammar2.7.pickle in site-packages/Sphinx-.../sphinx/pycode/. This - helps to avoid race conditions when building the documentation in - parallel. diff --git a/build/pkgs/sphinxcontrib_websupport/SPKG.rst b/build/pkgs/sphinxcontrib_websupport/SPKG.rst new file mode 100644 index 00000000000..59ec5963136 --- /dev/null +++ b/build/pkgs/sphinxcontrib_websupport/SPKG.rst @@ -0,0 +1,17 @@ +.. _sphinxcontrib_websupport: + +sphinxcontrib-websupport +======================== + +Description +----------- + +Sphinx API for Web Apps + +sphinxcontrib-webuspport provides a Python API to easily integrate +Sphinx documentation into your Web application. + +License +------- + +BSD diff --git a/build/pkgs/sphinxcontrib_websupport/SPKG.txt b/build/pkgs/sphinxcontrib_websupport/SPKG.txt deleted file mode 100644 index cda85a6edf6..00000000000 --- a/build/pkgs/sphinxcontrib_websupport/SPKG.txt +++ /dev/null @@ -1,12 +0,0 @@ -= sphinxcontrib-websupport = - -== Description == - -Sphinx API for Web Apps - -sphinxcontrib-webuspport provides a Python API to easily integrate Sphinx -documentation into your Web application. - -== License == - -BSD diff --git a/build/pkgs/sqlite/SPKG.rst b/build/pkgs/sqlite/SPKG.rst new file mode 100644 index 00000000000..2cf982ee620 --- /dev/null +++ b/build/pkgs/sqlite/SPKG.rst @@ -0,0 +1,32 @@ +SQLite +====== + +Description +----------- + +SQLite is a software library that implements a self-contained, +serverless, zero-configuration, transactional SQL database engine. + +License +------- + +Public Domain + +.. _upstream_contact: + +Upstream contact +---------------- + +- http://www.sqlite.org + +Dependencies +------------ + +- readline + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- Use the autoconf version of sqlite. diff --git a/build/pkgs/sqlite/SPKG.txt b/build/pkgs/sqlite/SPKG.txt deleted file mode 100644 index 23698c87b59..00000000000 --- a/build/pkgs/sqlite/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= SQLite = - -== Description == - -SQLite is a software library that implements a self-contained, -serverless, zero-configuration, transactional SQL database engine. - -== License == - -Public Domain - -== Upstream contact == - - * http://www.sqlite.org - -== Dependencies == - -* readline - -== Special Update/Build Instructions == - -* Use the autoconf version of sqlite. diff --git a/build/pkgs/subprocess32/SPKG.txt b/build/pkgs/subprocess32/SPKG.rst similarity index 57% rename from build/pkgs/subprocess32/SPKG.txt rename to build/pkgs/subprocess32/SPKG.rst index 0bacc96c8a1..79ec8a9aac1 100644 --- a/build/pkgs/subprocess32/SPKG.txt +++ b/build/pkgs/subprocess32/SPKG.rst @@ -1,5 +1,7 @@ -= subprocess32 = +subprocess32 +============ -== Description == +Description +----------- A backport of the subprocess module from Python 3 for use on 2.x diff --git a/build/pkgs/suitesparse/SPKG.rst b/build/pkgs/suitesparse/SPKG.rst new file mode 100644 index 00000000000..aae9ddf929e --- /dev/null +++ b/build/pkgs/suitesparse/SPKG.rst @@ -0,0 +1,1315 @@ +SuiteSpare is a collection of software to deal with sparse matrix. It is +hosted at http://faculty.cse.tamu.edu/davis/suitesparse.html + +This spkg does a minimal install of suitesparse disabling the following + +- metis +- GraphBLAS (need cmake) +- Mongoose (need cmake) + +An external metis package can be used but we just disable its use. + +Patches: + +- The first patch disable the building of package using cmake. +- The second patch make sure we use sage's blas/lapack on OS X. By + default + +suitesparse discard any configurations to use the accelerate framework. + +The building of metis is diabled by passing MY_METIS_LIB=none to make +(any value would have done) We also configure cholmod so it doesn't +require metis by passing CHOLMOD_CONFIG=-DNPARTITION to make. + +Other configurations are self explanatory. + +License: because SuiteSparse is a collection, it comes with a variety of +licenses. Find below a copy of the "LICENSES.txt" shipped with +SuiteSparse. + +> AMD/Doc/License.txt < +----------------------- + + AMD, Copyright (c), 1996-2015, Timothy A. Davis, + Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. + + Availability: + + http://www.suitesparse.com + +- + + -------------- + + AMD License: BSD 3-clause: + +- + + -------------- + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +> BTF/Doc/License.txt < +----------------------- + + BTF, Copyright (C) 2004-2013, University of Florida + by Timothy A. Davis and Ekanathan Palamadai. + BTF is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + +- + + -------------- + + BTF is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + BTF is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +> CAMD/Doc/License.txt < +------------------------ + + CAMD, Copyright (c) by Timothy A. Davis, + Yanqing Chen, + Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. + CAMD is available under alternate licenses, contact T. Davis for + details. + + CAMD License: BSD 3-clause + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + + Availability: + + http://www.suitesparse.com + +> CCOLAMD/Doc/License.txt < +--------------------------- + + CCOLAMD: constrained column approximate minimum degree ordering + Copyright (C) 2005-2016, Univ. of Florida. Authors: Timothy A. Davis, + Sivasankaran Rajamanickam, and Stefan Larimore. Closely based on + COLAMD by + Davis, Stefan Larimore, in collaboration with Esmond Ng, and John + Gilbert. + http://www.suitesparse.com + +- + + -------------- + + CCOLAMD license: BSD 3-clause: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +- + + -------------- + +> CHOLMOD/Doc/License.txt < +--------------------------- + +- + + -------------- + + ==> Check/License.txt <== + +- + + -------------- + + CHOLMOD/Check Module. Copyright (C) 2005-2006, Timothy A. Davis + CHOLMOD is + also available under other licenses; contact authors for details. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Check module only. + All CHOLMOD modules are licensed separately. + +- + + -------------- + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +- + + -------------- + + ==> Cholesky/License.txt <== + +- + + -------------- + + CHOLMOD/Cholesky module, Copyright (C) 2005-2006, Timothy A. Davis. + CHOLMOD is also available under other licenses; contact authors for + details. http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Cholesky module only. + All CHOLMOD modules are licensed separately. + +- + + -------------- + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +- + + -------------- + + ==> Core/License.txt <== + +- + + -------------- + + CHOLMOD/Core Module. Copyright (C) 2005-2006, Univ. of Florida. + Author: + Timothy A. Davis. CHOLMOD is also available under other licenses; + contact + authors for details. http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Core module only. + All CHOLMOD modules are licensed separately. + +- + + -------------- + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +- + + -------------- + + ==> Demo/License.txt <== + +- + + -------------- + + CHOLMOD/Demo Module. Copyright (C) 2005-2006, Timothy A. Davis. + CHOLMOD + is also available under other licenses; contact authors for details. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Demo module only. + All CHOLMOD modules are licensed separately. + +- + + -------------- + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + +- + + -------------- + + ==> Include/License.txt <== + +- + + -------------- + + CHOLMOD/Include/\* files. Copyright (C) 2005-2006, either Univ. of + Florida + or T. Davis, depending on the file. + + Each file is licensed separately, according to the Module for which + it + contains definitions and prototypes: + + Include/cholmod.h LGPL + Include/cholmod_blas.h LGPL + Include/cholmod_camd.h part of Partition module + Include/cholmod_check.h part of Check module + Include/cholmod_cholesky.h part of Cholesky module + Include/cholmod_complexity.h LGPL + Include/cholmod_config.h LGPL + Include/cholmod_core.h part of Core module + Include/cholmod_function.h no license; freely usable, no restrictions + Include/cholmod_gpu.h part of GPU module + Include/cholmod_gpu_kernels.h part of GPU module + Include/cholmod_internal.h LGPL + Include/cholmod_io64.h LGPL + Include/cholmod_matrixops.h part of MatrixOps module + Include/cholmod_modify.h part of Modify module + Include/cholmod_partition.h part of Partition module + Include/cholmod_supernodal.h part of Supernodal module + Include/cholmod_template.h LGPL + +- + + -------------- + + ==> MATLAB/License.txt <== + +- + + -------------- + + CHOLMOD/MATLAB Module. Copyright (C) 2005-2006, Timothy A. Davis. + CHOLMOD + is also available under other licenses; contact authors for details. + MATLAB(tm) is a Registered Trademark of The MathWorks, Inc. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/MATLAB module only. + All CHOLMOD modules are licensed separately. + +- + + -------------- + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + +- + + -------------- + + ==> MatrixOps/License.txt <== + +- + + -------------- + + CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis. + CHOLMOD is also available under other licenses; contact authors for + details. http://www.suitesparse.com + + Note that this license is for the CHOLMOD/MatrixOps module only. + All CHOLMOD modules are licensed separately. + +- + + -------------- + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + +- + + -------------- + + ==> Modify/License.txt <== + +- + + -------------- + + CHOLMOD/Modify Module. Copyright (C) 2005-2006, Timothy A. Davis and + William W. Hager. CHOLMOD is also available under other licenses; + contact + authors for details. http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Modify module only. + All CHOLMOD modules are licensed separately. + +- + + -------------- + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + +- + + -------------- + + ==> Partition/License.txt <== + +- + + -------------- + + CHOLMOD/Partition Module. + Copyright (C) 2005-2006, Univ. of Florida. Author: Timothy A. Davis + CHOLMOD is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Partition module only. + All CHOLMOD modules are licensed separately. + +- + + -------------- + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +- + + -------------- + + ==> Supernodal/License.txt <== + +- + + -------------- + + CHOLMOD/Supernodal Module. + Copyright (C) 2005-2006, Timothy A. Davis + CHOLMOD is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Supernodal module only. + All CHOLMOD modules are licensed separately. + +- + + -------------- + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + +- + + -------------- + + ==> Tcov/License.txt <== + +- + + -------------- + + CHOLMOD/Tcov Module. Copyright (C) 2005-2006, Timothy A. Davis + CHOLMOD is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Tcov module only. + All CHOLMOD modules are licensed separately. + +- + + -------------- + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + +- + + -------------- + + ==> Valgrind/License.txt <== + +- + + -------------- + + CHOLMOD/Valgrind Module. Copyright (C) 2005-2006, Timothy A. Davis. + CHOLMOD is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + + Note that this license is for the CHOLMOD/Valgrind module only. + All CHOLMOD modules are licensed separately. + +- + + -------------- + + This Module is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This Module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + +> COLAMD/Doc/License.txt < +-------------------------- + + COLAMD, Copyright 1998-2016, Timothy A. Davis. + http://www.suitesparse.com + http://www.suitesparse.com + + COLAMD License: BSD 3-clause + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +> CSparse/Doc/License.txt < +--------------------------- + + CSparse: a Concise Sparse matrix package. + Copyright (c) 2006, Timothy A. Davis. + http://www.suitesparse.com + +- + + -------------- + + CSparse is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + CSparse is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +> CXSparse/Doc/License.txt < +---------------------------- + + CXSparse: a Concise Sparse matrix package - Extended. + Copyright (c) 2006, Timothy A. Davis. + http://www.suitesparse.com + +- + + -------------- + + CXSparse is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + CXSparse is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +> CXSparse_newfiles/Doc/License.txt < +------------------------------------- + + CXSparse: a Concise Sparse matrix package - Extended. + Copyright (c) 2006, Timothy A. Davis. + http://www.suitesparse.com + +- + + -------------- + + CXSparse is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + CXSparse is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +> GPUQREngine/Doc/License.txt < +------------------------------- + + GPUQREngine Copyright (c) 2013, Timothy A. Davis, Sencer Nuri + Yeralan, + and Sanjay Ranka. + http://www.suitesparse.com + + GPUQREngine is free software; you can redistribute it and/or modify + it under + the terms of the GNU General Public License as published by the Free + Software + Foundation; either version 2 of the License, or (at your option) any + later + version. + + GPUQREngine is distributed in the hope that it will be useful, but + WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. + + You should have received a copy of the GNU General Public License + along with + this Module; if not, write to the Free Software Foundation, Inc., 51 + Franklin + Street, Fifth Floor, Boston, MA 02110-1301, USA. + +> KLU/Doc/License.txt < +----------------------- + + KLU, Copyright (C) 2004-2013, University of Florida + by Timothy A. Davis and Ekanathan Palamadai. + KLU is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + +- + + -------------- + + KLU is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + KLU is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +> LDL/Doc/License.txt < +----------------------- + + LDL Copyright (c) 2005-2013 by Timothy A. Davis. + LDL is also available under other licenses; contact the author for + details. + http://www.suitesparse.com + +- + + -------------- + + LDL is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + LDL is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + +> MATLAB_Tools/Doc/License.txt < +-------------------------------- + + The MATLAB_Tools collection of packages is + Copyright (c), Timothy A. Davis, All Rights Reserved, + with the exception of the spqr_rank package, which is + Copyright (c), Timothy A. Davis and Les Foster, All Rights Reserved, + + All packages are available under alternative licenses. + Contact the authors for details. + +- + + -------------- + + MATLAB_Tools License, with the exception of SSMULT and + SuiteSparseCollection: + +- + + -------------- + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +- + + -------------- + + SuiteSparseCollection License: + +- + + -------------- + + SuiteSparseCollection is free software; you can redistribute it + and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + SuiteSparseCollection is distributed in the hope that it will be + useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +- + + -------------- + + SSMULT License: + +- + + -------------- + + SSMULT, Copyright (c) 2007-2011, Timothy A. Davis, + http://www.suitesparse.com. + + SSMULT is free software; you can redistribute it and/or modify it + under the + terms of the GNU General Public License as published by the Free + Software + Foundation; either version 2 of the License, or (at your option) any + later + version. + + SSMULT is distributed in the hope that it will be useful, but WITHOUT + ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + details. + + You should have received a copy of the GNU General Public License + along + with this package; if not, write to the Free Software Foundation, + Inc., 51 + Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +> RBio/Doc/License.txt < +------------------------ + + RBio toolbox. Copyright (C) 2006-2009, Timothy A. Davis + RBio is also available under other licenses; contact authors for + details. + http://www.suitesparse.com + +- + + -------------- + + RBio is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + RBio is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this Module; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + +> SPQR/Doc/License.txt < +------------------------ + + SPQR, Copyright 2008-2016 by Timothy A. Davis. + All Rights Reserved. + SPQR is available under alternate licenses, contact T. Davis for + details. + + SPQR License: + + Your use or distribution of SPQR or any modified version of + SPQR implies that you agree to this License. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + + Permission is hereby granted to use or copy this program under the + terms of the GNU GPL, provided that the Copyright, this License, + and the Availability of the original version is retained on all + copies. + User documentation of any code that uses this code or any modified + version of this code must cite the Copyright, this License, the + Availability note, and "Used by permission." Permission to modify + the code and to distribute modified code is granted, provided the + Copyright, this License, and the Availability note are retained, + and a notice that the code was modified is included. + + Availability: + + http://www.suitesparse.com + +> SuiteSparse_GPURuntime/Doc/License.txt < +------------------------------------------ + + SuiteSparse_GPURuntime Copyright (c) 2013-2016, Timothy A. Davis, + Sencer Nuri Yeralan, and Sanjay Ranka. http://www.suitesparse.com + +- + + -------------- + + SuiteSparse_GPURuntime is free software; you can redistribute it + and/or modify + it under the terms of the GNU General Public License as published by + the Free + Software Foundation; either version 2 of the License, or (at your + option) any + later version. + + SuiteSparse_GPURuntime is distributed in the hope that it will be + useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more + details. + + You should have received a copy of the GNU General Public License + along with + this Module; if not, write to the Free Software Foundation, Inc., 51 + Franklin + Street, Fifth Floor, Boston, MA 02110-1301, USA. + +> ssget/Doc/License.txt < +------------------------- + + Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +> UMFPACK/Doc/License.txt < +--------------------------- + + UMFPACK, Copyright 1995-2009 by Timothy A. Davis. + All Rights Reserved. + UMFPACK is available under alternate licenses, contact T. Davis for + details. + + UMFPACK License: + + Your use or distribution of UMFPACK or any modified version of + UMFPACK implies that you agree to this License. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + USA + + Permission is hereby granted to use or copy this program under the + terms of the GNU GPL, provided that the Copyright, this License, + and the Availability of the original version is retained on all + copies. + User documentation of any code that uses this code or any modified + version of this code must cite the Copyright, this License, the + Availability note, and "Used by permission." Permission to modify + the code and to distribute modified code is granted, provided the + Copyright, this License, and the Availability note are retained, + and a notice that the code was modified is included. + + Availability: + + http://www.suitesparse.com + +> CSparse/MATLAB/ssget/Doc/License.txt < +---------------------------------------- + + Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +> CXSparse/MATLAB/ssget/Doc/License.txt < +----------------------------------------- + + Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + +- Redistributions of source code must retain the above copyright + + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the organizations to which the authors are + + affiliated, nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR + ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY + WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH + DAMAGE. + +> GraphBLAS/Doc/License.txt < +----------------------------- + + SuiteSparse:GraphBLAS, Copyright 2017, Timothy A. Davis + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use SuiteSparse:GraphBLAS except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. + See the License for the specific language governing permissions and + limitations under the License. + +.. _mongoose_license: + +> Mongoose License < +-------------------- + + Mongoose, Copyright 2018, Timothy A. Davis, Scott P. Kolodziej, + William W. Hager, S. Nuri Yeralan + Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June + 2007 diff --git a/build/pkgs/suitesparse/SPKG.txt b/build/pkgs/suitesparse/SPKG.txt deleted file mode 100644 index ff1fa1ca2f2..00000000000 --- a/build/pkgs/suitesparse/SPKG.txt +++ /dev/null @@ -1,967 +0,0 @@ -SuiteSpare is a collection of software to deal with sparse matrix. -It is hosted at http://faculty.cse.tamu.edu/davis/suitesparse.html - -This spkg does a minimal install of suitesparse disabling the following -* metis -* GraphBLAS (need cmake) -* Mongoose (need cmake) - -An external metis package can be used but we just disable its use. - -Patches: -* The first patch disable the building of package using cmake. -* The second patch make sure we use sage's blas/lapack on OS X. By default -suitesparse discard any configurations to use the accelerate framework. - -The building of metis is diabled by passing -MY_METIS_LIB=none to make (any value would have done) -We also configure cholmod so it doesn't require metis by -passing -CHOLMOD_CONFIG=-DNPARTITION to make. - -Other configurations are self explanatory. - -License: because SuiteSparse is a collection, it comes with a variety -of licenses. Find below a copy of the "LICENSES.txt" shipped with -SuiteSparse. - -==> AMD/Doc/License.txt <== - - AMD, Copyright (c), 1996-2015, Timothy A. Davis, - Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. - - Availability: - - http://www.suitesparse.com - - ------------------------------------------------------------------------------- - AMD License: BSD 3-clause: - ------------------------------------------------------------------------------- - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - -==> BTF/Doc/License.txt <== - BTF, Copyright (C) 2004-2013, University of Florida - by Timothy A. Davis and Ekanathan Palamadai. - BTF is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - BTF is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - BTF is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -==> CAMD/Doc/License.txt <== - - CAMD, Copyright (c) by Timothy A. Davis, - Yanqing Chen, - Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. - CAMD is available under alternate licenses, contact T. Davis for details. - - CAMD License: BSD 3-clause - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - Availability: - - http://www.suitesparse.com - -==> CCOLAMD/Doc/License.txt <== - - CCOLAMD: constrained column approximate minimum degree ordering - Copyright (C) 2005-2016, Univ. of Florida. Authors: Timothy A. Davis, - Sivasankaran Rajamanickam, and Stefan Larimore. Closely based on COLAMD by - Davis, Stefan Larimore, in collaboration with Esmond Ng, and John Gilbert. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - CCOLAMD license: BSD 3-clause: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - -------------------------------------------------------------------------------- - -==> CHOLMOD/Doc/License.txt <== - -------------------------------------------------------------------------------- - ==> Check/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Check Module. Copyright (C) 2005-2006, Timothy A. Davis CHOLMOD is - also available under other licenses; contact authors for details. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Check module only. - All CHOLMOD modules are licensed separately. - - ---------------------------------------------------------------------------- - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -------------------------------------------------------------------------------- - ==> Cholesky/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Cholesky module, Copyright (C) 2005-2006, Timothy A. Davis. - CHOLMOD is also available under other licenses; contact authors for - details. http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Cholesky module only. - All CHOLMOD modules are licensed separately. - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -------------------------------------------------------------------------------- - ==> Core/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Core Module. Copyright (C) 2005-2006, Univ. of Florida. Author: - Timothy A. Davis. CHOLMOD is also available under other licenses; contact - authors for details. http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Core module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -------------------------------------------------------------------------------- - ==> Demo/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Demo Module. Copyright (C) 2005-2006, Timothy A. Davis. CHOLMOD - is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Demo module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - ==> Include/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Include/* files. Copyright (C) 2005-2006, either Univ. of Florida - or T. Davis, depending on the file. - - Each file is licensed separately, according to the Module for which it - contains definitions and prototypes: - - Include/cholmod.h LGPL - Include/cholmod_blas.h LGPL - Include/cholmod_camd.h part of Partition module - Include/cholmod_check.h part of Check module - Include/cholmod_cholesky.h part of Cholesky module - Include/cholmod_complexity.h LGPL - Include/cholmod_config.h LGPL - Include/cholmod_core.h part of Core module - Include/cholmod_function.h no license; freely usable, no restrictions - Include/cholmod_gpu.h part of GPU module - Include/cholmod_gpu_kernels.h part of GPU module - Include/cholmod_internal.h LGPL - Include/cholmod_io64.h LGPL - Include/cholmod_matrixops.h part of MatrixOps module - Include/cholmod_modify.h part of Modify module - Include/cholmod_partition.h part of Partition module - Include/cholmod_supernodal.h part of Supernodal module - Include/cholmod_template.h LGPL - - -------------------------------------------------------------------------------- - ==> MATLAB/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/MATLAB Module. Copyright (C) 2005-2006, Timothy A. Davis. CHOLMOD - is also available under other licenses; contact authors for details. - MATLAB(tm) is a Registered Trademark of The MathWorks, Inc. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/MATLAB module only. - All CHOLMOD modules are licensed separately. - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - ==> MatrixOps/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis. - CHOLMOD is also available under other licenses; contact authors for - details. http://www.suitesparse.com - - Note that this license is for the CHOLMOD/MatrixOps module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - ==> Modify/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Modify Module. Copyright (C) 2005-2006, Timothy A. Davis and - William W. Hager. CHOLMOD is also available under other licenses; contact - authors for details. http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Modify module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - ==> Partition/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Partition Module. - Copyright (C) 2005-2006, Univ. of Florida. Author: Timothy A. Davis - CHOLMOD is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Partition module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -------------------------------------------------------------------------------- - ==> Supernodal/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Supernodal Module. - Copyright (C) 2005-2006, Timothy A. Davis - CHOLMOD is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Supernodal module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - ==> Tcov/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Tcov Module. Copyright (C) 2005-2006, Timothy A. Davis - CHOLMOD is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Tcov module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - ==> Valgrind/License.txt <== - -------------------------------------------------------------------------------- - - CHOLMOD/Valgrind Module. Copyright (C) 2005-2006, Timothy A. Davis. - CHOLMOD is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - Note that this license is for the CHOLMOD/Valgrind module only. - All CHOLMOD modules are licensed separately. - - - ---------------------------------------------------------------------------- - - - This Module is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This Module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - -==> COLAMD/Doc/License.txt <== - COLAMD, Copyright 1998-2016, Timothy A. Davis. http://www.suitesparse.com - http://www.suitesparse.com - - COLAMD License: BSD 3-clause - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - -==> CSparse/Doc/License.txt <== - CSparse: a Concise Sparse matrix package. - Copyright (c) 2006, Timothy A. Davis. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - CSparse is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - CSparse is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -==> CXSparse/Doc/License.txt <== - CXSparse: a Concise Sparse matrix package - Extended. - Copyright (c) 2006, Timothy A. Davis. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - CXSparse is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - CXSparse is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -==> CXSparse_newfiles/Doc/License.txt <== - CXSparse: a Concise Sparse matrix package - Extended. - Copyright (c) 2006, Timothy A. Davis. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - CXSparse is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - CXSparse is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -==> GPUQREngine/Doc/License.txt <== - GPUQREngine Copyright (c) 2013, Timothy A. Davis, Sencer Nuri Yeralan, - and Sanjay Ranka. - http://www.suitesparse.com - - GPUQREngine is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - GPUQREngine is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - this Module; if not, write to the Free Software Foundation, Inc., 51 Franklin - Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -==> KLU/Doc/License.txt <== - KLU, Copyright (C) 2004-2013, University of Florida - by Timothy A. Davis and Ekanathan Palamadai. - KLU is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - KLU is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - KLU is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -==> LDL/Doc/License.txt <== - LDL Copyright (c) 2005-2013 by Timothy A. Davis. - LDL is also available under other licenses; contact the author for details. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - LDL is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - LDL is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -==> MATLAB_Tools/Doc/License.txt <== - The MATLAB_Tools collection of packages is - Copyright (c), Timothy A. Davis, All Rights Reserved, - with the exception of the spqr_rank package, which is - Copyright (c), Timothy A. Davis and Les Foster, All Rights Reserved, - - All packages are available under alternative licenses. - Contact the authors for details. - - -------------------------------------------------------------------------------- - MATLAB_Tools License, with the exception of SSMULT and SuiteSparseCollection: - -------------------------------------------------------------------------------- - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - -------------------------------------------------------------------------------- - SuiteSparseCollection License: - -------------------------------------------------------------------------------- - - SuiteSparseCollection is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - SuiteSparseCollection is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this package; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -------------------------------------------------------------------------------- - SSMULT License: - -------------------------------------------------------------------------------- - - SSMULT, Copyright (c) 2007-2011, Timothy A. Davis, - http://www.suitesparse.com. - - SSMULT is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any later - version. - - SSMULT is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. - - You should have received a copy of the GNU General Public License along - with this package; if not, write to the Free Software Foundation, Inc., 51 - Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -==> RBio/Doc/License.txt <== - RBio toolbox. Copyright (C) 2006-2009, Timothy A. Davis - RBio is also available under other licenses; contact authors for details. - http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - RBio is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - RBio is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this Module; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -==> SPQR/Doc/License.txt <== - SPQR, Copyright 2008-2016 by Timothy A. Davis. - All Rights Reserved. - SPQR is available under alternate licenses, contact T. Davis for details. - - SPQR License: - - Your use or distribution of SPQR or any modified version of - SPQR implies that you agree to this License. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA - - Permission is hereby granted to use or copy this program under the - terms of the GNU GPL, provided that the Copyright, this License, - and the Availability of the original version is retained on all copies. - User documentation of any code that uses this code or any modified - version of this code must cite the Copyright, this License, the - Availability note, and "Used by permission." Permission to modify - the code and to distribute modified code is granted, provided the - Copyright, this License, and the Availability note are retained, - and a notice that the code was modified is included. - - Availability: - - http://www.suitesparse.com - - -==> SuiteSparse_GPURuntime/Doc/License.txt <== - SuiteSparse_GPURuntime Copyright (c) 2013-2016, Timothy A. Davis, - Sencer Nuri Yeralan, and Sanjay Ranka. http://www.suitesparse.com - - -------------------------------------------------------------------------------- - - SuiteSparse_GPURuntime is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) any - later version. - - SuiteSparse_GPURuntime is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. - - You should have received a copy of the GNU General Public License along with - this Module; if not, write to the Free Software Foundation, Inc., 51 Franklin - Street, Fifth Floor, Boston, MA 02110-1301, USA. - -==> ssget/Doc/License.txt <== - Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - -==> UMFPACK/Doc/License.txt <== - UMFPACK, Copyright 1995-2009 by Timothy A. Davis. - All Rights Reserved. - UMFPACK is available under alternate licenses, contact T. Davis for details. - - UMFPACK License: - - Your use or distribution of UMFPACK or any modified version of - UMFPACK implies that you agree to this License. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - USA - - Permission is hereby granted to use or copy this program under the - terms of the GNU GPL, provided that the Copyright, this License, - and the Availability of the original version is retained on all copies. - User documentation of any code that uses this code or any modified - version of this code must cite the Copyright, this License, the - Availability note, and "Used by permission." Permission to modify - the code and to distribute modified code is granted, provided the - Copyright, this License, and the Availability note are retained, - and a notice that the code was modified is included. - - Availability: - - http://www.suitesparse.com - - -==> CSparse/MATLAB/ssget/Doc/License.txt <== - Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - - -==> CXSparse/MATLAB/ssget/Doc/License.txt <== - Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. - -==> GraphBLAS/Doc/License.txt <== - SuiteSparse:GraphBLAS, Copyright 2017, Timothy A. Davis - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use SuiteSparse:GraphBLAS except in compliance with the - License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -==> Mongoose License <== - Mongoose, Copyright 2018, Timothy A. Davis, Scott P. Kolodziej, - William W. Hager, S. Nuri Yeralan - Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 - - diff --git a/build/pkgs/surf/SPKG.rst b/build/pkgs/surf/SPKG.rst new file mode 100644 index 00000000000..ef3f8d4d3a9 --- /dev/null +++ b/build/pkgs/surf/SPKG.rst @@ -0,0 +1,40 @@ +surf +==== + +Description +----------- + +surf is a tool to visualize some real algebraic geometry: plane +algebraic curves, algebraic surfaces and hyperplane sections of +surfaces. surf is script driven and has (optionally) a nifty GUI using +the Gtk widget set. + +This is used by the Singular Jupyter kernel to produce 3D plots. + +License +------- + +GPL version 2 or later + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://surf.sourceforge.net (although the project is essentially dead) + +Dependencies +------------ + +- cups (optional) +- GNU flex Version 2.5 or higher +- GTK+ Version 1.2.0 or higher (optional) +- POSIX Threads +- GNU MP(gmp) Version 2 or higher +- lib-tiff +- lib-jpeg +- zlib +- ps2pdf (optional) + +This package is "experimental" because not all of these dependencies are +packaged with Sage. diff --git a/build/pkgs/surf/SPKG.txt b/build/pkgs/surf/SPKG.txt deleted file mode 100644 index 4967aa2cc72..00000000000 --- a/build/pkgs/surf/SPKG.txt +++ /dev/null @@ -1,33 +0,0 @@ -= surf = - -== Description == - -surf is a tool to visualize some real algebraic geometry: plane algebraic -curves, algebraic surfaces and hyperplane sections of surfaces. surf is script -driven and has (optionally) a nifty GUI using the Gtk widget set. - -This is used by the Singular Jupyter kernel to produce 3D plots. - -== License == - -GPL version 2 or later - -== Upstream Contact == - -http://surf.sourceforge.net -(although the project is essentially dead) - -== Dependencies == - -* cups (optional) -* GNU flex Version 2.5 or higher -* GTK+ Version 1.2.0 or higher (optional) -* POSIX Threads -* GNU MP(gmp) Version 2 or higher -* lib-tiff -* lib-jpeg -* zlib -* ps2pdf (optional) - -This package is "experimental" because not all of these dependencies are -packaged with Sage. diff --git a/build/pkgs/symmetrica/SPKG.rst b/build/pkgs/symmetrica/SPKG.rst new file mode 100644 index 00000000000..cc61066f6c6 --- /dev/null +++ b/build/pkgs/symmetrica/SPKG.rst @@ -0,0 +1,59 @@ +symmetrica +========== + +Description +----------- + +Symmetrica is a program developed by Lehrstuhl Mathematik II of the +University of Bayreuth. It has routines to handle the following topics + +- ordinary representation theory of the symmetric group and related + groups (2/11/04) +- ordinary representation theory of the classical groups +- modular representation theory of the symmetric group +- projective representation theory of the symmetric group +- combinatorics of tableaux +- symmetric functions and polynomials (7/22/04) +- commutative and non commutative Schubert polynomials +- operations of finite groups. +- ordinary representation theory of Hecke algebras of type A_n + +For more details check http://www.symmetrica.de (currently redirects to +http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA) + +License +------- + +Public Domain (see the above web site) + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Axel Kohnert - see http://www.mathe2.uni-bayreuth.de/axel/ + +Dependencies +------------ + +- GNU patch (for applying the patches to upstream) + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +The following patches are applied in spkg-install: + +- bruch.patch: store integers in a temporary variable before freeing + memory +- de.patch: turn off banner +- int32.patch: use int32_t and uint32_t for type INT. +- sort_sum_rename.patch: rename sort to sym_sort, sum to sym_sum +- We copy over our own Makefile: + + patches/makefile (Fix compiler, i.e., use $CC, and let it use + $CFLAGS.) + +Permissions in the upstream tarball are funky, please run "chmod 644 +src/*" after unpacking. diff --git a/build/pkgs/symmetrica/SPKG.txt b/build/pkgs/symmetrica/SPKG.txt deleted file mode 100644 index bafe8ac922d..00000000000 --- a/build/pkgs/symmetrica/SPKG.txt +++ /dev/null @@ -1,44 +0,0 @@ -= symmetrica = - -== Description == - -Symmetrica is a program developed by Lehrstuhl Mathematik II of the -University of Bayreuth. It has routines to handle the following topics - - * ordinary representation theory of the symmetric group and related groups (2/11/04) - * ordinary representation theory of the classical groups - * modular representation theory of the symmetric group - * projective representation theory of the symmetric group - * combinatorics of tableaux - * symmetric functions and polynomials (7/22/04) - * commutative and non commutative Schubert polynomials - * operations of finite groups. - * ordinary representation theory of Hecke algebras of type A_n - -For more details check http://www.symmetrica.de (currently redirects -to http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA) - -== License == - -Public Domain (see the above web site) - -== Upstream Contact == - * Axel Kohnert - see http://www.mathe2.uni-bayreuth.de/axel/ - -== Dependencies == - * GNU patch (for applying the patches to upstream) - -== Special Update/Build Instructions == - -The following patches are applied in spkg-install: - - * bruch.patch: store integers in a temporary variable before freeing memory - * de.patch: turn off banner - * int32.patch: use int32_t and uint32_t for type INT. - * sort_sum_rename.patch: rename sort to sym_sort, sum to sym_sum - * We copy over our own Makefile: - patches/makefile (Fix compiler, i.e., use $CC, and let it use $CFLAGS.) - -Permissions in the upstream tarball are funky, please run -"chmod 644 src/*" after unpacking. - diff --git a/build/pkgs/sympow/SPKG.rst b/build/pkgs/sympow/SPKG.rst new file mode 100644 index 00000000000..706257251b4 --- /dev/null +++ b/build/pkgs/sympow/SPKG.rst @@ -0,0 +1,69 @@ +sympow +====== + +Description +----------- + +SYMPOW is a package to compute special values of symmetric power +elliptic curve L-functions. It can compute up to about 64 digits of +precision. + +License +------- + +- See the file src/COPYING + +.. _upstream_contact: + +Upstream Contact +---------------- + + SYMPOW does not appear to be maintained any longer, so there is no + upstream web site. + Mark Watkins, the package author, now works at Magma. + Previous (possibly still usable) email is watkins@maths.usyd.edu.au + +Dependencies +------------ + +- GNU patch + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- Some of the code is very dubious, and it is anyones guess really what + + the compiler does with it. For example, the following line exists in + src/eulerfactors.c: + + if ((HECKE) && (d==1)) return hecke_good(p,ap,m,v); + + But since hecke_good is defined as returning void, it's hard to know + exactly how this code behaves. I would not be surprised by any bugs + that might show up. I (David Kirkby) would personally not trust this + code much at all. + +- This is a difficult package to maintain. A trac ticket (#9758) has + been + + opened to implement Watkins-Delaunay's algorithm for computing + modular + degrees in Sage. Once implemented, it should be possible to remove + this + package. + +- The package is configured such that the data files are in a directory + + below where 'sympow' is installed. If Sage is installed globally, + then + it will be impossible to create the data files without being root. + This has been fixed in the Gentoo Linux distribution. Some + information + from Christopher can be see on + http://trac.sagemath.org/sage_trac/ticket/9703 + This package will generate binary versions of all shipped datafiles, + so these will work. However, creating totally new datafiles from + scratch + will not work. diff --git a/build/pkgs/sympow/SPKG.txt b/build/pkgs/sympow/SPKG.txt deleted file mode 100644 index d108adc33ed..00000000000 --- a/build/pkgs/sympow/SPKG.txt +++ /dev/null @@ -1,43 +0,0 @@ -= sympow = - -== Description == -SYMPOW is a package to compute special values of symmetric power elliptic -curve L-functions. It can compute up to about 64 digits of precision. - -== License == - - * See the file src/COPYING - -== Upstream Contact == - SYMPOW does not appear to be maintained any longer, so there is no - upstream web site. - Mark Watkins, the package author, now works at Magma. - Previous (possibly still usable) email is watkins@maths.usyd.edu.au - -== Dependencies == - * GNU patch - -== Special Update/Build Instructions == - * Some of the code is very dubious, and it is anyones guess really what - the compiler does with it. For example, the following line exists in - src/eulerfactors.c: - - if ((HECKE) && (d==1)) return hecke_good(p,ap,m,v); - - But since hecke_good is defined as returning void, it's hard to know - exactly how this code behaves. I would not be surprised by any bugs - that might show up. I (David Kirkby) would personally not trust this - code much at all. - * This is a difficult package to maintain. A trac ticket (#9758) has been - opened to implement Watkins-Delaunay's algorithm for computing modular - degrees in Sage. Once implemented, it should be possible to remove this - package. - * The package is configured such that the data files are in a directory - below where 'sympow' is installed. If Sage is installed globally, then - it will be impossible to create the data files without being root. - This has been fixed in the Gentoo Linux distribution. Some information - from Christopher can be see on http://trac.sagemath.org/sage_trac/ticket/9703 - This package will generate binary versions of all shipped datafiles, - so these will work. However, creating totally new datafiles from scratch - will not work. - diff --git a/build/pkgs/sympy/SPKG.rst b/build/pkgs/sympy/SPKG.rst new file mode 100644 index 00000000000..47247e25499 --- /dev/null +++ b/build/pkgs/sympy/SPKG.rst @@ -0,0 +1,41 @@ +SymPy +===== + +Description +----------- + +SymPy is a Python library for symbolic mathematics. It aims to become a +full-featured computer algebra system (CAS) while keeping the code as +simple as possible in order to be comprehensible and easily extensible. +SymPy is written entirely in Python and does not require any external +libraries, except optionally for plotting support. + +Website +------- + +http://sympy.org/ + +License +------- + +New BSD: http://www.opensource.org/licenses/bsd-license.php + +.. _upstream_contact: + +Upstream Contact +---------------- + +sympy mailinglist: http://groups.google.com/group/sympy + +Dependencies +------------ + +- Python 2.5 or later + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- A simple script can be used to ease the updating of the SPKG. See the + README. diff --git a/build/pkgs/sympy/SPKG.txt b/build/pkgs/sympy/SPKG.txt deleted file mode 100644 index 0136f8ca23d..00000000000 --- a/build/pkgs/sympy/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= SymPy = - -== Description == - -SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python and does not require any external libraries, except optionally for plotting support. - -== Website == - -http://sympy.org/ - -== License == - -New BSD: http://www.opensource.org/licenses/bsd-license.php - -== Upstream Contact == - -sympy mailinglist: http://groups.google.com/group/sympy - -== Dependencies == - * Python 2.5 or later - -== Special Update/Build Instructions == - - * A simple script can be used to ease the updating of the SPKG. See the README. - diff --git a/build/pkgs/tachyon/SPKG.rst b/build/pkgs/tachyon/SPKG.rst new file mode 100644 index 00000000000..8db46a0931b --- /dev/null +++ b/build/pkgs/tachyon/SPKG.rst @@ -0,0 +1,78 @@ +tachyon +======= + +Description +----------- + +Tachyon is a raytracer developed by John E. Stone. Tachyon supports the +typical ray tracer features, most of the common geometric primitives, +shading and texturing modes, etc. It also supports less common features +such as HDR image output, ambient occlusion lighting, and support for +various triangle mesh and volumetric texture formats beneficial for +molecular visualization (e.g. rendering VMD scenes). + +Currently not all of Tachyon's functionality is exported by the Sage +interface. + +License +------- + +- Copyright (c) 1994-2010 John E. Stone +- All rights reserved. +- + +- Redistribution and use in source and binary forms, with or without +- modification, are permitted provided that the following conditions +- are met: +- 1. Redistributions of source code must retain the above copyright +- notice, this list of conditions and the following disclaimer. +- 2. Redistributions in binary form must reproduce the above copyright +- notice, this list of conditions and the following disclaimer in the +- documentation and/or other materials provided with the distribution. +- 3. The name of the author may not be used to endorse or promote + products +- derived from this software without specific prior written permission. + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://jedi.ks.uiuc.edu/~johns/raytracer/ John Stone + +Dependencies +------------ + +This spkg depends on: + +- libpng + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- Delete the scenes directory, which has lots of cool examples. +- Delete the msvc directory, which is also large and not used within + Sage. +- The CVS subdirectories are currently (almost) empty, but should + + otherwise be deleted. + +- The upstream files had strange permissions, i.e. some source files + + were executable, while almost all files weren't world-readable. + +- There's seems to be some crap like \`tachyon.html.tar.gz\` and a few + + \`.#*\` files I haven't [yet] deleted, since they're not that large. + +- TODO: Check whether building multi-threaded versions on MacOS X + + meanwhile works. (This was said to fail with an old beta.) + +- TODO: Use \`patch\` instead of copying over pre-patched files. +- TODO: [Optionally] also install some of the documentation. +- TODO: I doubt the CFLAGS set for AIX and HP-UX won't get overridden + + by the created Makefile, but that's a minor issue. -leif diff --git a/build/pkgs/tachyon/SPKG.txt b/build/pkgs/tachyon/SPKG.txt deleted file mode 100644 index 5c3deaba733..00000000000 --- a/build/pkgs/tachyon/SPKG.txt +++ /dev/null @@ -1,61 +0,0 @@ -= tachyon = - -== Description == - -Tachyon is a raytracer developed by John E. Stone. Tachyon supports -the typical ray tracer features, most of the common geometric -primitives, shading and texturing modes, etc. It also supports less -common features such as HDR image output, ambient occlusion lighting, -and support for various triangle mesh and volumetric texture formats -beneficial for molecular visualization (e.g. rendering VMD scenes). - -Currently not all of Tachyon's functionality is exported by the Sage -interface. - - -== License == - - * Copyright (c) 1994-2010 John E. Stone - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - - -== Upstream Contact == - -http://jedi.ks.uiuc.edu/~johns/raytracer/ -John Stone - - -== Dependencies == - -This spkg depends on: - - * libpng - - -== Special Update/Build Instructions == - - * Delete the scenes directory, which has lots of cool examples. - * Delete the msvc directory, which is also large and not used within Sage. - * The CVS subdirectories are currently (almost) empty, but should - otherwise be deleted. - * The upstream files had strange permissions, i.e. some source files - were executable, while almost all files weren't world-readable. - * There's seems to be some crap like `tachyon.html.tar.gz` and a few - `.#*` files I haven't [yet] deleted, since they're not that large. - * TODO: Check whether building multi-threaded versions on MacOS X - meanwhile works. (This was said to fail with an old beta.) - * TODO: Use `patch` instead of copying over pre-patched files. - * TODO: [Optionally] also install some of the documentation. - * TODO: I doubt the CFLAGS set for AIX and HP-UX won't get overridden - by the created Makefile, but that's a minor issue. -leif diff --git a/build/pkgs/tdlib/SPKG.rst b/build/pkgs/tdlib/SPKG.rst new file mode 100644 index 00000000000..5bdf50255f2 --- /dev/null +++ b/build/pkgs/tdlib/SPKG.rst @@ -0,0 +1,34 @@ +TdLib +===== + +Description +----------- + +Providing algorithms concerning treedecompositions + +website: http://www.tdi.informatik.uni-frankfurt.de/~lukas/tdlib.html + +License +------- + +GNU General Public License v2 + +.. _spkg_maintainers: + +SPKG Maintainers +---------------- + +Lukas Larisch (larisch@informatik.uni-frankfurt.de) + +.. _upstream_contact: + +Upstream Contact +---------------- + +Lukas Larisch (larisch@informatik.uni-frankfurt.de) git-repo: +git://pholia.tdi.cs.uni-frankfurt.de/git/tdlib + +Dependencies +------------ + +- None diff --git a/build/pkgs/tdlib/SPKG.txt b/build/pkgs/tdlib/SPKG.txt deleted file mode 100644 index a4567c1b9c4..00000000000 --- a/build/pkgs/tdlib/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= TdLib = - -== Description == -Providing algorithms concerning treedecompositions - -website: http://www.tdi.informatik.uni-frankfurt.de/~lukas/tdlib.html - -== License == -GNU General Public License v2 - -== SPKG Maintainers == -Lukas Larisch (larisch@informatik.uni-frankfurt.de) - -== Upstream Contact == -Lukas Larisch (larisch@informatik.uni-frankfurt.de) -git-repo: git://pholia.tdi.cs.uni-frankfurt.de/git/tdlib - -== Dependencies == - * None - diff --git a/build/pkgs/termcap/SPKG.rst b/build/pkgs/termcap/SPKG.rst new file mode 100644 index 00000000000..7d63f9ce177 --- /dev/null +++ b/build/pkgs/termcap/SPKG.rst @@ -0,0 +1,32 @@ +termcap +======= + +Description +----------- + +A library of C functions that enable programs to send control strings to +terminals in a way independent of the terminal type. + +License +------- + +GPL version 2 + +.. _upstream_contact: + +Upstream Contact +---------------- + +Please report any bugs in this library to bug-gnu-emacs@prep.ai.mit.edu + +Dependencies +------------ + +- GNU patch + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None diff --git a/build/pkgs/termcap/SPKG.txt b/build/pkgs/termcap/SPKG.txt deleted file mode 100644 index 7a26059e18f..00000000000 --- a/build/pkgs/termcap/SPKG.txt +++ /dev/null @@ -1,23 +0,0 @@ -= termcap = - -== Description == - -A library of C functions that enable programs to send control strings -to terminals in a way independent of the terminal type. - -== License == - -GPL version 2 - -== Upstream Contact == - -Please report any bugs in this library to bug-gnu-emacs@prep.ai.mit.edu - -== Dependencies == - - * GNU patch - -== Special Update/Build Instructions == - -None - diff --git a/build/pkgs/terminado/SPKG.txt b/build/pkgs/terminado/SPKG.rst similarity index 87% rename from build/pkgs/terminado/SPKG.txt rename to build/pkgs/terminado/SPKG.rst index 8f5a4b8d6ff..38970eddb75 100644 --- a/build/pkgs/terminado/SPKG.txt +++ b/build/pkgs/terminado/SPKG.rst @@ -1,6 +1,8 @@ -= terminado = +terminado +========= -== Description == +Description +----------- This is a Tornado websocket backend for the term.js Javascript terminal emulator library. diff --git a/build/pkgs/testpath/SPKG.txt b/build/pkgs/testpath/SPKG.rst similarity index 75% rename from build/pkgs/testpath/SPKG.txt rename to build/pkgs/testpath/SPKG.rst index 2ea91ce9d57..520b92b07d7 100644 --- a/build/pkgs/testpath/SPKG.txt +++ b/build/pkgs/testpath/SPKG.rst @@ -1,6 +1,8 @@ -= testpath = +testpath +======== -== Description == +Description +----------- Testpath diff --git a/build/pkgs/texlive/SPKG.rst b/build/pkgs/texlive/SPKG.rst new file mode 100644 index 00000000000..c0a35c67311 --- /dev/null +++ b/build/pkgs/texlive/SPKG.rst @@ -0,0 +1,41 @@ +TeXlive +======= + +Description +----------- + +TeX Live is an easy way to get up and running with the TeX document +production system. It provides a comprehensive TeX system with binaries +for most flavors of Unix, including GNU/Linux, and also Windows. It +includes all the major TeX-related programs, macro packages, and fonts +that are free software, including support for many languages around the +world. + +This package installs all texlive packages required to build Sage. If +necessary, texlive itself is installed. + +License +------- + +Various FSF-approved free software licenses. See +https://www.tug.org/texlive/copying.html for details. + +.. _upstream_contact: + +Upstream Contact +---------------- + +Home page: https://www.tug.org/texlive + +Dependencies +------------ + +- python + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +This package requires internet access to download texlive packages for +the TeX mirrors. diff --git a/build/pkgs/texlive/SPKG.txt b/build/pkgs/texlive/SPKG.txt deleted file mode 100644 index 36e2c9825bd..00000000000 --- a/build/pkgs/texlive/SPKG.txt +++ /dev/null @@ -1,31 +0,0 @@ -= TeXlive = - -== Description == - -TeX Live is an easy way to get up and running with the TeX document -production system. It provides a comprehensive TeX system with -binaries for most flavors of Unix, including GNU/Linux, and also -Windows. It includes all the major TeX-related programs, macro -packages, and fonts that are free software, including support for many -languages around the world. - -This package installs all texlive packages required to build Sage. If -necessary, texlive itself is installed. - -== License == - -Various FSF-approved free software licenses. See -https://www.tug.org/texlive/copying.html for details. - -== Upstream Contact == - -Home page: https://www.tug.org/texlive - -== Dependencies == - -* python - -== Special Update/Build Instructions == - -This package requires internet access to download texlive packages for -the TeX mirrors. diff --git a/build/pkgs/thebe/SPKG.rst b/build/pkgs/thebe/SPKG.rst new file mode 100644 index 00000000000..de0a9a2e556 --- /dev/null +++ b/build/pkgs/thebe/SPKG.rst @@ -0,0 +1,39 @@ +thebe +===== + +Description +----------- + +Jupyter javascript plugin for static sites. Thebe takes the Jupyter +front end, and make it work outside of the notebook context. + +This is used by Sage's Sphinx-based documentation build system to +produce html documentation that can be turned live (see +https://trac.sagemath.org/ticket/20690). + +License +------- + +MIT + +.. _upstream_contact: + +Upstream Contact +---------------- + +Home page: https://oreillymedia.github.io/thebe/ Source: +https://github.com/oreillymedia/thebe/ + +Dependencies +------------ + +None. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +There are no release numbers, hence find the latest commit, download +https://github.com/oreillymedia/thebe/archive/$%7BCOMMIT%7D.zip and +rename it thebe-${COMMIT:0:8}.zip diff --git a/build/pkgs/thebe/SPKG.txt b/build/pkgs/thebe/SPKG.txt deleted file mode 100644 index de5c05c7c5b..00000000000 --- a/build/pkgs/thebe/SPKG.txt +++ /dev/null @@ -1,30 +0,0 @@ -= thebe = - -== Description == - -Jupyter javascript plugin for static sites. Thebe takes the Jupyter front end, -and make it work outside of the notebook context. - -This is used by Sage's Sphinx-based documentation build system to produce html -documentation that can be turned live (see -https://trac.sagemath.org/ticket/20690). - -== License == - -MIT - -== Upstream Contact == - -Home page: https://oreillymedia.github.io/thebe/ -Source: https://github.com/oreillymedia/thebe/ - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -There are no release numbers, hence find the latest commit, download -https://github.com/oreillymedia/thebe/archive/${COMMIT}.zip and rename it -thebe-${COMMIT:0:8}.zip - diff --git a/build/pkgs/threejs/SPKG.rst b/build/pkgs/threejs/SPKG.rst new file mode 100644 index 00000000000..55430c52aa5 --- /dev/null +++ b/build/pkgs/threejs/SPKG.rst @@ -0,0 +1,31 @@ +Three.js +======== + +Description +----------- + +Three.js is a JavaScript library to display 3D graphics in the browser. + +License +------- + +MIT License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Home page: http://threejs.org + +Dependencies +------------ + +None. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +None. diff --git a/build/pkgs/threejs/SPKG.txt b/build/pkgs/threejs/SPKG.txt deleted file mode 100644 index 57052228b76..00000000000 --- a/build/pkgs/threejs/SPKG.txt +++ /dev/null @@ -1,22 +0,0 @@ -= Three.js = - -== Description == - -Three.js is a JavaScript library to display 3D graphics in the browser. - -== License == - -MIT License - -== Upstream Contact == - -Home page: http://threejs.org - -== Dependencies == - -None. - -== Special Update/Build Instructions == - -None. - diff --git a/build/pkgs/tides/SPKG.rst b/build/pkgs/tides/SPKG.rst new file mode 100644 index 00000000000..c9c26356866 --- /dev/null +++ b/build/pkgs/tides/SPKG.rst @@ -0,0 +1,35 @@ +TIDES +===== + +Description +----------- + +TIDES is a library for integration of ODE's with high precision. + +License +------- + +GPLv3+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +- Marcos Rodriguez (marcos@unizar.es) + +Dependencies +------------ + +- gcc +- mpfr +- gmp + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +minc_tides.patch changes the size of the name of the temporal files, so +there is no problem in systems that use long names. Also solves a bug in +the inverse function. diff --git a/build/pkgs/tides/SPKG.txt b/build/pkgs/tides/SPKG.txt deleted file mode 100644 index da9bbbd729c..00000000000 --- a/build/pkgs/tides/SPKG.txt +++ /dev/null @@ -1,25 +0,0 @@ -= TIDES = - -== Description == - -TIDES is a library for integration of ODE's with high precision. - -== License == - -GPLv3+ - -== Upstream Contact == - -* Marcos Rodriguez (marcos@unizar.es) - -== Dependencies == - -* gcc -* mpfr -* gmp - -== Special Update/Build Instructions == - -minc_tides.patch changes the size of the name of the temporal files, so -there is no problem in systems that use long names. Also solves a bug -in the inverse function. diff --git a/build/pkgs/topcom/SPKG.rst b/build/pkgs/topcom/SPKG.rst new file mode 100644 index 00000000000..b7c9e155899 --- /dev/null +++ b/build/pkgs/topcom/SPKG.rst @@ -0,0 +1,43 @@ +TOPCOM +====== + +Description +----------- + +TOPCOM is a collection of clients to compute Triangulations Of Point +Configurations and Oriented Matroids, resp. + +The algorithms use only combinatorial data of the point configuration as +is given by its oriented matroid. Some basic commands for computing and +manipulating oriented matroids can also be accessed by the user. + +It was very much inspired by the maple program PUNTOS, which was written +by Jesus de Loera. TOPCOM is entirely written in C++, so there is a +significant speed up compared to PUNTOS. + +License +------- + +GPL v2 + +.. _upstream_contact: + +Upstream Contact +---------------- + +Prof. Dr. Jörg Rambau Lehrstuhl für +Wirtschaftsmathematik Raum FAN-D.1.29 (Sekretariat: FAN-D.1.30) +Universität Bayreuth D-95440 Bayreuth Germany Tel: +49-921-55-7350, Fax: ++49-921-55-7352 http://www.rambau.wm.uni-bayreuth.de + +Dependencies +------------ + +- gmp, libcdd + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +See spkg-src diff --git a/build/pkgs/topcom/SPKG.txt b/build/pkgs/topcom/SPKG.txt deleted file mode 100644 index 51772f4a3b8..00000000000 --- a/build/pkgs/topcom/SPKG.txt +++ /dev/null @@ -1,34 +0,0 @@ -= TOPCOM = - -== Description == -TOPCOM is a collection of clients to compute Triangulations Of Point -Configurations and Oriented Matroids, resp. - -The algorithms use only combinatorial data of the point configuration -as is given by its oriented matroid. Some basic commands for computing -and manipulating oriented matroids can also be accessed by the user. - -It was very much inspired by the maple program PUNTOS, which was -written by Jesus de Loera. TOPCOM is entirely written in C++, so there -is a significant speed up compared to PUNTOS. - -== License == -GPL v2 - -== Upstream Contact == -Prof. Dr. Jörg Rambau -Lehrstuhl für Wirtschaftsmathematik -Raum FAN-D.1.29 (Sekretariat: FAN-D.1.30) -Universität Bayreuth -D-95440 Bayreuth -Germany -Tel: +49-921-55-7350, Fax: +49-921-55-7352 -http://www.rambau.wm.uni-bayreuth.de - -== Dependencies == -* gmp, libcdd - -== Special Update/Build Instructions == - -See spkg-src - diff --git a/build/pkgs/tornado/SPKG.rst b/build/pkgs/tornado/SPKG.rst new file mode 100644 index 00000000000..79b7e67f1d8 --- /dev/null +++ b/build/pkgs/tornado/SPKG.rst @@ -0,0 +1,24 @@ +tornado +======= + +Description +----------- + +Python web framework and asynchronous networking library + +License +------- + +Apache License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Home page: http://www.tornadoweb.org + +Dependencies +------------ + +Python diff --git a/build/pkgs/tornado/SPKG.txt b/build/pkgs/tornado/SPKG.txt deleted file mode 100644 index 5938a047bed..00000000000 --- a/build/pkgs/tornado/SPKG.txt +++ /dev/null @@ -1,18 +0,0 @@ -= tornado = - -== Description == - -Python web framework and asynchronous networking library - -== License == - -Apache License - -== Upstream Contact == - -Home page: http://www.tornadoweb.org - -== Dependencies == - -Python - diff --git a/build/pkgs/traitlets/SPKG.txt b/build/pkgs/traitlets/SPKG.rst similarity index 65% rename from build/pkgs/traitlets/SPKG.txt rename to build/pkgs/traitlets/SPKG.rst index 0cca54ec4bf..0d624dc30c8 100644 --- a/build/pkgs/traitlets/SPKG.txt +++ b/build/pkgs/traitlets/SPKG.rst @@ -1,6 +1,8 @@ -= traitlets = +traitlets +========= -== Description == +Description +----------- Traitlets Python config system diff --git a/build/pkgs/twisted/SPKG.txt b/build/pkgs/twisted/SPKG.rst similarity index 82% rename from build/pkgs/twisted/SPKG.txt rename to build/pkgs/twisted/SPKG.rst index d2122e44f7e..5b6e9293e55 100644 --- a/build/pkgs/twisted/SPKG.txt +++ b/build/pkgs/twisted/SPKG.rst @@ -1,6 +1,8 @@ -= twisted = +twisted +======= -== Description == +Description +----------- An asynchronous networking framework written in Python diff --git a/build/pkgs/typing/SPKG.txt b/build/pkgs/typing/SPKG.rst similarity index 89% rename from build/pkgs/typing/SPKG.txt rename to build/pkgs/typing/SPKG.rst index 273da4324fc..5bdd9ff8ebc 100644 --- a/build/pkgs/typing/SPKG.txt +++ b/build/pkgs/typing/SPKG.rst @@ -1,6 +1,8 @@ -= typing = +typing +====== -== Description == +Description +----------- Typing – Type Hints for Python @@ -12,6 +14,7 @@ annotations. The notation can be used for documenting code in a concise, standard format, and it has been designed to also be used by static and runtime type checkers, static analyzers, IDEs and other tools. -== License == +License +------- Python Software Foundation License diff --git a/build/pkgs/valgrind/SPKG.rst b/build/pkgs/valgrind/SPKG.rst new file mode 100644 index 00000000000..f31ddcd1f34 --- /dev/null +++ b/build/pkgs/valgrind/SPKG.rst @@ -0,0 +1,56 @@ +Valgrind +======== + +Description +----------- + +This is an optional spkg. It supports Linux on x86, x86-64, ppc, ppc64 +and ARM as well as Darwin (Mac OS X 10.5 and 10.6) on x86 and x86-64. + +Valgrind is an instrumentation framework for building dynamic analysis +tools. There are Valgrind tools that can automatically detect many +memory management and threading bugs, and profile your programs in +detail. You can also use Valgrind to build new tools. + +The Valgrind distribution currently includes six production-quality +tools: a memory error detector, two thread error detectors, a cache and +branch-prediction profiler, a call-graph generating cache and +branch-prediction profiler, and a heap profiler. It also includes three +experimental tools: a heap/stack/global array overrun detector, a second +heap profiler that examines how heap blocks are used, and a SimPoint +basic block vector generator. It runs on the following platforms: +X86/Linux, AMD64/Linux, ARM/Linux, PPC32/Linux, PPC64/Linux, +S390X/Linux, ARM/Android (2.3.x), X86/Darwin and AMD64/Darwin (Mac OS X +10.6 and 10.7). + +License +------- + +Valgrind is Open Source / Free Software, and is freely available under +the GNU General Public License, version 2. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- http://www.valgrind.org/ +- valgrind-user, valgrind-devel mailing lists + +Dependencies +------------ + +- None + +.. _special_build_instructions: + +Special Build Instructions +-------------------------- + +- To build on OS X, you need to use Apple's compiler. FSF GCC is + unsupported. + +Patches +~~~~~~~ + +- None. diff --git a/build/pkgs/valgrind/SPKG.txt b/build/pkgs/valgrind/SPKG.txt deleted file mode 100644 index fa065c32de4..00000000000 --- a/build/pkgs/valgrind/SPKG.txt +++ /dev/null @@ -1,44 +0,0 @@ -= Valgrind = - -== Description == - -This is an optional spkg. It supports Linux on x86, x86-64, ppc, ppc64 and ARM -as well as Darwin (Mac OS X 10.5 and 10.6) on x86 and x86-64. - -Valgrind is an instrumentation framework for building dynamic analysis tools. -There are Valgrind tools that can automatically detect many memory management -and threading bugs, and profile your programs in detail. You can also use -Valgrind to build new tools. - -The Valgrind distribution currently includes six production-quality tools: -a memory error detector, two thread error detectors, a cache and -branch-prediction profiler, a call-graph generating cache and branch-prediction -profiler, and a heap profiler. It also includes three experimental tools: a -heap/stack/global array overrun detector, a second heap profiler that examines -how heap blocks are used, and a SimPoint basic block vector generator. It runs -on the following platforms: X86/Linux, AMD64/Linux, ARM/Linux, PPC32/Linux, -PPC64/Linux, S390X/Linux, ARM/Android (2.3.x), X86/Darwin and AMD64/Darwin -(Mac OS X 10.6 and 10.7). - -== License == - -Valgrind is Open Source / Free Software, and is freely available under the -GNU General Public License, version 2. - -== Upstream Contact == - - * http://www.valgrind.org/ - * valgrind-user, valgrind-devel mailing lists - -== Dependencies == - - * None - -== Special Build Instructions == - - * To build on OS X, you need to use Apple's compiler. FSF GCC is unsupported. - -=== Patches === - - * None. - diff --git a/build/pkgs/vcversioner/SPKG.rst b/build/pkgs/vcversioner/SPKG.rst new file mode 100644 index 00000000000..bd8360bf349 --- /dev/null +++ b/build/pkgs/vcversioner/SPKG.rst @@ -0,0 +1,26 @@ +vcversioner +=========== + +Description +----------- + +Write a setup.py with no version information specified, and vcversioner +will find a recent, properly-formatted VCS tag and extract a version +from it. + +License +------- + +Python Software Foundation License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Home page: https://pypi.python.org/pypi/vcversioner/ + +Dependencies +------------ + +Python, Setuptools diff --git a/build/pkgs/vcversioner/SPKG.txt b/build/pkgs/vcversioner/SPKG.txt deleted file mode 100644 index eae91aa062e..00000000000 --- a/build/pkgs/vcversioner/SPKG.txt +++ /dev/null @@ -1,20 +0,0 @@ -= vcversioner = - -== Description == - -Write a setup.py with no version information specified, and -vcversioner will find a recent, properly-formatted VCS tag and extract -a version from it. - -== License == - -Python Software Foundation License - -== Upstream Contact == - -Home page: https://pypi.python.org/pypi/vcversioner/ - -== Dependencies == - -Python, Setuptools - diff --git a/build/pkgs/wcwidth/SPKG.txt b/build/pkgs/wcwidth/SPKG.rst similarity index 72% rename from build/pkgs/wcwidth/SPKG.txt rename to build/pkgs/wcwidth/SPKG.rst index d91b994aacf..ed233830d3a 100644 --- a/build/pkgs/wcwidth/SPKG.txt +++ b/build/pkgs/wcwidth/SPKG.rst @@ -1,6 +1,8 @@ -= wcwidth = +wcwidth +======= -== Description == +Description +----------- Measures number of Terminal column cells of wide-character codes diff --git a/build/pkgs/webencodings/SPKG.rst b/build/pkgs/webencodings/SPKG.rst new file mode 100644 index 00000000000..581cf290078 --- /dev/null +++ b/build/pkgs/webencodings/SPKG.rst @@ -0,0 +1,24 @@ +webencodings +============ + +Description +----------- + +Character encoding aliases for legacy web content. + +License +------- + +BSD License + +.. _upstream_contact: + +Upstream Contact +---------------- + +Home Page: https://github.com/gsnedders/python-webencodings + +Dependencies +------------ + +Python diff --git a/build/pkgs/webencodings/SPKG.txt b/build/pkgs/webencodings/SPKG.txt deleted file mode 100644 index 7480c468420..00000000000 --- a/build/pkgs/webencodings/SPKG.txt +++ /dev/null @@ -1,17 +0,0 @@ -= webencodings = - -== Description == - -Character encoding aliases for legacy web content. - -== License == - -BSD License - -== Upstream Contact == - -Home Page: https://github.com/gsnedders/python-webencodings - -== Dependencies == - -Python diff --git a/build/pkgs/werkzeug/SPKG.rst b/build/pkgs/werkzeug/SPKG.rst new file mode 100644 index 00000000000..860d3762b49 --- /dev/null +++ b/build/pkgs/werkzeug/SPKG.rst @@ -0,0 +1,21 @@ +Werkzeug +======== + +Description +----------- + +The Swiss Army knife of Python web development + +Werkzeug started as simple collection of various utilities for WSGI +applications and has become one of the most advanced WSGI utility +modules. It includes a powerful debugger, full featured request and +response objects, HTTP utilities to handle entity tags, cache control +headers, HTTP dates, cookie handling, file uploads, a powerful URL +routing system and a bunch of community contributed addon modules. + +Werkzeug is unicode aware and doesn't enforce a specific template +engine, database adapter or anything else. It doesn’t even enforce a +specific way of handling requests and leaves all that up to the +developer. It's most useful for end user applications which should work +on as many server environments as possible (such as blogs, wikis, +bulletin boards, etc.). diff --git a/build/pkgs/werkzeug/SPKG.txt b/build/pkgs/werkzeug/SPKG.txt deleted file mode 100644 index fac6f309dee..00000000000 --- a/build/pkgs/werkzeug/SPKG.txt +++ /dev/null @@ -1,18 +0,0 @@ -= Werkzeug = - -== Description == - -The Swiss Army knife of Python web development - -Werkzeug started as simple collection of various utilities for WSGI -applications and has become one of the most advanced WSGI utility modules. It -includes a powerful debugger, full featured request and response objects, HTTP -utilities to handle entity tags, cache control headers, HTTP dates, cookie -handling, file uploads, a powerful URL routing system and a bunch of community -contributed addon modules. - -Werkzeug is unicode aware and doesn't enforce a specific template engine, -database adapter or anything else. It doesn’t even enforce a specific way of -handling requests and leaves all that up to the developer. It's most useful -for end user applications which should work on as many server environments as -possible (such as blogs, wikis, bulletin boards, etc.). diff --git a/build/pkgs/widgetsnbextension/SPKG.rst b/build/pkgs/widgetsnbextension/SPKG.rst new file mode 100644 index 00000000000..7c14261cf95 --- /dev/null +++ b/build/pkgs/widgetsnbextension/SPKG.rst @@ -0,0 +1,7 @@ +widgetsnbextension +================== + +Description +----------- + +Interactive HTML widgets for Jupyter notebooks. diff --git a/build/pkgs/widgetsnbextension/SPKG.txt b/build/pkgs/widgetsnbextension/SPKG.txt deleted file mode 100644 index e432175c9e0..00000000000 --- a/build/pkgs/widgetsnbextension/SPKG.txt +++ /dev/null @@ -1,6 +0,0 @@ -= widgetsnbextension = - -== Description == - -Interactive HTML widgets for Jupyter notebooks. - diff --git a/build/pkgs/xz/SPKG.rst b/build/pkgs/xz/SPKG.rst new file mode 100644 index 00000000000..ed6b24d0d0a --- /dev/null +++ b/build/pkgs/xz/SPKG.rst @@ -0,0 +1,24 @@ +xz +== + +Description +----------- + +XZ Utils is free general-purpose data compression software with a high +compression ratio. + +License +------- + +Some parts public domain, other parts GNU LGPLv2.1, GNU GPLv2, or GNU +GPLv3. + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://tukaani.org/xz/ + +Dependencies +------------ diff --git a/build/pkgs/xz/SPKG.txt b/build/pkgs/xz/SPKG.txt deleted file mode 100644 index 7a66b43d63e..00000000000 --- a/build/pkgs/xz/SPKG.txt +++ /dev/null @@ -1,17 +0,0 @@ -= xz = - -== Description == - -XZ Utils is free general-purpose data compression software with a high compression ratio. - -== License == - -Some parts public domain, -other parts GNU LGPLv2.1, GNU GPLv2, or GNU GPLv3. - -== Upstream Contact == - -http://tukaani.org/xz/ - -== Dependencies == - diff --git a/build/pkgs/yasm/SPKG.rst b/build/pkgs/yasm/SPKG.rst new file mode 100644 index 00000000000..52b63546a3c --- /dev/null +++ b/build/pkgs/yasm/SPKG.rst @@ -0,0 +1,42 @@ +yasm +==== + +Description +----------- + +Yasm is a complete rewrite of the NASM assembler under the “new” BSD +License (some portions are under other licenses, see COPYING for +details). + +Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM +and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit +Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates +source debugging information in STABS, DWARF 2, and CodeView 8 formats. + +Yasm can be easily integrated into Visual Studio 2005/2008 and 2010 for +assembly of NASM or GAS syntax code into Win32 or Win64 object files. + +See https://yasm.tortall.net + +License +------- + +Yasm is licensed under the 2-clause and 3-clause “revised” BSD licenses, +with one exception: the Bit::Vector module used by the mainline version +of Yasm to implement its large integer and machine-independent floating +point support is triple-licensed under the Artistic license, GPL, and +LGPL. The “yasm-nextgen” codebase uses a different BSD-licensed +implementation and is thus entirely under BSD-equivalent licenses. The +full text of the licenses are provided in the Yasm source distribution. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- https://yasm.tortall.net + +Dependencies +------------ + +- none diff --git a/build/pkgs/yasm/SPKG.txt b/build/pkgs/yasm/SPKG.txt deleted file mode 100644 index 3dd72875678..00000000000 --- a/build/pkgs/yasm/SPKG.txt +++ /dev/null @@ -1,19 +0,0 @@ -= yasm = - -== Description == -Yasm is a complete rewrite of the NASM assembler under the “new” BSD License (some portions are under other licenses, see COPYING for details). - -Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source debugging information in STABS, DWARF 2, and CodeView 8 formats. - -Yasm can be easily integrated into Visual Studio 2005/2008 and 2010 for assembly of NASM or GAS syntax code into Win32 or Win64 object files. - -See https://yasm.tortall.net - -== License == -Yasm is licensed under the 2-clause and 3-clause “revised” BSD licenses, with one exception: the Bit::Vector module used by the mainline version of Yasm to implement its large integer and machine-independent floating point support is triple-licensed under the Artistic license, GPL, and LGPL. The “yasm-nextgen” codebase uses a different BSD-licensed implementation and is thus entirely under BSD-equivalent licenses. The full text of the licenses are provided in the Yasm source distribution. - -== Upstream Contact == - * https://yasm.tortall.net - -== Dependencies == - * none diff --git a/build/pkgs/zeromq/SPKG.rst b/build/pkgs/zeromq/SPKG.rst new file mode 100644 index 00000000000..8593b4ed6fb --- /dev/null +++ b/build/pkgs/zeromq/SPKG.rst @@ -0,0 +1,33 @@ +zeromq +====== + +Description +----------- + +A modern networking library. Also known as 0mq or zmq. The same API is +provided by http://www.crossroads.io, though we currently use the +http://www.zeromq.org implementation. + +License +------- + +LGPLv3+ + +.. _upstream_contact: + +Upstream Contact +---------------- + +http://www.zeromq.org + +Dependencies +------------ + +A working compiler. + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +N/A diff --git a/build/pkgs/zeromq/SPKG.txt b/build/pkgs/zeromq/SPKG.txt deleted file mode 100644 index 7459f724a82..00000000000 --- a/build/pkgs/zeromq/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= zeromq = - -== Description == - -A modern networking library. Also known as 0mq or zmq. The same API is -provided by http://www.crossroads.io, though we currently use the -http://www.zeromq.org implementation. - -== License == - -LGPLv3+ - -== Upstream Contact == - -http://www.zeromq.org - -== Dependencies == - -A working compiler. - -== Special Update/Build Instructions == - -N/A - diff --git a/build/pkgs/zlib/SPKG.rst b/build/pkgs/zlib/SPKG.rst new file mode 100644 index 00000000000..85cff6ec42d --- /dev/null +++ b/build/pkgs/zlib/SPKG.rst @@ -0,0 +1,35 @@ +zlib +==== + +Description +----------- + +Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also +Free, Not to Mention Unencumbered by Patents) + +License +------- + +- Modified BSD. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- http://www.zlib.net/ + +Dependencies +------------ + +- None + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +Patches +~~~~~~~ + +- cygwin_symbols.patch: remove undefined symbols on Cygwin. diff --git a/build/pkgs/zlib/SPKG.txt b/build/pkgs/zlib/SPKG.txt deleted file mode 100644 index eeb3ae76007..00000000000 --- a/build/pkgs/zlib/SPKG.txt +++ /dev/null @@ -1,24 +0,0 @@ -= zlib = - -== Description == - -Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also -Free, Not to Mention Unencumbered by Patents) - -== License == - - * Modified BSD. - -== Upstream Contact == - - * http://www.zlib.net/ - -== Dependencies == - - * None - -== Special Update/Build Instructions == - -=== Patches === - - * cygwin_symbols.patch: remove undefined symbols on Cygwin. diff --git a/build/pkgs/zn_poly/SPKG.rst b/build/pkgs/zn_poly/SPKG.rst new file mode 100644 index 00000000000..65fe7ea8e8f --- /dev/null +++ b/build/pkgs/zn_poly/SPKG.rst @@ -0,0 +1,105 @@ +zn_poly +======= + +Description +----------- + +zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n is +any modulus that fits into an unsigned long. + +Website: https://gitlab.com/sagemath/zn_poly + +Note: Original website is at http://cims.nyu.edu/~harvey/zn_poly/ but is +no longer maintained. Sage maintains an "official" continuation of the +project at the above link. + +License +------- + +GPL V2 or V3. Some of the code has been copied from other projects - see +the file src/COPYING for details. + +.. _upstream_contact: + +Upstream Contact +---------------- + +- David Harvey +- E. M. Bray + +Dependencies +------------ + +- GMP/MPIR +- (some) Python (to create the Makefile) +- GNU patch +- NTL apparently only if we configured zn_poly differently (same for + FLINT) + +.. _special_updatebuild_instructions: + +Special Update/Build Instructions +--------------------------------- + +- Make sure the patches still apply. + + Especially changes in \`makemakefile.py\` may also require changes to + \`spkg-install\` (and perhaps also \`spkg-check`). + +- There's also a \`--use-flint\` option to \`configure`; no idea what + it does, + + and we currently don't use it either. + +- TODO: +- Use \`make install\` instead of manually "installing" (copying and + sym- + + linking) the [shared] libraries and header files. This requires + further + tweaking of \`makemakefile.py`, since it currently only installs a + static + library and the headers. + +- If everything's fine, i.e., no problems arise, some comments and + especial- + + ly some code I currently just commented out can certainly be removed. + (-leif, 04/2012) + +- The version number "0.9.p11" is used as a doctest in the function + + package_versions in sage/misc/packages.py, so if this package gets + upgraded, that doctest needs to be changed. + +Patches +~~~~~~~ + +- All patches from Sage have been merged into upstream. These include: +- makemakefile.py.patch: + + Improves the Python script creating the Makeefile for better use at + least within Sage; see patch for details. (Last modified at #12433, + which added and changed a lot.) + +- profiler.c.patch, zn_poly.h.patch: + + Fix potential redefinition of \`ulong\` (in combination with other + headers). + +- mpn_mulmid-tune.c.patch, mulmid-tune.c.patch, mul-tune.c.patch: + + Fix "jump into scope of identifier with variably modified type" + errors. (See #8771). + +- mpn_mulmid-test.c.patch: + + Fix a potential problem when the value of ZNP_mpn_smp_kara_thresh is + SIZE_MAX, this is usually irrealistic but can happen at least on + linux on power7 with gcc-4.7.1 (see #14098). + +- fix_fudge_factor_in_nuss-test.c.patch: + + As the name says; fix provided by upstream (David Harvey); see + + #. 13947. diff --git a/build/pkgs/zn_poly/SPKG.txt b/build/pkgs/zn_poly/SPKG.txt deleted file mode 100644 index e6f3dde412a..00000000000 --- a/build/pkgs/zn_poly/SPKG.txt +++ /dev/null @@ -1,70 +0,0 @@ -= zn_poly = - -== Description == - -zn_poly is a C library for polynomial arithmetic in Z/nZ[x], where n is any -modulus that fits into an unsigned long. - -Website: https://gitlab.com/sagemath/zn_poly - -Note: Original website is at http://cims.nyu.edu/~harvey/zn_poly/ but is no -longer maintained. Sage maintains an "official" continuation of the project -at the above link. - -== License == - -GPL V2 or V3. Some of the code has been copied from other projects - see -the file src/COPYING for details. - -== Upstream Contact == - - * David Harvey - * E. M. Bray - -== Dependencies == - - * GMP/MPIR - * (some) Python (to create the Makefile) - * GNU patch - * NTL apparently only if we configured zn_poly differently (same for FLINT) - -== Special Update/Build Instructions == - - * Make sure the patches still apply. - Especially changes in `makemakefile.py` may also require changes to - `spkg-install` (and perhaps also `spkg-check`). - * There's also a `--use-flint` option to `configure`; no idea what it does, - and we currently don't use it either. - * TODO: - - Use `make install` instead of manually "installing" (copying and sym- - linking) the [shared] libraries and header files. This requires further - tweaking of `makemakefile.py`, since it currently only installs a static - library and the headers. - - If everything's fine, i.e., no problems arise, some comments and especial- - ly some code I currently just commented out can certainly be removed. - (-leif, 04/2012) - * The version number "0.9.p11" is used as a doctest in the function - package_versions in sage/misc/packages.py, so if this package gets - upgraded, that doctest needs to be changed. - -=== Patches === - - * All patches from Sage have been merged into upstream. These include: - * makemakefile.py.patch: - Improves the Python script creating the Makeefile for better use at - least within Sage; see patch for details. (Last modified at #12433, - which added and changed a lot.) - * profiler.c.patch, zn_poly.h.patch: - Fix potential redefinition of `ulong` (in combination with other - headers). - * mpn_mulmid-tune.c.patch, mulmid-tune.c.patch, mul-tune.c.patch: - Fix "jump into scope of identifier with variably modified type" - errors. (See #8771). - * mpn_mulmid-test.c.patch: - Fix a potential problem when the value of ZNP_mpn_smp_kara_thresh is - SIZE_MAX, this is usually irrealistic but can happen at least on - linux on power7 with gcc-4.7.1 (see #14098). - * fix_fudge_factor_in_nuss-test.c.patch: - As the name says; fix provided by upstream (David Harvey); see - #13947. - diff --git a/build/pkgs/zope_interface/SPKG.rst b/build/pkgs/zope_interface/SPKG.rst new file mode 100644 index 00000000000..19310888c32 --- /dev/null +++ b/build/pkgs/zope_interface/SPKG.rst @@ -0,0 +1,16 @@ +zope.interface +============== + +Description +----------- + +This package is intended to be independently reusable in any Python +project. It is maintained by the Zope Toolkit project. + +This package provides an implementation of "object interfaces" for +Python. Interfaces are a mechanism for labeling objects as conforming to +a given API or contract. So, this package can be considered as +implementation of the Design By Contract methodology support in Python. + +For detailed documentation, please see +http://docs.zope.org/zope.interface diff --git a/build/pkgs/zope_interface/SPKG.txt b/build/pkgs/zope_interface/SPKG.txt deleted file mode 100644 index ca529666746..00000000000 --- a/build/pkgs/zope_interface/SPKG.txt +++ /dev/null @@ -1,13 +0,0 @@ -= zope.interface = - -== Description == - -This package is intended to be independently reusable in any Python project. -It is maintained by the Zope Toolkit project. - -This package provides an implementation of "object interfaces" for Python. -Interfaces are a mechanism for labeling objects as conforming to a given API -or contract. So, this package can be considered as implementation of the -Design By Contract methodology support in Python. - -For detailed documentation, please see http://docs.zope.org/zope.interface From ac5ffd577869aaa35b743982d79b71bc09c9b9cd Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 May 2020 21:15:50 -0700 Subject: [PATCH 043/301] Remove rst labels --- build/pkgs/4ti2/SPKG.rst | 1 - build/pkgs/arb/SPKG.rst | 2 -- build/pkgs/atlas/SPKG.rst | 2 -- build/pkgs/autotools/SPKG.rst | 2 -- build/pkgs/awali/SPKG.rst | 2 -- build/pkgs/backports_abc/SPKG.rst | 1 - build/pkgs/backports_ssl_match_hostname/SPKG.rst | 2 -- build/pkgs/barvinok/SPKG.rst | 1 - build/pkgs/benzene/SPKG.rst | 1 - build/pkgs/bleach/SPKG.rst | 1 - build/pkgs/bliss/SPKG.rst | 2 -- build/pkgs/boost/SPKG.rst | 1 - build/pkgs/boost_cropped/SPKG.rst | 1 - build/pkgs/brial/SPKG.rst | 1 - build/pkgs/buckygen/SPKG.rst | 1 - build/pkgs/bzip2/SPKG.rst | 2 -- build/pkgs/cbc/SPKG.rst | 3 --- build/pkgs/ccache/SPKG.rst | 1 - build/pkgs/cddlib/SPKG.rst | 1 - build/pkgs/certifi/SPKG.rst | 1 - build/pkgs/cliquer/SPKG.rst | 1 - build/pkgs/cmake/SPKG.rst | 1 - build/pkgs/cocoalib/SPKG.rst | 2 -- build/pkgs/combinatorial_designs/SPKG.rst | 2 -- build/pkgs/compilerwrapper/SPKG.rst | 3 --- build/pkgs/configure/SPKG.rst | 2 -- build/pkgs/conway_polynomials/SPKG.rst | 1 - build/pkgs/coxeter3/SPKG.rst | 2 -- build/pkgs/cryptominisat/SPKG.rst | 2 -- build/pkgs/csdp/SPKG.rst | 2 -- build/pkgs/curl/SPKG.rst | 2 -- build/pkgs/cvxopt/SPKG.rst | 2 -- build/pkgs/cycler/SPKG.rst | 1 - build/pkgs/cypari/SPKG.rst | 1 - build/pkgs/cysignals/SPKG.rst | 1 - build/pkgs/cython/SPKG.rst | 1 - build/pkgs/d3js/SPKG.rst | 2 -- build/pkgs/database_cremona_ellcurve/SPKG.rst | 2 -- build/pkgs/database_jones_numfield/SPKG.rst | 2 -- build/pkgs/database_kohel/SPKG.rst | 2 -- build/pkgs/database_mutation_class/SPKG.rst | 2 -- build/pkgs/database_odlyzko_zeta/SPKG.rst | 1 - build/pkgs/database_symbolic_data/SPKG.rst | 2 -- build/pkgs/dateutil/SPKG.rst | 1 - build/pkgs/deformation/SPKG.rst | 1 - build/pkgs/defusedxml/SPKG.rst | 2 -- build/pkgs/docutils/SPKG.rst | 2 -- build/pkgs/dot2tex/SPKG.rst | 2 -- build/pkgs/e_antic/SPKG.rst | 2 -- build/pkgs/ecl/SPKG.rst | 2 -- build/pkgs/eclib/SPKG.rst | 1 - build/pkgs/ecm/SPKG.rst | 2 -- build/pkgs/elliptic_curves/SPKG.rst | 1 - build/pkgs/entrypoints/SPKG.rst | 2 -- build/pkgs/fflas_ffpack/SPKG.rst | 2 -- build/pkgs/flask_autoindex/SPKG.rst | 1 - build/pkgs/flask_babel/SPKG.rst | 1 - build/pkgs/flask_oldsessions/SPKG.rst | 1 - build/pkgs/flask_openid/SPKG.rst | 1 - build/pkgs/flask_silk/SPKG.rst | 1 - build/pkgs/flint/SPKG.rst | 1 - build/pkgs/fplll/SPKG.rst | 1 - build/pkgs/fpylll/SPKG.rst | 1 - build/pkgs/freetype/SPKG.rst | 1 - build/pkgs/fricas/SPKG.rst | 1 - build/pkgs/frobby/SPKG.rst | 2 -- build/pkgs/functools32/SPKG.rst | 1 - build/pkgs/gambit/SPKG.rst | 1 - build/pkgs/gap/SPKG.rst | 2 -- build/pkgs/gap3/SPKG.rst | 4 ---- build/pkgs/gap_jupyter/SPKG.rst | 2 -- build/pkgs/gap_packages/SPKG.rst | 1 - build/pkgs/gc/SPKG.rst | 2 -- build/pkgs/gcc/SPKG.rst | 2 -- build/pkgs/gdb/SPKG.rst | 2 -- build/pkgs/gf2x/SPKG.rst | 2 -- build/pkgs/gfan/SPKG.rst | 2 -- build/pkgs/gfortran/SPKG.rst | 2 -- build/pkgs/giac/SPKG.rst | 2 -- build/pkgs/giacpy_sage/SPKG.rst | 2 -- build/pkgs/git/SPKG.rst | 2 -- build/pkgs/git_trac/SPKG.rst | 3 --- build/pkgs/givaro/SPKG.rst | 1 - build/pkgs/glpk/SPKG.rst | 2 -- build/pkgs/glucose/SPKG.rst | 2 -- build/pkgs/gmp/SPKG.rst | 1 - build/pkgs/gp2c/SPKG.rst | 1 - build/pkgs/graphs/SPKG.rst | 1 - build/pkgs/gsl/SPKG.rst | 2 -- build/pkgs/html5lib/SPKG.rst | 1 - build/pkgs/iconv/SPKG.rst | 2 -- build/pkgs/igraph/SPKG.rst | 2 -- build/pkgs/iml/SPKG.rst | 2 -- build/pkgs/ipython/SPKG.rst | 1 - build/pkgs/isl/SPKG.rst | 1 - build/pkgs/jinja2/SPKG.rst | 2 -- build/pkgs/jmol/SPKG.rst | 3 --- build/pkgs/jsonschema/SPKG.rst | 1 - build/pkgs/jupymake/SPKG.rst | 2 -- build/pkgs/kenzo/SPKG.rst | 1 - build/pkgs/kiwisolver/SPKG.rst | 1 - build/pkgs/latte_int/SPKG.rst | 1 - build/pkgs/lcalc/SPKG.rst | 2 -- build/pkgs/libatomic_ops/SPKG.rst | 2 -- build/pkgs/libbraiding/SPKG.rst | 2 -- build/pkgs/libffi/SPKG.rst | 1 - build/pkgs/libgd/SPKG.rst | 2 -- build/pkgs/libhomfly/SPKG.rst | 2 -- build/pkgs/libogg/SPKG.rst | 2 -- build/pkgs/libpng/SPKG.rst | 2 -- build/pkgs/libsemigroups/SPKG.rst | 1 - build/pkgs/libtheora/SPKG.rst | 2 -- build/pkgs/lidia/SPKG.rst | 1 - build/pkgs/lie/SPKG.rst | 1 - build/pkgs/linbox/SPKG.rst | 3 --- build/pkgs/lrcalc/SPKG.rst | 1 - build/pkgs/lrslib/SPKG.rst | 2 -- build/pkgs/m4ri/SPKG.rst | 2 -- build/pkgs/m4rie/SPKG.rst | 1 - build/pkgs/markupsafe/SPKG.rst | 1 - build/pkgs/mathjax/SPKG.rst | 2 -- build/pkgs/matplotlib/SPKG.rst | 2 -- build/pkgs/maxima/SPKG.rst | 2 -- build/pkgs/mcqd/SPKG.rst | 2 -- build/pkgs/meataxe/SPKG.rst | 1 - build/pkgs/mistune/SPKG.rst | 1 - build/pkgs/modular_decomposition/SPKG.rst | 2 -- build/pkgs/mpc/SPKG.rst | 2 -- build/pkgs/mpfi/SPKG.rst | 1 - build/pkgs/mpfr/SPKG.rst | 2 -- build/pkgs/mpfrcx/SPKG.rst | 1 - build/pkgs/mpir/SPKG.rst | 2 -- build/pkgs/mpmath/SPKG.rst | 1 - build/pkgs/nauty/SPKG.rst | 2 -- build/pkgs/ncurses/SPKG.rst | 2 -- build/pkgs/networkx/SPKG.rst | 1 - build/pkgs/ninja_build/SPKG.rst | 1 - build/pkgs/normaliz/SPKG.rst | 2 -- build/pkgs/nose/SPKG.rst | 2 -- build/pkgs/notedown/SPKG.rst | 1 - build/pkgs/ntl/SPKG.rst | 2 -- build/pkgs/numpy/SPKG.rst | 2 -- build/pkgs/openblas/SPKG.rst | 2 -- build/pkgs/openssl/SPKG.rst | 1 - build/pkgs/p_group_cohomology/SPKG.rst | 2 -- build/pkgs/palp/SPKG.rst | 1 - build/pkgs/pandoc_attributes/SPKG.rst | 2 -- build/pkgs/pandocfilters/SPKG.rst | 2 -- build/pkgs/pari/SPKG.rst | 2 -- build/pkgs/pari_elldata/SPKG.rst | 1 - build/pkgs/pari_galdata/SPKG.rst | 1 - build/pkgs/pari_galpol/SPKG.rst | 1 - build/pkgs/pari_jupyter/SPKG.rst | 1 - build/pkgs/pari_nftables/SPKG.rst | 1 - build/pkgs/pari_seadata/SPKG.rst | 1 - build/pkgs/pari_seadata_small/SPKG.rst | 1 - build/pkgs/patch/SPKG.rst | 2 -- build/pkgs/pcre/SPKG.rst | 2 -- build/pkgs/perl_term_readline_gnu/SPKG.rst | 1 - build/pkgs/pexpect/SPKG.rst | 1 - build/pkgs/pillow/SPKG.rst | 1 - build/pkgs/pip/SPKG.rst | 1 - build/pkgs/pkgconf/SPKG.rst | 2 -- build/pkgs/pkgconfig/SPKG.rst | 2 -- build/pkgs/planarity/SPKG.rst | 2 -- build/pkgs/plantri/SPKG.rst | 1 - build/pkgs/polylib/SPKG.rst | 1 - build/pkgs/polymake/SPKG.rst | 2 -- build/pkgs/polytopes_db/SPKG.rst | 1 - build/pkgs/ppl/SPKG.rst | 3 --- build/pkgs/pplpy/SPKG.rst | 1 - build/pkgs/primecount/SPKG.rst | 1 - build/pkgs/psutil/SPKG.rst | 1 - build/pkgs/ptyprocess/SPKG.rst | 1 - build/pkgs/pycosat/SPKG.rst | 2 -- build/pkgs/pygments/SPKG.rst | 2 -- build/pkgs/pynac/SPKG.rst | 2 -- build/pkgs/pynormaliz/SPKG.rst | 2 -- build/pkgs/pyparsing/SPKG.rst | 1 - build/pkgs/pysingular/SPKG.rst | 1 - build/pkgs/python2/SPKG.rst | 2 -- build/pkgs/python_igraph/SPKG.rst | 3 --- build/pkgs/python_openid/SPKG.rst | 1 - build/pkgs/pytz/SPKG.rst | 1 - build/pkgs/pyzmq/SPKG.rst | 2 -- build/pkgs/qepcad/SPKG.rst | 2 -- build/pkgs/qhull/SPKG.rst | 1 - build/pkgs/r/SPKG.rst | 1 - build/pkgs/ratpoints/SPKG.rst | 3 --- build/pkgs/readline/SPKG.rst | 2 -- build/pkgs/rpy2/SPKG.rst | 2 -- build/pkgs/rst2ipynb/SPKG.rst | 2 -- build/pkgs/rw/SPKG.rst | 1 - build/pkgs/saclib/SPKG.rst | 1 - build/pkgs/sage_brial/SPKG.rst | 1 - build/pkgs/sagenb/SPKG.rst | 2 -- build/pkgs/sagetex/SPKG.rst | 2 -- build/pkgs/scipoptsuite/SPKG.rst | 3 --- build/pkgs/scipy/SPKG.rst | 2 -- build/pkgs/scons/SPKG.rst | 1 - build/pkgs/setuptools/SPKG.rst | 2 -- build/pkgs/singledispatch/SPKG.rst | 1 - build/pkgs/singular/SPKG.rst | 2 -- build/pkgs/singular_jupyter/SPKG.rst | 2 -- build/pkgs/sip/SPKG.rst | 1 - build/pkgs/sirocco/SPKG.rst | 2 -- build/pkgs/six/SPKG.rst | 1 - build/pkgs/sphinx/SPKG.rst | 2 -- build/pkgs/sphinxcontrib_websupport/SPKG.rst | 1 - build/pkgs/sqlite/SPKG.rst | 2 -- build/pkgs/suitesparse/SPKG.rst | 1 - build/pkgs/surf/SPKG.rst | 1 - build/pkgs/symmetrica/SPKG.rst | 2 -- build/pkgs/sympow/SPKG.rst | 2 -- build/pkgs/sympy/SPKG.rst | 2 -- build/pkgs/tachyon/SPKG.rst | 2 -- build/pkgs/tdlib/SPKG.rst | 2 -- build/pkgs/termcap/SPKG.rst | 2 -- build/pkgs/texlive/SPKG.rst | 2 -- build/pkgs/thebe/SPKG.rst | 2 -- build/pkgs/threejs/SPKG.rst | 2 -- build/pkgs/tides/SPKG.rst | 2 -- build/pkgs/topcom/SPKG.rst | 2 -- build/pkgs/tornado/SPKG.rst | 1 - build/pkgs/valgrind/SPKG.rst | 2 -- build/pkgs/vcversioner/SPKG.rst | 1 - build/pkgs/webencodings/SPKG.rst | 1 - build/pkgs/xz/SPKG.rst | 1 - build/pkgs/yasm/SPKG.rst | 1 - build/pkgs/zeromq/SPKG.rst | 2 -- build/pkgs/zlib/SPKG.rst | 2 -- build/pkgs/zn_poly/SPKG.rst | 2 -- 232 files changed, 371 deletions(-) diff --git a/build/pkgs/4ti2/SPKG.rst b/build/pkgs/4ti2/SPKG.rst index 28f9b8d862d..528f5db4fc5 100644 --- a/build/pkgs/4ti2/SPKG.rst +++ b/build/pkgs/4ti2/SPKG.rst @@ -12,7 +12,6 @@ License 4ti2 is released under a GPL v2 license. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/arb/SPKG.rst b/build/pkgs/arb/SPKG.rst index b1942674518..c0eea2854e7 100644 --- a/build/pkgs/arb/SPKG.rst +++ b/build/pkgs/arb/SPKG.rst @@ -16,7 +16,6 @@ License GNU General Public License v2+ -.. _upstream_contact: Upstream Contact ---------------- @@ -30,7 +29,6 @@ Dependencies - MPIR or GMP - MPFR -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/atlas/SPKG.rst b/build/pkgs/atlas/SPKG.rst index ac06b0f23ad..62901240a3d 100644 --- a/build/pkgs/atlas/SPKG.rst +++ b/build/pkgs/atlas/SPKG.rst @@ -11,7 +11,6 @@ License 3-clause BSD -.. _upstream_contact: Upstream Contact ---------------- @@ -24,7 +23,6 @@ Dependencies - Python -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/autotools/SPKG.rst b/build/pkgs/autotools/SPKG.rst index 7df67e23a8e..240889f2151 100644 --- a/build/pkgs/autotools/SPKG.rst +++ b/build/pkgs/autotools/SPKG.rst @@ -34,7 +34,6 @@ License GNU General Public License version 3 or later. -.. _upstream_contact: Upstream Contact ---------------- @@ -59,7 +58,6 @@ To update the package: - Sage with autotools package installed - Internet access -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/awali/SPKG.rst b/build/pkgs/awali/SPKG.rst index a0b7f840e5e..6e5b3fe5d63 100644 --- a/build/pkgs/awali/SPKG.rst +++ b/build/pkgs/awali/SPKG.rst @@ -18,7 +18,6 @@ License - GPL 3.0 -.. _upstream_contact: Upstream Contact ---------------- @@ -37,7 +36,6 @@ Dependencies - graphviz must be installed from your distro, and available in the path. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/backports_abc/SPKG.rst b/build/pkgs/backports_abc/SPKG.rst index 25187ea00b0..1d3d02d6a9e 100644 --- a/build/pkgs/backports_abc/SPKG.rst +++ b/build/pkgs/backports_abc/SPKG.rst @@ -11,7 +11,6 @@ License Python Software Foundation License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/backports_ssl_match_hostname/SPKG.rst b/build/pkgs/backports_ssl_match_hostname/SPKG.rst index d43ba82b16c..6e298bae7a6 100644 --- a/build/pkgs/backports_ssl_match_hostname/SPKG.rst +++ b/build/pkgs/backports_ssl_match_hostname/SPKG.rst @@ -11,7 +11,6 @@ License Python Software Foundation License -.. _upstream_contact: Upstream Contact ---------------- @@ -23,7 +22,6 @@ Dependencies Python, Setuptools -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/barvinok/SPKG.rst b/build/pkgs/barvinok/SPKG.rst index 6255ae14973..d24f1f0f9f7 100644 --- a/build/pkgs/barvinok/SPKG.rst +++ b/build/pkgs/barvinok/SPKG.rst @@ -13,7 +13,6 @@ License GPL v2 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/benzene/SPKG.rst b/build/pkgs/benzene/SPKG.rst index ba4b3091095..dce503de516 100644 --- a/build/pkgs/benzene/SPKG.rst +++ b/build/pkgs/benzene/SPKG.rst @@ -15,7 +15,6 @@ License Benzene is licensed under the GNU General Public License v2 or later ( June 2007 ) -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/bleach/SPKG.rst b/build/pkgs/bleach/SPKG.rst index 12f5838dbf8..c003a348c41 100644 --- a/build/pkgs/bleach/SPKG.rst +++ b/build/pkgs/bleach/SPKG.rst @@ -11,7 +11,6 @@ License Apache License v2 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/bliss/SPKG.rst b/build/pkgs/bliss/SPKG.rst index 744e2ea9dc9..1ce6bbf9d56 100644 --- a/build/pkgs/bliss/SPKG.rst +++ b/build/pkgs/bliss/SPKG.rst @@ -1,4 +1,3 @@ -.. _bliss_0.73debian_1: bliss 0.73+debian-1 =================== @@ -14,7 +13,6 @@ License LGPL -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/boost/SPKG.rst b/build/pkgs/boost/SPKG.rst index 619d9d04d25..13fdbc2df52 100644 --- a/build/pkgs/boost/SPKG.rst +++ b/build/pkgs/boost/SPKG.rst @@ -11,7 +11,6 @@ License Boost software license (GPL compatible) -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/boost_cropped/SPKG.rst b/build/pkgs/boost_cropped/SPKG.rst index 11625210007..33336a460f1 100644 --- a/build/pkgs/boost_cropped/SPKG.rst +++ b/build/pkgs/boost_cropped/SPKG.rst @@ -26,7 +26,6 @@ License Boost Software License - see http://www.boost.org/users/license.html -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/brial/SPKG.rst b/build/pkgs/brial/SPKG.rst index d16585ab57f..93e89b2205f 100644 --- a/build/pkgs/brial/SPKG.rst +++ b/build/pkgs/brial/SPKG.rst @@ -21,7 +21,6 @@ License GPL version 2 or later -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/buckygen/SPKG.rst b/build/pkgs/buckygen/SPKG.rst index dd82768c260..62409dc6a3e 100644 --- a/build/pkgs/buckygen/SPKG.rst +++ b/build/pkgs/buckygen/SPKG.rst @@ -15,7 +15,6 @@ License Buckygen is licensed under the GNU General Public License v3 ( June 2007 ) -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/bzip2/SPKG.rst b/build/pkgs/bzip2/SPKG.rst index 322fd411846..8639e28d8ce 100644 --- a/build/pkgs/bzip2/SPKG.rst +++ b/build/pkgs/bzip2/SPKG.rst @@ -15,7 +15,6 @@ License BSD-style -.. _upstream_contact: Upstream Contact ---------------- @@ -28,7 +27,6 @@ Dependencies None -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/cbc/SPKG.rst b/build/pkgs/cbc/SPKG.rst index 397f43f9b74..44c316385c8 100644 --- a/build/pkgs/cbc/SPKG.rst +++ b/build/pkgs/cbc/SPKG.rst @@ -1,4 +1,3 @@ -.. _coin_or_cbc: COIN-OR / CBC ============= @@ -22,7 +21,6 @@ License Eclipse Public License, Version 1.0 (EPL-1.0) (http://opensource.org/licenses/eclipse-1.0) -.. _upstream_contact: Upstream Contact ---------------- @@ -30,7 +28,6 @@ Upstream Contact - John Forrest - Robin Lougee-Heimer -.. _project_home_page: Project Home Page ----------------- diff --git a/build/pkgs/ccache/SPKG.rst b/build/pkgs/ccache/SPKG.rst index 5f265fa9cbe..bade4edeb0b 100644 --- a/build/pkgs/ccache/SPKG.rst +++ b/build/pkgs/ccache/SPKG.rst @@ -14,7 +14,6 @@ License GNU General Public License version 3 or later -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/cddlib/SPKG.rst b/build/pkgs/cddlib/SPKG.rst index aa356cdd1cd..406cfb74d91 100644 --- a/build/pkgs/cddlib/SPKG.rst +++ b/build/pkgs/cddlib/SPKG.rst @@ -26,7 +26,6 @@ License GPL v2 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/certifi/SPKG.rst b/build/pkgs/certifi/SPKG.rst index 0db5472aa61..9fc7bde2d70 100644 --- a/build/pkgs/certifi/SPKG.rst +++ b/build/pkgs/certifi/SPKG.rst @@ -11,7 +11,6 @@ License ISC -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/cliquer/SPKG.rst b/build/pkgs/cliquer/SPKG.rst index 9445d46a51c..4f65497f1c8 100644 --- a/build/pkgs/cliquer/SPKG.rst +++ b/build/pkgs/cliquer/SPKG.rst @@ -13,7 +13,6 @@ License GNU General Public License v2 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/cmake/SPKG.rst b/build/pkgs/cmake/SPKG.rst index 3654a5b0f35..549a231f8dc 100644 --- a/build/pkgs/cmake/SPKG.rst +++ b/build/pkgs/cmake/SPKG.rst @@ -22,7 +22,6 @@ License CMake is distributed under the OSI-approved BSD 3-clause License. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/cocoalib/SPKG.rst b/build/pkgs/cocoalib/SPKG.rst index c958335a964..94e820a9aae 100644 --- a/build/pkgs/cocoalib/SPKG.rst +++ b/build/pkgs/cocoalib/SPKG.rst @@ -11,7 +11,6 @@ License - GPL v3 -.. _upstream_contact: Upstream Contact ---------------- @@ -26,7 +25,6 @@ Dependencies - GMP/MPIR -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/combinatorial_designs/SPKG.rst b/build/pkgs/combinatorial_designs/SPKG.rst index 18d661e9fc2..327573dd863 100644 --- a/build/pkgs/combinatorial_designs/SPKG.rst +++ b/build/pkgs/combinatorial_designs/SPKG.rst @@ -1,4 +1,3 @@ -.. _combinatorial_designs: Combinatorial Designs ===================== @@ -18,7 +17,6 @@ License Public domain. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/compilerwrapper/SPKG.rst b/build/pkgs/compilerwrapper/SPKG.rst index 9cb9735728b..9e9690b020a 100644 --- a/build/pkgs/compilerwrapper/SPKG.rst +++ b/build/pkgs/compilerwrapper/SPKG.rst @@ -1,4 +1,3 @@ -.. _compiler_wrapper: Compiler Wrapper ================ @@ -15,7 +14,6 @@ License GPL v2+ -.. _upstream_contact: Upstream Contact ---------------- @@ -28,7 +26,6 @@ Dependencies - None -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/configure/SPKG.rst b/build/pkgs/configure/SPKG.rst index 437a9971436..4927e8d64d1 100644 --- a/build/pkgs/configure/SPKG.rst +++ b/build/pkgs/configure/SPKG.rst @@ -13,7 +13,6 @@ License GPLv3+ -.. _upstream_contact: Upstream Contact ---------------- @@ -26,7 +25,6 @@ Dependencies None -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/conway_polynomials/SPKG.rst b/build/pkgs/conway_polynomials/SPKG.rst index 0dc3da9cef2..16036a280f2 100644 --- a/build/pkgs/conway_polynomials/SPKG.rst +++ b/build/pkgs/conway_polynomials/SPKG.rst @@ -1,4 +1,3 @@ -.. _conway_polynomials_database: Conway Polynomials Database =========================== diff --git a/build/pkgs/coxeter3/SPKG.rst b/build/pkgs/coxeter3/SPKG.rst index ce18a36c4db..79111787f29 100644 --- a/build/pkgs/coxeter3/SPKG.rst +++ b/build/pkgs/coxeter3/SPKG.rst @@ -27,7 +27,6 @@ License GPL -.. _upstream_contact: Upstream Contact ---------------- @@ -43,7 +42,6 @@ Dependencies None -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/cryptominisat/SPKG.rst b/build/pkgs/cryptominisat/SPKG.rst index 253e71a2798..6f7f0ce55d0 100644 --- a/build/pkgs/cryptominisat/SPKG.rst +++ b/build/pkgs/cryptominisat/SPKG.rst @@ -20,7 +20,6 @@ License MIT License -.. _upstream_contact: Upstream Contact ---------------- @@ -30,7 +29,6 @@ Upstream Contact - Website: http://www.msoos.org/ - Releases: https://github.com/msoos/cryptominisat/releases -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/csdp/SPKG.rst b/build/pkgs/csdp/SPKG.rst index 571aaadd4c5..15a1c3df3ee 100644 --- a/build/pkgs/csdp/SPKG.rst +++ b/build/pkgs/csdp/SPKG.rst @@ -13,7 +13,6 @@ License Common Public License Version 1.0 -.. _upstream_contact: Upstream Contact ---------------- @@ -23,7 +22,6 @@ Dmitrii Pasechnik Dependencies ------------ -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/curl/SPKG.rst b/build/pkgs/curl/SPKG.rst index bbc2ba69836..a5afed66d66 100644 --- a/build/pkgs/curl/SPKG.rst +++ b/build/pkgs/curl/SPKG.rst @@ -12,7 +12,6 @@ License "MIT style license" : see file "COPYING" at the root of the source tarball, explanations at https://curl.haxx.se/docs/copyright.html. -.. _upstream_contact: Upstream Contact ---------------- @@ -25,7 +24,6 @@ Dependencies None listed. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/cvxopt/SPKG.rst b/build/pkgs/cvxopt/SPKG.rst index 7533a2303ac..698ef1888ac 100644 --- a/build/pkgs/cvxopt/SPKG.rst +++ b/build/pkgs/cvxopt/SPKG.rst @@ -13,7 +13,6 @@ applications straightforward by building on Python's extensive standard library and on the strengths of Python as a high-level programming language. -.. _upstream_contact: Upstream Contact ---------------- @@ -36,7 +35,6 @@ Dependencies - GSL - GLPK -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/cycler/SPKG.rst b/build/pkgs/cycler/SPKG.rst index aa98c36c280..7849d027a22 100644 --- a/build/pkgs/cycler/SPKG.rst +++ b/build/pkgs/cycler/SPKG.rst @@ -12,7 +12,6 @@ License BSD -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/cypari/SPKG.rst b/build/pkgs/cypari/SPKG.rst index 5dd839dfb56..c680d58e2d1 100644 --- a/build/pkgs/cypari/SPKG.rst +++ b/build/pkgs/cypari/SPKG.rst @@ -11,7 +11,6 @@ License GPL version 2 or later -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/cysignals/SPKG.rst b/build/pkgs/cysignals/SPKG.rst index 6bf1a1a4a2f..55f1e2b2dd0 100644 --- a/build/pkgs/cysignals/SPKG.rst +++ b/build/pkgs/cysignals/SPKG.rst @@ -11,7 +11,6 @@ License LGPL version 3 or later -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/cython/SPKG.rst b/build/pkgs/cython/SPKG.rst index f452f9cd3ef..8c5b201c86c 100644 --- a/build/pkgs/cython/SPKG.rst +++ b/build/pkgs/cython/SPKG.rst @@ -24,7 +24,6 @@ License Apache License, Version 2.0 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/d3js/SPKG.rst b/build/pkgs/d3js/SPKG.rst index 72c758df5d5..1b24b48ccb8 100644 --- a/build/pkgs/d3js/SPKG.rst +++ b/build/pkgs/d3js/SPKG.rst @@ -13,7 +13,6 @@ License BSD 3-Clause License -.. _upstream_contact: Upstream Contact ---------------- @@ -26,7 +25,6 @@ Dependencies None. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/database_cremona_ellcurve/SPKG.rst b/build/pkgs/database_cremona_ellcurve/SPKG.rst index f7d12916f2a..02fd4f4d89b 100644 --- a/build/pkgs/database_cremona_ellcurve/SPKG.rst +++ b/build/pkgs/database_cremona_ellcurve/SPKG.rst @@ -25,7 +25,6 @@ Patches - None -.. _upstream_contact: Upstream Contact ---------------- @@ -34,7 +33,6 @@ Upstream Contact - Email: john.cremona@gmail.com - Website: http://homepages.warwick.ac.uk/staff/J.E.Cremona/ -.. _update_instructions: Update Instructions ------------------- diff --git a/build/pkgs/database_jones_numfield/SPKG.rst b/build/pkgs/database_jones_numfield/SPKG.rst index fd9077f52fd..9d6854d8dd2 100644 --- a/build/pkgs/database_jones_numfield/SPKG.rst +++ b/build/pkgs/database_jones_numfield/SPKG.rst @@ -12,7 +12,6 @@ License GPLv2+ -.. _upstream_contact: Upstream Contact ---------------- @@ -24,7 +23,6 @@ Dependencies None -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/database_kohel/SPKG.rst b/build/pkgs/database_kohel/SPKG.rst index 6ecaee240db..2208efb7a9d 100644 --- a/build/pkgs/database_kohel/SPKG.rst +++ b/build/pkgs/database_kohel/SPKG.rst @@ -1,4 +1,3 @@ -.. _kohel_database: Kohel database ============== @@ -8,7 +7,6 @@ Description Database of modular and Hilbert polynomials. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/database_mutation_class/SPKG.rst b/build/pkgs/database_mutation_class/SPKG.rst index 78d015ecad3..dd07544bb64 100644 --- a/build/pkgs/database_mutation_class/SPKG.rst +++ b/build/pkgs/database_mutation_class/SPKG.rst @@ -1,4 +1,3 @@ -.. _mutation_class_database: Mutation class database ======================= @@ -23,7 +22,6 @@ Description \``sage.combinat.cluster_algebra_quiver.quiver_mutation_type._save_data_dig6(n, types='Exceptional', verbose=False)`\` -.. _spkg_maintainers: SPKG Maintainers ---------------- diff --git a/build/pkgs/database_odlyzko_zeta/SPKG.rst b/build/pkgs/database_odlyzko_zeta/SPKG.rst index 68d649f61b3..d0865cd907c 100644 --- a/build/pkgs/database_odlyzko_zeta/SPKG.rst +++ b/build/pkgs/database_odlyzko_zeta/SPKG.rst @@ -1,4 +1,3 @@ -.. _zeros_of_the_riemann_zeta_function: Zeros of the Riemann zeta function ================================== diff --git a/build/pkgs/database_symbolic_data/SPKG.rst b/build/pkgs/database_symbolic_data/SPKG.rst index 217729482e6..67c72efad12 100644 --- a/build/pkgs/database_symbolic_data/SPKG.rst +++ b/build/pkgs/database_symbolic_data/SPKG.rst @@ -31,7 +31,6 @@ License GNU General Public License -.. _upstream_contact: Upstream Contact ---------------- @@ -41,7 +40,6 @@ Upstream Contact Dependencies ------------ -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/dateutil/SPKG.rst b/build/pkgs/dateutil/SPKG.rst index 4270e471662..6bfb61a0b6b 100644 --- a/build/pkgs/dateutil/SPKG.rst +++ b/build/pkgs/dateutil/SPKG.rst @@ -12,7 +12,6 @@ License Simplified BSD License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/deformation/SPKG.rst b/build/pkgs/deformation/SPKG.rst index bba378f0a3c..f8cc5e2a22d 100644 --- a/build/pkgs/deformation/SPKG.rst +++ b/build/pkgs/deformation/SPKG.rst @@ -12,7 +12,6 @@ License GLPv3 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/defusedxml/SPKG.rst b/build/pkgs/defusedxml/SPKG.rst index d829cac1c4e..e39d1435e33 100644 --- a/build/pkgs/defusedxml/SPKG.rst +++ b/build/pkgs/defusedxml/SPKG.rst @@ -13,7 +13,6 @@ License Python Software Foundation License (PSFL) -.. _upstream_contact: Upstream Contact ---------------- @@ -25,7 +24,6 @@ Dependencies - pip -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/docutils/SPKG.rst b/build/pkgs/docutils/SPKG.rst index 8f8e0bb7415..0b3d2f4ab66 100644 --- a/build/pkgs/docutils/SPKG.rst +++ b/build/pkgs/docutils/SPKG.rst @@ -14,7 +14,6 @@ License Modified BSD -.. _upstream_contact: Upstream Contact ---------------- @@ -26,7 +25,6 @@ Dependencies None -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/dot2tex/SPKG.rst b/build/pkgs/dot2tex/SPKG.rst index 70cae44d0c2..2ba3d5aa3a7 100644 --- a/build/pkgs/dot2tex/SPKG.rst +++ b/build/pkgs/dot2tex/SPKG.rst @@ -16,7 +16,6 @@ License - MIT -.. _upstream_contact: Upstream Contact ---------------- @@ -46,7 +45,6 @@ Patches Remove the failing semicolon test for the open dot2tex issue #5 - https://github.com/kjellmf/dot2tex/issues/5 -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/e_antic/SPKG.rst b/build/pkgs/e_antic/SPKG.rst index c298b7c79a9..e6e3ffc29c3 100644 --- a/build/pkgs/e_antic/SPKG.rst +++ b/build/pkgs/e_antic/SPKG.rst @@ -1,4 +1,3 @@ -.. _e_antic: e-antic ======= @@ -16,7 +15,6 @@ License e-antic is licensed GPL v3. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/ecl/SPKG.rst b/build/pkgs/ecl/SPKG.rst index a4a701ff803..b7b191129d6 100644 --- a/build/pkgs/ecl/SPKG.rst +++ b/build/pkgs/ecl/SPKG.rst @@ -28,7 +28,6 @@ License http://ecls.sourceforge.net/license.html -.. _upstream_contact: Upstream Contact ---------------- @@ -41,7 +40,6 @@ Dependencies - mpir - boehm_gc -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/eclib/SPKG.rst b/build/pkgs/eclib/SPKG.rst index 13c6155767d..9c24ab8cebc 100644 --- a/build/pkgs/eclib/SPKG.rst +++ b/build/pkgs/eclib/SPKG.rst @@ -20,7 +20,6 @@ License eclib is licensed GPL v2+. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/ecm/SPKG.rst b/build/pkgs/ecm/SPKG.rst index 93490d6ee5d..fbbae582bb5 100644 --- a/build/pkgs/ecm/SPKG.rst +++ b/build/pkgs/ecm/SPKG.rst @@ -13,7 +13,6 @@ License LGPL V3+ -.. _upstream_contact: Upstream Contact ---------------- @@ -26,7 +25,6 @@ Dependencies - GMP/MPIR (Note: Python is \*not\* required for ordinary builds.) - GNU patch -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/elliptic_curves/SPKG.rst b/build/pkgs/elliptic_curves/SPKG.rst index 0bdacbc65cf..cb22e9ccb42 100644 --- a/build/pkgs/elliptic_curves/SPKG.rst +++ b/build/pkgs/elliptic_curves/SPKG.rst @@ -12,7 +12,6 @@ Includes two databases: - William Stein's database of interesting curves -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/entrypoints/SPKG.rst b/build/pkgs/entrypoints/SPKG.rst index 45a491489a2..e33daf5c768 100644 --- a/build/pkgs/entrypoints/SPKG.rst +++ b/build/pkgs/entrypoints/SPKG.rst @@ -6,14 +6,12 @@ Description Discover and load entry points from installed packages. -.. _upstream_contact: Upstream Contact ---------------- https://github.com/takluyver/entrypoints -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/fflas_ffpack/SPKG.rst b/build/pkgs/fflas_ffpack/SPKG.rst index 4cdae414e0d..8373e0f5cfa 100644 --- a/build/pkgs/fflas_ffpack/SPKG.rst +++ b/build/pkgs/fflas_ffpack/SPKG.rst @@ -14,14 +14,12 @@ License LGPL V2.1 or later -.. _spkg_repository: SPKG Repository --------------- https://bitbucket.org/malb/fflas-ffpack-spkg -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/flask_autoindex/SPKG.rst b/build/pkgs/flask_autoindex/SPKG.rst index b83dee98c9c..43f8f79e3da 100644 --- a/build/pkgs/flask_autoindex/SPKG.rst +++ b/build/pkgs/flask_autoindex/SPKG.rst @@ -1,4 +1,3 @@ -.. _flask_autoindex: Flask-AutoIndex =============== diff --git a/build/pkgs/flask_babel/SPKG.rst b/build/pkgs/flask_babel/SPKG.rst index 4676433718d..6974facfcf8 100644 --- a/build/pkgs/flask_babel/SPKG.rst +++ b/build/pkgs/flask_babel/SPKG.rst @@ -1,4 +1,3 @@ -.. _flask_babel: Flask-Babel =========== diff --git a/build/pkgs/flask_oldsessions/SPKG.rst b/build/pkgs/flask_oldsessions/SPKG.rst index eff9a20741d..9ce3d39c12d 100644 --- a/build/pkgs/flask_oldsessions/SPKG.rst +++ b/build/pkgs/flask_oldsessions/SPKG.rst @@ -1,4 +1,3 @@ -.. _flask_oldsessions: Flask-OldSessions ================= diff --git a/build/pkgs/flask_openid/SPKG.rst b/build/pkgs/flask_openid/SPKG.rst index 4da174844d4..5ac2ac228e0 100644 --- a/build/pkgs/flask_openid/SPKG.rst +++ b/build/pkgs/flask_openid/SPKG.rst @@ -1,4 +1,3 @@ -.. _flask_openid: Flask-OpenID ============ diff --git a/build/pkgs/flask_silk/SPKG.rst b/build/pkgs/flask_silk/SPKG.rst index 094cbbdc40b..6d5b14492c4 100644 --- a/build/pkgs/flask_silk/SPKG.rst +++ b/build/pkgs/flask_silk/SPKG.rst @@ -1,4 +1,3 @@ -.. _flask_silk: Flask-Silk ========== diff --git a/build/pkgs/flint/SPKG.rst b/build/pkgs/flint/SPKG.rst index 2106706b866..c62bc607dd8 100644 --- a/build/pkgs/flint/SPKG.rst +++ b/build/pkgs/flint/SPKG.rst @@ -14,7 +14,6 @@ License FLINT is licensed GPL v2+. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/fplll/SPKG.rst b/build/pkgs/fplll/SPKG.rst index 9c9d161435f..f31484c927a 100644 --- a/build/pkgs/fplll/SPKG.rst +++ b/build/pkgs/fplll/SPKG.rst @@ -15,7 +15,6 @@ License - LGPL V2.1+ -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/fpylll/SPKG.rst b/build/pkgs/fpylll/SPKG.rst index 441ba667e7f..a583f5757d8 100644 --- a/build/pkgs/fpylll/SPKG.rst +++ b/build/pkgs/fpylll/SPKG.rst @@ -11,7 +11,6 @@ License GPL version 2 or later -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/freetype/SPKG.rst b/build/pkgs/freetype/SPKG.rst index 8d7fd4f28ec..7b516572480 100644 --- a/build/pkgs/freetype/SPKG.rst +++ b/build/pkgs/freetype/SPKG.rst @@ -36,7 +36,6 @@ From the documentation: > FreeType License and the GNU Public License, Version 2. It can thus > be used by any kind of projects, be they proprietary or not. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/fricas/SPKG.rst b/build/pkgs/fricas/SPKG.rst index 6d944a96ebf..cb86c9c65d3 100644 --- a/build/pkgs/fricas/SPKG.rst +++ b/build/pkgs/fricas/SPKG.rst @@ -11,7 +11,6 @@ License Modified BSD license. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/frobby/SPKG.rst b/build/pkgs/frobby/SPKG.rst index f78e5cc6e1e..43d67a408ee 100644 --- a/build/pkgs/frobby/SPKG.rst +++ b/build/pkgs/frobby/SPKG.rst @@ -23,7 +23,6 @@ Maintainers - Bjarke Hammersholt Roune (www.broune.com) -.. _upstream_contact: Upstream Contact ---------------- @@ -35,7 +34,6 @@ Dependencies - GMP built with support for C++ -.. _special_updatebuild_instructions: Special Update/Build instructions --------------------------------- diff --git a/build/pkgs/functools32/SPKG.rst b/build/pkgs/functools32/SPKG.rst index 1f5d27e9122..0a9c6f1370f 100644 --- a/build/pkgs/functools32/SPKG.rst +++ b/build/pkgs/functools32/SPKG.rst @@ -12,7 +12,6 @@ License Python Software Foundation License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/gambit/SPKG.rst b/build/pkgs/gambit/SPKG.rst index 91af81e0a10..d40cbdd1637 100644 --- a/build/pkgs/gambit/SPKG.rst +++ b/build/pkgs/gambit/SPKG.rst @@ -13,7 +13,6 @@ License GPL v2+ -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/gap/SPKG.rst b/build/pkgs/gap/SPKG.rst index 19f6111f279..54886af1642 100644 --- a/build/pkgs/gap/SPKG.rst +++ b/build/pkgs/gap/SPKG.rst @@ -18,7 +18,6 @@ it for your special use. This is a stripped-down version of GAP. The databases, which are architecture-independent, are in a separate package. -.. _upstream_contact: Upstream Contact ---------------- @@ -32,7 +31,6 @@ Dependencies - Readline - MPIR -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/gap3/SPKG.rst b/build/pkgs/gap3/SPKG.rst index 1a276ec17ff..05093945717 100644 --- a/build/pkgs/gap3/SPKG.rst +++ b/build/pkgs/gap3/SPKG.rst @@ -1,4 +1,3 @@ -.. _jean_michels_gap_3_distribution: Jean Michel's GAP 3 distribution ================================ @@ -56,14 +55,12 @@ system, are distributed under the terms of the GNU General Public License (see http://www.gnu.org/licenses/gpl.html or the file GPL in the etc directory of the GAP installation). -.. _spkg_maintainers: SPKG Maintainers ---------------- - Christian Stump -.. _upstream_contact: Upstream Contact ---------------- @@ -71,7 +68,6 @@ Upstream Contact Jean Michel http://webusers.imj-prg.fr/~jean.michel/ -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/gap_jupyter/SPKG.rst b/build/pkgs/gap_jupyter/SPKG.rst index ddc34974de4..9e46f9e46a6 100644 --- a/build/pkgs/gap_jupyter/SPKG.rst +++ b/build/pkgs/gap_jupyter/SPKG.rst @@ -1,4 +1,3 @@ -.. _jupyter_kernel_gap: jupyter-kernel-gap ================== @@ -16,7 +15,6 @@ License 3-Clause BSD License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/gap_packages/SPKG.rst b/build/pkgs/gap_packages/SPKG.rst index 46863df2e58..e89072b90c9 100644 --- a/build/pkgs/gap_packages/SPKG.rst +++ b/build/pkgs/gap_packages/SPKG.rst @@ -7,7 +7,6 @@ Description Several "official" and "undeposited" GAP packages available from http://www.gap-system.org/Packages/packages.html -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/gc/SPKG.rst b/build/pkgs/gc/SPKG.rst index 7ba6cb2da90..e6bf7c35fbf 100644 --- a/build/pkgs/gc/SPKG.rst +++ b/build/pkgs/gc/SPKG.rst @@ -11,7 +11,6 @@ License - Permissive BSD + GPL 2.0+ -.. _upstream_contact: Upstream Contact ---------------- @@ -24,7 +23,6 @@ Dependencies None. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/gcc/SPKG.rst b/build/pkgs/gcc/SPKG.rst index fec25c23522..0fe63a12e96 100644 --- a/build/pkgs/gcc/SPKG.rst +++ b/build/pkgs/gcc/SPKG.rst @@ -11,7 +11,6 @@ License GPL version 2 or version 3 -.. _upstream_contact: Upstream Contact ---------------- @@ -26,7 +25,6 @@ Dependencies - MPFR - MPC -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/gdb/SPKG.rst b/build/pkgs/gdb/SPKG.rst index 33e1599a6e1..d4975db94da 100644 --- a/build/pkgs/gdb/SPKG.rst +++ b/build/pkgs/gdb/SPKG.rst @@ -13,7 +13,6 @@ License GPL v3+ -.. _upstream_contact: Upstream Contact ---------------- @@ -30,7 +29,6 @@ Dependencies - gmp/mpir - makeinfo (external) -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/gf2x/SPKG.rst b/build/pkgs/gf2x/SPKG.rst index ae93d6ceae8..141fd49ff9a 100644 --- a/build/pkgs/gf2x/SPKG.rst +++ b/build/pkgs/gf2x/SPKG.rst @@ -15,7 +15,6 @@ License - GNU GPLv2+. -.. _upstream_contact: Upstream Contact ---------------- @@ -30,7 +29,6 @@ Dependencies - None -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/gfan/SPKG.rst b/build/pkgs/gfan/SPKG.rst index a78f232e1f6..292dfe62166 100644 --- a/build/pkgs/gfan/SPKG.rst +++ b/build/pkgs/gfan/SPKG.rst @@ -25,7 +25,6 @@ License - GPL version 2 or version 3 (according to the gfan website) -.. _upstream_contact: Upstream Contact ---------------- @@ -39,7 +38,6 @@ Dependencies - GMP/MPIR - CDDLIB -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/gfortran/SPKG.rst b/build/pkgs/gfortran/SPKG.rst index c9fa89477d9..3b4352444d1 100644 --- a/build/pkgs/gfortran/SPKG.rst +++ b/build/pkgs/gfortran/SPKG.rst @@ -12,7 +12,6 @@ License GPL version 2 or version 3 -.. _upstream_contact: Upstream Contact ---------------- @@ -27,7 +26,6 @@ Dependencies - MPFR - MPC -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/giac/SPKG.rst b/build/pkgs/giac/SPKG.rst index d4518c0aa22..62563c0fe05 100644 --- a/build/pkgs/giac/SPKG.rst +++ b/build/pkgs/giac/SPKG.rst @@ -30,7 +30,6 @@ Note: except the french html documentation which is freely redistributable for non commercial only purposes. This doc has been removed in the Sage package, see spkg-src -.. _upstream_contact: Upstream Contact ---------------- @@ -51,7 +50,6 @@ Dependencies - The Documentation is pre-built, hevea or latex or ... are not needed to install the package. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/giacpy_sage/SPKG.rst b/build/pkgs/giacpy_sage/SPKG.rst index a3634e2ea62..af4bd19500c 100644 --- a/build/pkgs/giacpy_sage/SPKG.rst +++ b/build/pkgs/giacpy_sage/SPKG.rst @@ -13,7 +13,6 @@ Licence GPLv2 or above -.. _upstream_contact: Upstream Contact ---------------- @@ -27,7 +26,6 @@ Dependencies - gmp, giac (the C++ library libgiac and headers) -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/git/SPKG.rst b/build/pkgs/git/SPKG.rst index 21e60a6692d..9ade00c58c9 100644 --- a/build/pkgs/git/SPKG.rst +++ b/build/pkgs/git/SPKG.rst @@ -1,4 +1,3 @@ -.. _git___the_stupid_content_tracker: git - the stupid content tracker ================================ @@ -12,7 +11,6 @@ Description - - \`man git\` -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/git_trac/SPKG.rst b/build/pkgs/git_trac/SPKG.rst index 968a9465d03..8691c8bc2fb 100644 --- a/build/pkgs/git_trac/SPKG.rst +++ b/build/pkgs/git_trac/SPKG.rst @@ -1,4 +1,3 @@ -.. _git_trac: Git-Trac ======== @@ -14,7 +13,6 @@ License GPLv3+ -.. _upstream_contact: Upstream Contact ---------------- @@ -27,7 +25,6 @@ Dependencies - python 2.7 or 3.3+ -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/givaro/SPKG.rst b/build/pkgs/givaro/SPKG.rst index 0e95bc5ccd5..54198224ef2 100644 --- a/build/pkgs/givaro/SPKG.rst +++ b/build/pkgs/givaro/SPKG.rst @@ -23,7 +23,6 @@ License - GNU GPL -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/glpk/SPKG.rst b/build/pkgs/glpk/SPKG.rst index 4c0a0ff4e10..a25136f27fd 100644 --- a/build/pkgs/glpk/SPKG.rst +++ b/build/pkgs/glpk/SPKG.rst @@ -26,7 +26,6 @@ License The GLPK package is GPL version 3. -.. _upstream_contact: Upstream Contact ---------------- @@ -43,7 +42,6 @@ Dependencies - GMP/MPIR - zlib -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/glucose/SPKG.rst b/build/pkgs/glucose/SPKG.rst index d97e616757d..d37117825b2 100644 --- a/build/pkgs/glucose/SPKG.rst +++ b/build/pkgs/glucose/SPKG.rst @@ -27,7 +27,6 @@ License event using Glucose Parallel as an embedded SAT engine (single core or not). -.. _upstream_contact: Upstream Contact ---------------- @@ -39,7 +38,6 @@ Dependencies zlib -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/gmp/SPKG.rst b/build/pkgs/gmp/SPKG.rst index c78329ef301..c9103d3e5ca 100644 --- a/build/pkgs/gmp/SPKG.rst +++ b/build/pkgs/gmp/SPKG.rst @@ -15,7 +15,6 @@ License - LGPL V3 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/gp2c/SPKG.rst b/build/pkgs/gp2c/SPKG.rst index 4859b41225d..35a232f6cae 100644 --- a/build/pkgs/gp2c/SPKG.rst +++ b/build/pkgs/gp2c/SPKG.rst @@ -13,7 +13,6 @@ License GPL version 2+ -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/graphs/SPKG.rst b/build/pkgs/graphs/SPKG.rst index a381a88422e..e4c2960a5e5 100644 --- a/build/pkgs/graphs/SPKG.rst +++ b/build/pkgs/graphs/SPKG.rst @@ -7,7 +7,6 @@ Description A database of graphs. Created by Emily Kirkman based on the work of Jason Grout. Since April 2012 it also contains the ISGCI graph database. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/gsl/SPKG.rst b/build/pkgs/gsl/SPKG.rst index 2fd0a56dcc1..b89f7e6fdf5 100644 --- a/build/pkgs/gsl/SPKG.rst +++ b/build/pkgs/gsl/SPKG.rst @@ -21,7 +21,6 @@ License - GPL V3 -.. _upstream_contact: Upstream Contact ---------------- @@ -58,7 +57,6 @@ Dependencies Sage library only uses it as a fall-back, if e.g. BLAS library is not present.) -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/html5lib/SPKG.rst b/build/pkgs/html5lib/SPKG.rst index 39dcde6512c..1f20ca08cdb 100644 --- a/build/pkgs/html5lib/SPKG.rst +++ b/build/pkgs/html5lib/SPKG.rst @@ -11,7 +11,6 @@ License MIT License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/iconv/SPKG.rst b/build/pkgs/iconv/SPKG.rst index a022b01083c..298f1a7b722 100644 --- a/build/pkgs/iconv/SPKG.rst +++ b/build/pkgs/iconv/SPKG.rst @@ -12,7 +12,6 @@ License - GPL 3 and LGPL 3. So we can safely link against the library in Sage. -.. _upstream_contact: Upstream Contact ---------------- @@ -25,7 +24,6 @@ Dependencies - None for the purposes of Sage, but in general gettext. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/igraph/SPKG.rst b/build/pkgs/igraph/SPKG.rst index dfaeeab6945..32e3cb9bf8d 100644 --- a/build/pkgs/igraph/SPKG.rst +++ b/build/pkgs/igraph/SPKG.rst @@ -13,7 +13,6 @@ License GPL version 2 -.. _upstream_contact: Upstream Contact ---------------- @@ -29,7 +28,6 @@ Dependencies libxml2-dev from her distro. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/iml/SPKG.rst b/build/pkgs/iml/SPKG.rst index d52b1e5e407..15a6d129b02 100644 --- a/build/pkgs/iml/SPKG.rst +++ b/build/pkgs/iml/SPKG.rst @@ -19,7 +19,6 @@ License - GPLv2+ -.. _upstream_contact: Upstream Contact ---------------- @@ -33,7 +32,6 @@ Dependencies - GMP - ATLAS -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/ipython/SPKG.rst b/build/pkgs/ipython/SPKG.rst index 7b6d5fbf51c..2790729df4a 100644 --- a/build/pkgs/ipython/SPKG.rst +++ b/build/pkgs/ipython/SPKG.rst @@ -29,7 +29,6 @@ License BSD -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/isl/SPKG.rst b/build/pkgs/isl/SPKG.rst index 5f7a59d66d4..e4bf84f2079 100644 --- a/build/pkgs/isl/SPKG.rst +++ b/build/pkgs/isl/SPKG.rst @@ -16,7 +16,6 @@ License isl is released under the MIT license, but depends on the LGPL GMP library. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/jinja2/SPKG.rst b/build/pkgs/jinja2/SPKG.rst index 0d06893aa49..9c2eb9e4355 100644 --- a/build/pkgs/jinja2/SPKG.rst +++ b/build/pkgs/jinja2/SPKG.rst @@ -17,7 +17,6 @@ License Modified BSD License -.. _upstream_contact: Upstream Contact ---------------- @@ -32,7 +31,6 @@ Dependencies - Pygments (according to 'spkg/standard/deps') - docutils (dito, as a note only) -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/jmol/SPKG.rst b/build/pkgs/jmol/SPKG.rst index 46ad240a003..c24b54cf82c 100644 --- a/build/pkgs/jmol/SPKG.rst +++ b/build/pkgs/jmol/SPKG.rst @@ -1,4 +1,3 @@ -.. _jmol_for_sage: Jmol for Sage ============= @@ -16,7 +15,6 @@ License GPLv2+ -.. _upstream_contact: Upstream Contact ---------------- @@ -34,7 +32,6 @@ No build-time dependencies. The commandline jmol requires java at runtime. -.. _special_build_instructions: Special Build Instructions -------------------------- diff --git a/build/pkgs/jsonschema/SPKG.rst b/build/pkgs/jsonschema/SPKG.rst index 791297dbd5d..57e9a4c353f 100644 --- a/build/pkgs/jsonschema/SPKG.rst +++ b/build/pkgs/jsonschema/SPKG.rst @@ -11,7 +11,6 @@ License MIT License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/jupymake/SPKG.rst b/build/pkgs/jupymake/SPKG.rst index ca7ff9c676a..538dc6e445a 100644 --- a/build/pkgs/jupymake/SPKG.rst +++ b/build/pkgs/jupymake/SPKG.rst @@ -11,7 +11,6 @@ License - GPL v2 -.. _upstream_contact: Upstream Contact ---------------- @@ -24,7 +23,6 @@ Dependencies - pip - polymake -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/kenzo/SPKG.rst b/build/pkgs/kenzo/SPKG.rst index e8eb8450d83..faa055b87ee 100644 --- a/build/pkgs/kenzo/SPKG.rst +++ b/build/pkgs/kenzo/SPKG.rst @@ -13,7 +13,6 @@ License GPL -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/kiwisolver/SPKG.rst b/build/pkgs/kiwisolver/SPKG.rst index d5f118a71da..8b8e86dd28b 100644 --- a/build/pkgs/kiwisolver/SPKG.rst +++ b/build/pkgs/kiwisolver/SPKG.rst @@ -24,7 +24,6 @@ License Modified BSD License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/latte_int/SPKG.rst b/build/pkgs/latte_int/SPKG.rst index d9bc723120f..6691a363287 100644 --- a/build/pkgs/latte_int/SPKG.rst +++ b/build/pkgs/latte_int/SPKG.rst @@ -12,7 +12,6 @@ License GPLv2 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/lcalc/SPKG.rst b/build/pkgs/lcalc/SPKG.rst index bba2786b7cb..2bc6a6ce554 100644 --- a/build/pkgs/lcalc/SPKG.rst +++ b/build/pkgs/lcalc/SPKG.rst @@ -11,7 +11,6 @@ License - LGPL V2+ -.. _upstream_contact: Upstream contact ---------------- @@ -31,7 +30,6 @@ Dependencies - PARI - GNU patch -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/libatomic_ops/SPKG.rst b/build/pkgs/libatomic_ops/SPKG.rst index 5060aa08d61..dc743ee01af 100644 --- a/build/pkgs/libatomic_ops/SPKG.rst +++ b/build/pkgs/libatomic_ops/SPKG.rst @@ -11,7 +11,6 @@ License - Permissive BSD + GPL 2.0+ -.. _upstream_contact: Upstream Contact ---------------- @@ -24,7 +23,6 @@ Dependencies None. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/libbraiding/SPKG.rst b/build/pkgs/libbraiding/SPKG.rst index cf397c048f3..f4075593ab9 100644 --- a/build/pkgs/libbraiding/SPKG.rst +++ b/build/pkgs/libbraiding/SPKG.rst @@ -12,14 +12,12 @@ License GPLv3+ -.. _spkg_maintainers: SPKG Maintainers ---------------- - Miguel Marco -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/libffi/SPKG.rst b/build/pkgs/libffi/SPKG.rst index e914b3c1580..3b7730a1dc2 100644 --- a/build/pkgs/libffi/SPKG.rst +++ b/build/pkgs/libffi/SPKG.rst @@ -52,7 +52,6 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/libgd/SPKG.rst b/build/pkgs/libgd/SPKG.rst index 9e80b22e10e..804855e3a1e 100644 --- a/build/pkgs/libgd/SPKG.rst +++ b/build/pkgs/libgd/SPKG.rst @@ -17,7 +17,6 @@ License - Custom (BSD-ish) -.. _upstream_contact: Upstream Contact ---------------- @@ -32,7 +31,6 @@ Dependencies - freetype - iconv -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/libhomfly/SPKG.rst b/build/pkgs/libhomfly/SPKG.rst index 8a4aa793c94..b7da49a70c8 100644 --- a/build/pkgs/libhomfly/SPKG.rst +++ b/build/pkgs/libhomfly/SPKG.rst @@ -12,14 +12,12 @@ License Public domain -.. _spkg_maintainers: SPKG Maintainers ---------------- - Miguel Marco -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/libogg/SPKG.rst b/build/pkgs/libogg/SPKG.rst index 7e0006b9dad..db511888876 100644 --- a/build/pkgs/libogg/SPKG.rst +++ b/build/pkgs/libogg/SPKG.rst @@ -46,7 +46,6 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.. _upstream_contact: Upstream Contact ---------------- @@ -60,7 +59,6 @@ This spkg provides dependencies for - the Sage library -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/libpng/SPKG.rst b/build/pkgs/libpng/SPKG.rst index 994a2899231..f562451f78e 100644 --- a/build/pkgs/libpng/SPKG.rst +++ b/build/pkgs/libpng/SPKG.rst @@ -19,7 +19,6 @@ License The libpng license - see http://www.libpng.org/pub/png/src/libpng-LICENSE.txt -.. _upstream_contact: Upstream Contact ---------------- @@ -34,7 +33,6 @@ This spkg depends on: - libz -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/libsemigroups/SPKG.rst b/build/pkgs/libsemigroups/SPKG.rst index 32b93be17e6..cf3b81d8de7 100644 --- a/build/pkgs/libsemigroups/SPKG.rst +++ b/build/pkgs/libsemigroups/SPKG.rst @@ -12,7 +12,6 @@ License GPL-3.0 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/libtheora/SPKG.rst b/build/pkgs/libtheora/SPKG.rst index 58d704b7e40..7acecc62466 100644 --- a/build/pkgs/libtheora/SPKG.rst +++ b/build/pkgs/libtheora/SPKG.rst @@ -45,7 +45,6 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.. _upstream_contact: Upstream Contact ---------------- @@ -64,7 +63,6 @@ This spkg provides dependencies for - the Sage library -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/lidia/SPKG.rst b/build/pkgs/lidia/SPKG.rst index 98160accb31..a2edd189623 100644 --- a/build/pkgs/lidia/SPKG.rst +++ b/build/pkgs/lidia/SPKG.rst @@ -20,7 +20,6 @@ lidia is released under the GPL, or so it is claimed. See https://groups.google.com/forum/#!msg/sage-devel/kTxgPSqrbUM/5Txj3_IKhlQJ and https://lists.debian.org/debian-legal/2007/07/msg00120.html -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/lie/SPKG.rst b/build/pkgs/lie/SPKG.rst index 5ad0495f76d..115261d7446 100644 --- a/build/pkgs/lie/SPKG.rst +++ b/build/pkgs/lie/SPKG.rst @@ -39,7 +39,6 @@ License GNU Lesser General Public License (LGPL), version unspecified -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/linbox/SPKG.rst b/build/pkgs/linbox/SPKG.rst index 956c2704b5f..5f4ff029748 100644 --- a/build/pkgs/linbox/SPKG.rst +++ b/build/pkgs/linbox/SPKG.rst @@ -13,7 +13,6 @@ License LGPL V2 or later -.. _upstream_contact: Upstream Contact ---------------- @@ -21,7 +20,6 @@ Upstream Contact - - -.. _spkg_repository: SPKG Repository --------------- @@ -45,7 +43,6 @@ Dependencies - ATLAS (non-MacOS X) / The Accelerate FrameWork (on MacOS X), or GSL's CBLAS -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/lrcalc/SPKG.rst b/build/pkgs/lrcalc/SPKG.rst index 66529d7d9d9..80f8bb08448 100644 --- a/build/pkgs/lrcalc/SPKG.rst +++ b/build/pkgs/lrcalc/SPKG.rst @@ -13,7 +13,6 @@ License GNU General Public License V2+ -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/lrslib/SPKG.rst b/build/pkgs/lrslib/SPKG.rst index 9e79bce7d34..852810abb5e 100644 --- a/build/pkgs/lrslib/SPKG.rst +++ b/build/pkgs/lrslib/SPKG.rst @@ -17,7 +17,6 @@ License lrslib is released under a GPL v2+ license. -.. _upstream_contact: Upstream Contact ---------------- @@ -35,7 +34,6 @@ and installs the "mplrs" binary, a distributed version of lrs using MPI. (Sage currently does not make use of plrs and mplrs.) -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/m4ri/SPKG.rst b/build/pkgs/m4ri/SPKG.rst index e77dfff0ef1..6b71b777848 100644 --- a/build/pkgs/m4ri/SPKG.rst +++ b/build/pkgs/m4ri/SPKG.rst @@ -12,7 +12,6 @@ License - GNU General Public License Version 2 or later (see src/COPYING) -.. _upstream_contact: Upstream Contact ---------------- @@ -26,7 +25,6 @@ Dependencies - libPNG -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/m4rie/SPKG.rst b/build/pkgs/m4rie/SPKG.rst index 504b6e32d98..34f5b73f732 100644 --- a/build/pkgs/m4rie/SPKG.rst +++ b/build/pkgs/m4rie/SPKG.rst @@ -12,7 +12,6 @@ License - GNU General Public License Version 2 or later (see src/COPYING) -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/markupsafe/SPKG.rst b/build/pkgs/markupsafe/SPKG.rst index 69f3f8f06e9..b2f117dae5b 100644 --- a/build/pkgs/markupsafe/SPKG.rst +++ b/build/pkgs/markupsafe/SPKG.rst @@ -11,7 +11,6 @@ License Simplified BSD -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/mathjax/SPKG.rst b/build/pkgs/mathjax/SPKG.rst index 646b1743bc2..1200613ec38 100644 --- a/build/pkgs/mathjax/SPKG.rst +++ b/build/pkgs/mathjax/SPKG.rst @@ -12,7 +12,6 @@ License Apache License, version 2.0 -.. _upstream_contact: Upstream Contact ---------------- @@ -24,7 +23,6 @@ Dependencies None. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/matplotlib/SPKG.rst b/build/pkgs/matplotlib/SPKG.rst index efe670d93cf..d5a1cac6564 100644 --- a/build/pkgs/matplotlib/SPKG.rst +++ b/build/pkgs/matplotlib/SPKG.rst @@ -22,7 +22,6 @@ licenses. Non-BSD compatible licenses (eg LGPL) are acceptable in matplotlib Toolkits. For a discussion of the motivations behind the licencing choice, see Licenses. -.. _upstream_contact: Upstream Contact ---------------- @@ -43,7 +42,6 @@ Dependencies - tornado - kiwisolver -.. _build_instructionschanges: Build Instructions/Changes -------------------------- diff --git a/build/pkgs/maxima/SPKG.rst b/build/pkgs/maxima/SPKG.rst index 45b4ced62e7..ff6085dfa08 100644 --- a/build/pkgs/maxima/SPKG.rst +++ b/build/pkgs/maxima/SPKG.rst @@ -23,7 +23,6 @@ Maxima is distributed under the GNU General Public License, with some export restrictions from the U.S. Department of Energy. See the file COPYING. -.. _upstream_contact: Upstream Contact ---------------- @@ -36,7 +35,6 @@ Dependencies - ECL (Embedded Common Lisp) -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/mcqd/SPKG.rst b/build/pkgs/mcqd/SPKG.rst index 2de2876e489..319dd5c6b23 100644 --- a/build/pkgs/mcqd/SPKG.rst +++ b/build/pkgs/mcqd/SPKG.rst @@ -1,4 +1,3 @@ -.. _mcqd_1.0: MCQD 1.0 ======== @@ -14,7 +13,6 @@ License GPL 3 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/meataxe/SPKG.rst b/build/pkgs/meataxe/SPKG.rst index 89e8cbcfe71..cc6c41d1f6d 100644 --- a/build/pkgs/meataxe/SPKG.rst +++ b/build/pkgs/meataxe/SPKG.rst @@ -20,7 +20,6 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. See the file COPYING. -.. _upstream_contact: Upstream contact ---------------- diff --git a/build/pkgs/mistune/SPKG.rst b/build/pkgs/mistune/SPKG.rst index 4e21fc42ebc..e540bd0915f 100644 --- a/build/pkgs/mistune/SPKG.rst +++ b/build/pkgs/mistune/SPKG.rst @@ -11,7 +11,6 @@ License BSD License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/modular_decomposition/SPKG.rst b/build/pkgs/modular_decomposition/SPKG.rst index bdfde451229..d61cbdd5b9d 100644 --- a/build/pkgs/modular_decomposition/SPKG.rst +++ b/build/pkgs/modular_decomposition/SPKG.rst @@ -1,4 +1,3 @@ -.. _modular_decomposition: modular decomposition ===================== @@ -15,7 +14,6 @@ License GPL -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/mpc/SPKG.rst b/build/pkgs/mpc/SPKG.rst index 119b205046a..81b3cef4f7e 100644 --- a/build/pkgs/mpc/SPKG.rst +++ b/build/pkgs/mpc/SPKG.rst @@ -18,7 +18,6 @@ License LGPLv3+ for the code and GFDLv1.3+ (with no invariant sections) for the documentation. -.. _upstream_contact: Upstream Contact ---------------- @@ -35,7 +34,6 @@ Dependencies - MPIR - MPFR -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/mpfi/SPKG.rst b/build/pkgs/mpfi/SPKG.rst index 400fa38c259..4e8897812ff 100644 --- a/build/pkgs/mpfi/SPKG.rst +++ b/build/pkgs/mpfi/SPKG.rst @@ -27,7 +27,6 @@ License. It is permitted to link MPFI to non-free programs, as long as when distributing them the MPFI source code and a means to re-link with a modified MPFI is provided. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/mpfr/SPKG.rst b/build/pkgs/mpfr/SPKG.rst index 50796922e49..d5a098228da 100644 --- a/build/pkgs/mpfr/SPKG.rst +++ b/build/pkgs/mpfr/SPKG.rst @@ -31,7 +31,6 @@ enables developers of non-free programs to use MPFR in their programs. If you have written a new function for MPFR or improved an existing one, please share your work! -.. _upstream_contact: Upstream Contact ---------------- @@ -46,7 +45,6 @@ Dependencies - GMP/MPIR - GNU patch -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/mpfrcx/SPKG.rst b/build/pkgs/mpfrcx/SPKG.rst index 24f2d607e7f..8a2c3e649ce 100644 --- a/build/pkgs/mpfrcx/SPKG.rst +++ b/build/pkgs/mpfrcx/SPKG.rst @@ -19,7 +19,6 @@ MPFRCX is distributed under the Gnu Lesser General Public License, either version 2.1 of the licence, or (at your option) any later version (LGPLv2.1+). -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/mpir/SPKG.rst b/build/pkgs/mpir/SPKG.rst index 2037868680d..7ea2a173059 100644 --- a/build/pkgs/mpir/SPKG.rst +++ b/build/pkgs/mpir/SPKG.rst @@ -15,7 +15,6 @@ License - LGPL V3+ -.. _upstream_contact: Upstream Contact ---------------- @@ -29,7 +28,6 @@ Dependencies - iconv - GNU patch -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/mpmath/SPKG.rst b/build/pkgs/mpmath/SPKG.rst index 2bd7795d534..a947501e4de 100644 --- a/build/pkgs/mpmath/SPKG.rst +++ b/build/pkgs/mpmath/SPKG.rst @@ -14,7 +14,6 @@ asymptotically fast algorithms that scale well for extremely high precision work. If available, mpmath will (optionally) use gmpy to speed up high precision operations. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/nauty/SPKG.rst b/build/pkgs/nauty/SPKG.rst index 15d1256a8db..76e42233452 100644 --- a/build/pkgs/nauty/SPKG.rst +++ b/build/pkgs/nauty/SPKG.rst @@ -16,7 +16,6 @@ http://users.cecs.anu.edu.au/~bdm/nauty/COPYRIGHT.txt (a copy of this file, called COPYRIGHT, is also present in the tarball) -.. _special_packaging_instruction: Special Packaging Instruction ----------------------------- @@ -25,7 +24,6 @@ Upstream distribute tarball named nauty${version}.tar.gz. We cannot deal with that so rename it nauty-${version}.tar.gz (notice the "-") without any changes. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/ncurses/SPKG.rst b/build/pkgs/ncurses/SPKG.rst index c6b60e92858..be8e3bb5b0b 100644 --- a/build/pkgs/ncurses/SPKG.rst +++ b/build/pkgs/ncurses/SPKG.rst @@ -31,7 +31,6 @@ License - MIT-style -.. _upstream_contact: Upstream Contact ---------------- @@ -43,7 +42,6 @@ Dependencies None -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/networkx/SPKG.rst b/build/pkgs/networkx/SPKG.rst index 2da1a3ff0ae..74bfdfe037d 100644 --- a/build/pkgs/networkx/SPKG.rst +++ b/build/pkgs/networkx/SPKG.rst @@ -12,7 +12,6 @@ License BSD -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/ninja_build/SPKG.rst b/build/pkgs/ninja_build/SPKG.rst index 7bc5bba4598..a0b88ecf63b 100644 --- a/build/pkgs/ninja_build/SPKG.rst +++ b/build/pkgs/ninja_build/SPKG.rst @@ -11,7 +11,6 @@ License Apache License 2.0 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/normaliz/SPKG.rst b/build/pkgs/normaliz/SPKG.rst index 1925ee6e637..8e33fabb953 100644 --- a/build/pkgs/normaliz/SPKG.rst +++ b/build/pkgs/normaliz/SPKG.rst @@ -14,7 +14,6 @@ License - GPL v3 -.. _upstream_contact: Upstream Contact ---------------- @@ -32,7 +31,6 @@ Dependencies - GMP/MPIR - boost -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/nose/SPKG.rst b/build/pkgs/nose/SPKG.rst index 3d1d34b411d..b66ffd2a980 100644 --- a/build/pkgs/nose/SPKG.rst +++ b/build/pkgs/nose/SPKG.rst @@ -12,7 +12,6 @@ License GNU LGPL -.. _upstream_contact: Upstream Contact ---------------- @@ -28,7 +27,6 @@ Dependencies - Python - GNU patch (shipped with Sage) -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/notedown/SPKG.rst b/build/pkgs/notedown/SPKG.rst index 7b909217702..793a1d1ef24 100644 --- a/build/pkgs/notedown/SPKG.rst +++ b/build/pkgs/notedown/SPKG.rst @@ -11,7 +11,6 @@ License BSD 2-Clause License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/ntl/SPKG.rst b/build/pkgs/ntl/SPKG.rst index 59eb14ca094..cc1ac43b9dd 100644 --- a/build/pkgs/ntl/SPKG.rst +++ b/build/pkgs/ntl/SPKG.rst @@ -16,7 +16,6 @@ License - GNU LGPLv2.1+ -.. _upstream_contact: Upstream Contact ---------------- @@ -29,7 +28,6 @@ Dependencies - gmp - gf2x -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/numpy/SPKG.rst b/build/pkgs/numpy/SPKG.rst index b6124dcdcdf..a70606eb027 100644 --- a/build/pkgs/numpy/SPKG.rst +++ b/build/pkgs/numpy/SPKG.rst @@ -7,7 +7,6 @@ Description This package adds numerical linear algebra and other numerical computing capabilities to python. -.. _upstream_contact: Upstream Contact ---------------- @@ -26,7 +25,6 @@ Dependencies - Atlas - Fortran -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/openblas/SPKG.rst b/build/pkgs/openblas/SPKG.rst index 5d66d0dd01f..d33fde7fb74 100644 --- a/build/pkgs/openblas/SPKG.rst +++ b/build/pkgs/openblas/SPKG.rst @@ -12,7 +12,6 @@ License 3-clause BSD license -.. _spkg_repository: SPKG Repository --------------- @@ -21,7 +20,6 @@ GitHub page: https://github.com/xianyi/OpenBLAS Releases: https://github.com/xianyi/OpenBLAS/releases -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/openssl/SPKG.rst b/build/pkgs/openssl/SPKG.rst index f51aa5500fe..06dbe35255a 100644 --- a/build/pkgs/openssl/SPKG.rst +++ b/build/pkgs/openssl/SPKG.rst @@ -15,7 +15,6 @@ License - Custom GPL-incompatible license -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/p_group_cohomology/SPKG.rst b/build/pkgs/p_group_cohomology/SPKG.rst index 3f175e70071..5de6d676797 100644 --- a/build/pkgs/p_group_cohomology/SPKG.rst +++ b/build/pkgs/p_group_cohomology/SPKG.rst @@ -44,14 +44,12 @@ available at http://creativecommons.org/licenses/by-sa/3.0/ -.. _spkg_maintainers: SPKG Maintainers ---------------- Simon A. King -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/palp/SPKG.rst b/build/pkgs/palp/SPKG.rst index ae39ebb26e3..820646a7be3 100644 --- a/build/pkgs/palp/SPKG.rst +++ b/build/pkgs/palp/SPKG.rst @@ -36,7 +36,6 @@ License released under GPL 2 or a later version. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pandoc_attributes/SPKG.rst b/build/pkgs/pandoc_attributes/SPKG.rst index 18f9c0e0383..44380586414 100644 --- a/build/pkgs/pandoc_attributes/SPKG.rst +++ b/build/pkgs/pandoc_attributes/SPKG.rst @@ -12,7 +12,6 @@ License BSD 2-Clause License -.. _upstream_contact: Upstream Contact ---------------- @@ -27,7 +26,6 @@ Dependencies - setuptools - pandocfilters -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/pandocfilters/SPKG.rst b/build/pkgs/pandocfilters/SPKG.rst index 77ad7412356..cc87256299d 100644 --- a/build/pkgs/pandocfilters/SPKG.rst +++ b/build/pkgs/pandocfilters/SPKG.rst @@ -11,7 +11,6 @@ License BSD 3-Clause License -.. _upstream_contact: Upstream Contact ---------------- @@ -23,7 +22,6 @@ Dependencies - Python -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/pari/SPKG.rst b/build/pkgs/pari/SPKG.rst index a9bf6c81c84..ef8a1549220 100644 --- a/build/pkgs/pari/SPKG.rst +++ b/build/pkgs/pari/SPKG.rst @@ -21,7 +21,6 @@ License GPL version 2+ -.. _upstream_contact: Upstream Contact ---------------- @@ -36,7 +35,6 @@ Dependencies - Readline - GNU patch (shipped with Sage) -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/pari_elldata/SPKG.rst b/build/pkgs/pari_elldata/SPKG.rst index 931d6bda9fc..6d487573f9b 100644 --- a/build/pkgs/pari_elldata/SPKG.rst +++ b/build/pkgs/pari_elldata/SPKG.rst @@ -12,7 +12,6 @@ License GNU General Public License (GPL version 2 or any later version). -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pari_galdata/SPKG.rst b/build/pkgs/pari_galdata/SPKG.rst index a60a71c0052..00b409f83a8 100644 --- a/build/pkgs/pari_galdata/SPKG.rst +++ b/build/pkgs/pari_galdata/SPKG.rst @@ -12,7 +12,6 @@ License GPL version 2+ -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pari_galpol/SPKG.rst b/build/pkgs/pari_galpol/SPKG.rst index 472e2463481..4dff32f9551 100644 --- a/build/pkgs/pari_galpol/SPKG.rst +++ b/build/pkgs/pari_galpol/SPKG.rst @@ -13,7 +13,6 @@ License GNU General Public License (GPL version 2 or any later version). -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pari_jupyter/SPKG.rst b/build/pkgs/pari_jupyter/SPKG.rst index 42756a30cba..c365806b7c9 100644 --- a/build/pkgs/pari_jupyter/SPKG.rst +++ b/build/pkgs/pari_jupyter/SPKG.rst @@ -11,7 +11,6 @@ License GPL version 3 or later -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pari_nftables/SPKG.rst b/build/pkgs/pari_nftables/SPKG.rst index dfd040f8d77..2f8c273b660 100644 --- a/build/pkgs/pari_nftables/SPKG.rst +++ b/build/pkgs/pari_nftables/SPKG.rst @@ -12,7 +12,6 @@ License GNU General Public License (GPL version 2 or any later version). -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pari_seadata/SPKG.rst b/build/pkgs/pari_seadata/SPKG.rst index a6c439a587d..83561bd4e91 100644 --- a/build/pkgs/pari_seadata/SPKG.rst +++ b/build/pkgs/pari_seadata/SPKG.rst @@ -15,7 +15,6 @@ License GNU General Public License (GPL version 2 or any later version). -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pari_seadata_small/SPKG.rst b/build/pkgs/pari_seadata_small/SPKG.rst index 669a16d7b94..149c0c5c416 100644 --- a/build/pkgs/pari_seadata_small/SPKG.rst +++ b/build/pkgs/pari_seadata_small/SPKG.rst @@ -14,7 +14,6 @@ License GPL version 2+ -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/patch/SPKG.rst b/build/pkgs/patch/SPKG.rst index 8c372f856f5..283448e24bf 100644 --- a/build/pkgs/patch/SPKG.rst +++ b/build/pkgs/patch/SPKG.rst @@ -20,7 +20,6 @@ under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. -.. _upstream_contact: Upstream Contact ---------------- @@ -35,7 +34,6 @@ Dependencies None -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/pcre/SPKG.rst b/build/pkgs/pcre/SPKG.rst index adafaa1f830..0f2b50045b5 100644 --- a/build/pkgs/pcre/SPKG.rst +++ b/build/pkgs/pcre/SPKG.rst @@ -11,7 +11,6 @@ License BSD License ; see LICENCE (sic) at the root of the original tarball. -.. _upstream_contact: Upstream Contact ---------------- @@ -23,7 +22,6 @@ Dependencies None listed. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/perl_term_readline_gnu/SPKG.rst b/build/pkgs/perl_term_readline_gnu/SPKG.rst index 2370da31edb..d9e8a1cf06c 100644 --- a/build/pkgs/perl_term_readline_gnu/SPKG.rst +++ b/build/pkgs/perl_term_readline_gnu/SPKG.rst @@ -13,7 +13,6 @@ License The Perl 5 License (Artistic 1 & GPL 1) -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pexpect/SPKG.rst b/build/pkgs/pexpect/SPKG.rst index 1dd208edcca..114739b5e1f 100644 --- a/build/pkgs/pexpect/SPKG.rst +++ b/build/pkgs/pexpect/SPKG.rst @@ -13,7 +13,6 @@ License ISC license: http://opensource.org/licenses/isc-license.txt This license is approved by the OSI and FSF as GPL-compatible. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pillow/SPKG.rst b/build/pkgs/pillow/SPKG.rst index 7190cb96884..2ff825c3cb7 100644 --- a/build/pkgs/pillow/SPKG.rst +++ b/build/pkgs/pillow/SPKG.rst @@ -14,7 +14,6 @@ License Standard PIL License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pip/SPKG.rst b/build/pkgs/pip/SPKG.rst index 81b37dfee1d..7df8cff59fc 100644 --- a/build/pkgs/pip/SPKG.rst +++ b/build/pkgs/pip/SPKG.rst @@ -13,7 +13,6 @@ License MIT -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pkgconf/SPKG.rst b/build/pkgs/pkgconf/SPKG.rst index 724b4c81e15..3916889b08a 100644 --- a/build/pkgs/pkgconf/SPKG.rst +++ b/build/pkgs/pkgconf/SPKG.rst @@ -12,7 +12,6 @@ License ISC License (equivalent to Simplified BSD) -.. _upstream_contact: Upstream Contact ---------------- @@ -24,7 +23,6 @@ Dependencies - C compiler + toolchain -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/pkgconfig/SPKG.rst b/build/pkgs/pkgconfig/SPKG.rst index b1696921a69..f027440c23d 100644 --- a/build/pkgs/pkgconfig/SPKG.rst +++ b/build/pkgs/pkgconfig/SPKG.rst @@ -12,7 +12,6 @@ License MIT License -.. _upstream_contact: Upstream Contact ---------------- @@ -24,7 +23,6 @@ Dependencies - Python 2.6+ -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/planarity/SPKG.rst b/build/pkgs/planarity/SPKG.rst index 02f586e4cdc..be0b86d7f96 100644 --- a/build/pkgs/planarity/SPKG.rst +++ b/build/pkgs/planarity/SPKG.rst @@ -18,7 +18,6 @@ License New BSD License -.. _upstream_contact: Upstream Contact ---------------- @@ -32,7 +31,6 @@ Dependencies None -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/plantri/SPKG.rst b/build/pkgs/plantri/SPKG.rst index b73cca0a27a..566ee96bb20 100644 --- a/build/pkgs/plantri/SPKG.rst +++ b/build/pkgs/plantri/SPKG.rst @@ -20,7 +20,6 @@ License Plantri is distributed without a license. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/polylib/SPKG.rst b/build/pkgs/polylib/SPKG.rst index 0eb86960ed7..54f0c438d6a 100644 --- a/build/pkgs/polylib/SPKG.rst +++ b/build/pkgs/polylib/SPKG.rst @@ -12,7 +12,6 @@ License GPL v3 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/polymake/SPKG.rst b/build/pkgs/polymake/SPKG.rst index 4e746be6ff8..e6144dc6a7c 100644 --- a/build/pkgs/polymake/SPKG.rst +++ b/build/pkgs/polymake/SPKG.rst @@ -15,7 +15,6 @@ License - GPL v3 -.. _upstream_contact: Upstream Contact ---------------- @@ -79,7 +78,6 @@ Information on missing Polymake prerequisites after installing polymake: (sage-sh) $ polymake polytope> show_unconfigured; -.. _debugging_polymake_install_problems: Debugging polymake install problems ----------------------------------- diff --git a/build/pkgs/polytopes_db/SPKG.rst b/build/pkgs/polytopes_db/SPKG.rst index c49b9dcbf05..a46d4d2fe18 100644 --- a/build/pkgs/polytopes_db/SPKG.rst +++ b/build/pkgs/polytopes_db/SPKG.rst @@ -1,4 +1,3 @@ -.. _reflexive_polytopes_databases: Reflexive Polytopes Databases ============================= diff --git a/build/pkgs/ppl/SPKG.rst b/build/pkgs/ppl/SPKG.rst index 1e83b945402..cab77c8b0be 100644 --- a/build/pkgs/ppl/SPKG.rst +++ b/build/pkgs/ppl/SPKG.rst @@ -1,4 +1,3 @@ -.. _parma_polyhedra_library: Parma Polyhedra Library ======================= @@ -32,7 +31,6 @@ License GPL v3+ -.. _upstream_contact: Upstream Contact ---------------- @@ -47,7 +45,6 @@ Dependencies - gmp (or mpir) -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/pplpy/SPKG.rst b/build/pkgs/pplpy/SPKG.rst index fb8401437ae..2a7c7e5618e 100644 --- a/build/pkgs/pplpy/SPKG.rst +++ b/build/pkgs/pplpy/SPKG.rst @@ -16,7 +16,6 @@ License GPL version 3 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/primecount/SPKG.rst b/build/pkgs/primecount/SPKG.rst index 8ac15bf1be7..f01e3971e3c 100644 --- a/build/pkgs/primecount/SPKG.rst +++ b/build/pkgs/primecount/SPKG.rst @@ -14,7 +14,6 @@ License primecount is licensed BSD 2 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/psutil/SPKG.rst b/build/pkgs/psutil/SPKG.rst index 544d634e747..5895ee2cdf7 100644 --- a/build/pkgs/psutil/SPKG.rst +++ b/build/pkgs/psutil/SPKG.rst @@ -13,7 +13,6 @@ License 3-clause BSD license -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/ptyprocess/SPKG.rst b/build/pkgs/ptyprocess/SPKG.rst index 46dda6faf3d..260a913cd76 100644 --- a/build/pkgs/ptyprocess/SPKG.rst +++ b/build/pkgs/ptyprocess/SPKG.rst @@ -20,7 +20,6 @@ Ptyprocess is under the ISC license, as code derived from Pexpect. http://opensource.org/licenses/ISC -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pycosat/SPKG.rst b/build/pkgs/pycosat/SPKG.rst index 27ba9485f92..40181d0c198 100644 --- a/build/pkgs/pycosat/SPKG.rst +++ b/build/pkgs/pycosat/SPKG.rst @@ -16,7 +16,6 @@ License MIT -.. _upstream_contact: Upstream Contact ---------------- @@ -29,7 +28,6 @@ Dependencies None. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/pygments/SPKG.rst b/build/pkgs/pygments/SPKG.rst index 621a2c3ab5a..09c0ce57057 100644 --- a/build/pkgs/pygments/SPKG.rst +++ b/build/pkgs/pygments/SPKG.rst @@ -31,7 +31,6 @@ License Modified BSD -.. _upstream_contact: Upstream Contact ---------------- @@ -43,7 +42,6 @@ Dependencies Python -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/pynac/SPKG.rst b/build/pkgs/pynac/SPKG.rst index 6e9f9ac7bd1..27c3f062c84 100644 --- a/build/pkgs/pynac/SPKG.rst +++ b/build/pkgs/pynac/SPKG.rst @@ -12,7 +12,6 @@ License GPL V2+ -.. _upstream_contact: Upstream Contact ---------------- @@ -26,7 +25,6 @@ Dependencies Python -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/pynormaliz/SPKG.rst b/build/pkgs/pynormaliz/SPKG.rst index 5d5e8f3bafe..da072c3f873 100644 --- a/build/pkgs/pynormaliz/SPKG.rst +++ b/build/pkgs/pynormaliz/SPKG.rst @@ -11,7 +11,6 @@ License - GPL v2 or later -.. _upstream_contact: Upstream Contact ---------------- @@ -24,7 +23,6 @@ Dependencies - pip - normaliz -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/pyparsing/SPKG.rst b/build/pkgs/pyparsing/SPKG.rst index b546f23a3e9..a7f497229c9 100644 --- a/build/pkgs/pyparsing/SPKG.rst +++ b/build/pkgs/pyparsing/SPKG.rst @@ -11,7 +11,6 @@ License MIT License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/pysingular/SPKG.rst b/build/pkgs/pysingular/SPKG.rst index d53c891f7ed..7dba8c07cdd 100644 --- a/build/pkgs/pysingular/SPKG.rst +++ b/build/pkgs/pysingular/SPKG.rst @@ -13,7 +13,6 @@ License GPL version 2 or later -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/python2/SPKG.rst b/build/pkgs/python2/SPKG.rst index 22702cdf0ac..75411f544c0 100644 --- a/build/pkgs/python2/SPKG.rst +++ b/build/pkgs/python2/SPKG.rst @@ -24,7 +24,6 @@ them. Python's licensing is GPL compatible. For more details see http://www.python.org/psf/license/ -.. _upstream_contact: Upstream Contact ---------------- @@ -40,7 +39,6 @@ Dependencies - libpng - SQLite -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/python_igraph/SPKG.rst b/build/pkgs/python_igraph/SPKG.rst index fb5809424a4..04887d77367 100644 --- a/build/pkgs/python_igraph/SPKG.rst +++ b/build/pkgs/python_igraph/SPKG.rst @@ -1,4 +1,3 @@ -.. _python_igraph: python-igraph ============= @@ -15,7 +14,6 @@ License GPL version 2 -.. _upstream_contact: Upstream Contact ---------------- @@ -28,7 +26,6 @@ Dependencies - python - igraph -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/python_openid/SPKG.rst b/build/pkgs/python_openid/SPKG.rst index 21c728375af..5219fa1e117 100644 --- a/build/pkgs/python_openid/SPKG.rst +++ b/build/pkgs/python_openid/SPKG.rst @@ -1,4 +1,3 @@ -.. _python_openid: python-openid ============= diff --git a/build/pkgs/pytz/SPKG.rst b/build/pkgs/pytz/SPKG.rst index 3a2fd999785..ebeba1ad914 100644 --- a/build/pkgs/pytz/SPKG.rst +++ b/build/pkgs/pytz/SPKG.rst @@ -6,7 +6,6 @@ Description World Timezone Definitions for Python -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/pyzmq/SPKG.rst b/build/pkgs/pyzmq/SPKG.rst index e165dd9a861..86594e23d02 100644 --- a/build/pkgs/pyzmq/SPKG.rst +++ b/build/pkgs/pyzmq/SPKG.rst @@ -11,7 +11,6 @@ License LGPLv3+ -.. _upstream_contact: Upstream Contact ---------------- @@ -25,7 +24,6 @@ Dependencies - Cython - zeromq -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/qepcad/SPKG.rst b/build/pkgs/qepcad/SPKG.rst index 05923ff7d0f..be23ccc167c 100644 --- a/build/pkgs/qepcad/SPKG.rst +++ b/build/pkgs/qepcad/SPKG.rst @@ -26,7 +26,6 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.. _upstream_contact: Upstream Contact ---------------- @@ -42,7 +41,6 @@ Dependencies - readline - saclib -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/qhull/SPKG.rst b/build/pkgs/qhull/SPKG.rst index 4e84a01e44d..03c42327734 100644 --- a/build/pkgs/qhull/SPKG.rst +++ b/build/pkgs/qhull/SPKG.rst @@ -29,7 +29,6 @@ There is also the Python interface Pyhull available on PyPI https://pypi.python.org/pypi/pyhull (see also documentation at http://pythonhosted.org/pyhull/). -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/r/SPKG.rst b/build/pkgs/r/SPKG.rst index 16b5587dd49..2b498e85e0f 100644 --- a/build/pkgs/r/SPKG.rst +++ b/build/pkgs/r/SPKG.rst @@ -18,7 +18,6 @@ License - GPL v2 or GPL v3 -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/ratpoints/SPKG.rst b/build/pkgs/ratpoints/SPKG.rst index b74b5add4e6..6e6029f0c80 100644 --- a/build/pkgs/ratpoints/SPKG.rst +++ b/build/pkgs/ratpoints/SPKG.rst @@ -11,7 +11,6 @@ NOTE: the ratpoints package has been assimilated by PARI/GP. Therefore, this package (as Sage package) is deprecated. In the future, it will be removed from Sage. -.. _upstream_contact: Upstream Contact ---------------- @@ -26,12 +25,10 @@ Dependencies - GMP/MPIR - (GNU) patch -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- -.. _note_on_sse2_instructions: Note on SSE2 instructions ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/build/pkgs/readline/SPKG.rst b/build/pkgs/readline/SPKG.rst index 1d77564b757..d33180ec0b9 100644 --- a/build/pkgs/readline/SPKG.rst +++ b/build/pkgs/readline/SPKG.rst @@ -18,7 +18,6 @@ License - GPL V3+ -.. _upstream_contact: Upstream Contact ---------------- @@ -30,7 +29,6 @@ Dependencies - ncurses -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/rpy2/SPKG.rst b/build/pkgs/rpy2/SPKG.rst index 928813e474d..b3391ea8de7 100644 --- a/build/pkgs/rpy2/SPKG.rst +++ b/build/pkgs/rpy2/SPKG.rst @@ -18,7 +18,6 @@ License which we are allowed to do by the full rpy2 license in order to remain GPL-compatible -.. _upstream_contact: Upstream Contact ---------------- @@ -28,7 +27,6 @@ Upstream Contact Dependencies ------------ -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/rst2ipynb/SPKG.rst b/build/pkgs/rst2ipynb/SPKG.rst index 41bc1f18fee..12dbaa5ee87 100644 --- a/build/pkgs/rst2ipynb/SPKG.rst +++ b/build/pkgs/rst2ipynb/SPKG.rst @@ -16,7 +16,6 @@ License BSD 3-Clause License -.. _upstream_contact: Upstream Contact ---------------- @@ -30,7 +29,6 @@ Dependencies - notedown - pandoc -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/rw/SPKG.rst b/build/pkgs/rw/SPKG.rst index a9c9e5a627f..03ca7382412 100644 --- a/build/pkgs/rw/SPKG.rst +++ b/build/pkgs/rw/SPKG.rst @@ -13,7 +13,6 @@ License GPL version 2 or later -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/saclib/SPKG.rst b/build/pkgs/saclib/SPKG.rst index ceed4811bfe..5301ddd82b3 100644 --- a/build/pkgs/saclib/SPKG.rst +++ b/build/pkgs/saclib/SPKG.rst @@ -26,7 +26,6 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/sage_brial/SPKG.rst b/build/pkgs/sage_brial/SPKG.rst index 26e04338ccc..3cc3c9181e9 100644 --- a/build/pkgs/sage_brial/SPKG.rst +++ b/build/pkgs/sage_brial/SPKG.rst @@ -17,7 +17,6 @@ License GPL version 2 or later -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/sagenb/SPKG.rst b/build/pkgs/sagenb/SPKG.rst index 591d4a41aa1..7d031d20a9d 100644 --- a/build/pkgs/sagenb/SPKG.rst +++ b/build/pkgs/sagenb/SPKG.rst @@ -1,4 +1,3 @@ -.. _sage_notebook: Sage Notebook ============= @@ -14,7 +13,6 @@ License GPLv3+ -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/sagetex/SPKG.rst b/build/pkgs/sagetex/SPKG.rst index 8946aaa632e..f0d2466e938 100644 --- a/build/pkgs/sagetex/SPKG.rst +++ b/build/pkgs/sagetex/SPKG.rst @@ -24,7 +24,6 @@ this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. -.. _spkg_maintainers: SPKG Maintainers ---------------- @@ -32,7 +31,6 @@ SPKG Maintainers Dan Drake (dr.dan.drake at gmail) and SageMath developers (sage-devel@googlegroups.com) -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/scipoptsuite/SPKG.rst b/build/pkgs/scipoptsuite/SPKG.rst index e8ba93ae626..febc62d889d 100644 --- a/build/pkgs/scipoptsuite/SPKG.rst +++ b/build/pkgs/scipoptsuite/SPKG.rst @@ -22,7 +22,6 @@ software is available with its source code. http://scip.zib.de/academic.txt -.. _spkg_maintainers: SPKG Maintainers ---------------- @@ -30,7 +29,6 @@ SPKG Maintainers - Martin Albrecht (original spkg) - Matthias Koeppe (updates for new spkg style) -.. _upstream_contact: Upstream Contact ---------------- @@ -42,7 +40,6 @@ Dependencies cmake -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/scipy/SPKG.rst b/build/pkgs/scipy/SPKG.rst index 916063b309f..f037ff798a5 100644 --- a/build/pkgs/scipy/SPKG.rst +++ b/build/pkgs/scipy/SPKG.rst @@ -20,7 +20,6 @@ License SciPy's license is free for both commercial and non-commercial use, under the BSD terms. See http://www.scipy.org/License_Compatibility -.. _upstream_contact: Upstream Contact ---------------- @@ -35,7 +34,6 @@ Dependencies - Fortran - GNU patch -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/scons/SPKG.rst b/build/pkgs/scons/SPKG.rst index 3ed849e9f6c..2a3822517f8 100644 --- a/build/pkgs/scons/SPKG.rst +++ b/build/pkgs/scons/SPKG.rst @@ -18,7 +18,6 @@ License X/MIT -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/setuptools/SPKG.rst b/build/pkgs/setuptools/SPKG.rst index a70c2c53cd6..78c67111416 100644 --- a/build/pkgs/setuptools/SPKG.rst +++ b/build/pkgs/setuptools/SPKG.rst @@ -17,7 +17,6 @@ License PSF or ZPL. i.e Python Software Foundation License or Zope Public License -.. _upstream_contact: Upstream Contact ---------------- @@ -29,7 +28,6 @@ Dependencies - python -.. _build_instructionschanges: Build Instructions/Changes -------------------------- diff --git a/build/pkgs/singledispatch/SPKG.rst b/build/pkgs/singledispatch/SPKG.rst index b280d9e4807..de7f7337ccb 100644 --- a/build/pkgs/singledispatch/SPKG.rst +++ b/build/pkgs/singledispatch/SPKG.rst @@ -12,7 +12,6 @@ License MIT License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/singular/SPKG.rst b/build/pkgs/singular/SPKG.rst index bbaa7366947..9a33f6781c4 100644 --- a/build/pkgs/singular/SPKG.rst +++ b/build/pkgs/singular/SPKG.rst @@ -13,7 +13,6 @@ License GPLv2 or GPLv3 -.. _upstream_contact: Upstream Contact ---------------- @@ -32,7 +31,6 @@ Dependencies - NTL - FLINT -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/singular_jupyter/SPKG.rst b/build/pkgs/singular_jupyter/SPKG.rst index 644f88c69b3..282bbc5f621 100644 --- a/build/pkgs/singular_jupyter/SPKG.rst +++ b/build/pkgs/singular_jupyter/SPKG.rst @@ -1,4 +1,3 @@ -.. _jupyter_kernel_singular: jupyter-kernel-singular ======================= @@ -15,7 +14,6 @@ License GPL version 2 or later -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/sip/SPKG.rst b/build/pkgs/sip/SPKG.rst index dff5a6590ca..edff1e3649e 100644 --- a/build/pkgs/sip/SPKG.rst +++ b/build/pkgs/sip/SPKG.rst @@ -6,7 +6,6 @@ Description Python extension module generator for C and C++ libraries -.. _upstream_contact: Upstream contact ---------------- diff --git a/build/pkgs/sirocco/SPKG.rst b/build/pkgs/sirocco/SPKG.rst index 61c659e3d7d..3d88325f106 100644 --- a/build/pkgs/sirocco/SPKG.rst +++ b/build/pkgs/sirocco/SPKG.rst @@ -12,14 +12,12 @@ License GPLv3+ -.. _spkg_maintainers: SPKG Maintainers ---------------- - Miguel Marco -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/six/SPKG.rst b/build/pkgs/six/SPKG.rst index 58ed0809857..2254c78eb8f 100644 --- a/build/pkgs/six/SPKG.rst +++ b/build/pkgs/six/SPKG.rst @@ -11,7 +11,6 @@ License MIT License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/sphinx/SPKG.rst b/build/pkgs/sphinx/SPKG.rst index 6de2f8af5c6..2e056b72a12 100644 --- a/build/pkgs/sphinx/SPKG.rst +++ b/build/pkgs/sphinx/SPKG.rst @@ -16,7 +16,6 @@ License Modified BSD; see e.g. its egg-info file for other options -.. _upstream_contact: Upstream Contact ---------------- @@ -38,7 +37,6 @@ Dependencies - Python - GNU patch (shipped with Sage) -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/sphinxcontrib_websupport/SPKG.rst b/build/pkgs/sphinxcontrib_websupport/SPKG.rst index 59ec5963136..27d4a863612 100644 --- a/build/pkgs/sphinxcontrib_websupport/SPKG.rst +++ b/build/pkgs/sphinxcontrib_websupport/SPKG.rst @@ -1,4 +1,3 @@ -.. _sphinxcontrib_websupport: sphinxcontrib-websupport ======================== diff --git a/build/pkgs/sqlite/SPKG.rst b/build/pkgs/sqlite/SPKG.rst index 2cf982ee620..f4b5d69f9a7 100644 --- a/build/pkgs/sqlite/SPKG.rst +++ b/build/pkgs/sqlite/SPKG.rst @@ -12,7 +12,6 @@ License Public Domain -.. _upstream_contact: Upstream contact ---------------- @@ -24,7 +23,6 @@ Dependencies - readline -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/suitesparse/SPKG.rst b/build/pkgs/suitesparse/SPKG.rst index aae9ddf929e..5e75714653c 100644 --- a/build/pkgs/suitesparse/SPKG.rst +++ b/build/pkgs/suitesparse/SPKG.rst @@ -1304,7 +1304,6 @@ SuiteSparse. See the License for the specific language governing permissions and limitations under the License. -.. _mongoose_license: > Mongoose License < -------------------- diff --git a/build/pkgs/surf/SPKG.rst b/build/pkgs/surf/SPKG.rst index ef3f8d4d3a9..1e2118c35ed 100644 --- a/build/pkgs/surf/SPKG.rst +++ b/build/pkgs/surf/SPKG.rst @@ -16,7 +16,6 @@ License GPL version 2 or later -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/symmetrica/SPKG.rst b/build/pkgs/symmetrica/SPKG.rst index cc61066f6c6..2708b62b35b 100644 --- a/build/pkgs/symmetrica/SPKG.rst +++ b/build/pkgs/symmetrica/SPKG.rst @@ -26,7 +26,6 @@ License Public Domain (see the above web site) -.. _upstream_contact: Upstream Contact ---------------- @@ -38,7 +37,6 @@ Dependencies - GNU patch (for applying the patches to upstream) -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/sympow/SPKG.rst b/build/pkgs/sympow/SPKG.rst index 706257251b4..e448e8c66fc 100644 --- a/build/pkgs/sympow/SPKG.rst +++ b/build/pkgs/sympow/SPKG.rst @@ -13,7 +13,6 @@ License - See the file src/COPYING -.. _upstream_contact: Upstream Contact ---------------- @@ -28,7 +27,6 @@ Dependencies - GNU patch -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/sympy/SPKG.rst b/build/pkgs/sympy/SPKG.rst index 47247e25499..ced31dd1e05 100644 --- a/build/pkgs/sympy/SPKG.rst +++ b/build/pkgs/sympy/SPKG.rst @@ -20,7 +20,6 @@ License New BSD: http://www.opensource.org/licenses/bsd-license.php -.. _upstream_contact: Upstream Contact ---------------- @@ -32,7 +31,6 @@ Dependencies - Python 2.5 or later -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/tachyon/SPKG.rst b/build/pkgs/tachyon/SPKG.rst index 8db46a0931b..e913f921fa9 100644 --- a/build/pkgs/tachyon/SPKG.rst +++ b/build/pkgs/tachyon/SPKG.rst @@ -33,7 +33,6 @@ License products - derived from this software without specific prior written permission. -.. _upstream_contact: Upstream Contact ---------------- @@ -47,7 +46,6 @@ This spkg depends on: - libpng -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/tdlib/SPKG.rst b/build/pkgs/tdlib/SPKG.rst index 5bdf50255f2..e70d559a272 100644 --- a/build/pkgs/tdlib/SPKG.rst +++ b/build/pkgs/tdlib/SPKG.rst @@ -13,14 +13,12 @@ License GNU General Public License v2 -.. _spkg_maintainers: SPKG Maintainers ---------------- Lukas Larisch (larisch@informatik.uni-frankfurt.de) -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/termcap/SPKG.rst b/build/pkgs/termcap/SPKG.rst index 7d63f9ce177..65e96b3469a 100644 --- a/build/pkgs/termcap/SPKG.rst +++ b/build/pkgs/termcap/SPKG.rst @@ -12,7 +12,6 @@ License GPL version 2 -.. _upstream_contact: Upstream Contact ---------------- @@ -24,7 +23,6 @@ Dependencies - GNU patch -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/texlive/SPKG.rst b/build/pkgs/texlive/SPKG.rst index c0a35c67311..a81008a27cc 100644 --- a/build/pkgs/texlive/SPKG.rst +++ b/build/pkgs/texlive/SPKG.rst @@ -20,7 +20,6 @@ License Various FSF-approved free software licenses. See https://www.tug.org/texlive/copying.html for details. -.. _upstream_contact: Upstream Contact ---------------- @@ -32,7 +31,6 @@ Dependencies - python -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/thebe/SPKG.rst b/build/pkgs/thebe/SPKG.rst index de0a9a2e556..2888032505d 100644 --- a/build/pkgs/thebe/SPKG.rst +++ b/build/pkgs/thebe/SPKG.rst @@ -16,7 +16,6 @@ License MIT -.. _upstream_contact: Upstream Contact ---------------- @@ -29,7 +28,6 @@ Dependencies None. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/threejs/SPKG.rst b/build/pkgs/threejs/SPKG.rst index 55430c52aa5..2891a05b51c 100644 --- a/build/pkgs/threejs/SPKG.rst +++ b/build/pkgs/threejs/SPKG.rst @@ -11,7 +11,6 @@ License MIT License -.. _upstream_contact: Upstream Contact ---------------- @@ -23,7 +22,6 @@ Dependencies None. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/tides/SPKG.rst b/build/pkgs/tides/SPKG.rst index c9c26356866..ba7738d2eff 100644 --- a/build/pkgs/tides/SPKG.rst +++ b/build/pkgs/tides/SPKG.rst @@ -11,7 +11,6 @@ License GPLv3+ -.. _upstream_contact: Upstream Contact ---------------- @@ -25,7 +24,6 @@ Dependencies - mpfr - gmp -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/topcom/SPKG.rst b/build/pkgs/topcom/SPKG.rst index b7c9e155899..6d16dbc37c4 100644 --- a/build/pkgs/topcom/SPKG.rst +++ b/build/pkgs/topcom/SPKG.rst @@ -20,7 +20,6 @@ License GPL v2 -.. _upstream_contact: Upstream Contact ---------------- @@ -35,7 +34,6 @@ Dependencies - gmp, libcdd -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/tornado/SPKG.rst b/build/pkgs/tornado/SPKG.rst index 79b7e67f1d8..db446514d67 100644 --- a/build/pkgs/tornado/SPKG.rst +++ b/build/pkgs/tornado/SPKG.rst @@ -11,7 +11,6 @@ License Apache License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/valgrind/SPKG.rst b/build/pkgs/valgrind/SPKG.rst index f31ddcd1f34..e3553325b7f 100644 --- a/build/pkgs/valgrind/SPKG.rst +++ b/build/pkgs/valgrind/SPKG.rst @@ -29,7 +29,6 @@ License Valgrind is Open Source / Free Software, and is freely available under the GNU General Public License, version 2. -.. _upstream_contact: Upstream Contact ---------------- @@ -42,7 +41,6 @@ Dependencies - None -.. _special_build_instructions: Special Build Instructions -------------------------- diff --git a/build/pkgs/vcversioner/SPKG.rst b/build/pkgs/vcversioner/SPKG.rst index bd8360bf349..31ade501ff3 100644 --- a/build/pkgs/vcversioner/SPKG.rst +++ b/build/pkgs/vcversioner/SPKG.rst @@ -13,7 +13,6 @@ License Python Software Foundation License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/webencodings/SPKG.rst b/build/pkgs/webencodings/SPKG.rst index 581cf290078..3fa1c3aed62 100644 --- a/build/pkgs/webencodings/SPKG.rst +++ b/build/pkgs/webencodings/SPKG.rst @@ -11,7 +11,6 @@ License BSD License -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/xz/SPKG.rst b/build/pkgs/xz/SPKG.rst index ed6b24d0d0a..ded4e934abb 100644 --- a/build/pkgs/xz/SPKG.rst +++ b/build/pkgs/xz/SPKG.rst @@ -13,7 +13,6 @@ License Some parts public domain, other parts GNU LGPLv2.1, GNU GPLv2, or GNU GPLv3. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/yasm/SPKG.rst b/build/pkgs/yasm/SPKG.rst index 52b63546a3c..63a33301845 100644 --- a/build/pkgs/yasm/SPKG.rst +++ b/build/pkgs/yasm/SPKG.rst @@ -29,7 +29,6 @@ LGPL. The “yasm-nextgen” codebase uses a different BSD-licensed implementation and is thus entirely under BSD-equivalent licenses. The full text of the licenses are provided in the Yasm source distribution. -.. _upstream_contact: Upstream Contact ---------------- diff --git a/build/pkgs/zeromq/SPKG.rst b/build/pkgs/zeromq/SPKG.rst index 8593b4ed6fb..37d6c669b58 100644 --- a/build/pkgs/zeromq/SPKG.rst +++ b/build/pkgs/zeromq/SPKG.rst @@ -13,7 +13,6 @@ License LGPLv3+ -.. _upstream_contact: Upstream Contact ---------------- @@ -25,7 +24,6 @@ Dependencies A working compiler. -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/zlib/SPKG.rst b/build/pkgs/zlib/SPKG.rst index 85cff6ec42d..0d32a6327f9 100644 --- a/build/pkgs/zlib/SPKG.rst +++ b/build/pkgs/zlib/SPKG.rst @@ -12,7 +12,6 @@ License - Modified BSD. -.. _upstream_contact: Upstream Contact ---------------- @@ -24,7 +23,6 @@ Dependencies - None -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- diff --git a/build/pkgs/zn_poly/SPKG.rst b/build/pkgs/zn_poly/SPKG.rst index 65fe7ea8e8f..4fd3f655c10 100644 --- a/build/pkgs/zn_poly/SPKG.rst +++ b/build/pkgs/zn_poly/SPKG.rst @@ -19,7 +19,6 @@ License GPL V2 or V3. Some of the code has been copied from other projects - see the file src/COPYING for details. -.. _upstream_contact: Upstream Contact ---------------- @@ -36,7 +35,6 @@ Dependencies - NTL apparently only if we configured zn_poly differently (same for FLINT) -.. _special_updatebuild_instructions: Special Update/Build Instructions --------------------------------- From d74cbcb6031add0a9a1486f4ea88f7a21ed0f41c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 May 2020 21:53:02 -0700 Subject: [PATCH 044/301] build/pkgs/*/SPKG.rst: Some manual format fixes --- build/pkgs/flintqs/SPKG.rst | 6 + build/pkgs/matplotlib/SPKG.rst | 11 +- build/pkgs/maxima/SPKG.rst | 13 +- build/pkgs/suitesparse/SPKG.rst | 342 ++++++-------------------------- build/pkgs/symmetrica/SPKG.rst | 18 +- 5 files changed, 80 insertions(+), 310 deletions(-) diff --git a/build/pkgs/flintqs/SPKG.rst b/build/pkgs/flintqs/SPKG.rst index be97a17a8ae..1387cbd9624 100644 --- a/build/pkgs/flintqs/SPKG.rst +++ b/build/pkgs/flintqs/SPKG.rst @@ -1,3 +1,9 @@ +FlintQS +======= + +Description +----------- + This is William Hart's GPL'd highly optimized multi-polynomial quadratic sieve for integer factorization: diff --git a/build/pkgs/matplotlib/SPKG.rst b/build/pkgs/matplotlib/SPKG.rst index d5a1cac6564..d559f2ae488 100644 --- a/build/pkgs/matplotlib/SPKG.rst +++ b/build/pkgs/matplotlib/SPKG.rst @@ -47,17 +47,14 @@ Build Instructions/Changes -------------------------- - NOTE: To drastically cut down on spkg size, we delete the internal - testing images. To do this, we repackage the tarball by removing - the contents of lib/matplotlib/tests/baseline_images/*, this is - done by the spkg-src script. - -- setup.py.patch: disable loading of Tests. Otherwise, setup.py + the contents of ``lib/matplotlib/tests/baseline_images/*``, this is + done by the ``spkg-src`` script. +- ``setup.py.patch``: disable loading of Tests. Otherwise, ``setup.py`` raises an error because it can't find the deleted files - from src/lib/matplotlib/tests/baseline_images/\* + from ``src/lib/matplotlib/tests/baseline_images/*`` - NOTE: as of matplotlib-1.0.0 and Sage 4.6, Sage does not use - $HOME/.matplotlib by default. Instead, it sets MPLCONFIGDIR to a subdirectory in $DOT_SAGE, see src/bin/sage-env diff --git a/build/pkgs/maxima/SPKG.rst b/build/pkgs/maxima/SPKG.rst index ff6085dfa08..edda0e0d067 100644 --- a/build/pkgs/maxima/SPKG.rst +++ b/build/pkgs/maxima/SPKG.rst @@ -40,14 +40,12 @@ Special Update/Build Instructions --------------------------------- 1. Go to http://sourceforge.net/projects/maxima/files/Maxima-source/ - and download the source tarball maxima-x.y.z.tar.gz; place it in the upstream/ directory. 2. Update package-version.txt and run sage-fix-pkg-checksums. 3. Make sure the patches still apply cleanly, and update them if - necessary. 4. Test the resulting package. @@ -56,30 +54,23 @@ All patch files in the patches/ directory are applied. Descriptions of these patches are either in the patch files themselves or below. - 0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch: - Fix for Maxima bug #2520 (abs_integrate fails on abs(sin(x)) and abs(cos(x))). Introduced in Trac #13364 (Upgrade Maxima to 5.29.1). - build-fasl.patch: Build a fasl library for ecl in addition to an - executable program. Introduced in Trac #16178 (Build maxima fasl without asdf). - infodir.patch: Correct the path to the Info directory. Introduced - in Trac #11348 (maxima test fails when install tree is moved). - matrixexp.patch: Fix matrixexp(matrix([%i*%pi])), which broke after - Maxima 5.29.1. Introduced in Trac #13973. -- maxima.system.patch: Set c::*compile-in-constants\* to t. - +- maxima.system.patch: Set ``c::*compile-in-constants*`` to t. Introduced in Trac #11966 (OS X 10.7 Lion: Maxima fails to build). - undoing_true_false_printing_patch.patch: Revert an upstream change - causing '?' to be printed around some words. Introduced in Trac - - #. 13364 (Upgrade Maxima to 5.29.1). + #13364 (Upgrade Maxima to 5.29.1). diff --git a/build/pkgs/suitesparse/SPKG.rst b/build/pkgs/suitesparse/SPKG.rst index 5e75714653c..465c76124b3 100644 --- a/build/pkgs/suitesparse/SPKG.rst +++ b/build/pkgs/suitesparse/SPKG.rst @@ -1,4 +1,7 @@ -SuiteSpare is a collection of software to deal with sparse matrix. It is +SuiteSparse +=========== + +SuiteSparse is a collection of software to deal with sparse matrix. It is hosted at http://faculty.cse.tamu.edu/davis/suitesparse.html This spkg does a minimal install of suitesparse disabling the following @@ -27,8 +30,8 @@ License: because SuiteSparse is a collection, it comes with a variety of licenses. Find below a copy of the "LICENSES.txt" shipped with SuiteSparse. -> AMD/Doc/License.txt < ------------------------ +AMD/Doc/License.txt +------------------- AMD, Copyright (c), 1996-2015, Timothy A. Davis, Patrick R. Amestoy, and Iain S. Duff. All Rights Reserved. @@ -37,31 +40,20 @@ SuiteSparse. http://www.suitesparse.com -- - - -------------- - AMD License: BSD 3-clause: -- - - -------------- - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -86,8 +78,8 @@ SuiteSparse. OF SUCH DAMAGE. -> BTF/Doc/License.txt < ------------------------ +BTF/Doc/License.txt +------------------- BTF, Copyright (C) 2004-2013, University of Florida by Timothy A. Davis and Ekanathan Palamadai. @@ -95,10 +87,6 @@ SuiteSparse. details. http://www.suitesparse.com -- - - -------------- - BTF is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -114,7 +102,7 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -> CAMD/Doc/License.txt < +CAMD/Doc/License.txt ------------------------ CAMD, Copyright (c) by Timothy A. Davis, @@ -130,16 +118,13 @@ SuiteSparse. are met: - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -168,8 +153,8 @@ SuiteSparse. http://www.suitesparse.com -> CCOLAMD/Doc/License.txt < ---------------------------- +CCOLAMD/Doc/License.txt +----------------------- CCOLAMD: constrained column approximate minimum degree ordering Copyright (C) 2005-2016, Univ. of Florida. Authors: Timothy A. Davis, @@ -179,10 +164,6 @@ SuiteSparse. Gilbert. http://www.suitesparse.com -- - - -------------- - CCOLAMD license: BSD 3-clause: Redistribution and use in source and binary forms, with or without @@ -190,16 +171,13 @@ SuiteSparse. are met: - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -224,22 +202,10 @@ SuiteSparse. OF SUCH DAMAGE. -- - - -------------- - -> CHOLMOD/Doc/License.txt < ---------------------------- - -- - - -------------- - - ==> Check/License.txt <== - -- +CHOLMOD/Doc/License.txt +----------------------- - -------------- + ==Check/License.txt== CHOLMOD/Check Module. Copyright (C) 2005-2006, Timothy A. Davis CHOLMOD is @@ -249,10 +215,6 @@ SuiteSparse. Note that this license is for the CHOLMOD/Check module only. All CHOLMOD modules are licensed separately. -- - - -------------- - This Module is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -268,15 +230,7 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- - - -------------- - - ==> Cholesky/License.txt <== - -- - - -------------- + ==Cholesky/License.txt== CHOLMOD/Cholesky module, Copyright (C) 2005-2006, Timothy A. Davis. CHOLMOD is also available under other licenses; contact authors for @@ -285,10 +239,6 @@ SuiteSparse. Note that this license is for the CHOLMOD/Cholesky module only. All CHOLMOD modules are licensed separately. -- - - -------------- - This Module is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -304,15 +254,7 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- - - -------------- - - ==> Core/License.txt <== - -- - - -------------- + ==Core/License.txt== CHOLMOD/Core Module. Copyright (C) 2005-2006, Univ. of Florida. Author: @@ -323,10 +265,6 @@ SuiteSparse. Note that this license is for the CHOLMOD/Core module only. All CHOLMOD modules are licensed separately. -- - - -------------- - This Module is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -342,15 +280,7 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- - - -------------- - - ==> Demo/License.txt <== - -- - - -------------- + ==Demo/License.txt== CHOLMOD/Demo Module. Copyright (C) 2005-2006, Timothy A. Davis. CHOLMOD @@ -360,10 +290,6 @@ SuiteSparse. Note that this license is for the CHOLMOD/Demo module only. All CHOLMOD modules are licensed separately. -- - - -------------- - This Module is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 @@ -379,15 +305,7 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -- - - -------------- - - ==> Include/License.txt <== - -- - - -------------- + ==Include/License.txt== CHOLMOD/Include/\* files. Copyright (C) 2005-2006, either Univ. of Florida @@ -416,15 +334,7 @@ SuiteSparse. Include/cholmod_supernodal.h part of Supernodal module Include/cholmod_template.h LGPL -- - - -------------- - - ==> MATLAB/License.txt <== - -- - - -------------- + ==MATLAB/License.txt== CHOLMOD/MATLAB Module. Copyright (C) 2005-2006, Timothy A. Davis. CHOLMOD @@ -435,10 +345,6 @@ SuiteSparse. Note that this license is for the CHOLMOD/MATLAB module only. All CHOLMOD modules are licensed separately. -- - - -------------- - This Module is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 @@ -454,15 +360,7 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -- - - -------------- - - ==> MatrixOps/License.txt <== - -- - - -------------- + ==MatrixOps/License.txt== CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis. CHOLMOD is also available under other licenses; contact authors for @@ -471,10 +369,6 @@ SuiteSparse. Note that this license is for the CHOLMOD/MatrixOps module only. All CHOLMOD modules are licensed separately. -- - - -------------- - This Module is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 @@ -490,15 +384,7 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -- - - -------------- - - ==> Modify/License.txt <== - -- - - -------------- + ==Modify/License.txt== CHOLMOD/Modify Module. Copyright (C) 2005-2006, Timothy A. Davis and William W. Hager. CHOLMOD is also available under other licenses; @@ -508,10 +394,6 @@ SuiteSparse. Note that this license is for the CHOLMOD/Modify module only. All CHOLMOD modules are licensed separately. -- - - -------------- - This Module is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 @@ -527,15 +409,9 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -- - - -------------- - - ==> Partition/License.txt <== -- + ==Partition/License.txt== - -------------- CHOLMOD/Partition Module. Copyright (C) 2005-2006, Univ. of Florida. Author: Timothy A. Davis @@ -546,9 +422,6 @@ SuiteSparse. Note that this license is for the CHOLMOD/Partition module only. All CHOLMOD modules are licensed separately. -- - - -------------- This Module is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -565,15 +438,9 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- - - -------------- - - ==> Supernodal/License.txt <== -- + ==Supernodal/License.txt== - -------------- CHOLMOD/Supernodal Module. Copyright (C) 2005-2006, Timothy A. Davis @@ -584,9 +451,6 @@ SuiteSparse. Note that this license is for the CHOLMOD/Supernodal module only. All CHOLMOD modules are licensed separately. -- - - -------------- This Module is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -603,15 +467,9 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -- - - -------------- - ==> Tcov/License.txt <== + ==Tcov/License.txt== -- - - -------------- CHOLMOD/Tcov Module. Copyright (C) 2005-2006, Timothy A. Davis CHOLMOD is also available under other licenses; contact authors for @@ -621,9 +479,6 @@ SuiteSparse. Note that this license is for the CHOLMOD/Tcov module only. All CHOLMOD modules are licensed separately. -- - - -------------- This Module is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -640,15 +495,7 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -- - - -------------- - - ==> Valgrind/License.txt <== - -- - - -------------- + ==Valgrind/License.txt== CHOLMOD/Valgrind Module. Copyright (C) 2005-2006, Timothy A. Davis. CHOLMOD is also available under other licenses; contact authors for @@ -658,10 +505,6 @@ SuiteSparse. Note that this license is for the CHOLMOD/Valgrind module only. All CHOLMOD modules are licensed separately. -- - - -------------- - This Module is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 @@ -677,8 +520,8 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -> COLAMD/Doc/License.txt < --------------------------- +COLAMD/Doc/License.txt +---------------------- COLAMD, Copyright 1998-2016, Timothy A. Davis. http://www.suitesparse.com @@ -691,16 +534,13 @@ SuiteSparse. are met: - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -725,17 +565,13 @@ SuiteSparse. OF SUCH DAMAGE. -> CSparse/Doc/License.txt < ---------------------------- +CSparse/Doc/License.txt +----------------------- CSparse: a Concise Sparse matrix package. Copyright (c) 2006, Timothy A. Davis. http://www.suitesparse.com -- - - -------------- - CSparse is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -751,17 +587,13 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -> CXSparse/Doc/License.txt < ----------------------------- +CXSparse/Doc/License.txt +------------------------ CXSparse: a Concise Sparse matrix package - Extended. Copyright (c) 2006, Timothy A. Davis. http://www.suitesparse.com -- - - -------------- - CXSparse is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -777,17 +609,13 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -> CXSparse_newfiles/Doc/License.txt < -------------------------------------- +CXSparse_newfiles/Doc/License.txt +--------------------------------- CXSparse: a Concise Sparse matrix package - Extended. Copyright (c) 2006, Timothy A. Davis. http://www.suitesparse.com -- - - -------------- - CXSparse is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -803,8 +631,8 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -> GPUQREngine/Doc/License.txt < -------------------------------- +GPUQREngine/Doc/License.txt +--------------------------- GPUQREngine Copyright (c) 2013, Timothy A. Davis, Sencer Nuri Yeralan, @@ -832,8 +660,8 @@ SuiteSparse. Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -> KLU/Doc/License.txt < ------------------------ +KLU/Doc/License.txt +------------------- KLU, Copyright (C) 2004-2013, University of Florida by Timothy A. Davis and Ekanathan Palamadai. @@ -841,10 +669,6 @@ SuiteSparse. details. http://www.suitesparse.com -- - - -------------- - KLU is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -860,18 +684,14 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -> LDL/Doc/License.txt < ------------------------ +LDL/Doc/License.txt +------------------- LDL Copyright (c) 2005-2013 by Timothy A. Davis. LDL is also available under other licenses; contact the author for details. http://www.suitesparse.com -- - - -------------- - LDL is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -887,8 +707,8 @@ SuiteSparse. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -> MATLAB_Tools/Doc/License.txt < --------------------------------- +MATLAB_Tools/Doc/License.txt +---------------------------- The MATLAB_Tools collection of packages is Copyright (c), Timothy A. Davis, All Rights Reserved, @@ -898,32 +718,21 @@ SuiteSparse. All packages are available under alternative licenses. Contact the authors for details. -- - - -------------- - MATLAB_Tools License, with the exception of SSMULT and SuiteSparseCollection: -- - - -------------- - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -948,16 +757,8 @@ SuiteSparse. OF SUCH DAMAGE. -- - - -------------- - SuiteSparseCollection License: -- - - -------------- - SuiteSparseCollection is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -975,16 +776,8 @@ SuiteSparse. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- - - -------------- - SSMULT License: -- - - -------------- - SSMULT, Copyright (c) 2007-2011, Timothy A. Davis, http://www.suitesparse.com. @@ -1009,18 +802,14 @@ SuiteSparse. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -> RBio/Doc/License.txt < ------------------------- +RBio/Doc/License.txt +-------------------- RBio toolbox. Copyright (C) 2006-2009, Timothy A. Davis RBio is also available under other licenses; contact authors for details. http://www.suitesparse.com -- - - -------------- - RBio is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 @@ -1036,8 +825,8 @@ SuiteSparse. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -> SPQR/Doc/License.txt < ------------------------- +SPQR/Doc/License.txt +-------------------- SPQR, Copyright 2008-2016 by Timothy A. Davis. All Rights Reserved. @@ -1079,16 +868,12 @@ SuiteSparse. http://www.suitesparse.com -> SuiteSparse_GPURuntime/Doc/License.txt < ------------------------------------------- +SuiteSparse_GPURuntime/Doc/License.txt +-------------------------------------- SuiteSparse_GPURuntime Copyright (c) 2013-2016, Timothy A. Davis, Sencer Nuri Yeralan, and Sanjay Ranka. http://www.suitesparse.com -- - - -------------- - SuiteSparse_GPURuntime is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1111,8 +896,8 @@ SuiteSparse. Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -> ssget/Doc/License.txt < -------------------------- +ssget/Doc/License.txt +--------------------- Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. @@ -1121,16 +906,13 @@ SuiteSparse. are met: - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -1155,8 +937,8 @@ SuiteSparse. OF SUCH DAMAGE. -> UMFPACK/Doc/License.txt < ---------------------------- +UMFPACK/Doc/License.txt +----------------------- UMFPACK, Copyright 1995-2009 by Timothy A. Davis. All Rights Reserved. @@ -1198,8 +980,8 @@ SuiteSparse. http://www.suitesparse.com -> CSparse/MATLAB/ssget/Doc/License.txt < ----------------------------------------- +CSparse/MATLAB/ssget/Doc/License.txt +------------------------------------ Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. @@ -1208,16 +990,13 @@ SuiteSparse. are met: - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -1242,8 +1021,8 @@ SuiteSparse. OF SUCH DAMAGE. -> CXSparse/MATLAB/ssget/Doc/License.txt < ------------------------------------------ +CXSparse/MATLAB/ssget/Doc/License.txt +------------------------------------- Copyright (c), 2009-2016, Timothy A. Davis, All Rights Reserved. @@ -1252,16 +1031,13 @@ SuiteSparse. are met: - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the organizations to which the authors are - affiliated, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -1286,8 +1062,8 @@ SuiteSparse. OF SUCH DAMAGE. -> GraphBLAS/Doc/License.txt < ------------------------------ +GraphBLAS/Doc/License.txt +------------------------- SuiteSparse:GraphBLAS, Copyright 2017, Timothy A. Davis @@ -1305,8 +1081,8 @@ SuiteSparse. limitations under the License. -> Mongoose License < --------------------- +Mongoose License +---------------- Mongoose, Copyright 2018, Timothy A. Davis, Scott P. Kolodziej, William W. Hager, S. Nuri Yeralan diff --git a/build/pkgs/symmetrica/SPKG.rst b/build/pkgs/symmetrica/SPKG.rst index 2708b62b35b..bd82eda45f7 100644 --- a/build/pkgs/symmetrica/SPKG.rst +++ b/build/pkgs/symmetrica/SPKG.rst @@ -43,15 +43,15 @@ Special Update/Build Instructions The following patches are applied in spkg-install: -- bruch.patch: store integers in a temporary variable before freeing +- ``bruch.patch``: store integers in a temporary variable before freeing memory -- de.patch: turn off banner -- int32.patch: use int32_t and uint32_t for type INT. -- sort_sum_rename.patch: rename sort to sym_sort, sum to sym_sum -- We copy over our own Makefile: +- ``de.patch``: turn off banner +- ``int32.patch``: use ``int32_t`` and ``uint32_t`` for type INT. +- ``sort_sum_rename.patch``: rename ``sort`` to ``sym_sort``, ``sum`` to ``sym_sum`` +- We copy over our own ``Makefile``: - patches/makefile (Fix compiler, i.e., use $CC, and let it use - $CFLAGS.) + ``patches/makefile`` (Fix compiler, i.e., use ``$CC``, and let it use + ``$CFLAGS``.) -Permissions in the upstream tarball are funky, please run "chmod 644 -src/*" after unpacking. +Permissions in the upstream tarball are funky, please run ``chmod 644 +src/*`` after unpacking. From 6257875c9aabcd730c3ba3801f9eb2e458d336d8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 May 2020 21:53:52 -0700 Subject: [PATCH 045/301] Generate External Packages chapter for the reference manual --- Makefile | 1 + bootstrap | 2 +- src/doc/.gitignore | 1 + src/doc/bootstrap | 28 ++++++++++++++++++++++++++++ src/doc/en/reference/index.rst | 1 + src/doc/en/reference/spkg/conf.py | 1 + 6 files changed, 33 insertions(+), 1 deletion(-) create mode 120000 src/doc/en/reference/spkg/conf.py diff --git a/Makefile b/Makefile index 822d1d316ff..96fa102e717 100644 --- a/Makefile +++ b/Makefile @@ -105,6 +105,7 @@ distclean: build-clean bootstrap-clean: rm -rf config configure build/make/Makefile-auto.in rm -f src/doc/en/installation/*.txt + rm -rf src/doc/en/reference/spkg/*.rst # Remove absolutely everything which isn't part of the git repo maintainer-clean: distclean bootstrap-clean diff --git a/bootstrap b/bootstrap index 4fc817e2377..22c89db0c17 100755 --- a/bootstrap +++ b/bootstrap @@ -155,7 +155,7 @@ save () { # Create configure tarball echo "Creating $NEWCONFBALL..." mkdir -p upstream - tar zcf "$NEWCONFBALL" configure config/* build/make/Makefile-auto.in src/doc/en/installation/*.txt + tar zcf "$NEWCONFBALL" configure config/* build/make/Makefile-auto.in src/doc/en/installation/*.txt src/doc/en/reference/spkg/*.rst # Update version echo "$NEWCONFVERSION" >$PKG/package-version.txt diff --git a/src/doc/.gitignore b/src/doc/.gitignore index a4b0d22f3bd..5039f33ca6a 100644 --- a/src/doc/.gitignore +++ b/src/doc/.gitignore @@ -2,5 +2,6 @@ /en/reference/*/sagenb /en/reference/sage /en/reference/sagenb +/en/reference/spkg/*.rst /output /en/installation/*.txt diff --git a/src/doc/bootstrap b/src/doc/bootstrap index eaefc1c83f4..f25a7a8d5f6 100755 --- a/src/doc/bootstrap +++ b/src/doc/bootstrap @@ -49,3 +49,31 @@ for SYSTEM in arch debian fedora cygwin homebrew; do echo "$(sage-print-system-package-command $SYSTEM --prompt --sudo install $(echo $(echo $SYSTEM_PACKAGES | xargs -n 1 echo | sort)))" > "$OUTPUT_DIR"/$SYSTEM.txt echo "$(sage-print-system-package-command $SYSTEM --prompt --sudo install $(echo $(echo $OPTIONAL_SYSTEM_PACKAGES | xargs -n 1 echo | sort)))" > "$OUTPUT_DIR"/$SYSTEM-optional.txt done + +OUTPUT_DIR="src/doc/en/reference/spkg" +mkdir -p "$OUTPUT_DIR" +echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/"*.rst" +OUTPUT_INDEX="$OUTPUT_DIR"/index.rst +cat > "$OUTPUT_INDEX" <> "$OUTPUT_INDEX" " $PKG_BASE" + fi + fi +done +cat >> "$OUTPUT_INDEX" <` * :doc:`References ` * :doc:`History and License ` * :ref:`genindex` diff --git a/src/doc/en/reference/spkg/conf.py b/src/doc/en/reference/spkg/conf.py new file mode 120000 index 00000000000..2bdf7e68470 --- /dev/null +++ b/src/doc/en/reference/spkg/conf.py @@ -0,0 +1 @@ +../conf_sub.py \ No newline at end of file From 584f22f4760ffea1fbe0f6408541d6ac6c48513f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 3 May 2020 10:55:58 +0200 Subject: [PATCH 046/301] some details in Lyndon words (pep, code and doc) --- src/sage/combinat/words/lyndon_word.py | 71 +++++++++++++------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/src/sage/combinat/words/lyndon_word.py b/src/sage/combinat/words/lyndon_word.py index 26c9f32268c..a0539d49685 100644 --- a/src/sage/combinat/words/lyndon_word.py +++ b/src/sage/combinat/words/lyndon_word.py @@ -12,15 +12,13 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import builtins from sage.structure.unique_representation import UniqueRepresentation from sage.structure.parent import Parent from sage.combinat.composition import Composition, Compositions from sage.rings.all import Integer -from sage.arith.all import factorial, divisors, gcd, moebius -from sage.misc.all import prod +from sage.arith.all import divisors, gcd, moebius, multinomial from sage.combinat.necklace import _sfc from sage.combinat.words.words import FiniteWords @@ -29,24 +27,26 @@ def LyndonWords(e=None, k=None): """ - Returns the combinatorial class of Lyndon words. + Return the combinatorial class of Lyndon words. A Lyndon word `w` is a word that is lexicographically less than all of its rotations. Equivalently, whenever `w` is split into two non-empty substrings, `w` is lexicographically less than the right substring. + See :wikipedia:`Lyndon_word` + INPUT: - no input at all or - - ``e`` - integer, size of alphabet - - ``k`` - integer, length of the words + - ``e`` -- integer, size of alphabet + - ``k`` -- integer, length of the words or - - ``e`` - a composition + - ``e`` -- a composition OUTPUT: @@ -95,15 +95,16 @@ def LyndonWords(e=None, k=None): raise TypeError("e must be a positive integer or a composition") + def LyndonWord(data, check=True): r""" Construction of a Lyndon word. INPUT: - - ``data`` - list - - ``check`` - bool (optional, default: True) if True, a - verification that the input data represent a Lyndon word. + - ``data`` -- list + - ``check`` -- bool (optional, default: ``True``) if ``True``, + check that the input data represents a Lyndon word. OUTPUT: @@ -120,13 +121,14 @@ def LyndonWord(data, check=True): ... ValueError: not a Lyndon word - If check is False, then no verification is done:: + If ``check`` is ``False``, then no verification is done:: sage: LyndonWord([2,1,2,3], check=False) word: 2123 """ return LyndonWords()(data, check=check) + class LyndonWords_class(UniqueRepresentation, Parent): r""" The set of all Lyndon words. @@ -186,6 +188,7 @@ def __contains__(self, w): w = self._words(w) return w.is_lyndon() + class LyndonWords_evaluation(UniqueRepresentation, Parent): r""" The set of Lyndon words on a fixed multiset of letters. @@ -223,7 +226,7 @@ def __repr__(self): sage: repr(LyndonWords([2,1,1])) 'Lyndon words with evaluation [2, 1, 1]' """ - return "Lyndon words with evaluation %s"%self._e + return "Lyndon words with evaluation %s" % self._e def __call__(self, *args, **kwds): r""" @@ -265,7 +268,7 @@ def __contains__(self, x): def cardinality(self): """ - Returns the number of Lyndon words with the evaluation e. + Return the number of Lyndon words with the evaluation e. EXAMPLES:: @@ -277,9 +280,7 @@ def cardinality(self): 30 Check to make sure that the count matches up with the number of - Lyndon words generated. - - :: + Lyndon words generated:: sage: comps = [[],[2,2],[3,2,7],[4,2]] + Compositions(4).list() sage: lws = [LyndonWords(comp) for comp in comps] @@ -287,13 +288,12 @@ def cardinality(self): True """ evaluation = self._e - le = builtins.list(evaluation) - if len(evaluation) == 0: - return 0 - + le = list(evaluation) + if not evaluation: + return Integer(0) n = sum(evaluation) - - return sum([moebius(j)*factorial(n/j) / prod([factorial(ni/j) for ni in evaluation]) for j in divisors(gcd(le))])/n + return sum(moebius(j) * multinomial([ni // j for ni in evaluation]) + for j in divisors(gcd(le))) // n def __iter__(self): """ @@ -331,19 +331,16 @@ def __iter__(self): """ if not self._e: return - k = 0 while self._e[k] == 0: k += 1 - for z in _sfc(self._e[k:], equality=True): - yield self._words([i+k+1 for i in z], check=False) + yield self._words([i + k + 1 for i in z], check=False) class LyndonWords_nk(UniqueRepresentation, Parent): r""" - Lyndon words of fixed length `k` over the alphabet - `\{1, 2, \ldots, n\}`. + Lyndon words of fixed length `k` over the alphabet `\{1, 2, \ldots, n\}`. INPUT: @@ -392,7 +389,7 @@ def __repr__(self): sage: repr(LyndonWords(2, 3)) 'Lyndon words from an alphabet of size 2 of length 3' """ - return "Lyndon words from an alphabet of size %s of length %s"%(self._n, self._k) + return "Lyndon words from an alphabet of size %s of length %s" % (self._n, self._k) def __call__(self, *args, **kwds): r""" @@ -445,8 +442,8 @@ def cardinality(self): else: s = Integer(0) for d in divisors(self._k): - s += moebius(d)*(self._n**(self._k/d)) - return s/self._k + s += moebius(d) * self._n**(self._k // d) + return s // self._k def __iter__(self): """ @@ -469,14 +466,17 @@ def __iter__(self): """ W = self._words._element_classes['list'] for lw in lyndon_word_iterator(self._n, self._k): - yield W(self._words, [i+1 for i in lw]) + yield W(self._words, [i + 1 for i in lw]) + def StandardBracketedLyndonWords(n, k): """ - Returns the combinatorial class of standard bracketed Lyndon words - from [1, ..., n] of length k. These are in one to one - correspondence with the Lyndon words and form a basis for the - subspace of degree k of the free Lie algebra of rank n. + Return the combinatorial class of standard bracketed Lyndon words + from [1, ..., n] of length k. + + These are in one to one correspondence with the Lyndon words and + form a basis for the subspace of degree k of the free Lie algebra + of rank n. EXAMPLES:: @@ -581,4 +581,3 @@ def standard_bracketing(lw): for i in range(1, len(lw)): if lw[i:] in LyndonWords(): return [standard_bracketing(lw[:i]), standard_bracketing(lw[i:])] - From 6fd708e2a4df5dd83dd08bcd8dfe08b448bed9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 3 May 2020 11:08:57 +0200 Subject: [PATCH 047/301] trac 29634 some further details --- src/sage/combinat/set_partition_ordered.py | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/sage/combinat/set_partition_ordered.py b/src/sage/combinat/set_partition_ordered.py index 791dfa13e09..731f159b117 100644 --- a/src/sage/combinat/set_partition_ordered.py +++ b/src/sage/combinat/set_partition_ordered.py @@ -184,11 +184,11 @@ def __classcall_private__(cls, parts=None, from_word=None): if from_word: return OrderedSetPartitions().from_finite_word(Words()(from_word)) # if `parts` looks like a sequence of "letters" then treat it like a word. - if parts in Words() or (len(parts) and (parts[0] in ZZ or isinstance(parts[0], str))): + if parts in Words() or (parts and (parts[0] in ZZ or isinstance(parts[0], str))): return OrderedSetPartitions().from_finite_word(Words()(parts)) else: - P = OrderedSetPartitions(reduce(lambda x,y: x.union(y), - map(Set, parts), Set([]))) + P = OrderedSetPartitions(reduce(lambda x, y: x.union(y), + parts, frozenset())) return P.element_class(P, parts) def __init__(self, parent, s): @@ -201,7 +201,7 @@ def __init__(self, parent, s): sage: s = OS([[1, 3], [2, 4]]) sage: TestSuite(s).run() """ - self._base_set = reduce(lambda x,y: x.union(y), map(Set, s), Set([])) + self._base_set = reduce(lambda x, y: x.union(y), map(Set, s), Set([])) ClonableArray.__init__(self, parent, [Set(_) for _ in s]) def _repr_(self): @@ -367,7 +367,7 @@ def reversed(self): sage: OrderedSetPartition([]).reversed() [] """ - par = self.parent() + par = parent(self) return par(list(reversed(self))) def complement(self): @@ -760,8 +760,8 @@ def strongly_fatter(self): [[{4}, {1, 5}, {3}], [{4}, {1}, {5}, {3}]] """ c = [sorted(X) for X in self] - l = len(c) - g = [-1] + [i for i in range(l-1) if c[i][-1] > c[i+1][0]] + [l-1] + l = len(c) - 1 + g = [-1] + [i for i in range(l) if c[i][-1] > c[i + 1][0]] + [l] # g lists the positions of the blocks that cannot be merged # with their right neighbors. subcomps = [OrderedSetPartition(c[g[i] + 1: g[i + 1] + 1]) @@ -953,21 +953,21 @@ def __contains__(self, x): if not isinstance(x, (OrderedSetPartition, list, tuple)): return False - #The total number of elements in the list - #should be the same as the number is self._set + # The total number of elements in the list + # should be the same as the number is self._set if sum(map(len, x)) != len(self._set): return False - #Check to make sure each element of the list - #is a nonempty set + # Check to make sure each element of the list + # is a nonempty set u = Set([]) for s in x: if not s or not isinstance(s, (set, frozenset, Set_generic)): return False u = u.union(s) - #Make sure that the union of all the - #sets is the original set + # Make sure that the union of all the + # sets is the original set if u != Set(self._set): return False @@ -1130,7 +1130,7 @@ def __iter__(self): [{3}, {1, 2, 4}], [{4}, {1, 2, 3}]] """ - for x in Compositions(len(self._set),length=self.n): + for x in Compositions(len(self._set), length=self.n): for z in OrderedSetPartitions_scomp(self._set, x): yield self.element_class(self, z) @@ -1407,7 +1407,7 @@ def __setstate__(self, state): self.__class__ = OrderedSetPartitions_scomp n = state['_n'] k = state['_k'] - OrderedSetPartitions_scomp.__init__(self, range(state['_n']), (k,n-k)) + OrderedSetPartitions_scomp.__init__(self, range(state['_n']), (k, n-k)) from sage.misc.persist import register_unpickle_override From 49ba962924b6876a577c44916d8ed55df7f432d2 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Wed, 3 Apr 2019 02:31:54 +0200 Subject: [PATCH 048/301] rebase and correct --- src/sage/combinat/sf/elementary.py | 117 +++++++++++++++++++++++++- src/sage/combinat/sf/homogeneous.py | 115 ++++++++++++++++++++++++++ src/sage/combinat/sf/monomial.py | 88 ++++++++++++++++++++ src/sage/combinat/sf/powersum.py | 116 ++++++++++++++++++++++++++ src/sage/combinat/sf/schur.py | 100 ++++++++++++++++++++++- src/sage/combinat/sf/sfa.py | 122 +++++++++++++++++++++++++++- 6 files changed, 655 insertions(+), 3 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index f65ea34ed69..34e91173027 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -20,7 +20,10 @@ #***************************************************************************** from . import multiplicative, classical from sage.combinat.partition import Partition - +from sage.misc.all import prod +from sage.functions.other import factorial, binomial +from sage.rings.all import infinity +from sage.combinat.q_analogues import q_binomial, q_factorial ################################### # # @@ -305,6 +308,118 @@ def expand(self, n, alphabet='x'): condition = lambda part: max(part) > n return self._expand(condition, n, alphabet) + + def principal_specialization(self, n=infinity, q=None): + r""" + Return the principal specialization of the symmetric function. + + The principal specialization of order `n` is the ring + homomorphism given by setting `x_i = q^i` for `i \in + \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`. + + The stable principal specialization is the ring + homomorphism given by setting `x_i = q^i` for all `i`. + + INPUT: + + - ``n`` (default: ``infinity``) -- a nonnegative integer or + ``infinity``, specifying whether to compute the principal + specialization of order ``n`` or the stable principal + specialization. + + - ``q`` (default: ``None``) -- the value to use for `q`, + the default is to create the fraction field of + polynomials in ``q`` over the coefficient ring. + + EXAMPLES:: + + sage: e = SymmetricFunctions(QQ).e() + sage: x = e[3,1] + sage: x.principal_specialization(3) + q^5 + q^4 + q^3 + sage: x = 5*e[1,1,1] + 3*e[2,1] + 1 + sage: x.principal_specialization(3) + 5*q^6 + 18*q^5 + 36*q^4 + 44*q^3 + 36*q^2 + 18*q + 6 + + By default, we return a rational functions in q. Sometimes it is + it is better to obtain an element of the symbolic ring:: + + sage: x.principal_specialization(q=var("q")) + -3*q/((q^2 - 1)*(q - 1)^2) - 5/(q - 1)^3 + 1 + + TESTS:: + + sage: e.zero().principal_specialization(3) + 0 + + """ + if q is None: + q = self.base_ring()["q"].fraction_field().gen() + if q == 1: + f = lambda partition: prod(binomial(n, part) for part in partition) + elif n == infinity: + f = lambda partition: prod(q**binomial(part, 2)/prod((1-q**i) + for i in range(1,part+1)) + for part in partition) + else: + f = lambda partition: prod(q**binomial(part, 2)*q_binomial(n, part, q=q) + for part in partition) + + return self.parent()._apply_module_morphism(self, f, q.parent()) + + + def exponential_specialization(self, t=None, q=1): + r""" + EXAMPLES:: + + sage: e = SymmetricFunctions(QQ).e() + sage: x = e[3,2] + sage: x.exponential_specialization() + 1/12*t^5 + sage: x = 5*e[2] + 3*e[1] + 1 + sage: x.exponential_specialization(t=var("t"), q=var("q")) + 5*q*t^2/(q + 1) + 3*t + 1 + + TESTS:: + + sage: e.zero().exponential_specialization() + 0 + + """ + if q == 1: + if t is None: + t = self.base_ring()["t"].gen() + def f(partition): + n = 0 + m = 1 + for part in partition: + n += part + m *= factorial(part) + return t**n/m + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + if q is None and t is None: + Rq = self.base_ring()["q"].fraction_field() + q = Rq.gen() + t = Rq["t"].gen() + elif q is None: + q = t.parent()["q"].fraction_field().gen() + elif t is None: + t = q.parent()["t"].gen() + + def f(partition): + n = 0 + m = 1 + for part in partition: + n += part + m *= q**binomial(part, 2)/q_factorial(part, q=q) + + return t**n * m + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + # Backward compatibility for unpickling from sage.misc.persist import register_unpickle_override register_unpickle_override('sage.combinat.sf.elementary', 'SymmetricFunctionAlgebraElement_elementary', SymmetricFunctionAlgebra_elementary.Element) diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index 3e5462d1742..618e136f9ee 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -28,6 +28,10 @@ #################################### from . import multiplicative, classical from sage.combinat.partition import Partition +from sage.rings.all import infinity +from sage.misc.all import prod +from sage.functions.other import factorial, binomial +from sage.combinat.q_analogues import q_binomial, q_factorial class SymmetricFunctionAlgebra_homogeneous(multiplicative.SymmetricFunctionAlgebra_multiplicative): def __init__(self, Sym): @@ -223,6 +227,117 @@ def expand(self, n, alphabet='x'): condition = lambda part: False return self._expand(condition, n, alphabet) + def principal_specialization(self, n=infinity, q=None): + r""" + Return the principal specialization of the symmetric function. + + The principal specialization of order `n` is the ring + homomorphism given by setting `x_i = q^i` for `i \in + \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`. + + The stable principal specialization is the ring + homomorphism given by setting `x_i = q^i` for all `i`. + + INPUT: + + - ``n`` (default: ``infinity``) -- a nonnegative integer or + ``infinity``, specifying whether to compute the principal + specialization of order ``n`` or the stable principal + specialization. + + - ``q`` (default: ``None``) -- the value to use for `q`, + the default is to create the fraction field of + polynomials in ``q`` over the coefficient ring. + + EXAMPLES:: + + sage: h = SymmetricFunctions(QQ).h() + sage: x = h[2,1] + sage: x.principal_specialization(3) + q^6 + 2*q^5 + 4*q^4 + 4*q^3 + 4*q^2 + 2*q + 1 + sage: x = 3*h[2] + 2*h[1] + 1 + sage: x.principal_specialization(3, q=var("q")) + 2*(q^3 - 1)/(q - 1) + 3*(q^4 - 1)*(q^3 - 1)/((q^2 - 1)*(q - 1)) + 1 + + TESTS:: + + sage: x = h.zero() + sage: s = x.principal_specialization(3); s + 0 + + """ + if q is None: + q = self.base_ring()["q"].fraction_field().gen() + if q == 1: + f = lambda partition: prod(binomial(n+part-1, part) for part in partition) + elif n == infinity: + f = lambda partition: prod(1/prod((1-q**i) for i in range(1, part+1)) for part in partition) + else: + f = lambda partition: prod(q_binomial(n+part-1, part, q=q) for part in partition) + + return self.parent()._apply_module_morphism(self, f, q.parent()) + + + def exponential_specialization(self, t=None, q=1): + r""" + EXAMPLES:: + + sage: h = SymmetricFunctions(QQ).h() + sage: x = h[5,3] + sage: x.exponential_specialization() + 1/720*t^8 + sage: factorial(5)*factorial(3) + 720 + + sage: x = 5*h[1,1,1] + 3*h[2,1] + 1 + sage: x.exponential_specialization() + 13/2*t^3 + 1 + + We also support the `q`-exponential_specialization:: + + sage: factor(h[3].exponential_specialization(q=var("q"), t=var("t"))) + t^3/((q^2 + q + 1)*(q + 1)) + + TESTS:: + + sage: x = h.zero() + sage: s = x.exponential_specialization(); s + 0 + + """ + if q == 1: + if t is None: + t = self.base_ring()["t"].gen() + def f(partition): + n = 0 + m = 1 + for part in partition: + n += part + m *= factorial(part) + return t**n/m + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + if q is None and t is None: + Rq = self.base_ring()["q"].fraction_field() + q = Rq.gen() + t = Rq["t"].gen() + elif q is None: + q = t.parent()["q"].fraction_field().gen() + elif t is None: + t = q.parent()["t"].gen() + + def f(partition): + n = 0 + m = 1 + for part in partition: + n += part + m *= q_factorial(part, q=q) + return t**n/m + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + # Backward compatibility for unpickling from sage.misc.persist import register_unpickle_override register_unpickle_override('sage.combinat.sf.homogeneous', 'SymmetricFunctionAlgebraElement_homogeneous', SymmetricFunctionAlgebra_homogeneous.Element) diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index 01cc7e73d5f..28097b92dd8 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -22,7 +22,10 @@ from . import classical import sage.libs.symmetrica.all as symmetrica from sage.rings.integer import Integer +from sage.rings.infinity import infinity from sage.combinat.partition import Partition, _Partitions +from sage.functions.other import factorial, binomial +from sage.arith.misc import multinomial class SymmetricFunctionAlgebra_monomial(classical.SymmetricFunctionAlgebra_classical): @@ -312,6 +315,91 @@ def condition(part): return len(part) > n return self._expand(condition, n, alphabet) +<<<<<<< HEAD +======= + def principal_specialization(self, n=infinity, q=None): + r""" + Return the principal specialization of the symmetric function. + + The principal specialization of order `n` is the ring + homomorphism given by setting `x_i = q^i` for `i \in + \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`. + + The stable principal specialization is the ring + homomorphism given by setting `x_i = q^i` for all `i`. + + INPUT: + + - ``n`` (default: ``infinity``) -- a nonnegative integer or + ``infinity``, specifying whether to compute the principal + specialization of order ``n`` or the stable principal + specialization. + + - ``q`` (default: ``None``) -- the value to use for `q`, + the default is to create the fraction field of + polynomials in ``q`` over the coefficient ring. + + EXAMPLES:: + + sage: m = SymmetricFunctions(QQ).m() + sage: x = m[3,1] + sage: x.principal_specialization(3) + q^7 + q^6 + q^5 + q^3 + q^2 + q + + sage: x = 5*m[2] + 3*m[1] + 1 + sage: x.principal_specialization(3, q=var("q")) + 5*(q^6 - 1)/(q^2 - 1) + 3*(q^3 - 1)/(q - 1) + 1 + + TESTS:: + + sage: m.zero().principal_specialization(3) + 0 + + """ + if q == 1: + f = lambda partition: binomial(n, len(partition))*multinomial(partition.to_exp()) + return self.parent()._apply_module_morphism(self, f, q.parent()) + + return self.parent().realization_of().powersum()(self).principal_specialization(n=n, q=q) + + def exponential_specialization(self, t=None, q=1): + r""" + EXAMPLES:: + + sage: m = SymmetricFunctions(QQ).m() + sage: (m[3]+m[2,1]+m[1,1,1]).exponential_specialization() + 1/6*t^3 + + sage: x = 5*m[1,1,1] + 3*m[2,1] + 1 + sage: x.exponential_specialization() + 5/6*t^3 + 1 + + We also support the `q`-exponential_specialization:: + + sage: factor(m[3].exponential_specialization(q=var("q"), t=var("t"))) + (q - 1)^2*t^3/(q^2 + q + 1) + + TESTS:: + + sage: m.zero().exponential_specialization() + 0 + + """ + if q == 1: + if t is None: + t = self.base_ring()["t"].gen() + def f(partition): + n = 0 + for part in partition: + if part != 1: + return 0 + n += 1 + return t**n/factorial(n) + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + return self.parent().realization_of().powersum()(self).exponential_specialization(t=t, q=q) +>>>>>>> rebase and correct # Backward compatibility for unpickling from sage.misc.persist import register_unpickle_override diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index 80d820ace7a..6cc6ac2a68c 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -21,6 +21,8 @@ from . import sfa, multiplicative, classical from sage.combinat.partition import Partition from sage.arith.all import divisors +from sage.rings.all import infinity +from sage.misc.all import prod class SymmetricFunctionAlgebra_power(multiplicative.SymmetricFunctionAlgebra_multiplicative): def __init__(self, Sym): @@ -704,6 +706,120 @@ def eval_at_permutation_roots(self, rho): p.eval_at_permutation_roots_on_generators(k, rho) for k in lam) return p._apply_module_morphism(self, on_basis, R) + def principal_specialization(self, n=infinity, q=None): + r"""Return the principal specialization of the symmetric function. + + The principal specialization of order `n` is the ring + homomorphism given by setting `x_i = q^i` for `i \in + \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`. + + The stable principal specialization is the ring + homomorphism given by setting `x_i = q^i` for all `i`. + + INPUT: + + - ``n`` (default: ``infinity``) -- a nonnegative integer or + ``infinity``, specifying whether to compute the principal + specialization of order ``n`` or the stable principal + specialization. + + - ``q`` (default: ``None``) -- the value to use for `q`, + the default is to create the fraction field of + polynomials in ``q`` over the coefficient ring. + + EXAMPLES:: + + sage: p = SymmetricFunctions(QQ).p() + sage: x = p[8,7,3,1] + sage: x.principal_specialization(3, q=var("q")) + (q^24 - 1)*(q^21 - 1)*(q^9 - 1)/((q^8 - 1)*(q^7 - 1)*(q - 1)) + + sage: x = 5*p[1,1,1] + 3*p[2,1] + 1 + sage: x.principal_specialization(3, q=var("q")) + 5*(q^3 - 1)^3/(q - 1)^3 + 3*(q^6 - 1)*(q^3 - 1)/((q^2 - 1)*(q - 1)) + 1 + + By default, we return a rational function in `q`:: + + sage: x.principal_specialization(3) + 8*q^6 + 18*q^5 + 36*q^4 + 38*q^3 + 36*q^2 + 18*q + 9 + + If ``n`` is not given we return the stable principal specialisation:: + + sage: x.principal_specialization(q=var("q")) + 3/((q^2 - 1)*(q - 1)) - 5/(q - 1)^3 + 1 + + TESTS:: + + sage: p.zero().principal_specialization(3) + 0 + + """ + if q is None: + q = self.base_ring()["q"].fraction_field().gen() + if q == 1: + f = lambda partition: n**len(partition) + elif n == infinity: + f = lambda partition: prod(1/(1-q**part) for part in partition) + else: + f = lambda partition: prod((1-q**(n*part))/(1-q**part) for part in partition) + + return self.parent()._apply_module_morphism(self, f, q.parent()) + + def exponential_specialization(self, t=None, q=1): + r""" + EXAMPLES:: + + sage: p = SymmetricFunctions(QQ).p() + sage: x = p[8,7,3,1] + sage: x.exponential_specialization() + 0 + sage: x = p[3] + 5*p[1,1] + 2*p[1] + 1 + sage: x.exponential_specialization(t=var("t")) + 5*t^2 + 2*t + 1 + + We also support the `q`-exponential_specialization:: + + sage: factor(p[3].exponential_specialization(q=var("q"), t=var("t"))) + (q - 1)^2*t^3/(q^2 + q + 1) + + TESTS:: + + sage: p.zero().exponential_specialization() + 0 + + """ + if q == 1: + if t is None: + t = self.base_ring()["t"].gen() + def f(partition): + n = 0 + for part in partition: + if part != 1: + return 0 + n += 1 + return t**n + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + if q is None and t is None: + Rq = self.base_ring()["q"].fraction_field() + q = Rq.gen() + t = Rq["t"].gen() + elif q is None: + q = t.parent()["q"].fraction_field().gen() + elif t is None: + t = q.parent()["t"].gen() + + def f(partition): + n = 0 + m = 1 + for part in partition: + n += part + m *= 1-q**part + return (1-q)**n * t**n / m + + return self.parent()._apply_module_morphism(self, f, t.parent()) + # Backward compatibility for unpickling from sage.misc.persist import register_unpickle_override register_unpickle_override('sage.combinat.sf.powersum', 'SymmetricFunctionAlgebraElement_power', SymmetricFunctionAlgebra_power.Element) diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index d193157aa3e..745de3b3dfc 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -21,7 +21,10 @@ from . import classical import sage.libs.lrcalc.lrcalc as lrcalc - +from sage.misc.all import prod +from sage.rings.infinity import infinity +from sage.functions.other import factorial +from sage.combinat.tableau import StandardTableaux class SymmetricFunctionAlgebra_schur(classical.SymmetricFunctionAlgebra_classical): def __init__(self, Sym): @@ -571,6 +574,101 @@ def expand(self, n, alphabet='x'): condition = lambda part: len(part) > n return self._expand(condition, n, alphabet) + def principal_specialization(self, n=infinity, q=None): + r""" + Return the principal specialization of the symmetric function. + + The principal specialization of order `n` is the ring + homomorphism given by setting `x_i = q^i` for `i \in + \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`. + + The stable principal specialization is the ring + homomorphism given by setting `x_i = q^i` for all `i`. + + INPUT: + + - ``n`` (default: ``infinity``) -- a nonnegative integer or + ``infinity``, specifying whether to compute the principal + specialization of order ``n`` or the stable principal + specialization. + + - ``q`` (default: ``None``) -- the value to use for `q`, + the default is to create the fraction field of + polynomials in ``q`` over the coefficient ring. + + EXAMPLES:: + + sage: s = SymmetricFunctions(QQ).s() + sage: x = s[2] + sage: x.principal_specialization(3) + q^4 + q^3 + 2*q^2 + q + 1 + + sage: x = 3*s[2,2] + 2*s[1] + 1 + sage: x.principal_specialization(3, q=var("q")) + 3*(q^4 - 1)*(q^3 - 1)*q^2/((q^2 - 1)*(q - 1)) + 2*(q^3 - 1)/(q - 1) + 1 + + sage: x.principal_specialization(q=var("q")) + -2/(q - 1) + 3*q^2/((q^3 - 1)*(q^2 - 1)^2*(q - 1)) + 1 + + TESTS:: + + sage: s.zero().principal_specialization(3) + 0 + + """ + if q is None: + q = self.base_ring()["q"].fraction_field().gen() + if q == 1: + f = lambda partition: (prod(n+partition.content(*c) for c in partition.cells()) + / prod(h for h in partition.hooks())) + elif n == infinity: + f = lambda partition: (q**sum(i*part for i, part in enumerate(partition)) + / prod(1-q**h for h in partition.hooks())) + else: + f = lambda partition: (q**sum(i*part for i, part in enumerate(partition)) + * prod(1-q**(n + partition.content(*c)) for c in partition.cells()) + / prod(1-q**h for h in partition.hooks())) + + return self.parent()._apply_module_morphism(self, f, q.parent()) + + + def exponential_specialization(self, t=None, q=1): + r""" + EXAMPLES:: + + sage: s = SymmetricFunctions(QQ).s() + sage: x = s[5,3] + sage: x.exponential_specialization() + 1/1440*t^8 + + sage: x = 5*s[1,1,1] + 3*s[2,1] + 1 + sage: x.exponential_specialization() + 11/6*t^3 + 1 + + We also support the `q`-exponential_specialization:: + + sage: factor(s[3].exponential_specialization(q=var("q"), t=var("t"))) + t^3/((q^2 + q + 1)*(q + 1)) + + TESTS:: + + sage: s.zero().exponential_specialization() + 0 + + """ + if q == 1: + if t is None: + t = self.base_ring()["t"].gen() + def f(partition): + n = partition.size() + return (StandardTableaux(partition).cardinality() + * t**n / factorial(n)) + + return self.parent()._apply_module_morphism(self, f, t.parent()) + + return self.parent().realization_of().powersum()(self).exponential_specialization(t=t, q=q) + + # Backward compatibility for unpickling from sage.misc.persist import register_unpickle_override register_unpickle_override('sage.combinat.sf.schur', 'SymmetricFunctionAlgebraElement_schur', SymmetricFunctionAlgebra_schur.Element) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 35838d1cd01..cf9996339fe 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -213,7 +213,7 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from sage.misc.cachefunc import cached_method -from sage.rings.all import Integer, PolynomialRing, QQ, ZZ +from sage.rings.all import Integer, PolynomialRing, QQ, ZZ, infinity from sage.rings.polynomial.polynomial_element import is_Polynomial from sage.rings.polynomial.multi_polynomial import is_MPolynomial from sage.combinat.partition import _Partitions, Partitions, Partitions_n, Partition @@ -5439,6 +5439,126 @@ def character_to_frobenius_image(self, n): return self.parent()(p.sum(self.eval_at_permutation_roots(rho) \ *p(rho)/rho.centralizer_size() for rho in Partitions(n))) + def principal_specialization(self, n=infinity, q=None): + r""" + Return the principal specialization of a symmetric function. + + The principal specialization of order `n` is the ring + homomorphism given by setting `x_i = q^i` for `i \in + \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`. + + The stable principal specialization is the ring homomorphism + given by setting `x_i = q^i` for all `i`. + + INPUT: + + - ``n`` (default: ``infinity``) -- a nonnegative integer or + ``infinity``, specifying whether to compute the principal + specialization of order ``n`` or the stable principal + specialization. + + - ``q`` (default: ``None``) -- the value to use for `q`, the + default is to create the fraction field of polynomials in + ``q`` over the coefficient ring. + + EXAMPLES:: + + sage: m = SymmetricFunctions(QQ).m() + sage: x = m[1,1] + sage: x.principal_specialization(3) + q^3 + q^2 + q + + By default we return a rational function in ``q``. Sometimes + it is better to obtain an element of the symbolic ring:: + + sage: h = SymmetricFunctions(QQ).h() + sage: (h[3]+h[2]).principal_specialization(q=var("q")) + 1/((q^2 - 1)*(q - 1)) - 1/((q^3 - 1)*(q^2 - 1)*(q - 1)) + + TESTS:: + + sage: m = SymmetricFunctions(QQ).m() + sage: m.zero().principal_specialization(3) + 0 + + sage: x = 5*m[1,1,1] + 3*m[2,1] + 1 + sage: x.principal_specialization(3) + 3*q^5 + 6*q^4 + 5*q^3 + 6*q^2 + 3*q + 1 + + sage: B = SymmetricFunctions(QQ).realizations() + sage: x = m[2,1] + sage: len(set([b(x).principal_specialization(n=3) for b in B])) + 1 + sage: len(set([b(x).principal_specialization() for b in B])) + 1 + sage: len(set([b(x).principal_specialization(n=4, q=1) for b in B])) + 1 + sage: len(set([b(x).principal_specialization(n=4, q=2) for b in B])) + 1 + + """ + from sage.combinat.sf.sf import SymmetricFunctions + p = SymmetricFunctions(self.parent().base_ring()).p() + return p(self).principal_specialization(n, q=q) + + + def exponential_specialization(self, t=None, q=1): + r"""Return the exponential specialization of a symmetric function. + + The `q`-exponential specialization is a ring homomorphism + defined on homogeneous symmetric functions `f` of degree `n` + as + + .. MATH:: + + ex_q(f) = (1-q)^n t^n ps(f), + + where `ps(f)` is the stable principal specialisation of `f`. + + INPUT: + + - ``t`` (default: None) -- the value to use for `t`, the default + is to create the fraction field of polynomials in ``t`` + over the coefficient ring. + + - ``q`` (default: 1) -- the value to use for `q`. + + EXAMPLES:: + + sage: m = SymmetricFunctions(QQ).m() + sage: (m[2,1]+m[1,1]).exponential_specialization() + 1/2*t^2 + + sage: x = m[3]+m[2,1]+m[1,1,1] + sage: d = x.homogeneous_degree() + sage: var("q t") + (q, t) + sage: factor((x.principal_specialization()*(1-q)^d*t^d)) + t^3/((q^2 + q + 1)*(q + 1)) + sage: factor(x.exponential_specialization(q=q, t=t)) + t^3/((q^2 + q + 1)*(q + 1)) + + TESTS:: + + sage: m = SymmetricFunctions(QQ).m() + sage: m.zero().exponential_specialization() + 0 + + sage: B = SymmetricFunctions(QQ).realizations() + sage: x = m[3]+m[2,1]+m[1,1,1] + sage: len(set([b(x).exponential_specialization(q=None, t=None) for b in B])) + 1 + sage: len(set([b(x).exponential_specialization(q=1) for b in B])) + 1 + sage: len(set([b(x).exponential_specialization(q=2) for b in B])) + 1 + sage: len(set([b(x).exponential_specialization(t=2) for b in B])) + 1 + + """ + p = self.parent().realization_of().powersum() + return p(self).exponential_specialization(t=t, q=q) + SymmetricFunctionAlgebra_generic.Element = SymmetricFunctionAlgebra_generic_Element From c1da94520b718d87edc567d4e08bdccc91b153b6 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Wed, 3 Apr 2019 10:34:19 +0200 Subject: [PATCH 049/301] fix doctests --- src/sage/combinat/sf/sfa.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index cf9996339fe..e036e91c336 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5485,8 +5485,13 @@ def principal_specialization(self, n=infinity, q=None): sage: x.principal_specialization(3) 3*q^5 + 6*q^4 + 5*q^3 + 6*q^2 + 3*q + 1 - sage: B = SymmetricFunctions(QQ).realizations() - sage: x = m[2,1] + Check that the principal specializations in different bases + are all the same. When specific implementations for further + bases are added, this test should be adapted:: + + sage: S = SymmetricFunctions(QQ) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: m = S.m(); x = m[2,1] sage: len(set([b(x).principal_specialization(n=3) for b in B])) 1 sage: len(set([b(x).principal_specialization() for b in B])) @@ -5497,13 +5502,12 @@ def principal_specialization(self, n=infinity, q=None): 1 """ - from sage.combinat.sf.sf import SymmetricFunctions - p = SymmetricFunctions(self.parent().base_ring()).p() + p = self.parent().realization_of().powersum() return p(self).principal_specialization(n, q=q) - def exponential_specialization(self, t=None, q=1): - r"""Return the exponential specialization of a symmetric function. + r""" + Return the exponential specialization of a symmetric function. The `q`-exponential specialization is a ring homomorphism defined on homogeneous symmetric functions `f` of degree `n` @@ -5544,8 +5548,13 @@ def exponential_specialization(self, t=None, q=1): sage: m.zero().exponential_specialization() 0 - sage: B = SymmetricFunctions(QQ).realizations() - sage: x = m[3]+m[2,1]+m[1,1,1] + Check that the exponential specializations in different bases + are all the same. When specific implementations for further + bases are added, this test should be adapted:: + + sage: S = SymmetricFunctions(QQ) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: m = S.m(); x = m[3]+m[2,1]+m[1,1,1] sage: len(set([b(x).exponential_specialization(q=None, t=None) for b in B])) 1 sage: len(set([b(x).exponential_specialization(q=1) for b in B])) From d2fba34e79a9b64ffe60a1814d04fdc2bc6d8013 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Mon, 15 Apr 2019 19:27:49 +0200 Subject: [PATCH 050/301] add documentation --- src/sage/combinat/sf/elementary.py | 37 +++++++++++++++++++++++++++- src/sage/combinat/sf/homogeneous.py | 37 +++++++++++++++++++++++++++- src/sage/combinat/sf/monomial.py | 37 +++++++++++++++++++++++++++- src/sage/combinat/sf/powersum.py | 37 +++++++++++++++++++++++++++- src/sage/combinat/sf/schur.py | 38 ++++++++++++++++++++++++++++- src/sage/combinat/sf/sfa.py | 19 +++++++++++++-- 6 files changed, 198 insertions(+), 7 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 34e91173027..06895b125d1 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -315,7 +315,8 @@ def principal_specialization(self, n=infinity, q=None): The principal specialization of order `n` is the ring homomorphism given by setting `x_i = q^i` for `i \in - \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`. + \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`, see Section + 7.8 of [EnumComb2]_. The stable principal specialization is the ring homomorphism given by setting `x_i = q^i` for all `i`. @@ -370,6 +371,40 @@ def principal_specialization(self, n=infinity, q=None): def exponential_specialization(self, t=None, q=1): r""" + Return the exponential specialization of a symmetric function. + + The exponential specialization `ex` is the ring homomorphism + defined on the basis of powersum symmetric functions by + setting `p_1 = t` and `p_n = 0` for `n > 1`. Equivalently, + on the basis of homogeneous functions it is given by `ex(h_n) + = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. + + By analogy `q`-exponential specialization is a ring homomorphism + defined on homogeneous symmetric functions `f` of degree `n` + as + + .. MATH:: + + ex_q(h_n) = t^n / [n]_q!, + + where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` + + .. MATH:: + + ex_q(f) = (1-q)^n t^n ps(f), + + where `ps(f)` is the stable principal specialisation of `f`. + Note that setting `q = 1` in the stable principal + specialisation is an invalid operation. + + INPUT: + + - ``t`` (default: None) -- the value to use for `t`, the default + is to create the fraction field of polynomials in ``t`` + over the coefficient ring. + + - ``q`` (default: 1) -- the value to use for `q`. + EXAMPLES:: sage: e = SymmetricFunctions(QQ).e() diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index 618e136f9ee..8b743939f9d 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -233,7 +233,8 @@ def principal_specialization(self, n=infinity, q=None): The principal specialization of order `n` is the ring homomorphism given by setting `x_i = q^i` for `i \in - \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`. + \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`, see Section + 7.8 of [EnumComb2]_. The stable principal specialization is the ring homomorphism given by setting `x_i = q^i` for all `i`. @@ -280,6 +281,40 @@ def principal_specialization(self, n=infinity, q=None): def exponential_specialization(self, t=None, q=1): r""" + Return the exponential specialization of a symmetric function. + + The exponential specialization `ex` is the ring homomorphism + defined on the basis of powersum symmetric functions by + setting `p_1 = t` and `p_n = 0` for `n > 1`. Equivalently, + on the basis of homogeneous functions it is given by `ex(h_n) + = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. + + By analogy `q`-exponential specialization is a ring homomorphism + defined on homogeneous symmetric functions `f` of degree `n` + as + + .. MATH:: + + ex_q(h_n) = t^n / [n]_q!, + + where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` + + .. MATH:: + + ex_q(f) = (1-q)^n t^n ps(f), + + where `ps(f)` is the stable principal specialisation of `f`. + Note that setting `q = 1` in the stable principal + specialisation is an invalid operation. + + INPUT: + + - ``t`` (default: None) -- the value to use for `t`, the default + is to create the fraction field of polynomials in ``t`` + over the coefficient ring. + + - ``q`` (default: 1) -- the value to use for `q`. + EXAMPLES:: sage: h = SymmetricFunctions(QQ).h() diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index 28097b92dd8..e9964b1ee09 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -323,7 +323,8 @@ def principal_specialization(self, n=infinity, q=None): The principal specialization of order `n` is the ring homomorphism given by setting `x_i = q^i` for `i \in - \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`. + \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`, see Section + 7.8 of [EnumComb2]_. The stable principal specialization is the ring homomorphism given by setting `x_i = q^i` for all `i`. @@ -364,6 +365,40 @@ def principal_specialization(self, n=infinity, q=None): def exponential_specialization(self, t=None, q=1): r""" + Return the exponential specialization of a symmetric function. + + The exponential specialization `ex` is the ring homomorphism + defined on the basis of powersum symmetric functions by + setting `p_1 = t` and `p_n = 0` for `n > 1`. Equivalently, + on the basis of homogeneous functions it is given by `ex(h_n) + = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. + + By analogy `q`-exponential specialization is a ring homomorphism + defined on homogeneous symmetric functions `f` of degree `n` + as + + .. MATH:: + + ex_q(h_n) = t^n / [n]_q!, + + where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` + + .. MATH:: + + ex_q(f) = (1-q)^n t^n ps(f), + + where `ps(f)` is the stable principal specialisation of `f`. + Note that setting `q = 1` in the stable principal + specialisation is an invalid operation. + + INPUT: + + - ``t`` (default: None) -- the value to use for `t`, the default + is to create the fraction field of polynomials in ``t`` + over the coefficient ring. + + - ``q`` (default: 1) -- the value to use for `q`. + EXAMPLES:: sage: m = SymmetricFunctions(QQ).m() diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index 6cc6ac2a68c..f26177c25be 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -711,7 +711,8 @@ def principal_specialization(self, n=infinity, q=None): The principal specialization of order `n` is the ring homomorphism given by setting `x_i = q^i` for `i \in - \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`. + \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`, see Section + 7.8 of [EnumComb2]_. The stable principal specialization is the ring homomorphism given by setting `x_i = q^i` for all `i`. @@ -767,6 +768,40 @@ def principal_specialization(self, n=infinity, q=None): def exponential_specialization(self, t=None, q=1): r""" + Return the exponential specialization of a symmetric function. + + The exponential specialization `ex` is the ring homomorphism + defined on the basis of powersum symmetric functions by + setting `p_1 = t` and `p_n = 0` for `n > 1`. Equivalently, + on the basis of homogeneous functions it is given by `ex(h_n) + = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. + + By analogy `q`-exponential specialization is a ring homomorphism + defined on homogeneous symmetric functions `f` of degree `n` + as + + .. MATH:: + + ex_q(h_n) = t^n / [n]_q!, + + where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` + + .. MATH:: + + ex_q(f) = (1-q)^n t^n ps(f), + + where `ps(f)` is the stable principal specialisation of `f`. + Note that setting `q = 1` in the stable principal + specialisation is an invalid operation. + + INPUT: + + - ``t`` (default: None) -- the value to use for `t`, the default + is to create the fraction field of polynomials in ``t`` + over the coefficient ring. + + - ``q`` (default: 1) -- the value to use for `q`. + EXAMPLES:: sage: p = SymmetricFunctions(QQ).p() diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 745de3b3dfc..771eafb5ee1 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -580,7 +580,8 @@ def principal_specialization(self, n=infinity, q=None): The principal specialization of order `n` is the ring homomorphism given by setting `x_i = q^i` for `i \in - \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`. + \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`, see Section + 7.8 of [EnumComb2]_. The stable principal specialization is the ring homomorphism given by setting `x_i = q^i` for all `i`. @@ -634,6 +635,41 @@ def principal_specialization(self, n=infinity, q=None): def exponential_specialization(self, t=None, q=1): r""" + Return the exponential specialization of a symmetric function. + + The exponential specialization `ex` is the ring homomorphism + defined on the basis of powersum symmetric functions by + setting `p_1 = t` and `p_n = 0` for `n > 1`. Equivalently, + on the basis of homogeneous functions it is given by `ex(h_n) + = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. + + By analogy `q`-exponential specialization is a ring homomorphism + defined on homogeneous symmetric functions `f` of degree `n` + as + + .. MATH:: + + ex_q(h_n) = t^n / [n]_q!, + + where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` + + .. MATH:: + + ex_q(f) = (1-q)^n t^n ps(f), + + where `ps(f)` is the stable principal specialisation of `f`. + Note that setting `q = 1` in the stable principal + specialisation is an invalid operation. + + INPUT: + + - ``t`` (default: None) -- the value to use for `t`, the default + is to create the fraction field of polynomials in ``t`` + over the coefficient ring. + + - ``q`` (default: 1) -- the value to use for `q`. + + EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index e036e91c336..cd6e1cad5e9 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5445,7 +5445,8 @@ def principal_specialization(self, n=infinity, q=None): The principal specialization of order `n` is the ring homomorphism given by setting `x_i = q^i` for `i \in - \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`. + \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`, see Section 7.8 + of [EnumComb2]_. The stable principal specialization is the ring homomorphism given by setting `x_i = q^i` for all `i`. @@ -5509,15 +5510,29 @@ def exponential_specialization(self, t=None, q=1): r""" Return the exponential specialization of a symmetric function. - The `q`-exponential specialization is a ring homomorphism + The exponential specialization `ex` is the ring homomorphism + defined on the basis of powersum symmetric functions by + setting `p_1 = t` and `p_n = 0` for `n > 1`. Equivalently, + on the basis of homogeneous functions it is given by `ex(h_n) + = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. + + By analogy `q`-exponential specialization is a ring homomorphism defined on homogeneous symmetric functions `f` of degree `n` as + .. MATH:: + + ex_q(h_n) = t^n / [n]_q!, + + where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` + .. MATH:: ex_q(f) = (1-q)^n t^n ps(f), where `ps(f)` is the stable principal specialisation of `f`. + Note that setting `q = 1` in the stable principal + specialisation is an invalid operation. INPUT: From dd7e42267265f4789e28c33398411132c23d8542 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Tue, 3 Dec 2019 22:25:57 +0100 Subject: [PATCH 051/301] raise error if q is in the base ring, add comment about plethysm --- src/sage/combinat/sf/elementary.py | 14 ++++++++++++-- src/sage/combinat/sf/homogeneous.py | 14 ++++++++++++-- src/sage/combinat/sf/monomial.py | 7 ++++++- src/sage/combinat/sf/powersum.py | 14 ++++++++++++-- src/sage/combinat/sf/schur.py | 14 ++++++++++++-- src/sage/combinat/sf/sfa.py | 24 ++++++++++++++++++++++++ 6 files changed, 78 insertions(+), 9 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 06895b125d1..6c939b954c3 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -355,7 +355,12 @@ def principal_specialization(self, n=infinity, q=None): """ if q is None: - q = self.base_ring()["q"].fraction_field().gen() + try: + self.base_ring()('q') + except TypeError: + q = self.base_ring()["q"].gen() + else: + raise ValueError("the variable q is in the base ring, pass it explicitely") if q == 1: f = lambda partition: prod(binomial(n, part) for part in partition) elif n == infinity: @@ -423,7 +428,12 @@ def exponential_specialization(self, t=None, q=1): """ if q == 1: if t is None: - t = self.base_ring()["t"].gen() + try: + self.base_ring()('t') + except TypeError: + t = self.base_ring()["t"].gen() + else: + raise ValueError("the variable t is in the base ring, pass it explicitely") def f(partition): n = 0 m = 1 diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index 8b743939f9d..2f4f9b9bd08 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -268,7 +268,12 @@ def principal_specialization(self, n=infinity, q=None): """ if q is None: - q = self.base_ring()["q"].fraction_field().gen() + try: + self.base_ring()('q') + except TypeError: + q = self.base_ring()["q"].gen() + else: + raise ValueError("the variable q is in the base ring, pass it explicitely") if q == 1: f = lambda partition: prod(binomial(n+part-1, part) for part in partition) elif n == infinity: @@ -342,7 +347,12 @@ def exponential_specialization(self, t=None, q=1): """ if q == 1: if t is None: - t = self.base_ring()["t"].gen() + try: + self.base_ring()('t') + except TypeError: + t = self.base_ring()["t"].gen() + else: + raise ValueError("the variable t is in the base ring, pass it explicitely") def f(partition): n = 0 m = 1 diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index e9964b1ee09..afa935d53c1 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -422,7 +422,12 @@ def exponential_specialization(self, t=None, q=1): """ if q == 1: if t is None: - t = self.base_ring()["t"].gen() + try: + self.base_ring()('t') + except TypeError: + t = self.base_ring()["t"].gen() + else: + raise ValueError("the variable t is in the base ring, pass it explicitely") def f(partition): n = 0 for part in partition: diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index f26177c25be..d72c2ce9b9c 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -756,7 +756,12 @@ def principal_specialization(self, n=infinity, q=None): """ if q is None: - q = self.base_ring()["q"].fraction_field().gen() + try: + self.base_ring()('q') + except TypeError: + q = self.base_ring()["q"].gen() + else: + raise ValueError("the variable q is in the base ring, pass it explicitely") if q == 1: f = lambda partition: n**len(partition) elif n == infinity: @@ -825,7 +830,12 @@ def exponential_specialization(self, t=None, q=1): """ if q == 1: if t is None: - t = self.base_ring()["t"].gen() + try: + self.base_ring()('t') + except TypeError: + t = self.base_ring()["t"].gen() + else: + raise ValueError("the variable t is in the base ring, pass it explicitely") def f(partition): n = 0 for part in partition: diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 771eafb5ee1..1ef5dcfaca6 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -618,7 +618,12 @@ def principal_specialization(self, n=infinity, q=None): """ if q is None: - q = self.base_ring()["q"].fraction_field().gen() + try: + self.base_ring()('q') + except TypeError: + q = self.base_ring()["q"].gen() + else: + raise ValueError("the variable q is in the base ring, pass it explicitely") if q == 1: f = lambda partition: (prod(n+partition.content(*c) for c in partition.cells()) / prod(h for h in partition.hooks())) @@ -694,7 +699,12 @@ def exponential_specialization(self, t=None, q=1): """ if q == 1: if t is None: - t = self.base_ring()["t"].gen() + try: + self.base_ring()('t') + except TypeError: + t = self.base_ring()["t"].gen() + else: + raise ValueError("the variable t is in the base ring, pass it explicitely") def f(partition): n = partition.size() return (StandardTableaux(partition).cardinality() diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index cd6e1cad5e9..335e7ecc625 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5476,6 +5476,30 @@ def principal_specialization(self, n=infinity, q=None): sage: (h[3]+h[2]).principal_specialization(q=var("q")) 1/((q^2 - 1)*(q - 1)) - 1/((q^3 - 1)*(q^2 - 1)*(q - 1)) + In case ``q`` is in the base ring, it must be passed explicitely:: + + sage: R = QQ['q,t'] + sage: Ht = SymmetricFunctions(R).macdonald().Ht() + sage: Ht[2].principal_specialization() + Traceback (most recent call last): + ... + ValueError: the variable q is in the base ring, pass it explicitely + + sage: Ht[2].principal_specialization(q=R("q")) + (-q^2 - 1)/(-q^3 + q^2 + q - 1) + + Note that the stable principal specialization can be obtained as a plethysm:: + + sage: R = QQ['q'].fraction_field() + sage: s = SymmetricFunctions(R).s() + sage: one = s.one() + sage: q = R("q") + sage: f = s[3,2,2] + sage: f.principal_specialization(q=q) == f(one/(1-q)).coefficient([]) + True + sage: f.principal_specialization(n=4,q=q) == f(one*(1-q^4)/(1-q)).coefficient([]) + True + TESTS:: sage: m = SymmetricFunctions(QQ).m() From cb893fd1a370b4c776e7480bb4eeb66623c26969 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Wed, 4 Dec 2019 22:52:23 +0100 Subject: [PATCH 052/301] explicitely -> explicitly --- src/sage/combinat/sf/elementary.py | 4 ++-- src/sage/combinat/sf/homogeneous.py | 4 ++-- src/sage/combinat/sf/monomial.py | 2 +- src/sage/combinat/sf/powersum.py | 4 ++-- src/sage/combinat/sf/schur.py | 4 ++-- src/sage/combinat/sf/sfa.py | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 6c939b954c3..bbe50025016 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -360,7 +360,7 @@ def principal_specialization(self, n=infinity, q=None): except TypeError: q = self.base_ring()["q"].gen() else: - raise ValueError("the variable q is in the base ring, pass it explicitely") + raise ValueError("the variable q is in the base ring, pass it explicitly") if q == 1: f = lambda partition: prod(binomial(n, part) for part in partition) elif n == infinity: @@ -433,7 +433,7 @@ def exponential_specialization(self, t=None, q=1): except TypeError: t = self.base_ring()["t"].gen() else: - raise ValueError("the variable t is in the base ring, pass it explicitely") + raise ValueError("the variable t is in the base ring, pass it explicitly") def f(partition): n = 0 m = 1 diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index 2f4f9b9bd08..f240f78aacb 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -273,7 +273,7 @@ def principal_specialization(self, n=infinity, q=None): except TypeError: q = self.base_ring()["q"].gen() else: - raise ValueError("the variable q is in the base ring, pass it explicitely") + raise ValueError("the variable q is in the base ring, pass it explicitly") if q == 1: f = lambda partition: prod(binomial(n+part-1, part) for part in partition) elif n == infinity: @@ -352,7 +352,7 @@ def exponential_specialization(self, t=None, q=1): except TypeError: t = self.base_ring()["t"].gen() else: - raise ValueError("the variable t is in the base ring, pass it explicitely") + raise ValueError("the variable t is in the base ring, pass it explicitly") def f(partition): n = 0 m = 1 diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index afa935d53c1..795521d969d 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -427,7 +427,7 @@ def exponential_specialization(self, t=None, q=1): except TypeError: t = self.base_ring()["t"].gen() else: - raise ValueError("the variable t is in the base ring, pass it explicitely") + raise ValueError("the variable t is in the base ring, pass it explicitly") def f(partition): n = 0 for part in partition: diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index d72c2ce9b9c..34e440372f1 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -761,7 +761,7 @@ def principal_specialization(self, n=infinity, q=None): except TypeError: q = self.base_ring()["q"].gen() else: - raise ValueError("the variable q is in the base ring, pass it explicitely") + raise ValueError("the variable q is in the base ring, pass it explicitly") if q == 1: f = lambda partition: n**len(partition) elif n == infinity: @@ -835,7 +835,7 @@ def exponential_specialization(self, t=None, q=1): except TypeError: t = self.base_ring()["t"].gen() else: - raise ValueError("the variable t is in the base ring, pass it explicitely") + raise ValueError("the variable t is in the base ring, pass it explicitly") def f(partition): n = 0 for part in partition: diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 1ef5dcfaca6..52cb1d50ad7 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -623,7 +623,7 @@ def principal_specialization(self, n=infinity, q=None): except TypeError: q = self.base_ring()["q"].gen() else: - raise ValueError("the variable q is in the base ring, pass it explicitely") + raise ValueError("the variable q is in the base ring, pass it explicitly") if q == 1: f = lambda partition: (prod(n+partition.content(*c) for c in partition.cells()) / prod(h for h in partition.hooks())) @@ -704,7 +704,7 @@ def exponential_specialization(self, t=None, q=1): except TypeError: t = self.base_ring()["t"].gen() else: - raise ValueError("the variable t is in the base ring, pass it explicitely") + raise ValueError("the variable t is in the base ring, pass it explicitly") def f(partition): n = partition.size() return (StandardTableaux(partition).cardinality() diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 335e7ecc625..85713fb65b3 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5476,14 +5476,14 @@ def principal_specialization(self, n=infinity, q=None): sage: (h[3]+h[2]).principal_specialization(q=var("q")) 1/((q^2 - 1)*(q - 1)) - 1/((q^3 - 1)*(q^2 - 1)*(q - 1)) - In case ``q`` is in the base ring, it must be passed explicitely:: + In case ``q`` is in the base ring, it must be passed explicitly:: sage: R = QQ['q,t'] sage: Ht = SymmetricFunctions(R).macdonald().Ht() sage: Ht[2].principal_specialization() Traceback (most recent call last): ... - ValueError: the variable q is in the base ring, pass it explicitely + ValueError: the variable q is in the base ring, pass it explicitly sage: Ht[2].principal_specialization(q=R("q")) (-q^2 - 1)/(-q^3 + q^2 + q - 1) From 51f32231c8becc78dec5eb428d3883194981ead2 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Thu, 5 Dec 2019 13:50:59 +0100 Subject: [PATCH 053/301] fix default values for eponential specialisation, import q_analogues locally --- src/sage/combinat/sf/elementary.py | 47 ++++++++++++++++++----------- src/sage/combinat/sf/homogeneous.py | 46 +++++++++++++++++----------- src/sage/combinat/sf/monomial.py | 19 +++++++----- src/sage/combinat/sf/powersum.py | 41 +++++++++++++++---------- src/sage/combinat/sf/schur.py | 32 +++++++++++++------- src/sage/combinat/sf/sfa.py | 4 ++- 6 files changed, 120 insertions(+), 69 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index bbe50025016..8073daa5c58 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -23,7 +23,6 @@ from sage.misc.all import prod from sage.functions.other import factorial, binomial from sage.rings.all import infinity -from sage.combinat.q_analogues import q_binomial, q_factorial ################################### # # @@ -354,13 +353,19 @@ def principal_specialization(self, n=infinity, q=None): 0 """ - if q is None: + from sage.combinat.q_analogues import q_binomial + + def get_variable(ring, name): try: - self.base_ring()('q') + ring(name) except TypeError: - q = self.base_ring()["q"].gen() + return ring[name].gen() else: - raise ValueError("the variable q is in the base ring, pass it explicitly") + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q is None: + q = get_variable(self.base_ring(), "q") + if q == 1: f = lambda partition: prod(binomial(n, part) for part in partition) elif n == infinity: @@ -408,7 +413,9 @@ def exponential_specialization(self, t=None, q=1): is to create the fraction field of polynomials in ``t`` over the coefficient ring. - - ``q`` (default: 1) -- the value to use for `q`. + - ``q`` (default: 1) -- the value to use for `q`. If + ``q`` is ``None`` create the fraction field of + polynomials in ``q`` over the coefficient ring. EXAMPLES:: @@ -426,14 +433,20 @@ def exponential_specialization(self, t=None, q=1): 0 """ + from sage.combinat.q_analogues import q_factorial + + def get_variable(ring, name): + try: + ring(name) + except TypeError: + return ring[name].gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + if q == 1: if t is None: - try: - self.base_ring()('t') - except TypeError: - t = self.base_ring()["t"].gen() - else: - raise ValueError("the variable t is in the base ring, pass it explicitly") + t = get_variable(self.base_ring(), 't') + def f(partition): n = 0 m = 1 @@ -445,13 +458,13 @@ def f(partition): return self.parent()._apply_module_morphism(self, f, t.parent()) if q is None and t is None: - Rq = self.base_ring()["q"].fraction_field() - q = Rq.gen() - t = Rq["t"].gen() + q = get_variable(self.base_ring(), 'q') + t = get_variable(q.parent(), 't') elif q is None: - q = t.parent()["q"].fraction_field().gen() + q = get_variable(t.parent(), 'q') elif t is None: - t = q.parent()["t"].gen() + t = get_variable(q.parent(), 't') + def f(partition): n = 0 diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index f240f78aacb..54b174ffc1a 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -31,7 +31,6 @@ from sage.rings.all import infinity from sage.misc.all import prod from sage.functions.other import factorial, binomial -from sage.combinat.q_analogues import q_binomial, q_factorial class SymmetricFunctionAlgebra_homogeneous(multiplicative.SymmetricFunctionAlgebra_multiplicative): def __init__(self, Sym): @@ -267,13 +266,19 @@ def principal_specialization(self, n=infinity, q=None): 0 """ - if q is None: + from sage.combinat.q_analogues import q_binomial + + def get_variable(ring, name): try: - self.base_ring()('q') + ring(name) except TypeError: - q = self.base_ring()["q"].gen() + return ring[name].gen() else: - raise ValueError("the variable q is in the base ring, pass it explicitly") + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q is None: + q = get_variable(self.base_ring(), 'q') + if q == 1: f = lambda partition: prod(binomial(n+part-1, part) for part in partition) elif n == infinity: @@ -318,7 +323,9 @@ def exponential_specialization(self, t=None, q=1): is to create the fraction field of polynomials in ``t`` over the coefficient ring. - - ``q`` (default: 1) -- the value to use for `q`. + - ``q`` (default: 1) -- the value to use for `q`. If + ``q`` is ``None`` create the fraction field of + polynomials in ``q`` over the coefficient ring. EXAMPLES:: @@ -345,14 +352,20 @@ def exponential_specialization(self, t=None, q=1): 0 """ + from sage.combinat.q_analogues import q_factorial + + def get_variable(ring, name): + try: + ring(name) + except TypeError: + return ring[name].gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + if q == 1: if t is None: - try: - self.base_ring()('t') - except TypeError: - t = self.base_ring()["t"].gen() - else: - raise ValueError("the variable t is in the base ring, pass it explicitly") + t = get_variable(self.base_ring(), 't') + def f(partition): n = 0 m = 1 @@ -364,13 +377,12 @@ def f(partition): return self.parent()._apply_module_morphism(self, f, t.parent()) if q is None and t is None: - Rq = self.base_ring()["q"].fraction_field() - q = Rq.gen() - t = Rq["t"].gen() + q = get_variable(self.base_ring(), 'q') + t = get_variable(q.parent(), 't') elif q is None: - q = t.parent()["q"].fraction_field().gen() + q = get_variable(t.parent(), 'q') elif t is None: - t = q.parent()["t"].gen() + t = get_variable(q.parent(), 't') def f(partition): n = 0 diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index 795521d969d..5d5f205943a 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -397,7 +397,9 @@ def exponential_specialization(self, t=None, q=1): is to create the fraction field of polynomials in ``t`` over the coefficient ring. - - ``q`` (default: 1) -- the value to use for `q`. + - ``q`` (default: 1) -- the value to use for `q`. If + ``q`` is ``None`` create the fraction field of + polynomials in ``q`` over the coefficient ring. EXAMPLES:: @@ -420,14 +422,17 @@ def exponential_specialization(self, t=None, q=1): 0 """ + def get_variable(ring, name): + try: + ring(name) + except TypeError: + return ring[name].gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + if q == 1: if t is None: - try: - self.base_ring()('t') - except TypeError: - t = self.base_ring()["t"].gen() - else: - raise ValueError("the variable t is in the base ring, pass it explicitly") + t = get_variable(self.base_ring(), 't') def f(partition): n = 0 for part in partition: diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index 34e440372f1..d835d9a0d6c 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -755,13 +755,17 @@ def principal_specialization(self, n=infinity, q=None): 0 """ - if q is None: + def get_variable(ring, name): try: - self.base_ring()('q') + ring(name) except TypeError: - q = self.base_ring()["q"].gen() + return ring[name].gen() else: - raise ValueError("the variable q is in the base ring, pass it explicitly") + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q is None: + q = get_variable(self.base_ring(), 'q') + if q == 1: f = lambda partition: n**len(partition) elif n == infinity: @@ -805,7 +809,9 @@ def exponential_specialization(self, t=None, q=1): is to create the fraction field of polynomials in ``t`` over the coefficient ring. - - ``q`` (default: 1) -- the value to use for `q`. + - ``q`` (default: 1) -- the value to use for `q`. If + ``q`` is ``None`` create the fraction field of + polynomials in ``q`` over the coefficient ring. EXAMPLES:: @@ -828,14 +834,18 @@ def exponential_specialization(self, t=None, q=1): 0 """ + def get_variable(ring, name): + try: + ring(name) + except TypeError: + return ring[name].gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + if q == 1: if t is None: - try: - self.base_ring()('t') - except TypeError: - t = self.base_ring()["t"].gen() - else: - raise ValueError("the variable t is in the base ring, pass it explicitly") + t = get_variable(self.base_ring(), 't') + def f(partition): n = 0 for part in partition: @@ -847,13 +857,12 @@ def f(partition): return self.parent()._apply_module_morphism(self, f, t.parent()) if q is None and t is None: - Rq = self.base_ring()["q"].fraction_field() - q = Rq.gen() - t = Rq["t"].gen() + q = get_variable(self.base_ring(), 'q') + t = get_variable(q.parent(), 't') elif q is None: - q = t.parent()["q"].fraction_field().gen() + q = get_variable(t.parent(), 'q') elif t is None: - t = q.parent()["t"].gen() + t = get_variable(q.parent(), 't') def f(partition): n = 0 diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 52cb1d50ad7..4706e61dee6 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -617,13 +617,17 @@ def principal_specialization(self, n=infinity, q=None): 0 """ - if q is None: + def get_variable(ring, name): try: - self.base_ring()('q') + ring(name) except TypeError: - q = self.base_ring()["q"].gen() + return ring[name].gen() else: - raise ValueError("the variable q is in the base ring, pass it explicitly") + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + + if q is None: + q = get_variable(self.base_ring(), 'q') + if q == 1: f = lambda partition: (prod(n+partition.content(*c) for c in partition.cells()) / prod(h for h in partition.hooks())) @@ -672,7 +676,9 @@ def exponential_specialization(self, t=None, q=1): is to create the fraction field of polynomials in ``t`` over the coefficient ring. - - ``q`` (default: 1) -- the value to use for `q`. + - ``q`` (default: 1) -- the value to use for `q`. If + ``q`` is ``None`` create the fraction field of + polynomials in ``q`` over the coefficient ring. EXAMPLES:: @@ -697,14 +703,18 @@ def exponential_specialization(self, t=None, q=1): 0 """ + def get_variable(ring, name): + try: + ring(name) + except TypeError: + return ring[name].gen() + else: + raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) + if q == 1: if t is None: - try: - self.base_ring()('t') - except TypeError: - t = self.base_ring()["t"].gen() - else: - raise ValueError("the variable t is in the base ring, pass it explicitly") + t = get_variable(self.base_ring(), 't') + def f(partition): n = partition.size() return (StandardTableaux(partition).cardinality() diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 85713fb65b3..4327085ef7d 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5564,7 +5564,9 @@ def exponential_specialization(self, t=None, q=1): is to create the fraction field of polynomials in ``t`` over the coefficient ring. - - ``q`` (default: 1) -- the value to use for `q`. + - ``q`` (default: 1) -- the value to use for `q`. If ``q`` + is ``None`` create the fraction field of polynomials in + ``q`` over the coefficient ring. EXAMPLES:: From 459a4dfd96235d3d8d39fa6539d0022aed0550d2 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Thu, 5 Dec 2019 19:33:31 +0100 Subject: [PATCH 054/301] specialisation -> specialization, remove erroneous "stable" --- src/sage/combinat/sf/elementary.py | 4 ++-- src/sage/combinat/sf/homogeneous.py | 4 ++-- src/sage/combinat/sf/monomial.py | 4 ++-- src/sage/combinat/sf/powersum.py | 6 +++--- src/sage/combinat/sf/schur.py | 4 ++-- src/sage/combinat/sf/sfa.py | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 8073daa5c58..9e03c07ad6f 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -403,9 +403,9 @@ def exponential_specialization(self, t=None, q=1): ex_q(f) = (1-q)^n t^n ps(f), - where `ps(f)` is the stable principal specialisation of `f`. + where `ps(f)` is the stable principal specialization of `f`. Note that setting `q = 1` in the stable principal - specialisation is an invalid operation. + specialization is an invalid operation. INPUT: diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index 54b174ffc1a..b42917b21e1 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -313,9 +313,9 @@ def exponential_specialization(self, t=None, q=1): ex_q(f) = (1-q)^n t^n ps(f), - where `ps(f)` is the stable principal specialisation of `f`. + where `ps(f)` is the stable principal specialization of `f`. Note that setting `q = 1` in the stable principal - specialisation is an invalid operation. + specialization is an invalid operation. INPUT: diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index 5d5f205943a..4b89f53393d 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -387,9 +387,9 @@ def exponential_specialization(self, t=None, q=1): ex_q(f) = (1-q)^n t^n ps(f), - where `ps(f)` is the stable principal specialisation of `f`. + where `ps(f)` is the stable principal specialization of `f`. Note that setting `q = 1` in the stable principal - specialisation is an invalid operation. + specialization is an invalid operation. INPUT: diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index d835d9a0d6c..10c1aa00a3e 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -744,7 +744,7 @@ def principal_specialization(self, n=infinity, q=None): sage: x.principal_specialization(3) 8*q^6 + 18*q^5 + 36*q^4 + 38*q^3 + 36*q^2 + 18*q + 9 - If ``n`` is not given we return the stable principal specialisation:: + If ``n`` is not given we return the stable principal specialization:: sage: x.principal_specialization(q=var("q")) 3/((q^2 - 1)*(q - 1)) - 5/(q - 1)^3 + 1 @@ -799,9 +799,9 @@ def exponential_specialization(self, t=None, q=1): ex_q(f) = (1-q)^n t^n ps(f), - where `ps(f)` is the stable principal specialisation of `f`. + where `ps(f)` is the stable principal specialization of `f`. Note that setting `q = 1` in the stable principal - specialisation is an invalid operation. + specialization is an invalid operation. INPUT: diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 4706e61dee6..228c5c22390 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -666,9 +666,9 @@ def exponential_specialization(self, t=None, q=1): ex_q(f) = (1-q)^n t^n ps(f), - where `ps(f)` is the stable principal specialisation of `f`. + where `ps(f)` is the stable principal specialization of `f`. Note that setting `q = 1` in the stable principal - specialisation is an invalid operation. + specialization is an invalid operation. INPUT: diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 4327085ef7d..09884c878f4 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5488,7 +5488,7 @@ def principal_specialization(self, n=infinity, q=None): sage: Ht[2].principal_specialization(q=R("q")) (-q^2 - 1)/(-q^3 + q^2 + q - 1) - Note that the stable principal specialization can be obtained as a plethysm:: + Note that the principal specialization can be obtained as a plethysm:: sage: R = QQ['q'].fraction_field() sage: s = SymmetricFunctions(R).s() @@ -5497,7 +5497,7 @@ def principal_specialization(self, n=infinity, q=None): sage: f = s[3,2,2] sage: f.principal_specialization(q=q) == f(one/(1-q)).coefficient([]) True - sage: f.principal_specialization(n=4,q=q) == f(one*(1-q^4)/(1-q)).coefficient([]) + sage: f.principal_specialization(n=4, q=q) == f(one*(1-q^4)/(1-q)).coefficient([]) True TESTS:: @@ -5554,9 +5554,9 @@ def exponential_specialization(self, t=None, q=1): ex_q(f) = (1-q)^n t^n ps(f), - where `ps(f)` is the stable principal specialisation of `f`. + where `ps(f)` is the stable principal specialization of `f`. Note that setting `q = 1` in the stable principal - specialisation is an invalid operation. + specialization is an invalid operation. INPUT: From 8f09ff6db1ca3228546f5ef3509182120e27809c Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Thu, 5 Dec 2019 22:02:14 +0100 Subject: [PATCH 055/301] documentation improvements --- src/sage/combinat/sf/elementary.py | 23 ++++++++++++----------- src/sage/combinat/sf/homogeneous.py | 23 ++++++++++++----------- src/sage/combinat/sf/monomial.py | 23 ++++++++++++----------- src/sage/combinat/sf/powersum.py | 13 ++++++------- src/sage/combinat/sf/schur.py | 24 ++++++++++++------------ src/sage/combinat/sf/sfa.py | 23 ++++++++++++----------- 6 files changed, 66 insertions(+), 63 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 9e03c07ad6f..df34e018cec 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -328,7 +328,7 @@ def principal_specialization(self, n=infinity, q=None): specialization. - ``q`` (default: ``None``) -- the value to use for `q`, - the default is to create the fraction field of + the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. EXAMPLES:: @@ -389,15 +389,17 @@ def exponential_specialization(self, t=None, q=1): on the basis of homogeneous functions it is given by `ex(h_n) = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. - By analogy `q`-exponential specialization is a ring homomorphism - defined on homogeneous symmetric functions `f` of degree `n` - as + By analogy, the `q`-exponential specialization is a ring + homomorphism defined on the complete homogeneous symmetric + functions as .. MATH:: ex_q(h_n) = t^n / [n]_q!, - where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` + where `[n]_q!` is the `q`-factorial. Equivalently, for + `q \neq 1` and a homogeneous symmetric function `f` of + degree `n`, .. MATH:: @@ -409,13 +411,12 @@ def exponential_specialization(self, t=None, q=1): INPUT: - - ``t`` (default: None) -- the value to use for `t`, the default - is to create the fraction field of polynomials in ``t`` - over the coefficient ring. + - ``t`` (default: None) -- the value to use for `t`, the + default is to create a ring of polynomials in ``t``. - - ``q`` (default: 1) -- the value to use for `q`. If - ``q`` is ``None`` create the fraction field of - polynomials in ``q`` over the coefficient ring. + - ``q`` (default: 1) -- the value to use for `q`. If ``q`` + is ``None`` create a ring (or fraction field) of + polynomials in ``q``. EXAMPLES:: diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index b42917b21e1..eef2d6b7744 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -246,7 +246,7 @@ def principal_specialization(self, n=infinity, q=None): specialization. - ``q`` (default: ``None``) -- the value to use for `q`, - the default is to create the fraction field of + the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. EXAMPLES:: @@ -299,15 +299,17 @@ def exponential_specialization(self, t=None, q=1): on the basis of homogeneous functions it is given by `ex(h_n) = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. - By analogy `q`-exponential specialization is a ring homomorphism - defined on homogeneous symmetric functions `f` of degree `n` - as + By analogy, the `q`-exponential specialization is a ring + homomorphism defined on the complete homogeneous symmetric + functions as .. MATH:: ex_q(h_n) = t^n / [n]_q!, - where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` + where `[n]_q!` is the `q`-factorial. Equivalently, for + `q \neq 1` and a homogeneous symmetric function `f` of + degree `n`, .. MATH:: @@ -319,13 +321,12 @@ def exponential_specialization(self, t=None, q=1): INPUT: - - ``t`` (default: None) -- the value to use for `t`, the default - is to create the fraction field of polynomials in ``t`` - over the coefficient ring. + - ``t`` (default: None) -- the value to use for `t`, the + default is to create a ring of polynomials in ``t``. - - ``q`` (default: 1) -- the value to use for `q`. If - ``q`` is ``None`` create the fraction field of - polynomials in ``q`` over the coefficient ring. + - ``q`` (default: 1) -- the value to use for `q`. If ``q`` + is ``None`` create a ring (or fraction field) of + polynomials in ``q``. EXAMPLES:: diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index 4b89f53393d..024127e61f5 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -337,7 +337,7 @@ def principal_specialization(self, n=infinity, q=None): specialization. - ``q`` (default: ``None``) -- the value to use for `q`, - the default is to create the fraction field of + the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. EXAMPLES:: @@ -373,15 +373,17 @@ def exponential_specialization(self, t=None, q=1): on the basis of homogeneous functions it is given by `ex(h_n) = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. - By analogy `q`-exponential specialization is a ring homomorphism - defined on homogeneous symmetric functions `f` of degree `n` - as + By analogy, the `q`-exponential specialization is a ring + homomorphism defined on the complete homogeneous symmetric + functions as .. MATH:: ex_q(h_n) = t^n / [n]_q!, - where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` + where `[n]_q!` is the `q`-factorial. Equivalently, for + `q \neq 1` and a homogeneous symmetric function `f` of + degree `n`, .. MATH:: @@ -393,13 +395,12 @@ def exponential_specialization(self, t=None, q=1): INPUT: - - ``t`` (default: None) -- the value to use for `t`, the default - is to create the fraction field of polynomials in ``t`` - over the coefficient ring. + - ``t`` (default: None) -- the value to use for `t`, the + default is to create a ring of polynomials in ``t``. - - ``q`` (default: 1) -- the value to use for `q`. If - ``q`` is ``None`` create the fraction field of - polynomials in ``q`` over the coefficient ring. + - ``q`` (default: 1) -- the value to use for `q`. If ``q`` + is ``None`` create a ring (or fraction field) of + polynomials in ``q``. EXAMPLES:: diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index 10c1aa00a3e..262a0c58ee1 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -725,7 +725,7 @@ def principal_specialization(self, n=infinity, q=None): specialization. - ``q`` (default: ``None``) -- the value to use for `q`, - the default is to create the fraction field of + the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. EXAMPLES:: @@ -805,13 +805,12 @@ def exponential_specialization(self, t=None, q=1): INPUT: - - ``t`` (default: None) -- the value to use for `t`, the default - is to create the fraction field of polynomials in ``t`` - over the coefficient ring. + - ``t`` (default: None) -- the value to use for `t`, the + default is to create a ring of polynomials in ``t``. - - ``q`` (default: 1) -- the value to use for `q`. If - ``q`` is ``None`` create the fraction field of - polynomials in ``q`` over the coefficient ring. + - ``q`` (default: 1) -- the value to use for `q`. If ``q`` + is ``None`` create a ring (or fraction field) of + polynomials in ``q``. EXAMPLES:: diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 228c5c22390..89f673b5aa4 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -594,7 +594,7 @@ def principal_specialization(self, n=infinity, q=None): specialization. - ``q`` (default: ``None``) -- the value to use for `q`, - the default is to create the fraction field of + the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. EXAMPLES:: @@ -652,15 +652,17 @@ def exponential_specialization(self, t=None, q=1): on the basis of homogeneous functions it is given by `ex(h_n) = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. - By analogy `q`-exponential specialization is a ring homomorphism - defined on homogeneous symmetric functions `f` of degree `n` - as + By analogy, the `q`-exponential specialization is a ring + homomorphism defined on the complete homogeneous symmetric + functions as .. MATH:: ex_q(h_n) = t^n / [n]_q!, - where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` + where `[n]_q!` is the `q`-factorial. Equivalently, for + `q \neq 1` and a homogeneous symmetric function `f` of + degree `n`, .. MATH:: @@ -672,14 +674,12 @@ def exponential_specialization(self, t=None, q=1): INPUT: - - ``t`` (default: None) -- the value to use for `t`, the default - is to create the fraction field of polynomials in ``t`` - over the coefficient ring. - - - ``q`` (default: 1) -- the value to use for `q`. If - ``q`` is ``None`` create the fraction field of - polynomials in ``q`` over the coefficient ring. + - ``t`` (default: None) -- the value to use for `t`, the + default is to create a ring of polynomials in ``t``. + - ``q`` (default: 1) -- the value to use for `q`. If ``q`` + is ``None`` create a ring (or fraction field) of + polynomials in ``q``. EXAMPLES:: diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 09884c878f4..36ee50f680a 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5459,8 +5459,8 @@ def principal_specialization(self, n=infinity, q=None): specialization. - ``q`` (default: ``None``) -- the value to use for `q`, the - default is to create the fraction field of polynomials in - ``q`` over the coefficient ring. + default is to create a ring (or fraction field) of + polynomials in ``q`` over the coefficient ring. EXAMPLES:: @@ -5540,15 +5540,17 @@ def exponential_specialization(self, t=None, q=1): on the basis of homogeneous functions it is given by `ex(h_n) = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. - By analogy `q`-exponential specialization is a ring homomorphism - defined on homogeneous symmetric functions `f` of degree `n` - as + By analogy, the `q`-exponential specialization is a ring + homomorphism defined on the complete homogeneous symmetric + functions as .. MATH:: ex_q(h_n) = t^n / [n]_q!, - where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` + where `[n]_q!` is the `q`-factorial. Equivalently, for + `q \neq 1` and a homogeneous symmetric function `f` of + degree `n`, .. MATH:: @@ -5560,13 +5562,12 @@ def exponential_specialization(self, t=None, q=1): INPUT: - - ``t`` (default: None) -- the value to use for `t`, the default - is to create the fraction field of polynomials in ``t`` - over the coefficient ring. + - ``t`` (default: None) -- the value to use for `t`, the + default is to create a ring of polynomials in ``t``. - ``q`` (default: 1) -- the value to use for `q`. If ``q`` - is ``None`` create the fraction field of polynomials in - ``q`` over the coefficient ring. + is ``None`` create a ring (or fraction field) of + polynomials in ``q``. EXAMPLES:: From 0a04ac9c9629e047304e9ced848f2bffb93fc111 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Thu, 5 Dec 2019 22:07:53 +0100 Subject: [PATCH 056/301] homogeneous is faster than powersum for schur --- src/sage/combinat/sf/schur.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 89f673b5aa4..44d46692e50 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -722,7 +722,10 @@ def f(partition): return self.parent()._apply_module_morphism(self, f, t.parent()) - return self.parent().realization_of().powersum()(self).exponential_specialization(t=t, q=q) + # if self is nice in the schur basis, the homogeneous + # symmetric functions seem to be a faster fallback than + # the powersum symmetric functions + return self.parent().realization_of().homogeneous()(self).exponential_specialization(t=t, q=q) # Backward compatibility for unpickling From 97f2a566a3af9c2653d1b37151eb5ac73ed68e4b Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Fri, 6 Dec 2019 12:10:34 +0100 Subject: [PATCH 057/301] formulas in documentation, special case exponential specialization for Schur --- src/sage/combinat/sf/elementary.py | 11 +++++- src/sage/combinat/sf/homogeneous.py | 10 +++++ src/sage/combinat/sf/monomial.py | 9 +++++ src/sage/combinat/sf/powersum.py | 10 +++++ src/sage/combinat/sf/schur.py | 57 +++++++++++++++++++++++++++-- 5 files changed, 92 insertions(+), 5 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index df34e018cec..2a95d78cb44 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -331,6 +331,16 @@ def principal_specialization(self, n=infinity, q=None): the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. + We use the formulas from Proposition 7.8.3 of [EnumComb2]_ + + .. MATH:: + + ps_{n,q}(e_\lambda) = \prod_i q^{\binom{\lambda_i}{2}} \binom{n}{\lambda_i}_q + + ps_{n,1}(e_\lambda) = \prod_i \binom{n}{\lambda_i} + + ps_q(e_\lambda) = \prod_i q^{\binom{\lambda_i}{2}} / \prod_{j=1}^{\lambda_i} (1-q^j) + EXAMPLES:: sage: e = SymmetricFunctions(QQ).e() @@ -466,7 +476,6 @@ def f(partition): elif t is None: t = get_variable(q.parent(), 't') - def f(partition): n = 0 m = 1 diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index eef2d6b7744..25128320686 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -249,6 +249,16 @@ def principal_specialization(self, n=infinity, q=None): the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. + We use the formulas from Proposition 7.8.3 of [EnumComb2]_ + + .. MATH:: + + ps_{n,q}(h_\lambda) = \prod_i \binom{n+\lambda_i-1}{\lambda_i}_q + + ps_{n,1}(h_\lambda) = \prod_i \binom{n+\lambda_i-1}{\lambda_i} + + ps_q(h_\lambda) = 1 / \prod_i \prod_{j=1}^{\lambda_i} (1-q^j) + EXAMPLES:: sage: h = SymmetricFunctions(QQ).h() diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index 024127e61f5..5dcdb427263 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -340,6 +340,15 @@ def principal_specialization(self, n=infinity, q=None): the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. + For ``q=1`` we use the formula from Proposition 7.8.3 of [EnumComb2]_ + + .. MATH:: + + ps_{n,1}(m_\lambda) = \binom{n}{len(\lambda)} + \binom{len(\lambda)}{m_1(\lambda), m_2(\lambda),\dots} + + In all other cases, we convert to powersum symmetric functions. + EXAMPLES:: sage: m = SymmetricFunctions(QQ).m() diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index 262a0c58ee1..49ae8cb51f3 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -728,6 +728,16 @@ def principal_specialization(self, n=infinity, q=None): the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. + We use the formulas from Proposition 7.8.3 of [EnumComb2]_ + + .. MATH:: + + ps_{n,q}(p_\lambda) = \prod_i (1-q^{n\lambda_i}) / (1-q^{\lambda_i}) + + ps_{n,1}(p_\lambda) = n^{len(\lambda)} + + ps_q(p_\lambda) = 1 / \prod_i (1-q^{\lambda_i}) + EXAMPLES:: sage: p = SymmetricFunctions(QQ).p() diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 44d46692e50..3b20e2712bd 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -597,6 +597,27 @@ def principal_specialization(self, n=infinity, q=None): the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. + For `q=1` we use the formula from Corollary 7.21.4 of [EnumComb2]_ + + .. MATH:: + + ps_{n,1}(s_\lambda) = \prod_{u\in\lambda} (n+c(u)) / h(u), + + where `h(u)` is the hook length of a cell `u` in `\lambda`. + + For `n=infinity` we use the formula from Corollary 7.21.3 of [EnumComb2]_ + + .. MATH:: + + ps_q(s_\lambda) = q^{\sum_i i\lambda_i} / \prod_{u\in\lambda} (1-q^{h(u)}) + + Otherwise, we use the formula from Corollary 7.21.2 of [EnumComb2]_ + + .. MATH:: + + ps_{n,q}(s_\lambda) = q^{\sum_i i\lambda_i} + \prod_{u\in\lambda} (1-q^{n+c(u)}/(1-q^{h(u)}) + EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() @@ -681,6 +702,25 @@ def exponential_specialization(self, t=None, q=1): is ``None`` create a ring (or fraction field) of polynomials in ``q``. + We use the formula in the proof of Corollary 7.21.6 of + [EnumComb2]_ + + .. MATH:: + + ex_{n,q}(s_\lambda) = t^n q^{\sum_i i\lambda_i} + / \prod_{u\in\lambda} (1 + \dots + q^{h(u)-1}) + + where `h(u)` is the hook length of a cell `u` in `\lambda`. + + As a limit case, we obtain a formula for `q=1` + + .. MATH:: + + ex_{n,1}(s_\lambda) = f^\lambda t^n / n! + + where `f^\lambda` is the number of standard Young + tableaux of shape `\lambda`. + EXAMPLES:: sage: s = SymmetricFunctions(QQ).s() @@ -722,10 +762,19 @@ def f(partition): return self.parent()._apply_module_morphism(self, f, t.parent()) - # if self is nice in the schur basis, the homogeneous - # symmetric functions seem to be a faster fallback than - # the powersum symmetric functions - return self.parent().realization_of().homogeneous()(self).exponential_specialization(t=t, q=q) + if q is None and t is None: + q = get_variable(self.base_ring(), 'q') + t = get_variable(q.parent(), 't') + elif q is None: + q = get_variable(t.parent(), 'q') + elif t is None: + t = get_variable(q.parent(), 't') + + f = lambda partition: (t**partition.size() + * q**sum(i*part for i, part in enumerate(partition)) + / prod(sum(q**i for i in range(h)) for h in partition.hooks())) + + return self.parent()._apply_module_morphism(self, f, t.parent()) # Backward compatibility for unpickling From 13fc77dc801762c367a761c6b9fab3415ea874b4 Mon Sep 17 00:00:00 2001 From: zabrocki Date: Thu, 26 Dec 2019 12:03:33 -0500 Subject: [PATCH 058/301] minor changes to documentation, mainly punctuation --- src/sage/combinat/sf/elementary.py | 12 ++++++------ src/sage/combinat/sf/homogeneous.py | 12 ++++++------ src/sage/combinat/sf/monomial.py | 9 +++++---- src/sage/combinat/sf/powersum.py | 13 ++++++------- src/sage/combinat/sf/schur.py | 10 +++++----- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 2a95d78cb44..7a58a7852ea 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -331,15 +331,15 @@ def principal_specialization(self, n=infinity, q=None): the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. - We use the formulas from Proposition 7.8.3 of [EnumComb2]_ + We use the formulas from Proposition 7.8.3 of [EnumComb2]_, .. MATH:: - ps_{n,q}(e_\lambda) = \prod_i q^{\binom{\lambda_i}{2}} \binom{n}{\lambda_i}_q + ps_{n,q}(e_\lambda) = \prod_i q^{\binom{\lambda_i}{2}} \binom{n}{\lambda_i}_q, - ps_{n,1}(e_\lambda) = \prod_i \binom{n}{\lambda_i} + ps_{n,1}(e_\lambda) = \prod_i \binom{n}{\lambda_i}, - ps_q(e_\lambda) = \prod_i q^{\binom{\lambda_i}{2}} / \prod_{j=1}^{\lambda_i} (1-q^j) + ps_q(e_\lambda) = \prod_i q^{\binom{\lambda_i}{2}} / \prod_{j=1}^{\lambda_i} (1-q^j). EXAMPLES:: @@ -413,9 +413,9 @@ def exponential_specialization(self, t=None, q=1): .. MATH:: - ex_q(f) = (1-q)^n t^n ps(f), + ex_q(f) = (1-q)^n t^n ps_q(f), - where `ps(f)` is the stable principal specialization of `f`. + where `ps_q(f)` is the stable principal specialization of `f`. Note that setting `q = 1` in the stable principal specialization is an invalid operation. diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index 25128320686..a1190a316fa 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -249,15 +249,15 @@ def principal_specialization(self, n=infinity, q=None): the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. - We use the formulas from Proposition 7.8.3 of [EnumComb2]_ + We use the formulas from Proposition 7.8.3 of [EnumComb2]_, .. MATH:: - ps_{n,q}(h_\lambda) = \prod_i \binom{n+\lambda_i-1}{\lambda_i}_q + ps_{n,q}(h_\lambda) = \prod_i \binom{n+\lambda_i-1}{\lambda_i}_q, - ps_{n,1}(h_\lambda) = \prod_i \binom{n+\lambda_i-1}{\lambda_i} + ps_{n,1}(h_\lambda) = \prod_i \binom{n+\lambda_i-1}{\lambda_i}, - ps_q(h_\lambda) = 1 / \prod_i \prod_{j=1}^{\lambda_i} (1-q^j) + ps_q(h_\lambda) = 1 / \prod_i \prod_{j=1}^{\lambda_i} (1-q^j). EXAMPLES:: @@ -323,9 +323,9 @@ def exponential_specialization(self, t=None, q=1): .. MATH:: - ex_q(f) = (1-q)^n t^n ps(f), + ex_q(f) = (1-q)^n t^n ps_q(f), - where `ps(f)` is the stable principal specialization of `f`. + where `ps_q(f)` is the stable principal specialization of `f`. Note that setting `q = 1` in the stable principal specialization is an invalid operation. diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index 5dcdb427263..652a32ce82e 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -340,12 +340,13 @@ def principal_specialization(self, n=infinity, q=None): the default is to create a ring (or fraction field) of polynomials in ``q`` over the coefficient ring. - For ``q=1`` we use the formula from Proposition 7.8.3 of [EnumComb2]_ + For ``q=1`` and finite ``n`` we use the formula from + Proposition 7.8.3 of [EnumComb2]_, .. MATH:: ps_{n,1}(m_\lambda) = \binom{n}{len(\lambda)} - \binom{len(\lambda)}{m_1(\lambda), m_2(\lambda),\dots} + \binom{len(\lambda)}{m_2(\lambda), m_2(\lambda),\dots}. In all other cases, we convert to powersum symmetric functions. @@ -396,9 +397,9 @@ def exponential_specialization(self, t=None, q=1): .. MATH:: - ex_q(f) = (1-q)^n t^n ps(f), + ex_q(f) = (1-q)^n t^n ps_q(f), - where `ps(f)` is the stable principal specialization of `f`. + where `ps_q(f)` is the stable principal specialization of `f`. Note that setting `q = 1` in the stable principal specialization is an invalid operation. diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index 49ae8cb51f3..60714c436e9 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -732,11 +732,11 @@ def principal_specialization(self, n=infinity, q=None): .. MATH:: - ps_{n,q}(p_\lambda) = \prod_i (1-q^{n\lambda_i}) / (1-q^{\lambda_i}) + ps_{n,q}(p_\lambda) = \prod_i (1-q^{n\lambda_i}) / (1-q^{\lambda_i}), - ps_{n,1}(p_\lambda) = n^{len(\lambda)} + ps_{n,1}(p_\lambda) = n^{len(\lambda)}, - ps_q(p_\lambda) = 1 / \prod_i (1-q^{\lambda_i}) + ps_q(p_\lambda) = 1 / \prod_i (1-q^{\lambda_i}). EXAMPLES:: @@ -796,8 +796,7 @@ def exponential_specialization(self, t=None, q=1): = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. By analogy `q`-exponential specialization is a ring homomorphism - defined on homogeneous symmetric functions `f` of degree `n` - as + defined on homogeneous symmetric functions `f` of degree `n` as .. MATH:: @@ -807,9 +806,9 @@ def exponential_specialization(self, t=None, q=1): .. MATH:: - ex_q(f) = (1-q)^n t^n ps(f), + ex_q(f) = (1-q)^n t^n ps_q(f), - where `ps(f)` is the stable principal specialization of `f`. + where `ps_q(f)` is the stable principal specialization of `f`. Note that setting `q = 1` in the stable principal specialization is an invalid operation. diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 3b20e2712bd..c8181a2615e 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -609,14 +609,14 @@ def principal_specialization(self, n=infinity, q=None): .. MATH:: - ps_q(s_\lambda) = q^{\sum_i i\lambda_i} / \prod_{u\in\lambda} (1-q^{h(u)}) + ps_q(s_\lambda) = q^{\sum_i i\lambda_i} / \prod_{u\in\lambda} (1-q^{h(u)}). - Otherwise, we use the formula from Corollary 7.21.2 of [EnumComb2]_ + Otherwise, we use the formula from Corollary 7.21.2 of [EnumComb2]_, .. MATH:: ps_{n,q}(s_\lambda) = q^{\sum_i i\lambda_i} - \prod_{u\in\lambda} (1-q^{n+c(u)}/(1-q^{h(u)}) + \prod_{u\in\lambda} (1-q^{n+c(u)}/(1-q^{h(u)}). EXAMPLES:: @@ -687,9 +687,9 @@ def exponential_specialization(self, t=None, q=1): .. MATH:: - ex_q(f) = (1-q)^n t^n ps(f), + ex_q(f) = (1-q)^n t^n ps_q(f), - where `ps(f)` is the stable principal specialization of `f`. + where `ps_q(f)` is the stable principal specialization of `f`. Note that setting `q = 1` in the stable principal specialization is an invalid operation. From 90e1e0f67c3cd233fcfaa344012953d648fd0bb9 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Wed, 1 Jan 2020 15:46:28 +0100 Subject: [PATCH 059/301] move q=1, stable comment from exponential specialization to principal specialization and raise appropriate error --- src/sage/combinat/sf/elementary.py | 6 ++++-- src/sage/combinat/sf/homogeneous.py | 6 ++++-- src/sage/combinat/sf/monomial.py | 2 ++ src/sage/combinat/sf/powersum.py | 9 ++++++--- src/sage/combinat/sf/schur.py | 7 ++++--- src/sage/combinat/sf/sfa.py | 22 +++++++++++++++++++--- 6 files changed, 39 insertions(+), 13 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 7a58a7852ea..f2d84af5104 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -319,6 +319,8 @@ def principal_specialization(self, n=infinity, q=None): The stable principal specialization is the ring homomorphism given by setting `x_i = q^i` for all `i`. + Note that setting `q = 1` in the stable principal + specialization is an invalid operation. INPUT: @@ -377,6 +379,8 @@ def get_variable(ring, name): q = get_variable(self.base_ring(), "q") if q == 1: + if n == infinity: + raise ValueError("the stable principal specialization at q=1 is not defined") f = lambda partition: prod(binomial(n, part) for part in partition) elif n == infinity: f = lambda partition: prod(q**binomial(part, 2)/prod((1-q**i) @@ -416,8 +420,6 @@ def exponential_specialization(self, t=None, q=1): ex_q(f) = (1-q)^n t^n ps_q(f), where `ps_q(f)` is the stable principal specialization of `f`. - Note that setting `q = 1` in the stable principal - specialization is an invalid operation. INPUT: diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index a1190a316fa..117081dbb68 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -237,6 +237,8 @@ def principal_specialization(self, n=infinity, q=None): The stable principal specialization is the ring homomorphism given by setting `x_i = q^i` for all `i`. + Note that setting `q = 1` in the stable principal + specialization is an invalid operation. INPUT: @@ -290,6 +292,8 @@ def get_variable(ring, name): q = get_variable(self.base_ring(), 'q') if q == 1: + if n == infinity: + raise ValueError("the stable principal specialization at q=1 is not defined") f = lambda partition: prod(binomial(n+part-1, part) for part in partition) elif n == infinity: f = lambda partition: prod(1/prod((1-q**i) for i in range(1, part+1)) for part in partition) @@ -326,8 +330,6 @@ def exponential_specialization(self, t=None, q=1): ex_q(f) = (1-q)^n t^n ps_q(f), where `ps_q(f)` is the stable principal specialization of `f`. - Note that setting `q = 1` in the stable principal - specialization is an invalid operation. INPUT: diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index 652a32ce82e..7b11cc79e5d 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -368,6 +368,8 @@ def principal_specialization(self, n=infinity, q=None): """ if q == 1: + if n == infinity: + raise ValueError("the stable principal specialization at q=1 is not defined") f = lambda partition: binomial(n, len(partition))*multinomial(partition.to_exp()) return self.parent()._apply_module_morphism(self, f, q.parent()) diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index 60714c436e9..b0360044f35 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -707,7 +707,8 @@ def eval_at_permutation_roots(self, rho): return p._apply_module_morphism(self, on_basis, R) def principal_specialization(self, n=infinity, q=None): - r"""Return the principal specialization of the symmetric function. + r""" + Return the principal specialization of the symmetric function. The principal specialization of order `n` is the ring homomorphism given by setting `x_i = q^i` for `i \in @@ -716,6 +717,8 @@ def principal_specialization(self, n=infinity, q=None): The stable principal specialization is the ring homomorphism given by setting `x_i = q^i` for all `i`. + Note that setting `q = 1` in the stable principal + specialization is an invalid operation. INPUT: @@ -777,6 +780,8 @@ def get_variable(ring, name): q = get_variable(self.base_ring(), 'q') if q == 1: + if n == infinity: + raise ValueError("the stable principal specialization at q=1 is not defined") f = lambda partition: n**len(partition) elif n == infinity: f = lambda partition: prod(1/(1-q**part) for part in partition) @@ -809,8 +814,6 @@ def exponential_specialization(self, t=None, q=1): ex_q(f) = (1-q)^n t^n ps_q(f), where `ps_q(f)` is the stable principal specialization of `f`. - Note that setting `q = 1` in the stable principal - specialization is an invalid operation. INPUT: diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index c8181a2615e..19b7e972344 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -585,6 +585,8 @@ def principal_specialization(self, n=infinity, q=None): The stable principal specialization is the ring homomorphism given by setting `x_i = q^i` for all `i`. + Note that setting `q = 1` in the stable principal + specialization is an invalid operation. INPUT: @@ -648,8 +650,9 @@ def get_variable(ring, name): if q is None: q = get_variable(self.base_ring(), 'q') - if q == 1: + if n == infinity: + raise ValueError("the stable principal specialization at q=1 is not defined") f = lambda partition: (prod(n+partition.content(*c) for c in partition.cells()) / prod(h for h in partition.hooks())) elif n == infinity: @@ -690,8 +693,6 @@ def exponential_specialization(self, t=None, q=1): ex_q(f) = (1-q)^n t^n ps_q(f), where `ps_q(f)` is the stable principal specialization of `f`. - Note that setting `q = 1` in the stable principal - specialization is an invalid operation. INPUT: diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 36ee50f680a..e4bb2cb59d3 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5449,7 +5449,9 @@ def principal_specialization(self, n=infinity, q=None): of [EnumComb2]_. The stable principal specialization is the ring homomorphism - given by setting `x_i = q^i` for all `i`. + given by setting `x_i = q^i` for all `i`. Note that setting + `q = 1` in the stable principal specialization is an invalid + operation. INPUT: @@ -5526,6 +5528,22 @@ def principal_specialization(self, n=infinity, q=None): sage: len(set([b(x).principal_specialization(n=4, q=2) for b in B])) 1 + Check that the stable principal specialization at `q = 1` + raises a ``ValueError``: + + sage: def test_error(x): + ....: message = "the stable principal specialization of %s at q=1 should raise a ValueError" + ....: try: + ....: x.principal_specialization(q=1) + ....: except ValueError as e: + ....: return(e) + ....: except StandardError as e: + ....: raise ValueError((message + ", but raised '%s' instead") % (x, e)) + ....: raise ValueError((message + ", but didn't") % x) + + sage: set([str(test_error(b(x))) for b in B]) + {'the stable principal specialization at q=1 is not defined'} + """ p = self.parent().realization_of().powersum() return p(self).principal_specialization(n, q=q) @@ -5557,8 +5575,6 @@ def exponential_specialization(self, t=None, q=1): ex_q(f) = (1-q)^n t^n ps(f), where `ps(f)` is the stable principal specialization of `f`. - Note that setting `q = 1` in the stable principal - specialization is an invalid operation. INPUT: From c6dac5aa0cf3d8ac6ae9302ce0b7f034f02ec1d1 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Thu, 2 Apr 2020 15:48:12 +0200 Subject: [PATCH 060/301] improvements to doc To my knowledge, the variables start at x_1, not x_0. --- src/sage/combinat/sf/elementary.py | 30 ++++++++++++++++------------- src/sage/combinat/sf/homogeneous.py | 30 ++++++++++++++++------------- src/sage/combinat/sf/monomial.py | 28 ++++++++++++++++----------- src/sage/combinat/sf/powersum.py | 30 ++++++++++++++++------------- src/sage/combinat/sf/schur.py | 30 ++++++++++++++++------------- src/sage/combinat/sf/sfa.py | 28 +++++++++++++++------------ 6 files changed, 101 insertions(+), 75 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index f2d84af5104..480a2ee3ce0 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -310,17 +310,20 @@ def expand(self, n, alphabet='x'): def principal_specialization(self, n=infinity, q=None): r""" - Return the principal specialization of the symmetric function. + Return the principal specialization of a symmetric function. - The principal specialization of order `n` is the ring - homomorphism given by setting `x_i = q^i` for `i \in - \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`, see Section - 7.8 of [EnumComb2]_. + The *principal specialization* of order `n` is the ring + homomorphism from the ring of symmetric functions to another + commutative ring `R` given by `x_i \mapsto q^{i-1}` for + `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`. + See Section 7.8 of [EnumComb2]_. - The stable principal specialization is the ring - homomorphism given by setting `x_i = q^i` for all `i`. - Note that setting `q = 1` in the stable principal - specialization is an invalid operation. + The *stable principal specialization* is the ring + homomorphism given by `x_i \mapsto q^{i-1}` for all `i`. + This is well-defined only if the resulting infinite sums + converge; thus, in particular, setting `q = 1` in the + stable principal specialization is an invalid operation. INPUT: @@ -329,11 +332,12 @@ def principal_specialization(self, n=infinity, q=None): specialization of order ``n`` or the stable principal specialization. - - ``q`` (default: ``None``) -- the value to use for `q`, - the default is to create a ring (or fraction field) of - polynomials in ``q`` over the coefficient ring. + - ``q`` (default: ``None``) -- the value to use for `q`; the + default is to create a ring of polynomials in ``q`` + (or a field of rational functions in ``q``) over the + given coefficient ring. - We use the formulas from Proposition 7.8.3 of [EnumComb2]_, + We use the formulas from Proposition 7.8.3 of [EnumComb2]_: .. MATH:: diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index 117081dbb68..feff79738eb 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -228,17 +228,20 @@ def expand(self, n, alphabet='x'): def principal_specialization(self, n=infinity, q=None): r""" - Return the principal specialization of the symmetric function. + Return the principal specialization of a symmetric function. - The principal specialization of order `n` is the ring - homomorphism given by setting `x_i = q^i` for `i \in - \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`, see Section - 7.8 of [EnumComb2]_. + The *principal specialization* of order `n` is the ring + homomorphism from the ring of symmetric functions to another + commutative ring `R` given by `x_i \mapsto q^{i-1}` for + `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`. + See Section 7.8 of [EnumComb2]_. - The stable principal specialization is the ring - homomorphism given by setting `x_i = q^i` for all `i`. - Note that setting `q = 1` in the stable principal - specialization is an invalid operation. + The *stable principal specialization* is the ring + homomorphism given by `x_i \mapsto q^{i-1}` for all `i`. + This is well-defined only if the resulting infinite sums + converge; thus, in particular, setting `q = 1` in the + stable principal specialization is an invalid operation. INPUT: @@ -247,11 +250,12 @@ def principal_specialization(self, n=infinity, q=None): specialization of order ``n`` or the stable principal specialization. - - ``q`` (default: ``None``) -- the value to use for `q`, - the default is to create a ring (or fraction field) of - polynomials in ``q`` over the coefficient ring. + - ``q`` (default: ``None``) -- the value to use for `q`; the + default is to create a ring of polynomials in ``q`` + (or a field of rational functions in ``q``) over the + given coefficient ring. - We use the formulas from Proposition 7.8.3 of [EnumComb2]_, + We use the formulas from Proposition 7.8.3 of [EnumComb2]_: .. MATH:: diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index 7b11cc79e5d..c2bef88a58f 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -319,15 +319,20 @@ def condition(part): ======= def principal_specialization(self, n=infinity, q=None): r""" - Return the principal specialization of the symmetric function. + Return the principal specialization of a symmetric function. - The principal specialization of order `n` is the ring - homomorphism given by setting `x_i = q^i` for `i \in - \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`, see Section - 7.8 of [EnumComb2]_. + The *principal specialization* of order `n` is the ring + homomorphism from the ring of symmetric functions to another + commutative ring `R` given by `x_i \mapsto q^{i-1}` for + `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`. + See Section 7.8 of [EnumComb2]_. - The stable principal specialization is the ring - homomorphism given by setting `x_i = q^i` for all `i`. + The *stable principal specialization* is the ring + homomorphism given by `x_i \mapsto q^{i-1}` for all `i`. + This is well-defined only if the resulting infinite sums + converge; thus, in particular, setting `q = 1` in the + stable principal specialization is an invalid operation. INPUT: @@ -336,12 +341,13 @@ def principal_specialization(self, n=infinity, q=None): specialization of order ``n`` or the stable principal specialization. - - ``q`` (default: ``None``) -- the value to use for `q`, - the default is to create a ring (or fraction field) of - polynomials in ``q`` over the coefficient ring. + - ``q`` (default: ``None``) -- the value to use for `q`; the + default is to create a ring of polynomials in ``q`` + (or a field of rational functions in ``q``) over the + given coefficient ring. For ``q=1`` and finite ``n`` we use the formula from - Proposition 7.8.3 of [EnumComb2]_, + Proposition 7.8.3 of [EnumComb2]_: .. MATH:: diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index b0360044f35..dd70cf22233 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -708,17 +708,20 @@ def eval_at_permutation_roots(self, rho): def principal_specialization(self, n=infinity, q=None): r""" - Return the principal specialization of the symmetric function. + Return the principal specialization of a symmetric function. - The principal specialization of order `n` is the ring - homomorphism given by setting `x_i = q^i` for `i \in - \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`, see Section - 7.8 of [EnumComb2]_. + The *principal specialization* of order `n` is the ring + homomorphism from the ring of symmetric functions to another + commutative ring `R` given by `x_i \mapsto q^{i-1}` for + `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`. + See Section 7.8 of [EnumComb2]_. - The stable principal specialization is the ring - homomorphism given by setting `x_i = q^i` for all `i`. - Note that setting `q = 1` in the stable principal - specialization is an invalid operation. + The *stable principal specialization* is the ring + homomorphism given by `x_i \mapsto q^{i-1}` for all `i`. + This is well-defined only if the resulting infinite sums + converge; thus, in particular, setting `q = 1` in the + stable principal specialization is an invalid operation. INPUT: @@ -727,11 +730,12 @@ def principal_specialization(self, n=infinity, q=None): specialization of order ``n`` or the stable principal specialization. - - ``q`` (default: ``None``) -- the value to use for `q`, - the default is to create a ring (or fraction field) of - polynomials in ``q`` over the coefficient ring. + - ``q`` (default: ``None``) -- the value to use for `q`; the + default is to create a ring of polynomials in ``q`` + (or a field of rational functions in ``q``) over the + given coefficient ring. - We use the formulas from Proposition 7.8.3 of [EnumComb2]_ + We use the formulas from Proposition 7.8.3 of [EnumComb2]_: .. MATH:: diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 19b7e972344..8999f3920ea 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -576,17 +576,20 @@ def expand(self, n, alphabet='x'): def principal_specialization(self, n=infinity, q=None): r""" - Return the principal specialization of the symmetric function. + Return the principal specialization of a symmetric function. - The principal specialization of order `n` is the ring - homomorphism given by setting `x_i = q^i` for `i \in - \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`, see Section - 7.8 of [EnumComb2]_. + The *principal specialization* of order `n` is the ring + homomorphism from the ring of symmetric functions to another + commutative ring `R` given by `x_i \mapsto q^{i-1}` for + `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`. + See Section 7.8 of [EnumComb2]_. - The stable principal specialization is the ring - homomorphism given by setting `x_i = q^i` for all `i`. - Note that setting `q = 1` in the stable principal - specialization is an invalid operation. + The *stable principal specialization* is the ring + homomorphism given by `x_i \mapsto q^{i-1}` for all `i`. + This is well-defined only if the resulting infinite sums + converge; thus, in particular, setting `q = 1` in the + stable principal specialization is an invalid operation. INPUT: @@ -595,11 +598,12 @@ def principal_specialization(self, n=infinity, q=None): specialization of order ``n`` or the stable principal specialization. - - ``q`` (default: ``None``) -- the value to use for `q`, - the default is to create a ring (or fraction field) of - polynomials in ``q`` over the coefficient ring. + - ``q`` (default: ``None``) -- the value to use for `q`; the + default is to create a ring of polynomials in ``q`` + (or a field of rational functions in ``q``) over the + given coefficient ring. - For `q=1` we use the formula from Corollary 7.21.4 of [EnumComb2]_ + For `q=1` we use the formula from Corollary 7.21.4 of [EnumComb2]_: .. MATH:: diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index e4bb2cb59d3..82445468639 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5443,15 +5443,18 @@ def principal_specialization(self, n=infinity, q=None): r""" Return the principal specialization of a symmetric function. - The principal specialization of order `n` is the ring - homomorphism given by setting `x_i = q^i` for `i \in - \{0,\dots,n-1\}` and `x_i = 0` for `i\geq n`, see Section 7.8 - of [EnumComb2]_. - - The stable principal specialization is the ring homomorphism - given by setting `x_i = q^i` for all `i`. Note that setting - `q = 1` in the stable principal specialization is an invalid - operation. + The *principal specialization* of order `n` is the ring + homomorphism from the ring of symmetric functions to another + commutative ring `R` given by `x_i \mapsto q^{i-1}` for + `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`. + See Section 7.8 of [EnumComb2]_. + + The *stable principal specialization* is the ring + homomorphism given by `x_i \mapsto q^{i-1}` for all `i`. + This is well-defined only if the resulting infinite sums + converge; thus, in particular, setting `q = 1` in the + stable principal specialization is an invalid operation. INPUT: @@ -5460,9 +5463,10 @@ def principal_specialization(self, n=infinity, q=None): specialization of order ``n`` or the stable principal specialization. - - ``q`` (default: ``None``) -- the value to use for `q`, the - default is to create a ring (or fraction field) of - polynomials in ``q`` over the coefficient ring. + - ``q`` (default: ``None``) -- the value to use for `q`; the + default is to create a ring of polynomials in ``q`` + (or a field of rational functions in ``q``) over the + given coefficient ring. EXAMPLES:: From 77af27c91a3fd5e773c099fc61222a7ff2258001 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Thu, 2 Apr 2020 15:49:56 +0200 Subject: [PATCH 061/301] redirect through monomial, not powersum Powersum conversion only works in char 0 --- src/sage/combinat/sf/sfa.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 82445468639..f6e4004f12b 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5549,8 +5549,8 @@ def principal_specialization(self, n=infinity, q=None): {'the stable principal specialization at q=1 is not defined'} """ - p = self.parent().realization_of().powersum() - return p(self).principal_specialization(n, q=q) + m = self.parent().realization_of().monomial() + return m(self).principal_specialization(n, q=q) def exponential_specialization(self, t=None, q=1): r""" From b2ad980cb9767f150c968f534c16a5b9f2ba1636 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Thu, 2 Apr 2020 16:00:52 +0200 Subject: [PATCH 062/301] more doc --- src/sage/combinat/sf/elementary.py | 13 ++++++++++--- src/sage/combinat/sf/homogeneous.py | 2 ++ src/sage/combinat/sf/monomial.py | 2 ++ src/sage/combinat/sf/powersum.py | 7 +++++-- src/sage/combinat/sf/schur.py | 2 ++ src/sage/combinat/sf/sfa.py | 4 +++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 480a2ee3ce0..05b68448ac4 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -317,6 +317,8 @@ def principal_specialization(self, n=infinity, q=None): commutative ring `R` given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. Here, `q` is a given element of `R`. + (To be more precise, it is a `K`-algebra homomorphism, + where `K` is the base ring.) See Section 7.8 of [EnumComb2]_. The *stable principal specialization* is the ring @@ -403,9 +405,14 @@ def exponential_specialization(self, t=None, q=1): The exponential specialization `ex` is the ring homomorphism defined on the basis of powersum symmetric functions by - setting `p_1 = t` and `p_n = 0` for `n > 1`. Equivalently, - on the basis of homogeneous functions it is given by `ex(h_n) - = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. + setting `p_1 = t` and `p_n = 0` for `n > 1`. + (To be more precise, it is a `K`-algebra homomorphism, + where `K` is the base ring.) + Equivalently, on the basis of homogeneous functions it is + given by `ex(h_n) = t^n / n!`, see Proposition 7.8.4 of + [EnumComb2]_. + In order for `ex` to be well-defined, the base ring must + be a `\QQ`-algebra. By analogy, the `q`-exponential specialization is a ring homomorphism defined on the complete homogeneous symmetric diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index feff79738eb..40bc4937281 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -235,6 +235,8 @@ def principal_specialization(self, n=infinity, q=None): commutative ring `R` given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. Here, `q` is a given element of `R`. + (To be more precise, it is a `K`-algebra homomorphism, + where `K` is the base ring.) See Section 7.8 of [EnumComb2]_. The *stable principal specialization* is the ring diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index c2bef88a58f..a324b568bd9 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -326,6 +326,8 @@ def principal_specialization(self, n=infinity, q=None): commutative ring `R` given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. Here, `q` is a given element of `R`. + (To be more precise, it is a `K`-algebra homomorphism, + where `K` is the base ring.) See Section 7.8 of [EnumComb2]_. The *stable principal specialization* is the ring diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index dd70cf22233..59d341ab7c0 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -715,6 +715,8 @@ def principal_specialization(self, n=infinity, q=None): commutative ring `R` given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. Here, `q` is a given element of `R`. + (To be more precise, it is a `K`-algebra homomorphism, + where `K` is the base ring.) See Section 7.8 of [EnumComb2]_. The *stable principal specialization* is the ring @@ -804,8 +806,9 @@ def exponential_specialization(self, t=None, q=1): on the basis of homogeneous functions it is given by `ex(h_n) = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. - By analogy `q`-exponential specialization is a ring homomorphism - defined on homogeneous symmetric functions `f` of degree `n` as + By analogy, the `q`-exponential specialization is a ring + homomorphism defined on the complete homogeneous symmetric + functions `f` by .. MATH:: diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 8999f3920ea..c011010a522 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -583,6 +583,8 @@ def principal_specialization(self, n=infinity, q=None): commutative ring `R` given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. Here, `q` is a given element of `R`. + (To be more precise, it is a `K`-algebra homomorphism, + where `K` is the base ring.) See Section 7.8 of [EnumComb2]_. The *stable principal specialization* is the ring diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index f6e4004f12b..ecf04060f09 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5448,6 +5448,8 @@ def principal_specialization(self, n=infinity, q=None): commutative ring `R` given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. Here, `q` is a given element of `R`. + (To be more precise, it is a `K`-algebra homomorphism, + where `K` is the base ring.) See Section 7.8 of [EnumComb2]_. The *stable principal specialization* is the ring @@ -5564,7 +5566,7 @@ def exponential_specialization(self, t=None, q=1): By analogy, the `q`-exponential specialization is a ring homomorphism defined on the complete homogeneous symmetric - functions as + functions by .. MATH:: From 4f5e2c536fd94ae0a08f881740efcd7a94325fdb Mon Sep 17 00:00:00 2001 From: zabrocki Date: Sat, 4 Apr 2020 11:20:50 -0400 Subject: [PATCH 063/301] correct use of n in exponential_specialization documentation in schur.py --- src/sage/combinat/sf/schur.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index c011010a522..ea4b0cd1246 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -714,7 +714,7 @@ def exponential_specialization(self, t=None, q=1): .. MATH:: - ex_{n,q}(s_\lambda) = t^n q^{\sum_i i\lambda_i} + ex_{q}(s_\lambda) = t^{|\lambda|} q^{\sum_i i\lambda_i} / \prod_{u\in\lambda} (1 + \dots + q^{h(u)-1}) where `h(u)` is the hook length of a cell `u` in `\lambda`. @@ -723,7 +723,7 @@ def exponential_specialization(self, t=None, q=1): .. MATH:: - ex_{n,1}(s_\lambda) = f^\lambda t^n / n! + ex_{1}(s_\lambda) = f^\lambda t^{|\lambda|} / |\lambda|! where `f^\lambda` is the number of standard Young tableaux of shape `\lambda`. From 3cb3a5f824f038da265a253c6ef36e03bd02b994 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Fri, 24 Apr 2020 13:40:11 +0200 Subject: [PATCH 064/301] better behaviour with respect to removable singularities --- src/sage/combinat/sf/powersum.py | 9 ++++++++- src/sage/combinat/sf/schur.py | 17 ++++++++++++++--- src/sage/combinat/sf/sfa.py | 22 +++++++++++++++++----- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index 59d341ab7c0..ca0f15d94d2 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -22,6 +22,7 @@ from sage.combinat.partition import Partition from sage.arith.all import divisors from sage.rings.all import infinity +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.misc.all import prod class SymmetricFunctionAlgebra_power(multiplicative.SymmetricFunctionAlgebra_multiplicative): @@ -792,7 +793,13 @@ def get_variable(ring, name): elif n == infinity: f = lambda partition: prod(1/(1-q**part) for part in partition) else: - f = lambda partition: prod((1-q**(n*part))/(1-q**part) for part in partition) + q_lim = PolynomialRing(self.base_ring(), "q").gen() + def f(partition): + denom = prod((1-q**part) for part in partition) + if denom: + return prod((1-q**(n*part)) for part in partition)/denom + quotient = prod((1-q_lim**(n*part))/(1-q_lim**part) for part in partition) + return quotient.subs({q_lim: q}) return self.parent()._apply_module_morphism(self, f, q.parent()) diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index ea4b0cd1246..02334fcda33 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -23,6 +23,7 @@ import sage.libs.lrcalc.lrcalc as lrcalc from sage.misc.all import prod from sage.rings.infinity import infinity +from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.functions.other import factorial from sage.combinat.tableau import StandardTableaux @@ -665,9 +666,19 @@ def get_variable(ring, name): f = lambda partition: (q**sum(i*part for i, part in enumerate(partition)) / prod(1-q**h for h in partition.hooks())) else: - f = lambda partition: (q**sum(i*part for i, part in enumerate(partition)) - * prod(1-q**(n + partition.content(*c)) for c in partition.cells()) - / prod(1-q**h for h in partition.hooks())) + q_lim = PolynomialRing(self.base_ring(), "q").gen() + def f(partition): + power = q**sum(i*part for i, part in enumerate(partition)) + denom = prod(1-q**h for h in partition.hooks()) + if denom: + return (power + * prod(1-q**(n + partition.content(*c)) + for c in partition.cells()) + / denom) + quotient = (prod(1-q_lim**(n + partition.content(*c)) + for c in partition.cells()) + / prod(1-q_lim**h for h in partition.hooks())) + return (power * quotient.subs({q_lim: q})) return self.parent()._apply_module_morphism(self, f, q.parent()) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index ecf04060f09..86612b510c7 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5494,7 +5494,7 @@ def principal_specialization(self, n=infinity, q=None): ValueError: the variable q is in the base ring, pass it explicitly sage: Ht[2].principal_specialization(q=R("q")) - (-q^2 - 1)/(-q^3 + q^2 + q - 1) + (q^2 + 1)/(q^3 - q^2 - q + 1) Note that the principal specialization can be obtained as a plethysm:: @@ -5550,9 +5550,19 @@ def principal_specialization(self, n=infinity, q=None): sage: set([str(test_error(b(x))) for b in B]) {'the stable principal specialization at q=1 is not defined'} + Check that specifying `q` which is a removable singularity works:: + + sage: S = SymmetricFunctions(QQ) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: m = S.m(); x = m[2,2,1] + sage: set([b(x).principal_specialization(n=4, q=QQbar.zeta(3)) for b in B]) + {-3} + """ - m = self.parent().realization_of().monomial() - return m(self).principal_specialization(n, q=q) + # heuristically, it seems fastest to fall back to the + # elementary basis instead of the powersum basis + e = self.parent().realization_of().elementary() + return e(self).principal_specialization(n, q=q) def exponential_specialization(self, t=None, q=1): r""" @@ -5629,8 +5639,10 @@ def exponential_specialization(self, t=None, q=1): 1 """ - p = self.parent().realization_of().powersum() - return p(self).exponential_specialization(t=t, q=q) + # heuristically, it seems fastest to fall back to the + # elementary basis instead of the powersum basis + e = self.parent().realization_of().elementary() + return e(self).exponential_specialization(t=t, q=q) SymmetricFunctionAlgebra_generic.Element = SymmetricFunctionAlgebra_generic_Element From 2b301b50c0e45fc1db972c17339cb82fd84e8306 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Fri, 24 Apr 2020 14:46:22 +0200 Subject: [PATCH 065/301] review the doc --- src/sage/combinat/sf/elementary.py | 74 +++++++++++++++----------- src/sage/combinat/sf/homogeneous.py | 71 +++++++++++++++---------- src/sage/combinat/sf/monomial.py | 76 ++++++++++++++++----------- src/sage/combinat/sf/powersum.py | 77 +++++++++++++++++---------- src/sage/combinat/sf/schur.py | 80 ++++++++++++++++++----------- src/sage/combinat/sf/sfa.py | 76 +++++++++++++++++---------- 6 files changed, 285 insertions(+), 169 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 05b68448ac4..4597f6ea6e5 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -312,17 +312,22 @@ def principal_specialization(self, n=infinity, q=None): r""" Return the principal specialization of a symmetric function. - The *principal specialization* of order `n` is the ring - homomorphism from the ring of symmetric functions to another - commutative ring `R` given by `x_i \mapsto q^{i-1}` for - `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. - Here, `q` is a given element of `R`. - (To be more precise, it is a `K`-algebra homomorphism, - where `K` is the base ring.) + The *principal specialization* of order `n` at `q` + is the ring homomorphism `ps_{n,q}` from the ring of + symmetric functions to another commutative ring `R` + given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` + and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`, and we assume that + the variables of our symmetric functions are + `x_1, x_2, x_3, \ldots`. + (To be more precise, `ps_{n,q}` is a `K`-algebra + homomorphism, where `K` is the base ring.) See Section 7.8 of [EnumComb2]_. - The *stable principal specialization* is the ring - homomorphism given by `x_i \mapsto q^{i-1}` for all `i`. + The *stable principal specialization* at `q` is the ring + homomorphism `ps_q` from the ring of symmetric functions + to another commutative ring `R` given by + `x_i \mapsto q^{i-1}` for all `i`. This is well-defined only if the resulting infinite sums converge; thus, in particular, setting `q = 1` in the stable principal specialization is an invalid operation. @@ -339,7 +344,8 @@ def principal_specialization(self, n=infinity, q=None): (or a field of rational functions in ``q``) over the given coefficient ring. - We use the formulas from Proposition 7.8.3 of [EnumComb2]_: + We use the formulas from Proposition 7.8.3 of [EnumComb2]_ + (using Gaussian binomial coefficients `\binom{u}{v}_q`): .. MATH:: @@ -359,7 +365,7 @@ def principal_specialization(self, n=infinity, q=None): sage: x.principal_specialization(3) 5*q^6 + 18*q^5 + 36*q^4 + 44*q^3 + 36*q^2 + 18*q + 6 - By default, we return a rational functions in q. Sometimes it is + By default, we return a rational functions in `q`. Sometimes it is better to obtain an element of the symbolic ring:: sage: x.principal_specialization(q=var("q")) @@ -403,20 +409,26 @@ def exponential_specialization(self, t=None, q=1): r""" Return the exponential specialization of a symmetric function. - The exponential specialization `ex` is the ring homomorphism - defined on the basis of powersum symmetric functions by - setting `p_1 = t` and `p_n = 0` for `n > 1`. - (To be more precise, it is a `K`-algebra homomorphism, - where `K` is the base ring.) - Equivalently, on the basis of homogeneous functions it is - given by `ex(h_n) = t^n / n!`, see Proposition 7.8.4 of + The *exponential specialization* `ex` at `t` is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R`. + It is defined whenever the base ring `K` is a + `\QQ`-algebra and `t` is an element of `R`. + The easiest way to define it is by specifying its + values on the powersum symmetric functions to be + `p_1 = t` and `p_n = 0` for `n > 1`. + Equivalently, on the homogeneous functions it is + given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of [EnumComb2]_. - In order for `ex` to be well-defined, the base ring must - be a `\QQ`-algebra. - By analogy, the `q`-exponential specialization is a ring - homomorphism defined on the complete homogeneous symmetric - functions as + By analogy, the `q`-exponential specialization is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R` that + depends on two elements `t` and `q` of `R` for which + the elements `1 - q^i` for all positive integers `i` + are invertible. + It can be defined by specifying its values on the + complete homogeneous symmetric functions to be .. MATH:: @@ -424,22 +436,24 @@ def exponential_specialization(self, t=None, q=1): where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` and a homogeneous symmetric function `f` of - degree `n`, + degree `n`, we have .. MATH:: ex_q(f) = (1-q)^n t^n ps_q(f), - where `ps_q(f)` is the stable principal specialization of `f`. + where `ps_q(f)` is the stable principal specialization of `f` + (see :meth:`principal_specialization`). + (See (7.29) in [EnumComb2]_.) INPUT: - - ``t`` (default: None) -- the value to use for `t`, the - default is to create a ring of polynomials in ``t``. + - ``t`` (default: ``None``) -- the value to use for `t`; + the default is to create a ring of polynomials in ``t``. - - ``q`` (default: 1) -- the value to use for `q`. If ``q`` - is ``None`` create a ring (or fraction field) of - polynomials in ``q``. + - ``q`` (default: `1`) -- the value to use for `q`. If + ``q`` is ``None``, then a ring (or fraction field) of + polynomials in ``q`` is created. EXAMPLES:: diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index 40bc4937281..4e932fbc94a 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -230,17 +230,22 @@ def principal_specialization(self, n=infinity, q=None): r""" Return the principal specialization of a symmetric function. - The *principal specialization* of order `n` is the ring - homomorphism from the ring of symmetric functions to another - commutative ring `R` given by `x_i \mapsto q^{i-1}` for - `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. - Here, `q` is a given element of `R`. - (To be more precise, it is a `K`-algebra homomorphism, - where `K` is the base ring.) + The *principal specialization* of order `n` at `q` + is the ring homomorphism `ps_{n,q}` from the ring of + symmetric functions to another commutative ring `R` + given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` + and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`, and we assume that + the variables of our symmetric functions are + `x_1, x_2, x_3, \ldots`. + (To be more precise, `ps_{n,q}` is a `K`-algebra + homomorphism, where `K` is the base ring.) See Section 7.8 of [EnumComb2]_. - The *stable principal specialization* is the ring - homomorphism given by `x_i \mapsto q^{i-1}` for all `i`. + The *stable principal specialization* at `q` is the ring + homomorphism `ps_q` from the ring of symmetric functions + to another commutative ring `R` given by + `x_i \mapsto q^{i-1}` for all `i`. This is well-defined only if the resulting infinite sums converge; thus, in particular, setting `q = 1` in the stable principal specialization is an invalid operation. @@ -257,7 +262,8 @@ def principal_specialization(self, n=infinity, q=None): (or a field of rational functions in ``q``) over the given coefficient ring. - We use the formulas from Proposition 7.8.3 of [EnumComb2]_: + We use the formulas from Proposition 7.8.3 of [EnumComb2]_ + (using Gaussian binomial coefficients `\binom{u}{v}_q`): .. MATH:: @@ -313,15 +319,26 @@ def exponential_specialization(self, t=None, q=1): r""" Return the exponential specialization of a symmetric function. - The exponential specialization `ex` is the ring homomorphism - defined on the basis of powersum symmetric functions by - setting `p_1 = t` and `p_n = 0` for `n > 1`. Equivalently, - on the basis of homogeneous functions it is given by `ex(h_n) - = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. - - By analogy, the `q`-exponential specialization is a ring - homomorphism defined on the complete homogeneous symmetric - functions as + The *exponential specialization* `ex` at `t` is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R`. + It is defined whenever the base ring `K` is a + `\QQ`-algebra and `t` is an element of `R`. + The easiest way to define it is by specifying its + values on the powersum symmetric functions to be + `p_1 = t` and `p_n = 0` for `n > 1`. + Equivalently, on the homogeneous functions it is + given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of + [EnumComb2]_. + + By analogy, the `q`-exponential specialization is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R` that + depends on two elements `t` and `q` of `R` for which + the elements `1 - q^i` for all positive integers `i` + are invertible. + It can be defined by specifying its values on the + complete homogeneous symmetric functions to be .. MATH:: @@ -329,22 +346,24 @@ def exponential_specialization(self, t=None, q=1): where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` and a homogeneous symmetric function `f` of - degree `n`, + degree `n`, we have .. MATH:: ex_q(f) = (1-q)^n t^n ps_q(f), - where `ps_q(f)` is the stable principal specialization of `f`. + where `ps_q(f)` is the stable principal specialization of `f` + (see :meth:`principal_specialization`). + (See (7.29) in [EnumComb2]_.) INPUT: - - ``t`` (default: None) -- the value to use for `t`, the - default is to create a ring of polynomials in ``t``. + - ``t`` (default: ``None``) -- the value to use for `t`; + the default is to create a ring of polynomials in ``t``. - - ``q`` (default: 1) -- the value to use for `q`. If ``q`` - is ``None`` create a ring (or fraction field) of - polynomials in ``q``. + - ``q`` (default: `1`) -- the value to use for `q`. If + ``q`` is ``None``, then a ring (or fraction field) of + polynomials in ``q`` is created. EXAMPLES:: diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index a324b568bd9..f6c7e2d60ef 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -321,17 +321,22 @@ def principal_specialization(self, n=infinity, q=None): r""" Return the principal specialization of a symmetric function. - The *principal specialization* of order `n` is the ring - homomorphism from the ring of symmetric functions to another - commutative ring `R` given by `x_i \mapsto q^{i-1}` for - `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. - Here, `q` is a given element of `R`. - (To be more precise, it is a `K`-algebra homomorphism, - where `K` is the base ring.) + The *principal specialization* of order `n` at `q` + is the ring homomorphism `ps_{n,q}` from the ring of + symmetric functions to another commutative ring `R` + given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` + and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`, and we assume that + the variables of our symmetric functions are + `x_1, x_2, x_3, \ldots`. + (To be more precise, `ps_{n,q}` is a `K`-algebra + homomorphism, where `K` is the base ring.) See Section 7.8 of [EnumComb2]_. - The *stable principal specialization* is the ring - homomorphism given by `x_i \mapsto q^{i-1}` for all `i`. + The *stable principal specialization* at `q` is the ring + homomorphism `ps_q` from the ring of symmetric functions + to another commutative ring `R` given by + `x_i \mapsto q^{i-1}` for all `i`. This is well-defined only if the resulting infinite sums converge; thus, in particular, setting `q = 1` in the stable principal specialization is an invalid operation. @@ -353,8 +358,10 @@ def principal_specialization(self, n=infinity, q=None): .. MATH:: - ps_{n,1}(m_\lambda) = \binom{n}{len(\lambda)} - \binom{len(\lambda)}{m_2(\lambda), m_2(\lambda),\dots}. + ps_{n,1}(m_\lambda) = \binom{n}{\ell(\lambda)} + \binom{\ell(\lambda)}{m_1(\lambda), m_2(\lambda),\dots}, + + where `\ell(\lambda)` denotes the length of `\lambda`. In all other cases, we convert to powersum symmetric functions. @@ -387,15 +394,26 @@ def exponential_specialization(self, t=None, q=1): r""" Return the exponential specialization of a symmetric function. - The exponential specialization `ex` is the ring homomorphism - defined on the basis of powersum symmetric functions by - setting `p_1 = t` and `p_n = 0` for `n > 1`. Equivalently, - on the basis of homogeneous functions it is given by `ex(h_n) - = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. - - By analogy, the `q`-exponential specialization is a ring - homomorphism defined on the complete homogeneous symmetric - functions as + The *exponential specialization* `ex` at `t` is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R`. + It is defined whenever the base ring `K` is a + `\QQ`-algebra and `t` is an element of `R`. + The easiest way to define it is by specifying its + values on the powersum symmetric functions to be + `p_1 = t` and `p_n = 0` for `n > 1`. + Equivalently, on the homogeneous functions it is + given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of + [EnumComb2]_. + + By analogy, the `q`-exponential specialization is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R` that + depends on two elements `t` and `q` of `R` for which + the elements `1 - q^i` for all positive integers `i` + are invertible. + It can be defined by specifying its values on the + complete homogeneous symmetric functions to be .. MATH:: @@ -403,24 +421,24 @@ def exponential_specialization(self, t=None, q=1): where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` and a homogeneous symmetric function `f` of - degree `n`, + degree `n`, we have .. MATH:: ex_q(f) = (1-q)^n t^n ps_q(f), - where `ps_q(f)` is the stable principal specialization of `f`. - Note that setting `q = 1` in the stable principal - specialization is an invalid operation. + where `ps_q(f)` is the stable principal specialization of `f` + (see :meth:`principal_specialization`). + (See (7.29) in [EnumComb2]_.) INPUT: - - ``t`` (default: None) -- the value to use for `t`, the - default is to create a ring of polynomials in ``t``. + - ``t`` (default: ``None``) -- the value to use for `t`; + the default is to create a ring of polynomials in ``t``. - - ``q`` (default: 1) -- the value to use for `q`. If ``q`` - is ``None`` create a ring (or fraction field) of - polynomials in ``q``. + - ``q`` (default: `1`) -- the value to use for `q`. If + ``q`` is ``None``, then a ring (or fraction field) of + polynomials in ``q`` is created. EXAMPLES:: diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index ca0f15d94d2..ba0399a1566 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -711,17 +711,22 @@ def principal_specialization(self, n=infinity, q=None): r""" Return the principal specialization of a symmetric function. - The *principal specialization* of order `n` is the ring - homomorphism from the ring of symmetric functions to another - commutative ring `R` given by `x_i \mapsto q^{i-1}` for - `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. - Here, `q` is a given element of `R`. - (To be more precise, it is a `K`-algebra homomorphism, - where `K` is the base ring.) + The *principal specialization* of order `n` at `q` + is the ring homomorphism `ps_{n,q}` from the ring of + symmetric functions to another commutative ring `R` + given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` + and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`, and we assume that + the variables of our symmetric functions are + `x_1, x_2, x_3, \ldots`. + (To be more precise, `ps_{n,q}` is a `K`-algebra + homomorphism, where `K` is the base ring.) See Section 7.8 of [EnumComb2]_. - The *stable principal specialization* is the ring - homomorphism given by `x_i \mapsto q^{i-1}` for all `i`. + The *stable principal specialization* at `q` is the ring + homomorphism `ps_q` from the ring of symmetric functions + to another commutative ring `R` given by + `x_i \mapsto q^{i-1}` for all `i`. This is well-defined only if the resulting infinite sums converge; thus, in particular, setting `q = 1` in the stable principal specialization is an invalid operation. @@ -744,9 +749,12 @@ def principal_specialization(self, n=infinity, q=None): ps_{n,q}(p_\lambda) = \prod_i (1-q^{n\lambda_i}) / (1-q^{\lambda_i}), - ps_{n,1}(p_\lambda) = n^{len(\lambda)}, + ps_{n,1}(p_\lambda) = n^{\ell(\lambda)}, - ps_q(p_\lambda) = 1 / \prod_i (1-q^{\lambda_i}). + ps_q(p_\lambda) = 1 / \prod_i (1-q^{\lambda_i}), + + where `\ell(\lambda)` denotes the length of `\lambda`, + and where the products range from `i=1` to `i=\ell(\lambda)`. EXAMPLES:: @@ -807,36 +815,51 @@ def exponential_specialization(self, t=None, q=1): r""" Return the exponential specialization of a symmetric function. - The exponential specialization `ex` is the ring homomorphism - defined on the basis of powersum symmetric functions by - setting `p_1 = t` and `p_n = 0` for `n > 1`. Equivalently, - on the basis of homogeneous functions it is given by `ex(h_n) - = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. - - By analogy, the `q`-exponential specialization is a ring - homomorphism defined on the complete homogeneous symmetric - functions `f` by + The *exponential specialization* `ex` at `t` is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R`. + It is defined whenever the base ring `K` is a + `\QQ`-algebra and `t` is an element of `R`. + The easiest way to define it is by specifying its + values on the powersum symmetric functions to be + `p_1 = t` and `p_n = 0` for `n > 1`. + Equivalently, on the homogeneous functions it is + given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of + [EnumComb2]_. + + By analogy, the `q`-exponential specialization is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R` that + depends on two elements `t` and `q` of `R` for which + the elements `1 - q^i` for all positive integers `i` + are invertible. + It can be defined by specifying its values on the + complete homogeneous symmetric functions to be .. MATH:: ex_q(h_n) = t^n / [n]_q!, - where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` + where `[n]_q!` is the `q`-factorial. Equivalently, for + `q \neq 1` and a homogeneous symmetric function `f` of + degree `n`, we have .. MATH:: ex_q(f) = (1-q)^n t^n ps_q(f), - where `ps_q(f)` is the stable principal specialization of `f`. + where `ps_q(f)` is the stable principal specialization of `f` + (see :meth:`principal_specialization`). + (See (7.29) in [EnumComb2]_.) INPUT: - - ``t`` (default: None) -- the value to use for `t`, the - default is to create a ring of polynomials in ``t``. + - ``t`` (default: ``None``) -- the value to use for `t`; + the default is to create a ring of polynomials in ``t``. - - ``q`` (default: 1) -- the value to use for `q`. If ``q`` - is ``None`` create a ring (or fraction field) of - polynomials in ``q``. + - ``q`` (default: `1`) -- the value to use for `q`. If + ``q`` is ``None``, then a ring (or fraction field) of + polynomials in ``q`` is created. EXAMPLES:: diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 02334fcda33..5421005f0d1 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -579,17 +579,22 @@ def principal_specialization(self, n=infinity, q=None): r""" Return the principal specialization of a symmetric function. - The *principal specialization* of order `n` is the ring - homomorphism from the ring of symmetric functions to another - commutative ring `R` given by `x_i \mapsto q^{i-1}` for - `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. - Here, `q` is a given element of `R`. - (To be more precise, it is a `K`-algebra homomorphism, - where `K` is the base ring.) + The *principal specialization* of order `n` at `q` + is the ring homomorphism `ps_{n,q}` from the ring of + symmetric functions to another commutative ring `R` + given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` + and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`, and we assume that + the variables of our symmetric functions are + `x_1, x_2, x_3, \ldots`. + (To be more precise, `ps_{n,q}` is a `K`-algebra + homomorphism, where `K` is the base ring.) See Section 7.8 of [EnumComb2]_. - The *stable principal specialization* is the ring - homomorphism given by `x_i \mapsto q^{i-1}` for all `i`. + The *stable principal specialization* at `q` is the ring + homomorphism `ps_q` from the ring of symmetric functions + to another commutative ring `R` given by + `x_i \mapsto q^{i-1}` for all `i`. This is well-defined only if the resulting infinite sums converge; thus, in particular, setting `q = 1` in the stable principal specialization is an invalid operation. @@ -618,14 +623,14 @@ def principal_specialization(self, n=infinity, q=None): .. MATH:: - ps_q(s_\lambda) = q^{\sum_i i\lambda_i} / \prod_{u\in\lambda} (1-q^{h(u)}). + ps_q(s_\lambda) = q^{\sum_i (i-1)\lambda_i} / \prod_{u\in\lambda} (1-q^{h(u)}). - Otherwise, we use the formula from Corollary 7.21.2 of [EnumComb2]_, + Otherwise, we use the formula from Theorem 7.21.2 of [EnumComb2]_, .. MATH:: - ps_{n,q}(s_\lambda) = q^{\sum_i i\lambda_i} - \prod_{u\in\lambda} (1-q^{n+c(u)}/(1-q^{h(u)}). + ps_{n,q}(s_\lambda) = q^{\sum_i (i-1)\lambda_i} + \prod_{u\in\lambda} (1-q^{n+c(u)})/(1-q^{h(u)}). EXAMPLES:: @@ -687,15 +692,26 @@ def exponential_specialization(self, t=None, q=1): r""" Return the exponential specialization of a symmetric function. - The exponential specialization `ex` is the ring homomorphism - defined on the basis of powersum symmetric functions by - setting `p_1 = t` and `p_n = 0` for `n > 1`. Equivalently, - on the basis of homogeneous functions it is given by `ex(h_n) - = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. - - By analogy, the `q`-exponential specialization is a ring - homomorphism defined on the complete homogeneous symmetric - functions as + The *exponential specialization* `ex` at `t` is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R`. + It is defined whenever the base ring `K` is a + `\QQ`-algebra and `t` is an element of `R`. + The easiest way to define it is by specifying its + values on the powersum symmetric functions to be + `p_1 = t` and `p_n = 0` for `n > 1`. + Equivalently, on the homogeneous functions it is + given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of + [EnumComb2]_. + + By analogy, the `q`-exponential specialization is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R` that + depends on two elements `t` and `q` of `R` for which + the elements `1 - q^i` for all positive integers `i` + are invertible. + It can be defined by specifying its values on the + complete homogeneous symmetric functions to be .. MATH:: @@ -703,30 +719,32 @@ def exponential_specialization(self, t=None, q=1): where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` and a homogeneous symmetric function `f` of - degree `n`, + degree `n`, we have .. MATH:: ex_q(f) = (1-q)^n t^n ps_q(f), - where `ps_q(f)` is the stable principal specialization of `f`. + where `ps_q(f)` is the stable principal specialization of `f` + (see :meth:`principal_specialization`). + (See (7.29) in [EnumComb2]_.) INPUT: - - ``t`` (default: None) -- the value to use for `t`, the - default is to create a ring of polynomials in ``t``. + - ``t`` (default: ``None``) -- the value to use for `t`; + the default is to create a ring of polynomials in ``t``. - - ``q`` (default: 1) -- the value to use for `q`. If ``q`` - is ``None`` create a ring (or fraction field) of - polynomials in ``q``. + - ``q`` (default: `1`) -- the value to use for `q`. If + ``q`` is ``None``, then a ring (or fraction field) of + polynomials in ``q`` is created. We use the formula in the proof of Corollary 7.21.6 of [EnumComb2]_ .. MATH:: - ex_{q}(s_\lambda) = t^{|\lambda|} q^{\sum_i i\lambda_i} - / \prod_{u\in\lambda} (1 + \dots + q^{h(u)-1}) + ex_{q}(s_\lambda) = t^{|\lambda|} q^{\sum_i (i-1)\lambda_i} + / \prod_{u\in\lambda} (1 + q + q^2 + \dots + q^{h(u)-1}) where `h(u)` is the hook length of a cell `u` in `\lambda`. diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 86612b510c7..feb9828a850 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5443,17 +5443,22 @@ def principal_specialization(self, n=infinity, q=None): r""" Return the principal specialization of a symmetric function. - The *principal specialization* of order `n` is the ring - homomorphism from the ring of symmetric functions to another - commutative ring `R` given by `x_i \mapsto q^{i-1}` for - `i \in \{1,\dots,n\}` and `x_i \mapsto 0` for `i > n`. - Here, `q` is a given element of `R`. - (To be more precise, it is a `K`-algebra homomorphism, - where `K` is the base ring.) + The *principal specialization* of order `n` at `q` + is the ring homomorphism `ps_{n,q}` from the ring of + symmetric functions to another commutative ring `R` + given by `x_i \mapsto q^{i-1}` for `i \in \{1,\dots,n\}` + and `x_i \mapsto 0` for `i > n`. + Here, `q` is a given element of `R`, and we assume that + the variables of our symmetric functions are + `x_1, x_2, x_3, \ldots`. + (To be more precise, `ps_{n,q}` is a `K`-algebra + homomorphism, where `K` is the base ring.) See Section 7.8 of [EnumComb2]_. - The *stable principal specialization* is the ring - homomorphism given by `x_i \mapsto q^{i-1}` for all `i`. + The *stable principal specialization* at `q` is the ring + homomorphism `ps_q` from the ring of symmetric functions + to another commutative ring `R` given by + `x_i \mapsto q^{i-1}` for all `i`. This is well-defined only if the resulting infinite sums converge; thus, in particular, setting `q = 1` in the stable principal specialization is an invalid operation. @@ -5558,6 +5563,12 @@ def principal_specialization(self, n=infinity, q=None): sage: set([b(x).principal_specialization(n=4, q=QQbar.zeta(3)) for b in B]) {-3} + sage: S = SymmetricFunctions(GF(3)) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: m = S.m(); x = m[3,2,1] + sage: set([b(x).principal_specialization(n=4, q=GF(3)(2)) for b in B]) + {-3} # Please replace by correct answer + """ # heuristically, it seems fastest to fall back to the # elementary basis instead of the powersum basis @@ -5568,15 +5579,26 @@ def exponential_specialization(self, t=None, q=1): r""" Return the exponential specialization of a symmetric function. - The exponential specialization `ex` is the ring homomorphism - defined on the basis of powersum symmetric functions by - setting `p_1 = t` and `p_n = 0` for `n > 1`. Equivalently, - on the basis of homogeneous functions it is given by `ex(h_n) - = t^n / n!`, see Proposition 7.8.4 of [EnumComb2]_. - - By analogy, the `q`-exponential specialization is a ring - homomorphism defined on the complete homogeneous symmetric - functions by + The *exponential specialization* `ex` at `t` is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R`. + It is defined whenever the base ring `K` is a + `\QQ`-algebra and `t` is an element of `R`. + The easiest way to define it is by specifying its + values on the powersum symmetric functions to be + `p_1 = t` and `p_n = 0` for `n > 1`. + Equivalently, on the homogeneous functions it is + given by `ex(h_n) = t^n / n!`; see Proposition 7.8.4 of + [EnumComb2]_. + + By analogy, the `q`-exponential specialization is a + `K`-algebra homomorphism from the `K`-algebra of + symmetric functions to another `K`-algebra `R` that + depends on two elements `t` and `q` of `R` for which + the elements `1 - q^i` for all positive integers `i` + are invertible. + It can be defined by specifying its values on the + complete homogeneous symmetric functions to be .. MATH:: @@ -5584,22 +5606,24 @@ def exponential_specialization(self, t=None, q=1): where `[n]_q!` is the `q`-factorial. Equivalently, for `q \neq 1` and a homogeneous symmetric function `f` of - degree `n`, + degree `n`, we have .. MATH:: - ex_q(f) = (1-q)^n t^n ps(f), + ex_q(f) = (1-q)^n t^n ps_q(f), - where `ps(f)` is the stable principal specialization of `f`. + where `ps_q(f)` is the stable principal specialization of `f` + (see :meth:`principal_specialization`). + (See (7.29) in [EnumComb2]_.) INPUT: - - ``t`` (default: None) -- the value to use for `t`, the - default is to create a ring of polynomials in ``t``. + - ``t`` (default: ``None``) -- the value to use for `t`; + the default is to create a ring of polynomials in ``t``. - - ``q`` (default: 1) -- the value to use for `q`. If ``q`` - is ``None`` create a ring (or fraction field) of - polynomials in ``q``. + - ``q`` (default: `1`) -- the value to use for `q`. If + ``q`` is ``None``, then a ring (or fraction field) of + polynomials in ``q`` is created. EXAMPLES:: From 2b2d77a11fd4c1ec4b71894c713cb5092290aac5 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Fri, 24 Apr 2020 14:48:11 +0200 Subject: [PATCH 066/301] use h, not p, as the base ring might not have 1/n --- src/sage/combinat/sf/monomial.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index f6c7e2d60ef..74fc3e856d3 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -363,7 +363,8 @@ def principal_specialization(self, n=infinity, q=None): where `\ell(\lambda)` denotes the length of `\lambda`. - In all other cases, we convert to powersum symmetric functions. + In all other cases, we convert to complete homogeneous + symmetric functions. EXAMPLES:: @@ -388,7 +389,7 @@ def principal_specialization(self, n=infinity, q=None): f = lambda partition: binomial(n, len(partition))*multinomial(partition.to_exp()) return self.parent()._apply_module_morphism(self, f, q.parent()) - return self.parent().realization_of().powersum()(self).principal_specialization(n=n, q=q) + return self.parent().realization_of().homogeneous()(self).principal_specialization(n=n, q=q) def exponential_specialization(self, t=None, q=1): r""" From fc793413912ce162303427b0de0939ce2134fe6f Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Fri, 24 Apr 2020 15:46:05 +0200 Subject: [PATCH 067/301] some doctests for a start --- src/sage/combinat/sf/elementary.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 4597f6ea6e5..3c38c476de7 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -376,6 +376,28 @@ def principal_specialization(self, n=infinity, q=None): sage: e.zero().principal_specialization(3) 0 + sage: e = SymmetricFunctions(GF(3)).e() + sage: a = e[2,1].principal_specialization(n=2, q=GF(3)(2)); a + 0 + sage: a.parent() + Finite Field of size 3 + sage: a = e[1,1].principal_specialization(n=2); a + q^2 + 1 + sage: a.parent() + Univariate Polynomial Ring in q over Finite Field of size 3 + sage: a = e.one().principal_specialization(n=2, q=GF(3)(2)); a + 1 + sage: a.parent() + Finite Field of size 3 + sage: a = e.one().principal_specialization(n=2, q=GF(3)(1)); a + 1 + sage: a.parent() + Finite Field of size 3 + sage: a = e.one().principal_specialization(n=2); a + 1 + sage: a.parent() + Univariate Polynomial Ring in q over Finite Field of size 3 + """ from sage.combinat.q_analogues import q_binomial From bd6ca365ac9918c5118591a72dd325f6c1c48bd0 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Fri, 24 Apr 2020 17:48:27 +0200 Subject: [PATCH 068/301] a bit more doc on q-factorials and ex --- src/sage/combinat/q_analogues.py | 12 ++++++++++-- src/sage/combinat/sf/elementary.py | 2 ++ src/sage/combinat/sf/homogeneous.py | 2 ++ src/sage/combinat/sf/monomial.py | 2 ++ src/sage/combinat/sf/powersum.py | 2 ++ src/sage/combinat/sf/schur.py | 2 ++ src/sage/combinat/sf/sfa.py | 2 ++ 7 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/q_analogues.py b/src/sage/combinat/q_analogues.py index e096fbbaa87..3228b06f354 100644 --- a/src/sage/combinat/q_analogues.py +++ b/src/sage/combinat/q_analogues.py @@ -86,8 +86,16 @@ def q_factorial(n, q=None): """ Return the `q`-analogue of the factorial `n!`. - If `q` is unspecified, then it defaults to using the generator `q` for - a univariate polynomial ring over the integers. + This is the product + + .. MATH:: + + [1]_q [2]_q \cdots [n]_q + = 1 \cdot (1+q) \cdot (1+q+q^2) \cdots (1+q+q^2+\cdots+q^{n-1) . + + If `q` is unspecified, then this function defaults to + using the generator `q` for a univariate polynomial + ring over the integers. EXAMPLES:: diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 3c38c476de7..92fca172b4d 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -468,6 +468,8 @@ def exponential_specialization(self, t=None, q=1): (see :meth:`principal_specialization`). (See (7.29) in [EnumComb2]_.) + The limit of `ex_q` as `q \to 1` is `ex`. + INPUT: - ``t`` (default: ``None``) -- the value to use for `t`; diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index 4e932fbc94a..119bb957ef4 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -356,6 +356,8 @@ def exponential_specialization(self, t=None, q=1): (see :meth:`principal_specialization`). (See (7.29) in [EnumComb2]_.) + The limit of `ex_q` as `q \to 1` is `ex`. + INPUT: - ``t`` (default: ``None``) -- the value to use for `t`; diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index 74fc3e856d3..dce57759ed2 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -432,6 +432,8 @@ def exponential_specialization(self, t=None, q=1): (see :meth:`principal_specialization`). (See (7.29) in [EnumComb2]_.) + The limit of `ex_q` as `q \to 1` is `ex`. + INPUT: - ``t`` (default: ``None``) -- the value to use for `t`; diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index ba0399a1566..67e9fe0641a 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -852,6 +852,8 @@ def exponential_specialization(self, t=None, q=1): (see :meth:`principal_specialization`). (See (7.29) in [EnumComb2]_.) + The limit of `ex_q` as `q \to 1` is `ex`. + INPUT: - ``t`` (default: ``None``) -- the value to use for `t`; diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 5421005f0d1..98459452bd2 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -729,6 +729,8 @@ def exponential_specialization(self, t=None, q=1): (see :meth:`principal_specialization`). (See (7.29) in [EnumComb2]_.) + The limit of `ex_q` as `q \to 1` is `ex`. + INPUT: - ``t`` (default: ``None``) -- the value to use for `t`; diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index feb9828a850..f0ceb33db36 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5616,6 +5616,8 @@ def exponential_specialization(self, t=None, q=1): (see :meth:`principal_specialization`). (See (7.29) in [EnumComb2]_.) + The limit of `ex_q` as `q \to 1` is `ex`. + INPUT: - ``t`` (default: ``None``) -- the value to use for `t`; From fa68592d15c2db0e5dbbd50eed7778f50fb5b3c1 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Fri, 24 Apr 2020 19:19:23 +0200 Subject: [PATCH 069/301] further corrections --- src/sage/combinat/sf/monomial.py | 5 +---- src/sage/combinat/sf/powersum.py | 4 +++- src/sage/combinat/sf/schur.py | 17 ++++++++++------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index dce57759ed2..b3ffa424f36 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -315,8 +315,6 @@ def condition(part): return len(part) > n return self._expand(condition, n, alphabet) -<<<<<<< HEAD -======= def principal_specialization(self, n=infinity, q=None): r""" Return the principal specialization of a symmetric function. @@ -485,8 +483,7 @@ def f(partition): return self.parent()._apply_module_morphism(self, f, t.parent()) - return self.parent().realization_of().powersum()(self).exponential_specialization(t=t, q=q) ->>>>>>> rebase and correct + return self.parent().realization_of().homogeneous()(self).exponential_specialization(t=t, q=q) # Backward compatibility for unpickling from sage.misc.persist import register_unpickle_override diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index 67e9fe0641a..325b6ba3b51 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -804,8 +804,10 @@ def get_variable(ring, name): q_lim = PolynomialRing(self.base_ring(), "q").gen() def f(partition): denom = prod((1-q**part) for part in partition) - if denom: + if denom.is_invertible(): return prod((1-q**(n*part)) for part in partition)/denom + # If denom is not invertible, we need to do the + # computation with universal coefficients instead: quotient = prod((1-q_lim**(n*part))/(1-q_lim**part) for part in partition) return quotient.subs({q_lim: q}) diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 98459452bd2..e8c6c317a31 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -617,7 +617,8 @@ def principal_specialization(self, n=infinity, q=None): ps_{n,1}(s_\lambda) = \prod_{u\in\lambda} (n+c(u)) / h(u), - where `h(u)` is the hook length of a cell `u` in `\lambda`. + where `h(u)` is the hook length of a cell `u` in `\lambda`, + and where `c(u)` is the content of a cell `u` in `\lambda`. For `n=infinity` we use the formula from Corollary 7.21.3 of [EnumComb2]_ @@ -665,7 +666,7 @@ def get_variable(ring, name): if q == 1: if n == infinity: raise ValueError("the stable principal specialization at q=1 is not defined") - f = lambda partition: (prod(n+partition.content(*c) for c in partition.cells()) + f = lambda partition: (prod(n+j-i for (i, j) in partition.cells()) / prod(h for h in partition.hooks())) elif n == infinity: f = lambda partition: (q**sum(i*part for i, part in enumerate(partition)) @@ -675,13 +676,15 @@ def get_variable(ring, name): def f(partition): power = q**sum(i*part for i, part in enumerate(partition)) denom = prod(1-q**h for h in partition.hooks()) - if denom: + if denom.is_invertible(): return (power - * prod(1-q**(n + partition.content(*c)) - for c in partition.cells()) + * prod(1-q**(n+j-i) + for (i, j) in partition.cells()) / denom) - quotient = (prod(1-q_lim**(n + partition.content(*c)) - for c in partition.cells()) + # If denom is not invertible, we need to do the + # computation with universal coefficients instead: + quotient = (prod(1-q_lim**(n+j-i) + for (i, j) in partition.cells()) / prod(1-q_lim**h for h in partition.hooks())) return (power * quotient.subs({q_lim: q})) From 34b78961977e03ec9889729eb54a279450dce6fd Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Fri, 24 Apr 2020 19:40:43 +0200 Subject: [PATCH 070/301] oops, there is no is_invertible in general rings --- src/sage/combinat/sf/powersum.py | 8 +++++--- src/sage/combinat/sf/schur.py | 12 +++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index 325b6ba3b51..a112b73fd53 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -804,12 +804,14 @@ def get_variable(ring, name): q_lim = PolynomialRing(self.base_ring(), "q").gen() def f(partition): denom = prod((1-q**part) for part in partition) - if denom.is_invertible(): + try: + ~denom return prod((1-q**(n*part)) for part in partition)/denom # If denom is not invertible, we need to do the # computation with universal coefficients instead: - quotient = prod((1-q_lim**(n*part))/(1-q_lim**part) for part in partition) - return quotient.subs({q_lim: q}) + except (ZeroDivisionError, NotImplementedError): + quotient = prod((1-q_lim**(n*part))/(1-q_lim**part) for part in partition) + return quotient.subs({q_lim: q}) return self.parent()._apply_module_morphism(self, f, q.parent()) diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index e8c6c317a31..faa3b1827e8 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -676,17 +676,19 @@ def get_variable(ring, name): def f(partition): power = q**sum(i*part for i, part in enumerate(partition)) denom = prod(1-q**h for h in partition.hooks()) - if denom.is_invertible(): + try: + ~denom return (power * prod(1-q**(n+j-i) for (i, j) in partition.cells()) / denom) # If denom is not invertible, we need to do the # computation with universal coefficients instead: - quotient = (prod(1-q_lim**(n+j-i) - for (i, j) in partition.cells()) - / prod(1-q_lim**h for h in partition.hooks())) - return (power * quotient.subs({q_lim: q})) + except (ZeroDivisionError, NotImplementedError): + quotient = (prod(1-q_lim**(n+j-i) + for (i, j) in partition.cells()) + / prod(1-q_lim**h for h in partition.hooks())) + return (power * quotient.subs({q_lim: q})) return self.parent()._apply_module_morphism(self, f, q.parent()) From 7c87d10f27ca78039ad3e4bfb1d01c4012e39052 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Fri, 24 Apr 2020 20:09:09 +0200 Subject: [PATCH 071/301] update references to Grinberg/Reiner (v6 is out) --- src/doc/en/reference/references/index.rst | 2 +- src/sage/combinat/sf/sfa.py | 17 +++++++++++------ src/sage/matroids/matroid.pyx | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index f488f0a8cbb..40038d67665 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -2415,7 +2415,7 @@ REFERENCES: .. [GriRei18] Darij Grinberg, Victor Reiner, *Hopf Algebras in Combinatorics*, - :arxiv:`1409.8356v5`. + :arxiv:`1409.8356v6`. .. [GR1989] \A. M. Garsia, C. Reutenauer. *A decomposition of Solomon's descent algebra.* Adv. Math. **77** (1989). diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index f0ceb33db36..b5b5874d69b 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -782,8 +782,9 @@ def gessel_reutenauer(self, lam): Let `\lambda` be a partition. The *Gessel-Reutenauer symmetric function* `\mathbf{GR}_\lambda` corresponding to `\lambda` is the symmetric function denoted `L_\lambda` in - [GR1993]_ and in Exercise 7.89 of [STA]_. It can be defined - in several ways: + [GR1993]_ and in Exercise 7.89 of [STA]_ and denoted + `\mathbf{GR}_\lambda` in Definition 6.6.34 of [GriRei18_]. + It can be defined in several ways: - It is the sum of the monomials `\mathbf{x}_w` over all words `w` over the alphabet @@ -800,15 +801,15 @@ def gessel_reutenauer(self, lam): - It is the sum of the fundamental quasisymmetric functions `F_{\operatorname{Des} \sigma}` over all - permutations `\sigma` which have cycle type `\lambda`. See + permutations `\sigma` that have cycle type `\lambda`. See :class:`sage.combinat.ncsf_qsym.qsym.QuasiSymmetricFunctions.Fundamental` for the definition of fundamental quasisymmetric functions, and :meth:`~sage.combinat.permutation.Permutation.cycle_type` for that of cycle type. For a permutation `\sigma`, we use `\operatorname{Des} \sigma` to denote the descent composition (:meth:`~sage.combinat.permutation.Permutation.descents_composition`) - of `\sigma`. Again, this definition makes the symmetry - of `\mathbf{GR}_\lambda` far from obvious. + of `\sigma`. Again, this definition does not make the + symmetry of `\mathbf{GR}_\lambda` obvious. - For every positive integer `n`, we have @@ -834,7 +835,9 @@ def gessel_reutenauer(self, lam): `\mathbf{GR}_\lambda` obvious. The equivalences of these three definitions are proven in - [GR1993]_ Sections 2-3. + [GR1993]_ Sections 2-3. (See also [GriRei18]_ Subsection + 6.6.2 for the equivalence of the first two definitions and + further formulas.) INPUT: @@ -855,6 +858,8 @@ def gessel_reutenauer(self, lam): Journal of Combinatorial Theory, Series A, 64 (1993), pp. 189--215. + .. [GriRei18]_ + EXAMPLES: The first few values of `\mathbf{GR}_{(n)} = L_n`:: diff --git a/src/sage/matroids/matroid.pyx b/src/sage/matroids/matroid.pyx index 8c9753554aa..d274d9eec53 100644 --- a/src/sage/matroids/matroid.pyx +++ b/src/sage/matroids/matroid.pyx @@ -6623,7 +6623,7 @@ cdef class Matroid(SageObject): sage: M.is_max_weight_independent_generic() False - Here is an example from [GriRei18]_ (Example 7.4.12 in v5):: + Here is an example from [GriRei18]_ (Example 7.4.12 in v6):: sage: A = Matrix(QQ, [[ 1, 1, 0, 0], ....: [-1, 0, 1, 1], @@ -6781,7 +6781,7 @@ cdef class Matroid(SageObject): sage: M.dual().is_max_weight_coindependent_generic(weights=wt) True - Here is an example from [GriRei18]_ (Example 7.4.12 in v5):: + Here is an example from [GriRei18]_ (Example 7.4.12 in v6):: sage: A = Matrix(QQ, [[ 1, 1, 0, 0], ....: [-1, 0, 1, 1], From 4efc8c4860a8c35974fdfc393aeb559bee716b99 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Sat, 25 Apr 2020 13:40:07 +0200 Subject: [PATCH 072/301] this way? --- src/sage/combinat/sf/monomial.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index b3ffa424f36..a2d94beefc2 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -387,7 +387,7 @@ def principal_specialization(self, n=infinity, q=None): f = lambda partition: binomial(n, len(partition))*multinomial(partition.to_exp()) return self.parent()._apply_module_morphism(self, f, q.parent()) - return self.parent().realization_of().homogeneous()(self).principal_specialization(n=n, q=q) + return self.parent().realization_of().elementary()(self).principal_specialization(n=n, q=q) def exponential_specialization(self, t=None, q=1): r""" @@ -483,7 +483,7 @@ def f(partition): return self.parent()._apply_module_morphism(self, f, t.parent()) - return self.parent().realization_of().homogeneous()(self).exponential_specialization(t=t, q=q) + return self.parent().realization_of().elementary()(self).exponential_specialization(t=t, q=q) # Backward compatibility for unpickling from sage.misc.persist import register_unpickle_override From 9084ab38fee9e83710a17098265edc9a239ddd21 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Fri, 24 Apr 2020 21:08:31 +0200 Subject: [PATCH 073/301] fix two doctests --- src/sage/combinat/sf/elementary.py | 4 ++-- src/sage/combinat/sf/sfa.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 92fca172b4d..ac6f4a483d5 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -381,8 +381,8 @@ def principal_specialization(self, n=infinity, q=None): 0 sage: a.parent() Finite Field of size 3 - sage: a = e[1,1].principal_specialization(n=2); a - q^2 + 1 + sage: a = e[1,1,1].principal_specialization(n=2); a + q^3 + 1 sage: a.parent() Univariate Polynomial Ring in q over Finite Field of size 3 sage: a = e.one().principal_specialization(n=2, q=GF(3)(2)); a diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index b5b5874d69b..a9c2f786d0e 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5572,7 +5572,7 @@ def principal_specialization(self, n=infinity, q=None): sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] sage: m = S.m(); x = m[3,2,1] sage: set([b(x).principal_specialization(n=4, q=GF(3)(2)) for b in B]) - {-3} # Please replace by correct answer + {1} """ # heuristically, it seems fastest to fall back to the From d0be31457016a3097f21ddccdee6a8ee89193672 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Sat, 25 Apr 2020 17:35:46 +0200 Subject: [PATCH 074/301] replacing ring[name] --- src/sage/combinat/sf/elementary.py | 6 ++++-- src/sage/combinat/sf/homogeneous.py | 6 ++++-- src/sage/combinat/sf/monomial.py | 3 ++- src/sage/combinat/sf/powersum.py | 6 ++++-- src/sage/combinat/sf/schur.py | 6 ++++-- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index ac6f4a483d5..4a8ab9dd87d 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -405,7 +405,8 @@ def get_variable(ring, name): try: ring(name) except TypeError: - return ring[name].gen() + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() else: raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) @@ -501,7 +502,8 @@ def get_variable(ring, name): try: ring(name) except TypeError: - return ring[name].gen() + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() else: raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index 119bb957ef4..cdff9116db5 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -296,7 +296,8 @@ def get_variable(ring, name): try: ring(name) except TypeError: - return ring[name].gen() + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() else: raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) @@ -398,7 +399,8 @@ def get_variable(ring, name): try: ring(name) except TypeError: - return ring[name].gen() + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() else: raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index a2d94beefc2..788a0903ca4 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -466,7 +466,8 @@ def get_variable(ring, name): try: ring(name) except TypeError: - return ring[name].gen() + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() else: raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index a112b73fd53..fc02927d72a 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -787,7 +787,8 @@ def get_variable(ring, name): try: ring(name) except TypeError: - return ring[name].gen() + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() else: raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) @@ -892,7 +893,8 @@ def get_variable(ring, name): try: ring(name) except TypeError: - return ring[name].gen() + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() else: raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index faa3b1827e8..373d89bda61 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -657,7 +657,8 @@ def get_variable(ring, name): try: ring(name) except TypeError: - return ring[name].gen() + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() else: raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) @@ -790,7 +791,8 @@ def get_variable(ring, name): try: ring(name) except TypeError: - return ring[name].gen() + from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing + return PolynomialRing(ring, name).gen() else: raise ValueError("the variable %s is in the base ring, pass it explicitly" % name) From 8c288fa19272f7c43d9cbaf3af59f9b66243bd65 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Sat, 25 Apr 2020 21:24:36 +0200 Subject: [PATCH 075/301] fix doctest, fix comments --- src/sage/combinat/sf/monomial.py | 8 +++++++- src/sage/combinat/sf/sfa.py | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index 788a0903ca4..d34de07096d 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -373,7 +373,7 @@ def principal_specialization(self, n=infinity, q=None): sage: x = 5*m[2] + 3*m[1] + 1 sage: x.principal_specialization(3, q=var("q")) - 5*(q^6 - 1)/(q^2 - 1) + 3*(q^3 - 1)/(q - 1) + 1 + -10*(q^3 - 1)*q/(q - 1) + 5*(q^3 - 1)^2/(q - 1)^2 + 3*(q^3 - 1)/(q - 1) + 1 TESTS:: @@ -387,6 +387,9 @@ def principal_specialization(self, n=infinity, q=None): f = lambda partition: binomial(n, len(partition))*multinomial(partition.to_exp()) return self.parent()._apply_module_morphism(self, f, q.parent()) + # heuristically, it seems fastest to fall back to the + # elementary basis - using the powersum basis would + # introduce singularities, because it is not a Z-basis return self.parent().realization_of().elementary()(self).principal_specialization(n=n, q=q) def exponential_specialization(self, t=None, q=1): @@ -484,6 +487,9 @@ def f(partition): return self.parent()._apply_module_morphism(self, f, t.parent()) + # heuristically, it seems fastest to fall back to the + # elementary basis - using the powersum basis would + # introduce singularities, because it is not a Z-basis return self.parent().realization_of().elementary()(self).exponential_specialization(t=t, q=q) # Backward compatibility for unpickling diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index a9c2f786d0e..76f906d71db 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5576,7 +5576,8 @@ def principal_specialization(self, n=infinity, q=None): """ # heuristically, it seems fastest to fall back to the - # elementary basis instead of the powersum basis + # elementary basis - using the powersum basis would + # introduce singularities, because it is not a Z-basis e = self.parent().realization_of().elementary() return e(self).principal_specialization(n, q=q) @@ -5671,7 +5672,8 @@ def exponential_specialization(self, t=None, q=1): """ # heuristically, it seems fastest to fall back to the - # elementary basis instead of the powersum basis + # elementary basis - using the powersum basis would + # introduce singularities, because it is not a Z-basis e = self.parent().realization_of().elementary() return e(self).exponential_specialization(t=t, q=q) From c37c530505daaa7e701cdfacf498007457c12b07 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Sat, 25 Apr 2020 22:05:23 +0200 Subject: [PATCH 076/301] test battery for principal_specialization --- src/sage/combinat/sf/elementary.py | 22 -------- src/sage/combinat/sf/sfa.py | 89 +++++++++++++++++++++++++++++- 2 files changed, 88 insertions(+), 23 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index 4a8ab9dd87d..cdc6da8f29e 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -376,28 +376,6 @@ def principal_specialization(self, n=infinity, q=None): sage: e.zero().principal_specialization(3) 0 - sage: e = SymmetricFunctions(GF(3)).e() - sage: a = e[2,1].principal_specialization(n=2, q=GF(3)(2)); a - 0 - sage: a.parent() - Finite Field of size 3 - sage: a = e[1,1,1].principal_specialization(n=2); a - q^3 + 1 - sage: a.parent() - Univariate Polynomial Ring in q over Finite Field of size 3 - sage: a = e.one().principal_specialization(n=2, q=GF(3)(2)); a - 1 - sage: a.parent() - Finite Field of size 3 - sage: a = e.one().principal_specialization(n=2, q=GF(3)(1)); a - 1 - sage: a.parent() - Finite Field of size 3 - sage: a = e.one().principal_specialization(n=2); a - 1 - sage: a.parent() - Univariate Polynomial Ring in q over Finite Field of size 3 - """ from sage.combinat.q_analogues import q_binomial diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 76f906d71db..4f8c551f02b 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5569,11 +5569,98 @@ def principal_specialization(self, n=infinity, q=None): {-3} sage: S = SymmetricFunctions(GF(3)) - sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: B = [S.m(), S.e(), S.h(), S.s(), S.f()] sage: m = S.m(); x = m[3,2,1] sage: set([b(x).principal_specialization(n=4, q=GF(3)(2)) for b in B]) {1} + sage: S = SymmetricFunctions(Zmod(4)) + sage: B = [S.m(), S.e(), S.h(), S.s(), S.f()] + sage: m = S.m(); x = m[3,2,1] + sage: set([b(x).principal_specialization(n=4, q=Zmod(4)(2)) for b in B]) + {0} + sage: y = m[3,1] + sage: set([b(y).principal_specialization(n=4, q=Zmod(4)(2)) for b in B]) + {2} + + Check that parents are correct over `\mathbb{F}_3`:: + + sage: S = SymmetricFunctions(GF(3)) + sage: B = [S.m(), S.e(), S.h(), S.s(), S.f()] + sage: lams = [Partition([]), Partition([1]), Partition([2,1])] + sage: set(b[lam].principal_specialization(n=2, q=GF(3)(0)).parent() for b in B for lam in lams) + {Finite Field of size 3} + sage: set(b[lam].principal_specialization(n=2, q=GF(3)(1)).parent() for b in B for lam in lams) + {Finite Field of size 3} + sage: set(b[lam].principal_specialization(n=2, q=GF(3)(2)).parent() for b in B for lam in lams) + {Finite Field of size 3} + sage: set(b[lam].principal_specialization(n=2).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Finite Field of size 3} + sage: set(b[lam].principal_specialization().parent() for b in B for lam in lams) + {Fraction Field of Univariate Polynomial Ring in q over Finite Field of size 3} + + sage: a = S.e()[2,1].principal_specialization(n=2, q=GF(3)(2)); a + 0 + sage: a = S.e()[1,1,1].principal_specialization(n=2); a + q^3 + 1 + + sage: set(b.one().principal_specialization(n=2, q=GF(3)(2)) for b in B) + {1} + sage: set(b.one().principal_specialization(n=2, q=GF(3)(1)) for b in B) + {1} + sage: set(b.one().principal_specialization(n=2) for b in B) + {1} + sage: set(b.one().principal_specialization() for b in B) + {1} + + Check that parents are correct over the integer ring:: + + sage: S = SymmetricFunctions(ZZ) + sage: B = [S.m(), S.e(), S.h(), S.s(), S.f()] + sage: lams = [Partition([]), Partition([1]), Partition([2,1])] + sage: set(b[lam].principal_specialization(n=2, q=0).parent() for b in B for lam in lams) + {Integer Ring} + sage: set(b[lam].principal_specialization(n=2, q=1).parent() for b in B for lam in lams) + {Integer Ring} + sage: set(b[lam].principal_specialization(n=2, q=2).parent() for b in B for lam in lams) + {Integer Ring} + sage: set(b[lam].principal_specialization(n=2).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Integer Ring} + sage: set(b[lam].principal_specialization().parent() for b in B for lam in lams) + {Fraction Field of Univariate Polynomial Ring in q over Integer Ring} + + Check that parents are correct over a polynomial ring:: + + sage: P = PolynomialRing(ZZ, "q") + sage: q = P.gen() + sage: S = SymmetricFunctions(P) + sage: B = [S.m(), S.e(), S.h(), S.s(), S.f()] + sage: lams = [Partition([]), Partition([1]), Partition([2,1])] + sage: set(b[lam].principal_specialization(n=2, q=P(0)).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Integer Ring} + sage: set(b[lam].principal_specialization(n=2, q=P(1)).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Integer Ring} + sage: set(b[lam].principal_specialization(n=2, q=P(2)).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Integer Ring} + sage: set(b[lam].principal_specialization(n=2, q=q).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Integer Ring} + sage: set(b[lam].principal_specialization(q=q).parent() for b in B for lam in lams) + {Fraction Field of Univariate Polynomial Ring in q over Integer Ring} + + sage: a = S.e()[2,1].principal_specialization(n=2, q=2); a + 6 + sage: a = S.e()[2,1].principal_specialization(n=2, q=q); a + q**2 + q + + sage: set(b.one().principal_specialization(n=2, q=P(2)) for b in B) + {1} + sage: set(b.one().principal_specialization(n=2, q=P(1)) for b in B) + {1} + sage: set(b.one().principal_specialization(n=2, q=q) for b in B) + {1} + sage: set(b.one().principal_specialization(q=q) for b in B) + {1} + """ # heuristically, it seems fastest to fall back to the # elementary basis - using the powersum basis would From 1ab1097f1aa12b10f1144e7e3b02bd349b0e8026 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Sat, 25 Apr 2020 23:37:57 +0200 Subject: [PATCH 077/301] attempt at fixing schur principal_spec --- src/sage/combinat/sf/schur.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 373d89bda61..17938743f66 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -673,8 +673,11 @@ def get_variable(ring, name): f = lambda partition: (q**sum(i*part for i, part in enumerate(partition)) / prod(1-q**h for h in partition.hooks())) else: - q_lim = PolynomialRing(self.base_ring(), "q").gen() + ZZq = PolynomialRing(ZZ, "q").gen() + q_lim = ZZq.gen() def f(partition): + if n < len(partition): + return 0 power = q**sum(i*part for i, part in enumerate(partition)) denom = prod(1-q**h for h in partition.hooks()) try: @@ -686,8 +689,8 @@ def f(partition): # If denom is not invertible, we need to do the # computation with universal coefficients instead: except (ZeroDivisionError, NotImplementedError): - quotient = (prod(1-q_lim**(n+j-i) - for (i, j) in partition.cells()) + quotient = ZZq((prod(1-q_lim**(n+j-i) + for (i, j) in partition.cells())) / prod(1-q_lim**h for h in partition.hooks())) return (power * quotient.subs({q_lim: q})) From d67dadd25d965fc77746dba6dc2f61041b915528 Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Sun, 26 Apr 2020 00:03:34 +0200 Subject: [PATCH 078/301] fix quotients --- src/sage/combinat/sf/schur.py | 20 +++++++++++--------- src/sage/combinat/sf/sfa.py | 20 ++++++++++++++------ 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 17938743f66..4e020edcd77 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -668,12 +668,13 @@ def get_variable(ring, name): if n == infinity: raise ValueError("the stable principal specialization at q=1 is not defined") f = lambda partition: (prod(n+j-i for (i, j) in partition.cells()) - / prod(h for h in partition.hooks())) + // prod(h for h in partition.hooks())) elif n == infinity: f = lambda partition: (q**sum(i*part for i, part in enumerate(partition)) / prod(1-q**h for h in partition.hooks())) else: - ZZq = PolynomialRing(ZZ, "q").gen() + from sage.rings.integer_ring import ZZ + ZZq = PolynomialRing(ZZ, "q") q_lim = ZZq.gen() def f(partition): if n < len(partition): @@ -682,13 +683,14 @@ def f(partition): denom = prod(1-q**h for h in partition.hooks()) try: ~denom - return (power - * prod(1-q**(n+j-i) - for (i, j) in partition.cells()) - / denom) - # If denom is not invertible, we need to do the - # computation with universal coefficients instead: - except (ZeroDivisionError, NotImplementedError): + rational = (power + * prod(1-q**(n+j-i) + for (i, j) in partition.cells()) + / denom) + return q.parent()(rational) + except (ZeroDivisionError, NotImplementedError, TypeError): + # If denom is not invertible, we need to do the + # computation with universal coefficients instead: quotient = ZZq((prod(1-q_lim**(n+j-i) for (i, j) in partition.cells())) / prod(1-q_lim**h for h in partition.hooks())) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 4f8c551f02b..a97cafa3b5f 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5582,6 +5582,9 @@ def principal_specialization(self, n=infinity, q=None): sage: y = m[3,1] sage: set([b(y).principal_specialization(n=4, q=Zmod(4)(2)) for b in B]) {2} + sage: z = m[1,1] + sage: set([b(z).principal_specialization(n=4) for b in B]) + {q^5 + q^4 + 2*q^3 + q^2 + q} Check that parents are correct over `\mathbb{F}_3`:: @@ -5597,13 +5600,14 @@ def principal_specialization(self, n=infinity, q=None): sage: set(b[lam].principal_specialization(n=2).parent() for b in B for lam in lams) {Univariate Polynomial Ring in q over Finite Field of size 3} sage: set(b[lam].principal_specialization().parent() for b in B for lam in lams) - {Fraction Field of Univariate Polynomial Ring in q over Finite Field of size 3} + {Fraction Field of Univariate Polynomial Ring in q over Finite Field of size 3, + Univariate Polynomial Ring in q over Finite Field of size 3} sage: a = S.e()[2,1].principal_specialization(n=2, q=GF(3)(2)); a 0 sage: a = S.e()[1,1,1].principal_specialization(n=2); a q^3 + 1 - + sage: set(b.one().principal_specialization(n=2, q=GF(3)(2)) for b in B) {1} sage: set(b.one().principal_specialization(n=2, q=GF(3)(1)) for b in B) @@ -5627,7 +5631,9 @@ def principal_specialization(self, n=infinity, q=None): sage: set(b[lam].principal_specialization(n=2).parent() for b in B for lam in lams) {Univariate Polynomial Ring in q over Integer Ring} sage: set(b[lam].principal_specialization().parent() for b in B for lam in lams) - {Fraction Field of Univariate Polynomial Ring in q over Integer Ring} + {Fraction Field of Univariate Polynomial Ring in q over Integer Ring, + Univariate Polynomial Ring in q over Integer Ring, + Univariate Polynomial Ring in q over Rational Field} Check that parents are correct over a polynomial ring:: @@ -5645,13 +5651,15 @@ def principal_specialization(self, n=infinity, q=None): sage: set(b[lam].principal_specialization(n=2, q=q).parent() for b in B for lam in lams) {Univariate Polynomial Ring in q over Integer Ring} sage: set(b[lam].principal_specialization(q=q).parent() for b in B for lam in lams) - {Fraction Field of Univariate Polynomial Ring in q over Integer Ring} + {Fraction Field of Univariate Polynomial Ring in q over Integer Ring, + Univariate Polynomial Ring in q over Integer Ring, + Univariate Polynomial Ring in q over Rational Field} sage: a = S.e()[2,1].principal_specialization(n=2, q=2); a 6 sage: a = S.e()[2,1].principal_specialization(n=2, q=q); a - q**2 + q - + q^2 + q + sage: set(b.one().principal_specialization(n=2, q=P(2)) for b in B) {1} sage: set(b.one().principal_specialization(n=2, q=P(1)) for b in B) From b283d231be19a63f0df2fb5eb7e94b456ac523bc Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Sun, 26 Apr 2020 00:12:48 +0200 Subject: [PATCH 079/301] similar changes to powersum --- src/sage/combinat/sf/powersum.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index fc02927d72a..1c3b50edb74 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -802,16 +802,19 @@ def get_variable(ring, name): elif n == infinity: f = lambda partition: prod(1/(1-q**part) for part in partition) else: - q_lim = PolynomialRing(self.base_ring(), "q").gen() + from sage.rings.integer_ring import ZZ + ZZq = PolynomialRing(ZZ, "q") + q_lim = ZZq.gen() def f(partition): denom = prod((1-q**part) for part in partition) try: ~denom - return prod((1-q**(n*part)) for part in partition)/denom - # If denom is not invertible, we need to do the - # computation with universal coefficients instead: - except (ZeroDivisionError, NotImplementedError): - quotient = prod((1-q_lim**(n*part))/(1-q_lim**part) for part in partition) + rational = prod((1-q**(n*part)) for part in partition)/denom + return q.parent()(rational) + except (ZeroDivisionError, NotImplementedError, TypeError): + # If denom is not invertible, we need to do the + # computation with universal coefficients instead: + quotient = ZZq(prod((1-q_lim**(n*part))/(1-q_lim**part) for part in partition)) return quotient.subs({q_lim: q}) return self.parent()._apply_module_morphism(self, f, q.parent()) From 0e2f95ce92868be51c8c8b21ebfe1a6b74f52eda Mon Sep 17 00:00:00 2001 From: Martin Rubey Date: Sun, 26 Apr 2020 00:13:50 +0200 Subject: [PATCH 080/301] add doctests for powersums --- src/sage/combinat/sf/sfa.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index a97cafa3b5f..1ad966a36b1 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5569,19 +5569,20 @@ def principal_specialization(self, n=infinity, q=None): {-3} sage: S = SymmetricFunctions(GF(3)) - sage: B = [S.m(), S.e(), S.h(), S.s(), S.f()] + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] sage: m = S.m(); x = m[3,2,1] sage: set([b(x).principal_specialization(n=4, q=GF(3)(2)) for b in B]) {1} sage: S = SymmetricFunctions(Zmod(4)) - sage: B = [S.m(), S.e(), S.h(), S.s(), S.f()] + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] sage: m = S.m(); x = m[3,2,1] sage: set([b(x).principal_specialization(n=4, q=Zmod(4)(2)) for b in B]) {0} sage: y = m[3,1] sage: set([b(y).principal_specialization(n=4, q=Zmod(4)(2)) for b in B]) {2} + sage: B = [S.m(), S.e(), S.h(), S.s(), S.f()] sage: z = m[1,1] sage: set([b(z).principal_specialization(n=4) for b in B]) {q^5 + q^4 + 2*q^3 + q^2 + q} @@ -5589,7 +5590,7 @@ def principal_specialization(self, n=infinity, q=None): Check that parents are correct over `\mathbb{F}_3`:: sage: S = SymmetricFunctions(GF(3)) - sage: B = [S.m(), S.e(), S.h(), S.s(), S.f()] + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] sage: lams = [Partition([]), Partition([1]), Partition([2,1])] sage: set(b[lam].principal_specialization(n=2, q=GF(3)(0)).parent() for b in B for lam in lams) {Finite Field of size 3} @@ -5620,7 +5621,7 @@ def principal_specialization(self, n=infinity, q=None): Check that parents are correct over the integer ring:: sage: S = SymmetricFunctions(ZZ) - sage: B = [S.m(), S.e(), S.h(), S.s(), S.f()] + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] sage: lams = [Partition([]), Partition([1]), Partition([2,1])] sage: set(b[lam].principal_specialization(n=2, q=0).parent() for b in B for lam in lams) {Integer Ring} @@ -5640,7 +5641,7 @@ def principal_specialization(self, n=infinity, q=None): sage: P = PolynomialRing(ZZ, "q") sage: q = P.gen() sage: S = SymmetricFunctions(P) - sage: B = [S.m(), S.e(), S.h(), S.s(), S.f()] + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] sage: lams = [Partition([]), Partition([1]), Partition([2,1])] sage: set(b[lam].principal_specialization(n=2, q=P(0)).parent() for b in B for lam in lams) {Univariate Polynomial Ring in q over Integer Ring} From e16d5249d729fa50350a8f7e1a4d3b6c4aedfe79 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Sun, 26 Apr 2020 00:55:51 +0200 Subject: [PATCH 081/301] attempt at a test battery for exponential specialization --- src/sage/combinat/sf/elementary.py | 4 +- src/sage/combinat/sf/homogeneous.py | 4 +- src/sage/combinat/sf/monomial.py | 4 +- src/sage/combinat/sf/powersum.py | 4 +- src/sage/combinat/sf/schur.py | 4 +- src/sage/combinat/sf/sfa.py | 57 ++++++++++++++++++++++++++++- 6 files changed, 71 insertions(+), 6 deletions(-) diff --git a/src/sage/combinat/sf/elementary.py b/src/sage/combinat/sf/elementary.py index cdc6da8f29e..678e065d96b 100644 --- a/src/sage/combinat/sf/elementary.py +++ b/src/sage/combinat/sf/elementary.py @@ -408,7 +408,9 @@ def get_variable(ring, name): def exponential_specialization(self, t=None, q=1): r""" - Return the exponential specialization of a symmetric function. + Return the exponential specialization of a + symmetric function (when `q = 1`), or the + `q`-exponential specialization (when `q \neq 1`). The *exponential specialization* `ex` at `t` is a `K`-algebra homomorphism from the `K`-algebra of diff --git a/src/sage/combinat/sf/homogeneous.py b/src/sage/combinat/sf/homogeneous.py index cdff9116db5..497e30bf709 100644 --- a/src/sage/combinat/sf/homogeneous.py +++ b/src/sage/combinat/sf/homogeneous.py @@ -318,7 +318,9 @@ def get_variable(ring, name): def exponential_specialization(self, t=None, q=1): r""" - Return the exponential specialization of a symmetric function. + Return the exponential specialization of a + symmetric function (when `q = 1`), or the + `q`-exponential specialization (when `q \neq 1`). The *exponential specialization* `ex` at `t` is a `K`-algebra homomorphism from the `K`-algebra of diff --git a/src/sage/combinat/sf/monomial.py b/src/sage/combinat/sf/monomial.py index d34de07096d..1fe6fe1729e 100644 --- a/src/sage/combinat/sf/monomial.py +++ b/src/sage/combinat/sf/monomial.py @@ -394,7 +394,9 @@ def principal_specialization(self, n=infinity, q=None): def exponential_specialization(self, t=None, q=1): r""" - Return the exponential specialization of a symmetric function. + Return the exponential specialization of a + symmetric function (when `q = 1`), or the + `q`-exponential specialization (when `q \neq 1`). The *exponential specialization* `ex` at `t` is a `K`-algebra homomorphism from the `K`-algebra of diff --git a/src/sage/combinat/sf/powersum.py b/src/sage/combinat/sf/powersum.py index 1c3b50edb74..63cd8165d76 100644 --- a/src/sage/combinat/sf/powersum.py +++ b/src/sage/combinat/sf/powersum.py @@ -821,7 +821,9 @@ def f(partition): def exponential_specialization(self, t=None, q=1): r""" - Return the exponential specialization of a symmetric function. + Return the exponential specialization of a + symmetric function (when `q = 1`), or the + `q`-exponential specialization (when `q \neq 1`). The *exponential specialization* `ex` at `t` is a `K`-algebra homomorphism from the `K`-algebra of diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index 4e020edcd77..a45c28ea5a1 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -701,7 +701,9 @@ def f(partition): def exponential_specialization(self, t=None, q=1): r""" - Return the exponential specialization of a symmetric function. + Return the exponential specialization of a + symmetric function (when `q = 1`), or the + `q`-exponential specialization (when `q \neq 1`). The *exponential specialization* `ex` at `t` is a `K`-algebra homomorphism from the `K`-algebra of diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 1ad966a36b1..a7898a7d40c 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5679,7 +5679,9 @@ def principal_specialization(self, n=infinity, q=None): def exponential_specialization(self, t=None, q=1): r""" - Return the exponential specialization of a symmetric function. + Return the exponential specialization of a + symmetric function (when `q = 1`), or the + `q`-exponential specialization (when `q \neq 1`). The *exponential specialization* `ex` at `t` is a `K`-algebra homomorphism from the `K`-algebra of @@ -5734,6 +5736,17 @@ def exponential_specialization(self, t=None, q=1): sage: m = SymmetricFunctions(QQ).m() sage: (m[2,1]+m[1,1]).exponential_specialization() 1/2*t^2 + sage: (m[2,1]+m[1,1]).exponential_specialization(q=None) + t**2 * (1 - q)/(1 + q) + sage: Qq = PolynomialRing(QQ, "q"); q = Qq.gen() + sage: (m[2,1]+m[1,1]).exponential_specialization(q=q) + t**2 * (1 - q)/(1 + q) + sage: Qt = PolynomialRing(QQ, "t"); t = Qt.gen() + sage: (m[2,1]+m[1,1]).exponential_specialization(t=t) + t**2 * (1 - q)/(1 + q) + sage: Qqt = PolynomialRing(QQ, ["q", "t"]); q, t = Qqt.gens() + sage: (m[2,1]+m[1,1]).exponential_specialization(q=q, t=t) + t**2 * (1 - q)/(1 + q) sage: x = m[3]+m[2,1]+m[1,1,1] sage: d = x.homogeneous_degree() @@ -5766,6 +5779,48 @@ def exponential_specialization(self, t=None, q=1): sage: len(set([b(x).exponential_specialization(t=2) for b in B])) 1 + Check that parents are correct over `\mathbb{F}_3`:: + + sage: S = SymmetricFunctions(GF(3)) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: lams = [Partition([]), Partition([1]), Partition([2,1])] + sage: set(b[lam].exponential_specialization(q=None).parent() for b in B for lam in lams) + {Fraction Field of Univariate Polynomial Ring in t over + Univariate Polynomial Ring in q over Finite Field of size 3, + Univariate Polynomial Ring in t over Univariate Polynomial Ring in q + over Finite Field of size 3} + sage: P2 = PolynomialRing(GF(3), ["q", "t"]) + sage: q2, t2 = P2.gens() + sage: set(b[lam].exponential_specialization(q=q2, t=t2).parent() for b in B for lam in lams) + {Fraction Field of Multivariate Polynomial Ring in q, t over Finite Field of size 3, + Multivariate Polynomial Ring in q, t over Finite Field of size 3} + + Check that parents are correct over `\QQ` for `q = 1`:: + + sage: S = SymmetricFunctions(QQ) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: lams = [Partition([]), Partition([1]), Partition([2,1])] + sage: set(b[lam].exponential_specialization(q=1).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in t over Rational Field} + sage: set(b[lam].exponential_specialization(q=1, t=1).parent() for b in B for lam in lams) + {Rational Field} + sage: P2 = PolynomialRing(QQ, ["q", "t"]) + sage: q2, t2 = P2.gens() + sage: set(b[lam].exponential_specialization(q=1, t=t2).parent() for b in B for lam in lams) + {Multivariate Polynomial Ring in q, t over Rational Field} + + Check that parents are correct over a polynomial ring:: + + sage: P = PolynomialRing(QQ, "q") + sage: q = P.gen() + sage: S = SymmetricFunctions(P) + sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] + sage: lams = [Partition([]), Partition([1]), Partition([2,1])] + sage: set(b[lam].exponential_specialization(q=q).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in t over + Univariate Polynomial Ring in q over Rational Field} + sage: set(b[lam].exponential_specialization(q=q, t=1).parent() for b in B for lam in lams) + {Univariate Polynomial Ring in q over Integer Ring} """ # heuristically, it seems fastest to fall back to the # elementary basis - using the powersum basis would From 97777402bbb51b0592e2b53bfb06fbea583a8def Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Sun, 26 Apr 2020 09:29:35 +0200 Subject: [PATCH 082/301] fix doctests --- src/sage/combinat/sf/sfa.py | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index a7898a7d40c..57a829c5403 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5736,17 +5736,17 @@ def exponential_specialization(self, t=None, q=1): sage: m = SymmetricFunctions(QQ).m() sage: (m[2,1]+m[1,1]).exponential_specialization() 1/2*t^2 - sage: (m[2,1]+m[1,1]).exponential_specialization(q=None) - t**2 * (1 - q)/(1 + q) + sage: m[1,1].exponential_specialization(q=None) + 1/2*t^2 sage: Qq = PolynomialRing(QQ, "q"); q = Qq.gen() - sage: (m[2,1]+m[1,1]).exponential_specialization(q=q) - t**2 * (1 - q)/(1 + q) + sage: m[1,1].exponential_specialization(q=q) + t^2 * (1 - q)/(1 + q) sage: Qt = PolynomialRing(QQ, "t"); t = Qt.gen() - sage: (m[2,1]+m[1,1]).exponential_specialization(t=t) - t**2 * (1 - q)/(1 + q) + sage: m[1,1].exponential_specialization(t=t) + 1/2*t^2 sage: Qqt = PolynomialRing(QQ, ["q", "t"]); q, t = Qqt.gens() - sage: (m[2,1]+m[1,1]).exponential_specialization(q=q, t=t) - t**2 * (1 - q)/(1 + q) + sage: m[1,1].exponential_specialization(q=q, t=t) + t^2 * (1 - q)/(1 + q) sage: x = m[3]+m[2,1]+m[1,1,1] sage: d = x.homogeneous_degree() @@ -5785,10 +5785,10 @@ def exponential_specialization(self, t=None, q=1): sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] sage: lams = [Partition([]), Partition([1]), Partition([2,1])] sage: set(b[lam].exponential_specialization(q=None).parent() for b in B for lam in lams) - {Fraction Field of Univariate Polynomial Ring in t over - Univariate Polynomial Ring in q over Finite Field of size 3, - Univariate Polynomial Ring in t over Univariate Polynomial Ring in q - over Finite Field of size 3} + {Univariate Polynomial Ring in t over Fraction Field + of Univariate Polynomial Ring in q over Finite Field of size 3, + Univariate Polynomial Ring in t over Univariate Polynomial Ring + in q over Finite Field of size 3} sage: P2 = PolynomialRing(GF(3), ["q", "t"]) sage: q2, t2 = P2.gens() sage: set(b[lam].exponential_specialization(q=q2, t=t2).parent() for b in B for lam in lams) @@ -5818,9 +5818,12 @@ def exponential_specialization(self, t=None, q=1): sage: lams = [Partition([]), Partition([1]), Partition([2,1])] sage: set(b[lam].exponential_specialization(q=q).parent() for b in B for lam in lams) {Univariate Polynomial Ring in t over - Univariate Polynomial Ring in q over Rational Field} + Fraction Field of Univariate Polynomial Ring in q over Rational Field, + Univariate Polynomial Ring in t over Univariate Polynomial Ring + in q over Rational Field} sage: set(b[lam].exponential_specialization(q=q, t=1).parent() for b in B for lam in lams) - {Univariate Polynomial Ring in q over Integer Ring} + {Fraction Field of Univariate Polynomial Ring in q over Rational Field, + Univariate Polynomial Ring in q over Rational Field} """ # heuristically, it seems fastest to fall back to the # elementary basis - using the powersum basis would From ab684e74e9bf8e622843de3bbfe5fed1e1a6b7b7 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Sun, 26 Apr 2020 12:26:13 +0200 Subject: [PATCH 083/301] fix doctests --- src/sage/combinat/sf/sfa.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 57a829c5403..c051ad385ae 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5736,17 +5736,19 @@ def exponential_specialization(self, t=None, q=1): sage: m = SymmetricFunctions(QQ).m() sage: (m[2,1]+m[1,1]).exponential_specialization() 1/2*t^2 - sage: m[1,1].exponential_specialization(q=None) + sage: (m[2,1]+m[1,1]).exponential_specialization(q=1) 1/2*t^2 + sage: m[1,1].exponential_specialization(q=None) + (q/(q + 1))*t^2 sage: Qq = PolynomialRing(QQ, "q"); q = Qq.gen() sage: m[1,1].exponential_specialization(q=q) - t^2 * (1 - q)/(1 + q) + (q/(q + 1))*t^2 sage: Qt = PolynomialRing(QQ, "t"); t = Qt.gen() sage: m[1,1].exponential_specialization(t=t) 1/2*t^2 sage: Qqt = PolynomialRing(QQ, ["q", "t"]); q, t = Qqt.gens() sage: m[1,1].exponential_specialization(q=q, t=t) - t^2 * (1 - q)/(1 + q) + q*t^2/(q + 1) sage: x = m[3]+m[2,1]+m[1,1,1] sage: d = x.homogeneous_degree() @@ -5792,8 +5794,8 @@ def exponential_specialization(self, t=None, q=1): sage: P2 = PolynomialRing(GF(3), ["q", "t"]) sage: q2, t2 = P2.gens() sage: set(b[lam].exponential_specialization(q=q2, t=t2).parent() for b in B for lam in lams) - {Fraction Field of Multivariate Polynomial Ring in q, t over Finite Field of size 3, - Multivariate Polynomial Ring in q, t over Finite Field of size 3} + {Multivariate Polynomial Ring in q, t over Finite Field of size 3, + Fraction Field of Multivariate Polynomial Ring in q, t over Finite Field of size 3} Check that parents are correct over `\QQ` for `q = 1`:: From db1704513d5a2a0138bfabb94a409f6439f1d220 Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Sun, 26 Apr 2020 12:31:32 +0200 Subject: [PATCH 084/301] follow Travis's suggestion about set output --- src/sage/combinat/sf/sfa.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index c051ad385ae..2d2f866ccea 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -5631,10 +5631,10 @@ def principal_specialization(self, n=infinity, q=None): {Integer Ring} sage: set(b[lam].principal_specialization(n=2).parent() for b in B for lam in lams) {Univariate Polynomial Ring in q over Integer Ring} - sage: set(b[lam].principal_specialization().parent() for b in B for lam in lams) - {Fraction Field of Univariate Polynomial Ring in q over Integer Ring, + sage: sorted(set(b[lam].principal_specialization().parent() for b in B for lam in lams), key=str) + [Fraction Field of Univariate Polynomial Ring in q over Integer Ring, Univariate Polynomial Ring in q over Integer Ring, - Univariate Polynomial Ring in q over Rational Field} + Univariate Polynomial Ring in q over Rational Field] Check that parents are correct over a polynomial ring:: @@ -5651,10 +5651,10 @@ def principal_specialization(self, n=infinity, q=None): {Univariate Polynomial Ring in q over Integer Ring} sage: set(b[lam].principal_specialization(n=2, q=q).parent() for b in B for lam in lams) {Univariate Polynomial Ring in q over Integer Ring} - sage: set(b[lam].principal_specialization(q=q).parent() for b in B for lam in lams) - {Fraction Field of Univariate Polynomial Ring in q over Integer Ring, + sage: sorted(set(b[lam].principal_specialization(q=q).parent() for b in B for lam in lams), key=str) + [Fraction Field of Univariate Polynomial Ring in q over Integer Ring, Univariate Polynomial Ring in q over Integer Ring, - Univariate Polynomial Ring in q over Rational Field} + Univariate Polynomial Ring in q over Rational Field] sage: a = S.e()[2,1].principal_specialization(n=2, q=2); a 6 @@ -5786,16 +5786,16 @@ def exponential_specialization(self, t=None, q=1): sage: S = SymmetricFunctions(GF(3)) sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] sage: lams = [Partition([]), Partition([1]), Partition([2,1])] - sage: set(b[lam].exponential_specialization(q=None).parent() for b in B for lam in lams) - {Univariate Polynomial Ring in t over Fraction Field + sage: sorted(set(b[lam].exponential_specialization(q=None).parent() for b in B for lam in lams), key=str) + [Univariate Polynomial Ring in t over Fraction Field of Univariate Polynomial Ring in q over Finite Field of size 3, Univariate Polynomial Ring in t over Univariate Polynomial Ring - in q over Finite Field of size 3} + in q over Finite Field of size 3] sage: P2 = PolynomialRing(GF(3), ["q", "t"]) sage: q2, t2 = P2.gens() - sage: set(b[lam].exponential_specialization(q=q2, t=t2).parent() for b in B for lam in lams) - {Multivariate Polynomial Ring in q, t over Finite Field of size 3, - Fraction Field of Multivariate Polynomial Ring in q, t over Finite Field of size 3} + sage: sorted(set(b[lam].exponential_specialization(q=q2, t=t2).parent() for b in B for lam in lams), key=str) + [Fraction Field of Multivariate Polynomial Ring in q, t over Finite Field of size 3, + Multivariate Polynomial Ring in q, t over Finite Field of size 3] Check that parents are correct over `\QQ` for `q = 1`:: @@ -5818,14 +5818,14 @@ def exponential_specialization(self, t=None, q=1): sage: S = SymmetricFunctions(P) sage: B = [S.p(), S.m(), S.e(), S.h(), S.s(), S.f()] sage: lams = [Partition([]), Partition([1]), Partition([2,1])] - sage: set(b[lam].exponential_specialization(q=q).parent() for b in B for lam in lams) - {Univariate Polynomial Ring in t over + sage: sorted(set(b[lam].exponential_specialization(q=q).parent() for b in B for lam in lams), key=str) + [Univariate Polynomial Ring in t over Fraction Field of Univariate Polynomial Ring in q over Rational Field, Univariate Polynomial Ring in t over Univariate Polynomial Ring - in q over Rational Field} - sage: set(b[lam].exponential_specialization(q=q, t=1).parent() for b in B for lam in lams) - {Fraction Field of Univariate Polynomial Ring in q over Rational Field, - Univariate Polynomial Ring in q over Rational Field} + in q over Rational Field] + sage: sorted(set(b[lam].exponential_specialization(q=q, t=1).parent() for b in B for lam in lams), key=str) + [Fraction Field of Univariate Polynomial Ring in q over Rational Field, + Univariate Polynomial Ring in q over Rational Field] """ # heuristically, it seems fastest to fall back to the # elementary basis - using the powersum basis would From f55e4d96fb4e67fe23c4252d29a26ff9a0732c6e Mon Sep 17 00:00:00 2001 From: Darij Grinberg Date: Sun, 26 Apr 2020 17:49:42 +0200 Subject: [PATCH 085/301] oops --- src/sage/combinat/q_analogues.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/combinat/q_analogues.py b/src/sage/combinat/q_analogues.py index 3228b06f354..8d9016cc65e 100644 --- a/src/sage/combinat/q_analogues.py +++ b/src/sage/combinat/q_analogues.py @@ -91,7 +91,7 @@ def q_factorial(n, q=None): .. MATH:: [1]_q [2]_q \cdots [n]_q - = 1 \cdot (1+q) \cdot (1+q+q^2) \cdots (1+q+q^2+\cdots+q^{n-1) . + = 1 \cdot (1+q) \cdot (1+q+q^2) \cdots (1+q+q^2+\cdots+q^{n-1}) . If `q` is unspecified, then this function defaults to using the generator `q` for a univariate polynomial From cf9e0f2802032941595f0b25b9d090da04939bfa Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 27 Apr 2020 20:53:57 -0700 Subject: [PATCH 086/301] src/sage/combinat/sf/sfa.py: Fixup markup in docstring --- src/sage/combinat/sf/sfa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 2d2f866ccea..051bd64e6a8 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -783,7 +783,7 @@ def gessel_reutenauer(self, lam): symmetric function* `\mathbf{GR}_\lambda` corresponding to `\lambda` is the symmetric function denoted `L_\lambda` in [GR1993]_ and in Exercise 7.89 of [STA]_ and denoted - `\mathbf{GR}_\lambda` in Definition 6.6.34 of [GriRei18_]. + `\mathbf{GR}_\lambda` in Definition 6.6.34 of [GriRei18]_. It can be defined in several ways: - It is the sum of the monomials `\mathbf{x}_w` over all From 3142781e671de21bf5e242a823fbe8c0a70fb72a Mon Sep 17 00:00:00 2001 From: Eric Gourgoulhon Date: Sun, 3 May 2020 14:51:19 +0200 Subject: [PATCH 087/301] Fix bug on initializing a vector field with rational components (trac #29639) --- src/sage/manifolds/differentiable/tensorfield.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/sage/manifolds/differentiable/tensorfield.py b/src/sage/manifolds/differentiable/tensorfield.py index 6f9658853d6..b2b434f6f4b 100644 --- a/src/sage/manifolds/differentiable/tensorfield.py +++ b/src/sage/manifolds/differentiable/tensorfield.py @@ -743,6 +743,15 @@ def _init_components(self, *comp, **kwargs): sage: t.display(Y) t = 2*u d/du*du + v^3 d/dv*du + (u + v) d/dv*dv + TESTS: + + Check that :trac:`29639` is fixed:: + + sage: v = M.vector_field() + sage: v._init_components(1/2, -1) + sage: v.display() + 1/2 d/dx - d/dy + """ comp0 = comp[0] self._is_zero = False # a priori @@ -757,7 +766,7 @@ def _init_components(self, *comp, **kwargs): # For compatibility with previous use of tensor_field(): self.set_name(comp0) else: - if hasattr(comp0, '__getitem__'): + if isinstance(comp0, (list, tuple)): # comp0 is a list/vector of components # otherwise comp is the tuple of components in a specific frame comp = comp0 From 3f426c1a57d7381f07c29dea6e25cdd395fd8401 Mon Sep 17 00:00:00 2001 From: Eric Gourgoulhon Date: Sun, 3 May 2020 15:31:35 +0200 Subject: [PATCH 088/301] Fix wedge product of multivector field with scalar field (trac #29628) --- .../manifolds/differentiable/multivectorfield.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/sage/manifolds/differentiable/multivectorfield.py b/src/sage/manifolds/differentiable/multivectorfield.py index e5099a620e8..867345c3eed 100644 --- a/src/sage/manifolds/differentiable/multivectorfield.py +++ b/src/sage/manifolds/differentiable/multivectorfield.py @@ -1049,7 +1049,21 @@ def wedge(self, other): sage: s[1,2,3] == a[1]*b[2,3] + a[2]*b[3,1] + a[3]*b[1,2] True + Exterior product with a scalar field:: + + sage: f = M.scalar_field(x, name='f') + sage: s = b.wedge(f); s + 2-vector field f*b on the 3-dimensional differentiable manifold M + sage: s.display() + f*b = x*y^2 d/dx/\d/dy + (x^2 + x*z) d/dx/\d/dz + x*z^2 d/dy/\d/dz + sage: s == f*b + True + sage: s == f.wedge(b) + True + """ + if other._tensor_rank == 0: # wedge product with a scalar field + return self * other if self._domain.is_subset(other._domain): if not self._ambient_domain.is_subset(other._ambient_domain): raise ValueError("incompatible ambient domains for exterior " + From e8f2f9fd7d9ed913c5aff3164faf15d2a543fd00 Mon Sep 17 00:00:00 2001 From: rbmj Date: Sun, 3 May 2020 11:44:17 -0400 Subject: [PATCH 089/301] Moved exponential sampling to _plot() and added documentation in plot_semilogx() --- src/sage/plot/plot.py | 85 +++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 39 deletions(-) diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py index df1528f8632..6697b5c9cd6 100644 --- a/src/sage/plot/plot.py +++ b/src/sage/plot/plot.py @@ -591,7 +591,6 @@ def f(x): return (x-3)*(x-5)*(x-7)+40 from sage.misc.randstate import current_randstate #for plot adaptive refinement from math import sin, cos, pi, log, exp #for polar_plot and log scaling - from sage.ext.fast_eval import fast_float, is_fast_float from sage.misc.decorators import options @@ -1947,11 +1946,9 @@ def f(x): return (floor(x)+0.5) / (1-(x-0.5)**2) raise ValueError('only one of color or rgbcolor should be specified') elif 'color' in kwds: kwds['rgbcolor'] = kwds.pop('color', (0,0,1)) # take blue as default ``rgbcolor`` - G_kwds = Graphics._extract_kwds_for_show(kwds, ignore=['xmin', 'xmax']) - if 'scale' in G_kwds: - kwds['scale'] = G_kwds['scale'] # pass down so plot knows if log-scale + kwds['scale'] = G_kwds['scale'] # pass scaling information to _plot too original_opts = kwds.pop('__original_opts', {}) do_show = kwds.pop('show',False) @@ -2108,12 +2105,6 @@ def _plot(funcs, xrange, parametric=False, else: f = funcs - #check to see if this is a log scale graph on the x axis - exp_points = False - if ('scale' in options.keys() and not parametric and - (options['scale'] == 'loglog' or options['scale'] == 'semilogx')): - exp_points = True - # Keep ``rgbcolor`` option 'automatic' only for lists of functions. # Otherwise, let the plot color be 'blue'. if parametric or not isinstance(funcs, (list, tuple)): @@ -2259,6 +2250,7 @@ def golden_rainbow(i,lightness=0.4): plot_points = int(options.pop('plot_points')) exclude = options.pop('exclude') + initial_points = None if exclude is not None: from sage.symbolic.expression import Expression if isinstance(exclude, Expression) and exclude.is_relational(): @@ -2286,21 +2278,39 @@ def golden_rainbow(i,lightness=0.4): initial_points = reduce(lambda a,b: a+b, [[x - epsilon, x + epsilon] for x in excluded_points], []) - data = generate_plot_points(f, xrange, plot_points, - adaptive_tolerance, adaptive_recursion, - randomize, initial_points, exp_dist=exp_points) - else: - data = generate_plot_points(f, xrange, plot_points, - adaptive_tolerance, adaptive_recursion, - randomize, exp_dist=exp_points) - + + # If we are a log scale plot on the x axis, do a change of variables + # so we sample the range in log scale + is_log_scale = ('scale' in options.keys() and + not parametric and + options['scale'] in ['loglog', 'semilogx']) + if is_log_scale: + f_orig = f + xrange_orig = xrange + f = lambda x: f_orig(exp(x)) + xrange = (log(xrange_orig[0]), log(xrange_orig[1])) + if not initial_points is None: + initial_points = [log(x) for x in initial_points] + + data = generate_plot_points(f, xrange, plot_points, + adaptive_tolerance, adaptive_recursion, + randomize, initial_points) for i in range(len(data)-1): # If the difference between consecutive x-values is more than # 2 times the difference between two consecutive plot points, then # add an exclusion point. - if abs(data[i+1][0] - data[i][0]) > 2*abs(xmax - xmin)/plot_points: + if abs(data[i+1][0] - data[i][0]) > 2*abs(xrange[1] - xrange[0])/plot_points: excluded_points.append((data[i][0] + data[i+1][0])/2) + + # If we did a change in variables, undo it now + if is_log_scale: + f = f_orig + xrange = xrange_orig + for i in range(len(data)): + data[i] = (exp(data[i][0]), data[i][1]) + for i in range(len(excluded_points)): + excluded_points[i] = exp(excluded_points[i]) if parametric: # We need the original x-values to be able to exclude points in parametric plots @@ -2345,7 +2355,7 @@ def golden_rainbow(i,lightness=0.4): fill_f = fill filldata = generate_plot_points(fill_f, xrange, plot_points, adaptive_tolerance, \ - adaptive_recursion, randomize, exp_dist=exp_points) + adaptive_recursion, randomize) filldata.reverse() filldata += data else: @@ -2356,7 +2366,7 @@ def golden_rainbow(i,lightness=0.4): if not hasattr(fill, '__call__') and polar: filldata = generate_plot_points(lambda x: base_level, xrange, plot_points, adaptive_tolerance, \ - adaptive_recursion, randomize, exp_dist=exp_points) + adaptive_recursion, randomize) filldata.reverse() filldata += data if not hasattr(fill, '__call__') and not polar: @@ -3135,6 +3145,20 @@ def plot_semilogx(funcs, *args, **kwds): g = plot_semilogx(exp, (1,10), base=2) # with base 2 sphinx_plot(g) + :: + + sage: s = var('s') # Samples points logarithmically so graph is smooth + sage: f = 4000000/(4000000 + 4000*s*i - s*s) + sage: plot_semilogx(20*log(abs(f), 10), (s, 1, 1e6)) + Graphics object consisting of 1 graphics primitive + + .. PLOT:: + + s = var('s') # Samples points logarithmically so graph is smooth + f = 4000000/(4000000 + 4000*s*i - s*s) + g = plot_semilogx(20*log(abs(f), 10), (s, 1, 1e6)) + sphinx_plot(g) + """ return plot(funcs, *args, scale='semilogx', **kwds) @@ -3805,7 +3829,7 @@ def adaptive_refinement(f, p1, p2, adaptive_tolerance=0.01, adaptive_recursion=5 return [] -def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adaptive_recursion=5, randomize=True, initial_points=None, exp_dist=False): +def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adaptive_recursion=5, randomize=True, initial_points=None): r""" Calculate plot points for a function f in the interval xrange. The adaptive refinement algorithm is also automatically invoked with a @@ -3833,9 +3857,6 @@ def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adap - ``initial_points`` - (default: None) a list of points that should be evaluated. - - ``exp_dist`` - (default: False) whether points should be distributed linearly - (False) or exponentially (True) within the range specified - OUTPUT: - a list of points (x, f(x)) in the interval xrange, which approximate @@ -3885,16 +3906,6 @@ def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adap [97, 499, 2681] """ from sage.plot.misc import setup_for_eval_on_grid - - f_actual = f - xrange_actual = xrange - if exp_dist: - if xrange[0] <= 0: - sage.misc.misc.verbose("Unable to perform exponential scale on negative range, clipping...", 1) - xrange[0] = 0.01 - f = lambda x: f_actual(exp(x)) - xrange = (log(xrange[0]), log(xrange[1])) - ignore, ranges = setup_for_eval_on_grid([], [xrange], plot_points) xmin, xmax, delta = ranges[0] data = srange(*ranges[0], include_endpoint=True) @@ -3984,8 +3995,4 @@ def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adap sage.misc.misc.verbose("WARNING: When plotting, failed to evaluate function at %s points." % exceptions, level=0) sage.misc.misc.verbose("Last error message: '%s'" % msg, level=0) - if exp_dist: - for i in range(len(data)): - data[i] = (exp(data[i][0]), data[i][1]) - return data From 0641da5c42bba02b4b75994e04d51b035be61fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 3 May 2020 17:52:23 +0200 Subject: [PATCH 090/301] spring cleanup of finite state machines (pep, lgtm, doc and code details) --- src/sage/combinat/finite_state_machine.py | 861 ++++++++-------------- 1 file changed, 308 insertions(+), 553 deletions(-) diff --git a/src/sage/combinat/finite_state_machine.py b/src/sage/combinat/finite_state_machine.py index 2e5c8d98847..61ebd590769 100644 --- a/src/sage/combinat/finite_state_machine.py +++ b/src/sage/combinat/finite_state_machine.py @@ -931,8 +931,7 @@ # **************************************************************************** from __future__ import print_function -import six -from six.moves import range, zip_longest, zip +from six.moves import zip_longest from IPython.lib.pretty import pretty import collections @@ -948,6 +947,7 @@ from sage.misc.misc import verbose from sage.misc.sageinspect import sage_getargspec from sage.rings.qqbar import QQbar +from sage.rings.integer_ring import ZZ from sage.rings.real_mpfr import RR from sage.structure.sage_object import SageObject @@ -1064,13 +1064,13 @@ def equal(iterator): return True -def startswith(list, prefix): +def startswith(list_, prefix): """ Determine whether list starts with the given prefix. INPUT: - - ``list`` -- list + - ``list_`` -- list - ``prefix`` -- list representing the prefix OUTPUT: @@ -1089,10 +1089,11 @@ def startswith(list, prefix): sage: startswith([1, 3, 2], [1, 2]) False """ + if len(prefix) > len(list_): + return False + return all(x == y for x, y in zip(list_, prefix)) - return list[:len(prefix)] == prefix - -#***************************************************************************** +# **************************************************************************** FSMEmptyWordSymbol = '-' @@ -1106,7 +1107,7 @@ def startswith(list, prefix): def FSMLetterSymbol(letter): """ - Returns a string associated to the input letter. + Return a string associated to the input letter. INPUT: @@ -1132,7 +1133,7 @@ def FSMLetterSymbol(letter): def FSMWordSymbol(word): """ - Returns a string of ``word``. It may returns the symbol of the + Return a string of ``word``. It may returns the symbol of the empty word ``FSMEmptyWordSymbol``. INPUT: @@ -1151,15 +1152,12 @@ def FSMWordSymbol(word): """ if not isinstance(word, list): return FSMLetterSymbol(word) - if len(word) == 0: + if not word: return FSMEmptyWordSymbol - s = '' - for letter in word: - s += (',' if len(s) > 0 else '') + FSMLetterSymbol(letter) - return s + return ','.join(FSMLetterSymbol(letter) for letter in word) -#***************************************************************************** +# **************************************************************************** def is_FSMState(S): @@ -1222,7 +1220,7 @@ class FSMState(SageObject): OUTPUT: - Returns a state of a finite state machine. + A state of a finite state machine. EXAMPLES:: @@ -1431,8 +1429,7 @@ def __init__(self, label, word_out=None, def __lt__(self, other): """ - Returns True if label of ``self`` is less than label of - ``other``. + Return ``True`` if label of ``self`` is less than label of ``other``. INPUT: @@ -1440,7 +1437,7 @@ def __lt__(self, other): OUTPUT: - True or False. + ``True`` or ``False`` EXAMPLES:: @@ -1450,7 +1447,6 @@ def __lt__(self, other): """ return self.label() < other.label() - @property def final_word_out(self): """ @@ -1643,10 +1639,9 @@ def is_final(self, is_final): "can have a final output word. " % (self.label(),)) - def label(self): """ - Returns the label of the state. + Return the label of the state. INPUT: @@ -1665,10 +1660,9 @@ def label(self): """ return self._label_ - def __copy__(self): """ - Returns a (shallow) copy of the state. + Return a (shallow) copy of the state. INPUT: @@ -1712,13 +1706,11 @@ def __copy__(self): new.hook = self.hook return new - copy = __copy__ - def __deepcopy__(self, memo): """ - Returns a deep copy of the state. + Return a deep copy of the state. INPUT: @@ -1748,10 +1740,9 @@ def __deepcopy__(self, memo): new.initial_probability = deepcopy(self.initial_probability, memo) return new - def deepcopy(self, memo=None): """ - Returns a deep copy of the state. + Return a deep copy of the state. INPUT: @@ -1796,7 +1787,7 @@ def deepcopy(self, memo=None): def relabeled(self, label, memo=None): """ - Returns a deep copy of the state with a new label. + Return a deep copy of the state with a new label. INPUT: @@ -1870,11 +1861,7 @@ def __getstate__(self): def __hash__(self): """ - Returns a hash value for the object. - - INPUT: - - Nothing. + Return a hash value for the object. OUTPUT: @@ -1910,20 +1897,20 @@ def _repr_(self): """ return pretty(self.label()) - def __eq__(left, right): + def __eq__(self, other): """ - Returns True if two states are the same, i.e., if they have + Return ``True`` if two states are the same, i.e., if they have the same labels. INPUT: - - ``left`` -- a state. + - ``self`` -- a state. - - ``right`` -- a state. + - ``other`` -- a state. OUTPUT: - True or False. + ``True`` or ``False``. Note that the hooks and whether the states are initial or final are not checked. To fully compare two states (including @@ -1943,24 +1930,23 @@ def __eq__(left, right): sage: A == B True """ - if not is_FSMState(right): + if not is_FSMState(other): return False - return left.label() == right.label() - + return self.label() == other.label() - def __ne__(left, right): + def __ne__(self, other): """ Tests for inequality, complement of __eq__. INPUT: - - ``left`` -- a state. + - ``self`` -- a state. - - ``right`` -- a state. + - ``other`` -- a state. OUTPUT: - True or False. + ``True`` or ``False`` EXAMPLES:: @@ -1970,19 +1956,18 @@ def __ne__(left, right): sage: A != B False """ - return (not (left == right)) + return not (self == other) - - def fully_equal(left, right, compare_color=True): + def fully_equal(self, other, compare_color=True): """ - Checks whether two states are fully equal, i.e., including all + Check whether two states are fully equal, i.e., including all attributes except ``hook``. INPUT: - - ``left`` -- a state. + - ``self`` -- a state. - - ``right`` -- a state. + - ``other`` -- a state. - ``compare_color`` -- If ``True`` (default) colors are compared as well, otherwise not. @@ -2008,27 +1993,18 @@ def fully_equal(left, right, compare_color=True): sage: A.fully_equal(B, compare_color=False) True """ - color = not compare_color or left.color == right.color - return (left == right and - left.is_initial == right.is_initial and - left.is_final == right.is_final and - left.final_word_out == right.final_word_out and - left.word_out == right.word_out and + color = not compare_color or self.color == other.color + return (self == other and + self.is_initial == other.is_initial and + self.is_final == other.is_final and + self.final_word_out == other.final_word_out and + self.word_out == other.word_out and color and - left.initial_probability == right.initial_probability) - + self.initial_probability == other.initial_probability) def __bool__(self): """ - Returns True. - - INPUT: - - Nothing. - - OUTPUT: - - True or False. + Return ``True``. TESTS:: @@ -2038,13 +2014,11 @@ def __bool__(self): """ return True # A state cannot be zero (see __init__) - __nonzero__ = __bool__ - def _epsilon_successors_(self, fsm=None): """ - Returns the dictionary with states reachable from ``self`` + Return the dictionary with states reachable from ``self`` without reading anything from an input tape as keys. The values are lists of outputs. @@ -2105,15 +2079,14 @@ def _epsilon_successors_(self, fsm=None): _epsilon_successors_dict_[self].remove([]) # delete starting state if not _epsilon_successors_dict_[self]: del _epsilon_successors_dict_[self] - for s, outputs in six.iteritems(_epsilon_successors_dict_): + for s, outputs in _epsilon_successors_dict_.items(): _epsilon_successors_dict_[s] = [t for t, _ in itertools.groupby(sorted(outputs))] return _epsilon_successors_dict_ - def _in_epsilon_cycle_(self, fsm=None): """ - Returns whether ``self`` is in an epsilon-cycle or not. + Return whether ``self`` is in an epsilon-cycle or not. INPUT: @@ -2140,10 +2113,9 @@ def _in_epsilon_cycle_(self, fsm=None): """ return self in self._epsilon_successors_(fsm) - def _epsilon_cycle_output_empty_(self, fsm=None): """ - Returns whether all epsilon-cycles in which ``self`` is + Return whether all epsilon-cycles in which ``self`` is contained have an empty output (i.e., do not write any output word). @@ -2154,7 +2126,7 @@ def _epsilon_cycle_output_empty_(self, fsm=None): OUTPUT: - ``True`` or ``False``. + ``True`` or ``False`` A ``ValueError`` is raised when ``self`` is not in an epsilon cycle. @@ -2203,7 +2175,7 @@ def _epsilon_cycle_output_empty_(self, fsm=None): raise ValueError("State %s is not in an epsilon cycle." % (self,)) -#***************************************************************************** +# **************************************************************************** def is_FSMTransition(T): @@ -2311,16 +2283,16 @@ def __init__(self, from_state, to_state, def __lt__(self, other): """ - Returns True if ``self`` is less than ``other`` with respect to the + Return True if ``self`` is less than ``other`` with respect to the key ``(self.from_state, self.word_in, self.to_state, self.word_out)``. INPUT: - - `other` -- a transition. + - ``other`` -- a transition. OUTPUT: - True or False. + ``True`` or ``False`` EXAMPLES:: @@ -2331,14 +2303,9 @@ def __lt__(self, other): return (self.from_state, self.word_in, self.to_state, self.word_out) < \ (other.from_state, other.word_in, other.to_state, other.word_out) - def __copy__(self): """ - Returns a (shallow) copy of the transition. - - INPUT: - - Nothing. + Return a (shallow) copy of the transition. OUTPUT: @@ -2357,13 +2324,11 @@ def __copy__(self): new.hook = self.hook return new - copy = __copy__ - def __deepcopy__(self, memo): """ - Returns a deep copy of the transition. + Return a deep copy of the transition. INPUT: @@ -2388,10 +2353,9 @@ def __deepcopy__(self, memo): new.hook = deepcopy(self.hook, memo) return new - def deepcopy(self, memo=None): """ - Returns a deep copy of the transition. + Return a deep copy of the transition. INPUT: @@ -2437,11 +2401,9 @@ def _repr_(self): repr(self.to_state), self._in_out_label_()) - def _in_out_label_(self): """ - Returns the input and output of a transition as - "word_in|word_out". + Return the input and output of a transition as "word_in|word_out". INPUT: @@ -2460,10 +2422,9 @@ def _in_out_label_(self): return "%s|%s" % (FSMWordSymbol(self.word_in), FSMWordSymbol(self.word_out)) - - def __eq__(left, right): + def __eq__(self, other): """ - Returns True if the two transitions are the same, i.e., if the + Return ``True`` if the two transitions are the same, i.e., if the both go from the same states to the same states and read and write the same words. @@ -2471,13 +2432,13 @@ def __eq__(left, right): INPUT: - - ``left`` -- a transition. + - ``self`` -- a transition. - - ``right`` -- a transition. + - ``other`` -- a transition. OUTPUT: - True or False. + ``True`` or ``False`` EXAMPLES:: @@ -2488,28 +2449,27 @@ def __eq__(left, right): sage: t1 == t2 True """ - if not is_FSMTransition(right): - raise TypeError('Only instances of FSMTransition ' \ - 'can be compared.') - return left.from_state == right.from_state \ - and left.to_state == right.to_state \ - and left.word_in == right.word_in \ - and left.word_out == right.word_out - + if not is_FSMTransition(other): + raise TypeError('Only instances of FSMTransition ' + 'can be compared.') + return self.from_state == other.from_state \ + and self.to_state == other.to_state \ + and self.word_in == other.word_in \ + and self.word_out == other.word_out - def __ne__(left, right): + def __ne__(self, other): """ + Test for inequality, complement of __eq__. INPUT: - - ``left`` -- a transition. + - ``self`` -- a transition. - - ``right`` -- a transition. + - ``other`` -- a transition. OUTPUT: - True or False. - Tests for inequality, complement of __eq__. + ``True`` or ``False`` EXAMPLES:: @@ -2520,20 +2480,11 @@ def __ne__(left, right): sage: t1 != t2 False """ - return (not (left == right)) - + return not (self == other) def __bool__(self): """ - Returns True. - - INPUT: - - Nothing. - - OUTPUT: - - True or False. + Return ``True``. EXAMPLES:: @@ -2546,7 +2497,7 @@ def __bool__(self): __nonzero__ = __bool__ -#***************************************************************************** +# **************************************************************************** def is_FiniteStateMachine(FSM): @@ -3126,9 +3077,9 @@ class FiniteStateMachine(SageObject): :attr:`input_alphabet`. """ - #************************************************************************* + # ************************************************************************ # init - #************************************************************************* + # ************************************************************************ def __init__(self, @@ -3147,9 +3098,10 @@ def __init__(self, sage: FiniteStateMachine() Empty finite state machine """ - self._states_ = [] # List of states in the finite state - # machine. Each state stores a list of - # outgoing transitions. + self._states_ = [] + # List of states in the finite state + # machine. Each state stores a list of + # outgoing transitions. if store_states_dict: self._states_dict_ = {} @@ -3191,16 +3143,16 @@ def __init__(self, if initial_states is not None: if not hasattr(initial_states, '__iter__'): - raise TypeError('Initial states must be iterable ' \ - '(e.g. a list of states).') + raise TypeError('Initial states must be iterable ' + '(e.g. a list of states).') for s in initial_states: state = self.add_state(s) state.is_initial = True if final_states is not None: if not hasattr(final_states, '__iter__'): - raise TypeError('Final states must be iterable ' \ - '(e.g. a list of states).') + raise TypeError('Final states must be iterable ' + '(e.g. a list of states).') for s in final_states: state = self.add_state(s) state.is_final = True @@ -3211,7 +3163,7 @@ def __init__(self, if on_duplicate_transition is None: on_duplicate_transition = duplicate_transition_ignore if hasattr(on_duplicate_transition, '__call__'): - self.on_duplicate_transition=on_duplicate_transition + self.on_duplicate_transition = on_duplicate_transition else: raise TypeError('on_duplicate_transition must be callable') @@ -3220,10 +3172,10 @@ def __init__(self, elif hasattr(data, 'items'): # data is a dict (or something similar), # format: key = from_state, value = iterator of transitions - for (sf, iter_transitions) in six.iteritems(data): + for (sf, iter_transitions) in data.items(): self.add_state(sf) if hasattr(iter_transitions, 'items'): - for (st, transition) in six.iteritems(iter_transitions): + for (st, transition) in iter_transitions.items(): self.add_state(st) if is_FSMTransition(transition): self.add_transition(transition) @@ -3274,18 +3226,13 @@ def __init__(self, self.construct_final_word_out(with_final_word_out) - #************************************************************************* + # ************************************************************************ # copy and hash - #************************************************************************* - + # ************************************************************************ def __copy__(self): """ - Returns a (shallow) copy of the finite state machine. - - INPUT: - - Nothing. + Return a (shallow) copy of the finite state machine. OUTPUT: @@ -3300,13 +3247,11 @@ def __copy__(self): """ raise NotImplementedError - copy = __copy__ - def empty_copy(self, memo=None, new_class=None): """ - Returns an empty deep copy of the finite state machine, i.e., + Return an empty deep copy of the finite state machine, i.e., ``input_alphabet``, ``output_alphabet``, ``on_duplicate_transition`` are preserved, but states and transitions are not. @@ -3352,10 +3297,9 @@ def empty_copy(self, memo=None, new_class=None): new._copy_from_other_(self, memo=memo, empty=True) return new - def __deepcopy__(self, memo): """ - Returns a deep copy of the finite state machine. + Return a deep copy of the finite state machine. INPUT: @@ -3375,10 +3319,9 @@ def __deepcopy__(self, memo): new._copy_from_other_(self) return new - def deepcopy(self, memo=None): """ - Returns a deep copy of the finite state machine. + Return a deep copy of the finite state machine. INPUT: @@ -3463,10 +3406,6 @@ def __getstate__(self): """ Return state for pickling excluding outgoing transitions. - INPUT: - - None - OUTPUT: A dictionary. @@ -3481,10 +3420,8 @@ def __getstate__(self): sage: loads(dumps(A)) == A True """ - odict = self.__dict__.copy() # copy the dict since we change it - odict.update({ - 'transitions': self.transitions() - }) + odict = self.__dict__.copy() # copy the dict since we change it + odict.update({'transitions': self.transitions()}) return odict def __setstate__(self, d): @@ -3512,13 +3449,13 @@ def __setstate__(self, d): transitions = d.pop('transitions') self.__dict__.update(d) for state in self.iter_states(): - state.transitions = [] # clean outgoing transitions + state.transitions = [] # clean outgoing transitions for transition in transitions: self.add_transition(transition) def relabeled(self, memo=None, labels=None): """ - Returns a deep copy of the finite state machine, but the + Return a deep copy of the finite state machine, but the states are relabeled. INPUT: @@ -3563,10 +3500,9 @@ def relabeled(self, memo=None, labels=None): del self._deepcopy_labels_ return new - def induced_sub_finite_state_machine(self, states): """ - Returns a sub-finite-state-machine of the finite state machine + Return a sub-finite-state-machine of the finite state machine induced by the given states. INPUT: @@ -3644,13 +3580,13 @@ def __hash__(self): """ if getattr(self, "_immutable", False): return hash((tuple(self.states()), tuple(self.transitions()))) - raise TypeError("Finite state machines are mutable, " \ - "and thus not hashable.") + raise TypeError("Finite state machines are mutable, " + "and thus not hashable.") - #************************************************************************* + # ************************************************************************ # operators - #************************************************************************* + # ************************************************************************ def __or__(self, other): @@ -3701,10 +3637,9 @@ def __iadd__(self, other): """ raise NotImplementedError - def __and__(self, other): """ - Returns the intersection of ``self`` with ``other``. + Return the intersection of ``self`` with ``other``. TESTS:: @@ -3716,7 +3651,6 @@ def __and__(self, other): if is_FiniteStateMachine(other): return self.intersection(other) - def __imul__(self, other): """ TESTS:: @@ -3962,41 +3896,34 @@ def __call__(self, *args, **kwargs): ....: automatic_output_type=True)) <... 'tuple'> """ - if len(args) == 0: + if not args: raise TypeError("Called with too few arguments.") if is_FiniteStateMachine(args[0]): return self.composition(*args, **kwargs) if hasattr(args[0], '__iter__'): - if not 'full_output' in kwargs: + if 'full_output' not in kwargs: kwargs['full_output'] = False - if not 'list_of_outputs' in kwargs: + if 'list_of_outputs' not in kwargs: kwargs['list_of_outputs'] = False - if not 'automatic_output_type' in kwargs: - kwargs['automatic_output_type'] = not 'format_output' in kwargs + if 'automatic_output_type' not in kwargs: + kwargs['automatic_output_type'] = 'format_output' not in kwargs input_tape = args[0] - if hasattr(input_tape, 'is_finite') and \ - not input_tape.is_finite(): - if not 'iterator_type' in kwargs: + if hasattr(input_tape, 'is_finite') and not input_tape.is_finite(): + if 'iterator_type' not in kwargs: kwargs['iterator_type'] = 'simple' return self.iter_process(*args, **kwargs) return self.process(*args, **kwargs) raise TypeError("Do not know what to do with that arguments.") - - #************************************************************************* + # ************************************************************************ # tests - #************************************************************************* - + # ************************************************************************ def __bool__(self): """ - Returns True if the finite state machine consists of at least + Return True if the finite state machine consists of at least one state. - INPUT: - - Nothing. - OUTPUT: True or False. @@ -4010,16 +3937,16 @@ def __bool__(self): __nonzero__ = __bool__ - def __eq__(left, right): + def __eq__(self, other): """ - Returns ``True`` if the two finite state machines are equal, + Return ``True`` if the two finite state machines are equal, i.e., if they have the same states and the same transitions. INPUT: - - ``left`` -- a finite state machine. + - ``self`` -- a finite state machine. - - ``right`` -- a finite state machine. + - ``other`` -- a finite state machine. OUTPUT: @@ -4063,53 +3990,50 @@ def __eq__(left, right): sage: F == G True """ - if not is_FiniteStateMachine(right): + if not is_FiniteStateMachine(other): raise TypeError('Only instances of FiniteStateMachine ' - 'can be compared.') - if len(left._states_) != len(right._states_): + 'can be compared.') + if len(self._states_) != len(other._states_): return False colors_equal = True - for state in left.iter_states(): + for state in self.iter_states(): try: - right_state = right.state(state.label()) + other_state = other.state(state.label()) except LookupError: return False # we handle colors separately - if not state.fully_equal(right_state, compare_color=False): + if not state.fully_equal(other_state, compare_color=False): return False - if state.color != right_state.color: + if state.color != other_state.color: colors_equal = False - left_transitions = state.transitions - right_transitions = right.state(state).transitions - if len(left_transitions) != len(right_transitions): + self_transitions = state.transitions + other_transitions = other.state(state).transitions + if len(self_transitions) != len(other_transitions): return False - for t in left_transitions: - if t not in right_transitions: + for t in self_transitions: + if t not in other_transitions: return False # handle colors if colors_equal: return True - if left.is_monochromatic() and right.is_monochromatic(): - return True - return False + return self.is_monochromatic() and other.is_monochromatic() - - def __ne__(left, right): + def __ne__(self, other): """ Tests for inequality, complement of :meth:`.__eq__`. INPUT: - - ``left`` -- a finite state machine. + - ``self`` -- a finite state machine. - - ``right`` -- a finite state machine. + - ``other`` -- a finite state machine. OUTPUT: - True or False. + ``True`` or ``False`` EXAMPLES:: @@ -4121,13 +4045,14 @@ def __ne__(left, right): sage: E == G False """ - return (not (left == right)) - + return not (self == other) def __contains__(self, item): """ - Returns true, if the finite state machine contains the - state or transition item. Note that only the labels of the + Return ``True``, if the finite state machine contains the + state or transition item. + + Note that only the labels of the states and the input and output words are tested. INPUT: @@ -4136,7 +4061,7 @@ def __contains__(self, item): OUTPUT: - True or False. + ``True`` or ``False`` EXAMPLES:: @@ -4274,9 +4199,9 @@ def default_is_zero(expression): for state in self.iter_states()) - #************************************************************************* + # ************************************************************************ # representations / LaTeX - #************************************************************************* + # ************************************************************************ def _repr_(self): @@ -4349,7 +4274,6 @@ def format_letter_negative(self, letter): \path[->] (v0) edge[loop above] node {$\overline{1}$} (); \end{tikzpicture} """ - from sage.rings.integer_ring import ZZ if letter in ZZ and letter < 0: return r'\overline{%d}' % -letter else: @@ -4855,11 +4779,7 @@ def latex_options(self, def _latex_(self): r""" - Returns a LaTeX code for the graph of the finite state machine. - - INPUT: - - Nothing. + Return a LaTeX code for the graph of the finite state machine. OUTPUT: @@ -4956,7 +4876,7 @@ def label_rotation(angle, both_directions): accepting_show_empty = False result = "\\begin{tikzpicture}[%s]\n" % ", ".join(options) - j = 0; + j = 0 for vertex in self.iter_states(): if not hasattr(vertex, "coordinates"): vertex.coordinates = (3*cos(2*pi*j/len(self.states())), @@ -5008,24 +4928,20 @@ def key_function(s): # transitions have to be sorted anyway, the performance # penalty should be bearable; nevertheless, this is only # required for doctests. - adjacent = collections.OrderedDict( - (pair, list(transitions)) - for pair, transitions in - itertools.groupby( - sorted(self.iter_transitions(), - key=key_function), - key=key_function - )) - - for ((source, target), transitions) in six.iteritems(adjacent): - if len(transitions) > 0: + adjacent = collections.OrderedDict((pair, list(transitions)) + for pair, transitions in itertools.groupby( + sorted(self.iter_transitions(), key=key_function), + key=key_function)) + + for ((source, target), transitions) in adjacent.items(): + if transitions: labels = [] for transition in transitions: if hasattr(transition, "format_label"): labels.append(transition.format_label()) else: labels.append(self._latex_transition_label_( - transition, self.format_transition_label)) + transition, self.format_transition_label)) label = ", ".join(labels) if source != target: angle = atan2( @@ -5057,17 +4973,16 @@ def key_function(s): result += "\\end{tikzpicture}" return result - def _latex_transition_label_(self, transition, format_function=None): r""" - Returns the proper transition label. + Return the proper transition label. INPUT: - - ``transition`` - a transition + - ``transition`` -- a transition - - ``format_function`` - a function formatting the labels + - ``format_function`` -- a function formatting the labels OUTPUT: @@ -5140,15 +5055,14 @@ def set_coordinates(self, coordinates, default=True): state.coordinates = (3*cos(2*pi*j/n), 3*sin(2*pi*j/n)) - - #************************************************************************* + # ************************************************************************ # other - #************************************************************************* - + # ************************************************************************ def _matrix_(self, R=None): """ - Returns the adjacency matrix of the finite state machine. + Return the adjacency matrix of the finite state machine. + See :meth:`.adjacency_matrix` for more information. EXAMPLES:: @@ -5168,11 +5082,10 @@ def _matrix_(self, R=None): """ return self.adjacency_matrix() - def adjacency_matrix(self, input=None, entry=None): """ - Returns the adjacency matrix of the underlying graph. + Return the adjacency matrix of the underlying graph. INPUT: @@ -5245,7 +5158,6 @@ def adjacency_matrix(self, input=None, [1 1 0] """ - from sage.rings.integer_ring import ZZ def default_function(transitions): x = var('x') @@ -5326,7 +5238,6 @@ def determine_input_alphabet(self, reset=True): ain.add(letter) self.input_alphabet = list(ain) - def determine_output_alphabet(self, reset=True): """ Determine the output alphabet according to the transitions @@ -5380,7 +5291,6 @@ def determine_output_alphabet(self, reset=True): aout.add(letter) self.output_alphabet = list(aout) - def determine_alphabets(self, reset=True): """ Determine the input and output alphabet according to the @@ -5424,19 +5334,13 @@ def determine_alphabets(self, reset=True): self.determine_input_alphabet(reset) self.determine_output_alphabet(reset) - - #************************************************************************* + # ************************************************************************ # get states and transitions - #************************************************************************* - + # ************************************************************************ def states(self): """ - Returns the states of the finite state machine. - - INPUT: - - Nothing. + Return the states of the finite state machine. OUTPUT: @@ -5452,11 +5356,7 @@ def states(self): def iter_states(self): """ - Returns an iterator of the states. - - INPUT: - - Nothing. + Return an iterator of the states. OUTPUT: @@ -5470,10 +5370,9 @@ def iter_states(self): """ return iter(self._states_) - def transitions(self, from_state=None): """ - Returns a list of all transitions. + Return a list of all transitions. INPUT: @@ -5493,10 +5392,9 @@ def transitions(self, from_state=None): """ return list(self.iter_transitions(from_state)) - def iter_transitions(self, from_state=None): """ - Returns an iterator of all transitions. + Return an iterator of all transitions. INPUT: @@ -5525,14 +5423,9 @@ def iter_transitions(self, from_state=None): else: return iter(self.state(from_state).transitions) - def _iter_transitions_all_(self): """ - Returns an iterator over all transitions. - - INPUT: - - Nothing. + Return an iterator over all transitions. OUTPUT: @@ -5549,14 +5442,9 @@ def _iter_transitions_all_(self): for t in state.transitions: yield t - def initial_states(self): """ - Returns a list of all initial states. - - INPUT: - - Nothing. + Return a list of all initial states. OUTPUT: @@ -5573,14 +5461,9 @@ def initial_states(self): """ return list(self.iter_initial_states()) - def iter_initial_states(self): """ - Returns an iterator of the initial states. - - INPUT: - - Nothing. + Return an iterator of the initial states. OUTPUT: @@ -5599,11 +5482,7 @@ def iter_initial_states(self): def final_states(self): """ - Returns a list of all final states. - - INPUT: - - Nothing. + Return a list of all final states. OUTPUT: @@ -5621,14 +5500,9 @@ def final_states(self): """ return list(self.iter_final_states()) - def iter_final_states(self): """ - Returns an iterator of the final states. - - INPUT: - - Nothing. + Return an iterator of the final states. OUTPUT: @@ -5648,7 +5522,7 @@ def iter_final_states(self): def state(self, state): """ - Returns the state of the finite state machine. + Return the state of the finite state machine. INPUT: @@ -5658,8 +5532,7 @@ def state(self, state): OUTPUT: - Returns the state of the finite state machine corresponding to - ``state``. + The state of the finite state machine corresponding to ``state``. If no state is found, then a ``LookupError`` is thrown. @@ -5692,10 +5565,9 @@ def what(s, switch): pass raise LookupError("No state with label %s found." % (what(state, switch),)) - def transition(self, transition): """ - Returns the transition of the finite state machine. + Return the transition of the finite state machine. INPUT: @@ -5705,8 +5577,8 @@ def transition(self, transition): OUTPUT: - Returns the transition of the finite state machine - corresponding to ``transition``. + The transition of the finite state machine corresponding + to ``transition``. If no transition is found, then a ``LookupError`` is thrown. @@ -5727,15 +5599,13 @@ def transition(self, transition): return s raise LookupError("No transition found.") - - #************************************************************************* + # ************************************************************************ # properties (state and transitions) - #************************************************************************* - + # ************************************************************************ def has_state(self, state): """ - Returns whether ``state`` is one of the states of the finite + Return whether ``state`` is one of the states of the finite state machine. INPUT: @@ -5757,10 +5627,9 @@ def has_state(self, state): except LookupError: return False - def has_transition(self, transition): """ - Returns whether ``transition`` is one of the transitions of + Return whether ``transition`` is one of the transitions of the finite state machine. INPUT: @@ -5786,10 +5655,9 @@ def has_transition(self, transition): return transition in self.iter_transitions() raise TypeError("Transition is not an instance of FSMTransition.") - def has_initial_state(self, state): """ - Returns whether ``state`` is one of the initial states of the + Return whether ``state`` is one of the initial states of the finite state machine. INPUT: @@ -5811,14 +5679,9 @@ def has_initial_state(self, state): except LookupError: return False - def has_initial_states(self): """ - Returns whether the finite state machine has an initial state. - - INPUT: - - Nothing. + Return whether the finite state machine has an initial state. OUTPUT: @@ -5829,12 +5692,11 @@ def has_initial_states(self): sage: FiniteStateMachine().has_initial_states() False """ - return len(self.initial_states()) > 0 - + return bool(self.initial_states()) def has_final_state(self, state): """ - Returns whether ``state`` is one of the final states of the + Return whether ``state`` is one of the final states of the finite state machine. INPUT: @@ -5855,14 +5717,9 @@ def has_final_state(self, state): except LookupError: return False - def has_final_states(self): """ - Returns whether the finite state machine has a final state. - - INPUT: - - Nothing. + Return whether the finite state machine has a final state. OUTPUT: @@ -5873,25 +5730,19 @@ def has_final_states(self): sage: FiniteStateMachine().has_final_states() False """ - return len(self.final_states()) > 0 - + return bool(self.final_states()) - #************************************************************************* + # ************************************************************************ # properties - #************************************************************************* - + # ************************************************************************ def is_deterministic(self): """ Return whether the finite finite state machine is deterministic. - INPUT: - - Nothing. - OUTPUT: - ``True`` or ``False``. + ``True`` or ``False`` A finite state machine is considered to be deterministic if each transition has input label of length one and for each @@ -5925,7 +5776,7 @@ def is_deterministic(self): sage: Automaton(initial_states=[0, 1]).is_deterministic() False """ - if len(self.initial_states())>1: + if len(self.initial_states()) > 1: return False for state in self.iter_states(): for transition in state.transitions: @@ -5936,23 +5787,18 @@ def is_deterministic(self): state.transitions, key=lambda t: t.word_in) - for key,transition_class in transition_classes_by_word_in: + for key, transition_class in transition_classes_by_word_in: if len(transition_class) > 1: return False return True - def is_complete(self): """ - Returns whether the finite state machine is complete. - - INPUT: - - Nothing. + Return whether the finite state machine is complete. OUTPUT: - ``True`` or ``False``. + ``True`` or ``False`` A finite state machine is considered to be complete if each transition has an input label of length one and for each @@ -6020,9 +5866,9 @@ def is_connected(self): raise NotImplementedError - #************************************************************************* + # ************************************************************************ # let the finite state machine work - #************************************************************************* + # ************************************************************************ _process_default_options_ = {'full_output': True, 'list_of_outputs': None, @@ -6030,10 +5876,9 @@ def is_connected(self): 'always_include_output': False, 'automatic_output_type': False} - def process(self, *args, **kwargs): """ - Returns whether the finite state machine accepts the input, the state + Return whether the finite state machine accepts the input, the state where the computation stops and which output is generated. INPUT: @@ -6638,14 +6483,14 @@ def _iter_process_simple_(self, iterator): "'simple' iterator cannot be used " "here." % (len(current),)) - pos, states = next(six.iteritems(current)) + pos, states = next(iter(current.items())) if len(states) > 1: raise RuntimeError("Process has branched " "(visiting %s states in branch). The " "'simple' iterator cannot be used " "here." % (len(states),)) - state, branch = next(six.iteritems(states)) + state, branch = next(iter(states.items())) if len(branch.outputs) > 1: raise RuntimeError("Process has branched. " "(%s different outputs in branch). The " @@ -6655,15 +6500,14 @@ def _iter_process_simple_(self, iterator): for o in branch.outputs[0]: yield o - branch.outputs[0] = [] # Reset output so that in the next round - # (of "for current in iterator") only new - # output is returned (by the yield). - + branch.outputs[0] = [] + # Reset output so that in the next round + # (of "for current in iterator") only new + # output is returned (by the yield). - #************************************************************************* + # ************************************************************************ # change finite state machine (add/remove state/transitions) - #************************************************************************* - + # ************************************************************************ def add_state(self, state): """ @@ -6959,9 +6803,9 @@ def add_from_transition_function(self, function, initial_states=None, state.is_initial = True not_done.append(state) else: - raise TypeError('Initial states must be iterable ' \ - '(e.g. a list of states).') - if len(not_done) == 0: + raise TypeError('Initial states must be iterable ' + '(e.g. a list of states).') + if not not_done: raise ValueError("No state is initial.") if explore_existing_states: ignore_done = self.states() @@ -6996,7 +6840,7 @@ def add_from_transition_function(self, function, initial_states=None, for (st_label, word) in return_value: if not self.has_state(st_label): not_done.append(self.add_state(st_label)) - elif len(ignore_done) > 0: + elif ignore_done: u = self.state(st_label) if u in ignore_done: not_done.append(u) @@ -7090,14 +6934,14 @@ def add_transitions_from_function(self, function, labels_as_input=True): transitions = return_value for t in transitions: if not hasattr(t, '__getitem__'): - raise ValueError("The callback function for " - "add_transitions_from_function " - "is expected to return a " - "pair (word_in, word_out) or a " - "list of such pairs. For " - "states %s and %s however, it " - "returned %s, which is not " - "acceptable." % (s_from, s_to, return_value)) + raise ValueError("The callback function for " + "add_transitions_from_function " + "is expected to return a " + "pair (word_in, word_out) or a " + "list of such pairs. For " + "states %s and %s however, it " + "returned %s, which is not " + "acceptable." % (s_from, s_to, return_value)) label_in = t[0] try: label_out = t[1] @@ -7183,10 +7027,9 @@ def remove_epsilon_transitions(self): """ raise NotImplementedError - def epsilon_successors(self, state): """ - Returns the dictionary with states reachable from ``state`` + Return the dictionary with states reachable from ``state`` without reading anything from an input tape as keys. The values are lists of outputs. @@ -7270,29 +7113,27 @@ def accessible_components(self): sage: F.accessible_components() Automaton with 3 states """ - - if len(self.initial_states()) == 0: + if not self.initial_states(): return deepcopy(self) - memo = {} + def accessible(from_state, read): return [(deepcopy(x.to_state, memo), x.word_out) for x in self.iter_transitions(from_state) if x.word_in[0] == read] - new_initial_states=[deepcopy(x, memo) for x in self.initial_states()] + new_initial_states = [deepcopy(x, memo) for x in self.initial_states()] result = self.empty_copy() result.add_from_transition_function(accessible, initial_states=new_initial_states) for final_state in self.iter_final_states(): try: - new_final_state=result.state(final_state.label) - new_final_state.is_final=True + new_final_state = result.state(final_state.label) + new_final_state.is_final = True except LookupError: pass return result - def coaccessible_components(self): r""" Return the sub-machine induced by the coaccessible states of this @@ -7813,7 +7654,7 @@ def product_FiniteStateMachine(self, other, function, final_function=None, new_class=None): r""" - Returns a new finite state machine whose states are + Return a new finite state machine whose states are `d`-tuples of states of the original finite state machines. INPUT: @@ -8080,7 +7921,7 @@ def default_final_function(*args): def composition(self, other, algorithm=None, only_accessible_components=True): """ - Returns a new transducer which is the composition of ``self`` + Return a new transducer which is the composition of ``self`` and ``other``. INPUT: @@ -8378,16 +8219,9 @@ def composition(self, other, algorithm=None, "possible.") if algorithm is None: - if (any(len(t.word_out) > 1 - for t in other.iter_transitions()) + if (any(len(t.word_out) > 1 for t in other.iter_transitions()) or - any(len(t.word_in) != 1 - for t in self.iter_transitions()) - #this might be used for multi-tape mode. - #or - #any(isinstance(t.word_in[0], tuple) and None in t.word_in[0] - # for t in self.iter_transitions()) - ): + any(len(t.word_in) != 1 for t in self.iter_transitions())): algorithm = 'explorative' else: algorithm = 'direct' @@ -8398,7 +8232,6 @@ def composition(self, other, algorithm=None, else: raise ValueError("Unknown algorithm %s." % (algorithm,)) - def _composition_direct_(self, other, only_accessible_components=True): """ See :meth:`.composition` for details. @@ -8544,16 +8377,11 @@ def composition_transition(states, input): F.output_alphabet = second.output_alphabet return F - def input_projection(self): """ - Returns an automaton where the output of each transition of + Return an automaton where the output of each transition of self is deleted. - INPUT: - - Nothing - OUTPUT: An automaton. @@ -8570,16 +8398,11 @@ def input_projection(self): """ return self.projection(what='input') - def output_projection(self): """ - Returns a automaton where the input of each transition of self + Return a automaton where the input of each transition of self is deleted and the new input is the original output. - INPUT: - - Nothing - OUTPUT: An automaton. @@ -8614,10 +8437,9 @@ def output_projection(self): """ return self.projection(what='output') - def projection(self, what='input'): """ - Returns an Automaton which transition labels are the projection + Return an Automaton which transition labels are the projection of the transition labels of the input. INPUT: @@ -8682,10 +8504,9 @@ def projection(self, what='input'): return new - def transposition(self, reverse_output_labels=True): """ - Returns a new finite state machine, where all transitions of the + Return a new finite state machine, where all transitions of the input finite state machine are reversed. INPUT: @@ -8784,17 +8605,12 @@ def transposition(self, reverse_output_labels=True): return transposition - def split_transitions(self): """ - Returns a new transducer, where all transitions in self with input + Return a new transducer, where all transitions in self with input labels consisting of more than one letter are replaced by a path of the corresponding length. - INPUT: - - Nothing. - OUTPUT: A new transducer. @@ -8825,16 +8641,11 @@ def split_transitions(self): transition.word_out)) return new - def final_components(self): """ - Returns the final components of a finite state machine as finite + Return the final components of a finite state machine as finite state machines. - INPUT: - - Nothing. - OUTPUT: A list of finite state machines, each representing a final @@ -9006,7 +8817,6 @@ def completion(self, sink=None): except LookupError: pass else: - from sage.rings.integer_ring import ZZ sink = 1 + max(itertools.chain( [-1], (s.label() for s in result.iter_states() @@ -9205,11 +9015,7 @@ def find_common_output(state): def equivalence_classes(self): r""" - Returns a list of equivalence classes of states. - - INPUT: - - Nothing. + Return a list of equivalence classes of states. OUTPUT: @@ -9283,7 +9089,7 @@ def equivalence_classes(self): state.final_word_out) states_grouped = full_group_by(self.states(), key=key_0) classes_current = [equivalence_class for - (key,equivalence_class) in states_grouped] + (key, equivalence_class) in states_grouped] while len(classes_current) != len(classes_previous): class_of = {} @@ -9303,15 +9109,13 @@ def equivalence_classes(self): for class_previous in classes_previous: states_grouped = full_group_by(class_previous, key=key_current) classes_current.extend([equivalence_class for - (key,equivalence_class) in states_grouped]) + (key, equivalence_class) in states_grouped]) return classes_current - def quotient(self, classes): r""" - Constructs the quotient with respect to the equivalence - classes. + Construct the quotient with respect to the equivalence classes. INPUT: @@ -9404,10 +9208,10 @@ def quotient(self, classes): for t in c[0].transitions]) for transition in self.iter_transitions(c[0]): new.add_transition( - from_state = new_state, - to_state = state_mapping[transition.to_state], - word_in = transition.word_in, - word_out = transition.word_out) + from_state=new_state, + to_state=state_mapping[transition.to_state], + word_in=transition.word_in, + word_out=transition.word_out) # check that all class members have the same information (modulo classes) for state in c: @@ -9477,7 +9281,7 @@ def key(transition): memo = {} for state in self.states(): - new_state = deepcopy(state,memo) + new_state = deepcopy(state, memo) state_dict[state] = new_state new.add_state(new_state) @@ -9882,20 +9686,18 @@ def find_final_word_out(state): # have been computed as it may not be permissible to stop at a # formerly non-final state unless a cycle has been completed. - for (state, position), final_word_out in six.iteritems(cache): + for (state, position), final_word_out in cache.items(): if position == 0 and final_word_out is not None: state.is_final = True state.final_word_out = final_word_out - # ************************************************************************* # other # ************************************************************************* - def graph(self, edge_labels='words_in_out'): """ - Returns the graph of the finite state machine with labeled + Return the graph of the finite state machine with labeled vertices and labeled edges. INPUT: @@ -9930,7 +9732,7 @@ def graph(self, edge_labels='words_in_out'): :class:`DiGraph` """ if edge_labels == 'words_in_out': - label_fct = lambda t:t._in_out_label_() + label_fct = lambda t: t._in_out_label_() elif hasattr(edge_labels, '__call__'): label_fct = edge_labels else: @@ -9940,7 +9742,7 @@ def graph(self, edge_labels='words_in_out'): isolated_vertices = [] for state in self.iter_states(): transitions = state.transitions - if len(transitions) == 0: + if not transitions: isolated_vertices.append(state.label()) for t in transitions: graph_data.append((t.from_state.label(), t.to_state.label(), @@ -10017,7 +9819,7 @@ def predecessors(self, state, valid_input=None): valid_list.append(input_list) valid_input = valid_list - unhandeled_direct_predecessors = {s:[] for s in self.states() } + unhandeled_direct_predecessors = {s: [] for s in self.states()} for t in self.transitions(): if valid_input is None or t.word_in in valid_input: unhandeled_direct_predecessors[t.to_state].append(t.from_state) @@ -10144,8 +9946,7 @@ def number_of_words(self, variable=var('n'), NotImplementedError: Finite State Machine must be deterministic. """ from sage.modules.free_module_element import vector - from sage.arith.all import falling_factorial - from sage.rings.integer_ring import ZZ + from sage.arith.all import binomial from sage.symbolic.ring import SR if base_ring is None: base_ring = QQbar @@ -10155,7 +9956,7 @@ def jordan_block_power(block, exponent): return matrix(block.nrows(), block.nrows(), lambda i, j: eigenvalue**(exponent-(j-i)) * - falling_factorial(exponent, j-i) / ZZ(j-i).factorial() + binomial(exponent, j - i) if j >= i else 0) if not self.is_deterministic(): @@ -10174,7 +9975,7 @@ def jordan_block_power(block, exponent): def asymptotic_moments(self, variable=var('n')): r""" - Returns the main terms of expectation and variance of the sum + Return the main terms of expectation and variance of the sum of output labels and its covariance with the sum of input labels. @@ -10605,9 +10406,11 @@ def get_matrix(fsm, x, y): y = R.symbol() z = R.symbol() M = get_matrix(self, x, y) + def substitute_one(g): return g.subs({x: 1, y: 1, z: 1}) else: + def substitute_one(g): # the result of the substitution shall live in QQ, # not in the polynomial ring R, so the method @@ -10975,8 +10778,7 @@ def default_is_zero(expression): def entry(transition): word_out = transition.word_out - if len(word_out) == 0 or ( - len(word_out) == 1 and not test(word_out[0])): + if not word_out or (len(word_out) == 1 and not test(word_out[0])): return transition.word_in[0] else: return 0 @@ -10984,7 +10786,6 @@ def entry(transition): relabeled = self.relabeled() n = len(relabeled.states()) assert [s.label() for s in relabeled.states()] == list(range(n)) - from sage.rings.integer_ring import ZZ entry_vector = vector(ZZ(s.is_initial) for s in relabeled.states()) exit_vector = vector([1] * n) @@ -11015,17 +10816,14 @@ def entry(transition): # ring, extend it instead of creating a univariate # polynomial ring over a polynomial ring. This # should improve performance. - R = PolynomialRing( - base_ring.base_ring(), - base_ring.variable_names() - + ('Z_waiting_time',)) + R = PolynomialRing(base_ring.base_ring(), + base_ring.variable_names() + + ('Z_waiting_time',)) else: R = PolynomialRing(base_ring, 'Z_waiting_time') Z = R.gens()[-1] - system_matrix = identity_matrix(n) - Z * \ - transition_matrix - G = entry_vector * system_matrix.solve_right( - exit_vector) + system_matrix = identity_matrix(n) - Z * transition_matrix + G = entry_vector * system_matrix.solve_right(exit_vector) expectation = G.subs({Z: 1}) variance = 2 * G.derivative(Z).subs({Z: 1}) \ + expectation \ @@ -11037,18 +10835,13 @@ def entry(transition): return {'expectation': expectation, 'variance': variance} - def is_monochromatic(self): """ - Checks whether the colors of all states are equal. - - INPUT: - - Nothing. + Check whether the colors of all states are equal. OUTPUT: - ``True`` or ``False``. + ``True`` or ``False`` EXAMPLES:: @@ -11063,7 +10856,6 @@ def is_monochromatic(self): """ return equal(s.color for s in self.iter_states()) - def language(self, max_length=None, **kwargs): r""" Return all words that can be written by this transducer. @@ -11158,7 +10950,7 @@ def language(self, max_length=None, **kwargs): it._finished_ = [] -#***************************************************************************** +# **************************************************************************** def is_Automaton(FSM): @@ -11278,13 +11070,13 @@ def _repr_(self): def _latex_transition_label_(self, transition, format_function=None): r""" - Returns the proper transition label. + Return the proper transition label. INPUT: - - ``transition`` - a transition + - ``transition`` -- a transition - - ``format_function`` - a function formatting the labels + - ``format_function`` -- a function formatting the labels OUTPUT: @@ -11311,10 +11103,9 @@ def _latex_transition_label_(self, transition, format_function = latex return format_function(transition.word_in) - def intersection(self, other, only_accessible_components=True): """ - Returns a new automaton which accepts an input if it is + Return a new automaton which accepts an input if it is accepted by both given automata. INPUT: @@ -11409,19 +11200,13 @@ def function(transition1, transition2): function, only_accessible_components=only_accessible_components) - cartesian_product = intersection - def determinisation(self): """ - Returns a deterministic automaton which accepts the same input + Return a deterministic automaton which accepts the same input words as the original one. - INPUT: - - Nothing. - OUTPUT: A new automaton, which is deterministic. @@ -11596,10 +11381,9 @@ def set_transition(states, letter): return result - def minimization(self, algorithm=None): """ - Returns the minimization of the input automaton as a new automaton. + Return the minimization of the input automaton as a new automaton. INPUT: @@ -11672,10 +11456,9 @@ def minimization(self, algorithm=None): else: raise NotImplementedError("Algorithm '%s' is not implemented. Choose 'Moore' or 'Brzozowski'" % algorithm) - def _minimization_Brzozowski_(self): """ - Returns a minimized automaton by using Brzozowski's algorithm. + Return a minimized automaton by using Brzozowski's algorithm. See also :meth:`.minimization`. @@ -11690,10 +11473,9 @@ def _minimization_Brzozowski_(self): """ return self.transposition().determinisation().transposition().determinisation() - def _minimization_Moore_(self): """ - Returns a minimized automaton by using Moore's algorithm. + Return a minimized automaton by using Moore's algorithm. See also :meth:`.minimization`. @@ -11712,10 +11494,9 @@ def _minimization_Moore_(self): if self.is_deterministic(): return self.quotient(self.equivalence_classes()) else: - raise NotImplementedError("Minimization via Moore's Algorithm is only " \ + raise NotImplementedError("Minimization via Moore's Algorithm is only " "implemented for deterministic finite state machines") - def complement(self): r""" Return the complement of this automaton. @@ -11802,7 +11583,7 @@ def is_equivalent(self, other): B = other.minimization().relabeled() labels = {B.process(path)[1].label(): state.label() - for (state, path) in six.iteritems(address)} + for (state, path) in address.items()} try: return A == B.relabeled(labels=labels) except KeyError: @@ -12204,7 +11985,6 @@ def shannon_parry_markov_chain(self): raise NotImplementedError("Automaton must be strongly connected.") if not all(s.is_final for s in self.iter_states()): raise NotImplementedError("All states must be final.") - from sage.rings.integer_ring import ZZ M = self.adjacency_matrix().change_ring(ZZ) states = {state: i for i, state in enumerate(self.iter_states())} w_all = sorted(M.eigenvectors_right(), @@ -12233,8 +12013,8 @@ def shannon_parry_markov_chain(self): P.state(s.label()).color = 1/(w[states[s]] * ff) P.state(s.label()).initial_probability = w[states[s]] * u[states[s]] return P - - + + def with_output(self, word_out_function=None): r""" Construct a transducer out of this automaton. @@ -12382,7 +12162,7 @@ def language(self, max_length=None, **kwargs): return T.language(max_length) -#***************************************************************************** +# **************************************************************************** def is_Transducer(FSM): @@ -12482,13 +12262,13 @@ def _repr_(self): def _latex_transition_label_(self, transition, format_function=None): r""" - Returns the proper transition label. + Return the proper transition label. INPUT: - - ``transition`` - a transition + - ``transition`` -- a transition - - ``format_function`` - a function formatting the labels + - ``format_function`` -- a function formatting the labels OUTPUT: @@ -12516,10 +12296,9 @@ def _latex_transition_label_(self, transition, return (format_function(transition.word_in) + "\\mid " + format_function(transition.word_out)) - def intersection(self, other, only_accessible_components=True): """ - Returns a new transducer which accepts an input if it is accepted by + Return a new transducer which accepts an input if it is accepted by both given finite state machines producing the same output. INPUT: @@ -12821,14 +12600,9 @@ def final_function(*states): final_function=final_function, only_accessible_components=only_accessible_components) - def simplification(self): """ - Returns a simplified transducer. - - INPUT: - - Nothing. + Return a simplified transducer. OUTPUT: @@ -13225,10 +12999,10 @@ class is created and is used during the processing. result = super(Transducer, self).process(*args, **options) if (condensed_output and not result or - not options['full_output'] and result is None): - raise ValueError("Invalid input sequence.") + not options['full_output'] and result is None): + raise ValueError("Invalid input sequence.") if condensed_output and len(result) >= 2: - raise ValueError("Found more than one accepting path.") + raise ValueError("Found more than one accepting path.") if condensed_output: return result[0] @@ -13273,7 +13047,7 @@ def _process_convert_output_(self, output_data, **kwargs): return output -#***************************************************************************** +# **************************************************************************** class _FSMTapeCache_(SageObject): @@ -13371,14 +13145,9 @@ def __init__(self, tape_cache_manager, tape, tape_ended, self.tape_cache_manager.append(self) self.cache = tuple(collections.deque() for _ in self.tape) - def _repr_(self): """ - Returns a string representation of ``self``. - - INPUT: - - Nothing. + Return a string representation of ``self``. OUTPUT: @@ -13435,7 +13204,7 @@ def __deepcopy__(self, memo): def deepcopy(self, memo=None): """ - Returns a deepcopy of ``self``. + Return a deepcopy of ``self``. INPUT: @@ -13519,10 +13288,9 @@ def read(self, track_number): return (True, newval) - def finished(self, track_number=None): r""" - Returns whether the tape (or a particular track) has reached an + Return whether the tape (or a particular track) has reached an end, i.e., there are no more letters in the cache and nothing more to read on the original tape. @@ -13533,7 +13301,7 @@ def finished(self, track_number=None): OUTPUT: - ``True`` or ``False``. + ``True`` or ``False`` TESTS:: @@ -13688,7 +13456,7 @@ def preview_word(self, track_number=None, length=1, return_word=False): def compare_to_tape(self, track_number, word): """ - Returns whether it is possible to read ``word`` from the given + Return whether it is possible to read ``word`` from the given track successfully. INPUT: @@ -13699,7 +13467,7 @@ def compare_to_tape(self, track_number, word): OUTPUT: - ``True`` or ``False``. + ``True`` or ``False`` TESTS:: @@ -13949,7 +13717,7 @@ def _transition_possible_test_(self, word_in): for track_number, word in enumerate(word_in_transposed)) -#***************************************************************************** +# **************************************************************************** class _FSMTapeCacheDetectEpsilon_(_FSMTapeCache_): @@ -14021,7 +13789,7 @@ def _transition_possible_test_(self, word_in): return self._transition_possible_epsilon_(word_in) -#***************************************************************************** +# **************************************************************************** class _FSMTapeCacheDetectAll_(_FSMTapeCache_): @@ -14080,7 +13848,7 @@ def compare_to_tape(self, track_number, word): return True -#***************************************************************************** +# **************************************************************************** def tupleofwords_to_wordoftuples(tupleofwords): @@ -14133,13 +13901,14 @@ def wordoftuples_to_tupleofwords(wordoftuples): """ if not equal(len(t) for t in wordoftuples): raise ValueError("Not all entries of input have the same length.") + def remove_empty_letters(word): return [letter for letter in word if letter is not None] return tuple(remove_empty_letters(word) for word in zip(*wordoftuples)) -#***************************************************************************** +# **************************************************************************** def is_FSMProcessIterator(PI): @@ -14155,7 +13924,7 @@ def is_FSMProcessIterator(PI): return isinstance(PI, FSMProcessIterator) -#***************************************************************************** +# **************************************************************************** class FSMProcessIterator(SageObject, @@ -14411,11 +14180,7 @@ class Current(dict): """ def __repr__(self): """ - Returns a nice representation of ``self``. - - INPUT: - - Nothing. + Return a nice representation of ``self``. OUTPUT: @@ -14439,8 +14204,8 @@ def __repr__(self): """ data = sorted( (state, pos, tape_cache, outputs) - for pos, states in six.iteritems(self) - for state, (tape_cache, outputs) in six.iteritems(states)) + for pos, states in self.items() + for state, (tape_cache, outputs) in states.items()) branch = "branch" if len(data) == 1 else "branches" result = "process (%s %s)" % (len(data), branch) for s, sdata in itertools.groupby(data, lambda x: x[0]): @@ -14716,7 +14481,7 @@ def _push_branches_(self, state, tape_cache, outputs): 'but output is written.' % (state,)) for eps_state, eps_outputs in \ - six.iteritems(state._epsilon_successors_(self.fsm)): + state._epsilon_successors_(self.fsm).items(): if eps_state == state: continue # "eps_state == state" means epsilon cycle @@ -14909,18 +14674,16 @@ def step(current_state, input_tape, outputs): return states_dict = self._current_.pop(heapq.heappop(self._current_positions_)) - for state, branch in six.iteritems(states_dict): + for state, branch in states_dict.items(): step(state, branch.tape_cache, branch.outputs) return self._current_ - next = __next__ - def result(self, format_output=None): """ - Returns the already finished branches during process. + Return the already finished branches during process. INPUT: @@ -14967,7 +14730,7 @@ def result(self, format_output=None): def preview_word(self, track_number=None, length=1, return_word=False): """ - Reads a word from the input tape. + Read a word from the input tape. INPUT: @@ -15022,7 +14785,7 @@ def preview_word(self, track_number=None, length=1, return_word=False): track_number, length, return_word) -#***************************************************************************** +# **************************************************************************** class _FSMProcessIteratorEpsilon_(FSMProcessIterator): @@ -15469,7 +15232,7 @@ def __init__(self, *args, **kwargs): return super(_FSMProcessIteratorAll_, self).__init__(*args, **kwargs) -#***************************************************************************** +# **************************************************************************** @cached_function @@ -15479,14 +15242,6 @@ def setup_latex_preamble(): to the preamble of Latex so that the finite state machines can be drawn nicely. - INPUT: - - Nothing. - - OUTPUT: - - Nothing. - See the section on :ref:`finite_state_machine_LaTeX_output` in the introductory examples of this module. From 62dc948cc2fb4309af1cfa4b984e377f31852acb Mon Sep 17 00:00:00 2001 From: Eric Gourgoulhon Date: Sun, 3 May 2020 17:57:07 +0200 Subject: [PATCH 091/301] #29639: correct the fix --- src/sage/manifolds/differentiable/tensorfield.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/manifolds/differentiable/tensorfield.py b/src/sage/manifolds/differentiable/tensorfield.py index b2b434f6f4b..155cf0ebc6d 100644 --- a/src/sage/manifolds/differentiable/tensorfield.py +++ b/src/sage/manifolds/differentiable/tensorfield.py @@ -766,7 +766,7 @@ def _init_components(self, *comp, **kwargs): # For compatibility with previous use of tensor_field(): self.set_name(comp0) else: - if isinstance(comp0, (list, tuple)): + if hasattr(comp0, '__len__') and hasattr(comp0, '__getitem__'): # comp0 is a list/vector of components # otherwise comp is the tuple of components in a specific frame comp = comp0 From e96c6ee56ad04152bf3c657e1f720ac2716f8e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 4 May 2020 09:08:00 +0200 Subject: [PATCH 092/301] trac 29641 fix some details --- src/sage/combinat/finite_state_machine.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sage/combinat/finite_state_machine.py b/src/sage/combinat/finite_state_machine.py index 61ebd590769..304ccaed330 100644 --- a/src/sage/combinat/finite_state_machine.py +++ b/src/sage/combinat/finite_state_machine.py @@ -1091,7 +1091,7 @@ def startswith(list_, prefix): """ if len(prefix) > len(list_): return False - return all(x == y for x, y in zip(list_, prefix)) + return list_[:len(prefix)] == prefix # **************************************************************************** @@ -2450,8 +2450,7 @@ def __eq__(self, other): True """ if not is_FSMTransition(other): - raise TypeError('Only instances of FSMTransition ' - 'can be compared.') + return False return self.from_state == other.from_state \ and self.to_state == other.to_state \ and self.word_in == other.word_in \ From b2e93e1e8133e14a7d6edbd53655a788ce596998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 4 May 2020 09:20:34 +0200 Subject: [PATCH 093/301] trac 29641 another fix --- src/sage/combinat/finite_state_machine.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sage/combinat/finite_state_machine.py b/src/sage/combinat/finite_state_machine.py index 304ccaed330..0155251214b 100644 --- a/src/sage/combinat/finite_state_machine.py +++ b/src/sage/combinat/finite_state_machine.py @@ -3990,8 +3990,7 @@ def __eq__(self, other): True """ if not is_FiniteStateMachine(other): - raise TypeError('Only instances of FiniteStateMachine ' - 'can be compared.') + return False if len(self._states_) != len(other._states_): return False colors_equal = True From bff915efa374aac254aad0eacd5250eca1836f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 4 May 2020 10:54:06 +0200 Subject: [PATCH 094/301] spring cleanup for typos (may 2020) --- src/sage/algebras/commutative_dga.py | 2 +- .../algebras/lie_algebras/classical_lie_algebra.py | 8 ++++---- src/sage/algebras/lie_algebras/verma_module.py | 8 ++++---- src/sage/categories/bialgebras_with_basis.py | 2 +- src/sage/categories/pushout.py | 6 +++--- src/sage/combinat/integer_vectors_mod_permgroup.py | 9 +++++---- .../dynamics/arithmetic_dynamics/projective_ds.py | 4 ++-- src/sage/ext_data/threejs/threejs_template.html | 4 ++-- src/sage/functions/prime_pi.pyx | 8 ++++---- src/sage/geometry/polyhedron/base.py | 7 +++---- .../polyhedron/combinatorial_polyhedron/base.pyx | 8 ++++---- .../combinatorial_polyhedron/list_of_faces.pyx | 2 +- .../graphs/graph_decompositions/clique_separators.pyx | 3 ++- src/sage/libs/flint/flint_ntl_wrap.h | 2 +- src/sage/libs/flint/flint_wrap.h | 2 +- .../differentiable/degenerate_submanifold.py | 2 +- src/sage/matrix/action.pyx | 9 +++++---- src/sage/matroids/extension.pyx | 11 ++++++----- src/sage/modular/cusps_nf.py | 2 +- src/sage/modular/modform_hecketriangle/readme.py | 2 +- src/sage/rings/integer.pyx | 2 +- src/sage/rings/localization.py | 5 +---- src/sage/rings/number_field/S_unit_solver.py | 2 +- src/sage/rings/polynomial/skew_polynomial_ring.py | 4 ++-- src/sage/rings/puiseux_series_ring_element.pyx | 6 +++--- src/sage/rings/qqbar.py | 2 +- src/sage/rings/valuation/inductive_valuation.py | 8 ++++---- src/sage/schemes/curves/projective_curve.py | 2 +- src/sage/schemes/elliptic_curves/mod_sym_num.pyx | 8 ++++---- src/sage/schemes/generic/algebraic_scheme.py | 4 ++-- .../hyperelliptic_finite_field.py | 10 +++++----- src/sage/structure/parent.pyx | 6 +++--- 32 files changed, 80 insertions(+), 80 deletions(-) diff --git a/src/sage/algebras/commutative_dga.py b/src/sage/algebras/commutative_dga.py index 24d0c041a8d..e6722c5c671 100644 --- a/src/sage/algebras/commutative_dga.py +++ b/src/sage/algebras/commutative_dga.py @@ -2533,7 +2533,7 @@ def minimal_model(self, i=3, max_iterations=3): def extend(phi, ndegrees, ndifs, nimags, nnames): """ - Extend phi to a new algebra with new genererators, labeled by nnames + Extend phi to a new algebra with new generators, labeled by nnames """ B = phi.domain() names = [str(g) for g in B.gens()] diff --git a/src/sage/algebras/lie_algebras/classical_lie_algebra.py b/src/sage/algebras/lie_algebras/classical_lie_algebra.py index 30e5176fdde..9bceec86923 100644 --- a/src/sage/algebras/lie_algebras/classical_lie_algebra.py +++ b/src/sage/algebras/lie_algebras/classical_lie_algebra.py @@ -14,15 +14,15 @@ - Travis Scrimshaw (2019-07-09): Implemented compact real form """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2013-2017 Travis Scrimshaw # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License 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 collections import OrderedDict from sage.misc.abstract_method import abstract_method @@ -238,7 +238,7 @@ def epsilon(self, i, h): """ return h[i-1,i-1] - # Do we want this to be optional or requried? + # Do we want this to be optional or required? # There probably is a generic implementation we can do. @abstract_method(optional=True) def simple_root(self, i, h): diff --git a/src/sage/algebras/lie_algebras/verma_module.py b/src/sage/algebras/lie_algebras/verma_module.py index 8781879bc8c..c59d964499f 100644 --- a/src/sage/algebras/lie_algebras/verma_module.py +++ b/src/sage/algebras/lie_algebras/verma_module.py @@ -11,15 +11,15 @@ and return as the ``construction()``. """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2017 Travis Scrimshaw # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License 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 sage.misc.lazy_attribute import lazy_attribute from sage.misc.cachefunc import cached_method @@ -651,7 +651,7 @@ def _acted_upon_(self, scalar, self_on_left=False): try: scalar = P._pbw(scalar) except (ValueError, TypeError): - # Cannot be made into a PBW element, so propogate it up + # Cannot be made into a PBW element, so propagate it up return CombinatorialFreeModule.Element._acted_upon_(self, scalar, self_on_left) diff --git a/src/sage/categories/bialgebras_with_basis.py b/src/sage/categories/bialgebras_with_basis.py index f7ced53db0a..831bab3f068 100644 --- a/src/sage/categories/bialgebras_with_basis.py +++ b/src/sage/categories/bialgebras_with_basis.py @@ -82,7 +82,7 @@ def convolution_product(self, *maps): EXAMPLES: We construct some maps: the identity, the antipode and - projection onto the homogeneous componente of degree 2:: + projection onto the homogeneous component of degree 2:: sage: Id = lambda x: x sage: Antipode = lambda x: x.antipode() diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py index 27e436c6360..6f9d44fea82 100644 --- a/src/sage/categories/pushout.py +++ b/src/sage/categories/pushout.py @@ -1260,7 +1260,7 @@ def __init__(self, gens, order, implementation): def _apply_functor_to_morphism(self, f): """ - Morphisms for inifinite polynomial rings are not implemented yet. + Morphisms for infinite polynomial rings are not implemented yet. TESTS:: @@ -1270,10 +1270,10 @@ def _apply_functor_to_morphism(self, f): sage: R.construction()[0](f) # indirect doctest Traceback (most recent call last): ... - NotImplementedError: Morphisms for inifinite polynomial rings are not implemented yet. + NotImplementedError: Morphisms for infinite polynomial rings are not implemented yet. """ - raise NotImplementedError("Morphisms for inifinite polynomial rings are not implemented yet.") + raise NotImplementedError("Morphisms for infinite polynomial rings are not implemented yet.") def _apply_functor(self, R): """ diff --git a/src/sage/combinat/integer_vectors_mod_permgroup.py b/src/sage/combinat/integer_vectors_mod_permgroup.py index 98f3c656469..684c7508564 100644 --- a/src/sage/combinat/integer_vectors_mod_permgroup.py +++ b/src/sage/combinat/integer_vectors_mod_permgroup.py @@ -1,14 +1,14 @@ r""" Integer vectors modulo the action of a permutation group """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2010-12 Nicolas Borie # # Distributed under the terms of the GNU General Public License (GPL) # # The full text of the GPL is available at: -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** from __future__ import print_function from sage.structure.unique_representation import UniqueRepresentation @@ -24,6 +24,7 @@ from sage.combinat.integer_vector import IntegerVectors + class IntegerVectorsModPermutationGroup(UniqueRepresentation): r""" Returns an enumerated set containing integer vectors which are @@ -963,5 +964,5 @@ def check(self): if self.parent()._sum is not None: assert sum(self) == self.parent()._sum, '%s should be a integer vector of sum %s'%(self, self.parent()._sum) if self.parent()._max_part >= 0: - assert max(self) <= self.parent()._max_part, 'Entries of %s must be inferiors to %s'%(self, self.parent()._max_part) + assert max(self) <= self.parent()._max_part, 'Entries of %s must be inferior to %s'%(self, self.parent()._max_part) assert self.parent().is_canonical(self) diff --git a/src/sage/dynamics/arithmetic_dynamics/projective_ds.py b/src/sage/dynamics/arithmetic_dynamics/projective_ds.py index 41cbe752f7a..52c436c51f2 100644 --- a/src/sage/dynamics/arithmetic_dynamics/projective_ds.py +++ b/src/sage/dynamics/arithmetic_dynamics/projective_ds.py @@ -4794,7 +4794,7 @@ def reduced_form(self, **kwds): ) """ if self.domain().ambient_space().dimension_relative() != 1: - return NotImplementedError('only implmeneted for dimension 1') + return NotImplementedError('only implemented for dimension 1') return_conjugation = kwds.get('return_conjugation', True) emb = kwds.get('emb', None) prec = kwds.get('prec', 300) @@ -4803,7 +4803,7 @@ def reduced_form(self, **kwds): dynatomic = algorithm = kwds.get('dynatomic', True) smallest_coeffs = kwds.get('smallest_coeffs', True) if smallest_coeffs: - if self.base_ring() not in [ZZ,QQ]: + if self.base_ring() not in [ZZ, QQ]: raise NotImplementedError("smallest coeff only over ZZ or QQ") check_min = kwds.get('check_minimal', True) from sage.dynamics.arithmetic_dynamics.endPN_minimal_model import smallest_dynamical diff --git a/src/sage/ext_data/threejs/threejs_template.html b/src/sage/ext_data/threejs/threejs_template.html index 2833d5021fe..ff1ebb9b829 100644 --- a/src/sage/ext_data/threejs/threejs_template.html +++ b/src/sage/ext_data/threejs/threejs_template.html @@ -133,7 +133,7 @@ var sprite = new THREE.Sprite( new THREE.SpriteMaterial( { map: texture } ) ); sprite.position.set( x, y, z ); - // Set the initial scale based on plot size to accomodate orthographic projection. + // Set the initial scale based on plot size to accommodate orthographic projection. // For other projections, the scale will get reset each frame based on camera distance. var scale = midToCorner/2; sprite.scale.set( scale, scale*.25 ); // ratio of canvas width to height @@ -360,7 +360,7 @@ renderer.render( scene, camera ); // Resize text based on distance from camera. - // Not neccessary for orthographic due to the nature of the projection (preserves sizes). + // Not necessary for orthographic due to the nature of the projection (preserves sizes). if ( !camera.isOrthographicCamera ) { for ( var i=0 ; i < scene.children.length ; i++ ) { if ( scene.children[i].type === 'Sprite' ) { diff --git a/src/sage/functions/prime_pi.pyx b/src/sage/functions/prime_pi.pyx index a29dce47bff..60ddf604af1 100644 --- a/src/sage/functions/prime_pi.pyx +++ b/src/sage/functions/prime_pi.pyx @@ -18,15 +18,15 @@ EXAMPLES:: True """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2009,2011 R. Andrew Ohana # Copyright (C) 2009 William Stein # # 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 cypari2.paridecl cimport * from cysignals.signals cimport * @@ -274,7 +274,7 @@ cdef class PrimePi(BuiltinFunction): cdef uint32_t _cached_count(self, uint32_t p): r""" For p < 65536, returns the value stored in ``self.__smallPi[p]``. For - p <= ``self.__maxSieve``, uses a binary seach on ``self.__primes`` to + p <= ``self.__maxSieve``, uses a binary search on ``self.__primes`` to compute pi(p). """ # inspired by Yann Laigle-Chapuy's suggestion diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 01989bbd80e..7e8f04713ab 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -2,7 +2,7 @@ Base class for polyhedra """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2008 Marshall Hampton # Copyright (C) 2011 Volker Braun # Copyright (C) 2015 Jean-Philippe Labbe @@ -13,7 +13,7 @@ # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # https://www.gnu.org/licenses/ -#***************************************************************************** +# **************************************************************************** from __future__ import division, print_function, absolute_import @@ -3253,14 +3253,13 @@ def is_simple(self): sage: p = Polyhedron([[0,0,0],[4,4,0],[4,0,0],[0,4,0],[2,2,2]]) sage: p.is_simple() False - """ if not self.is_compact(): return False return self.combinatorial_polyhedron().is_simple() def simpliciality(self): r""" - Return the largest interger `k` such that the polytope is `k`-simplicial. + Return the largest integer `k` such that the polytope is `k`-simplicial. A polytope is `k`-simplicial, if every `k`-face is a simplex. If `self` is a simplex, returns its dimension. diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx index d7d27efc5f0..83c922e05d2 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx @@ -1471,13 +1471,13 @@ cdef class CombinatorialPolyhedron(SageObject): else: facet_names = self.facet_names() if facet_names is None: - # No names where provided at initializiation. - facet_names = [("H",i) for i in range(n_facets)] + # No names where provided at initialisation. + facet_names = [("H", i) for i in range(n_facets)] Vrep = self.Vrep() if Vrep is None: - # No names where provided at initializiation. - Vrep = [("V",i) for i in range(n_Vrep)] + # No names where provided at initialisation. + Vrep = [("V", i) for i in range(n_Vrep)] vertices = Vrep + facet_names edges = tuple((Vrep[j], facet_names[n_facets - 1 - i]) for i,facet in enumerate(facet_iter) for j in facet.ambient_V_indices()) diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx index 920f297a89a..2db092697a2 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx @@ -347,7 +347,7 @@ cdef class ListOfFaces: return count_atoms(faces[0], face_length) # ``maybe_newfaces`` are all intersection of ``faces[n_faces -1]`` with previous faces. - # It needs to be allcoated to store those faces. + # It needs to be allocated to store those faces. cdef ListOfFaces maybe_newfaces_mem = ListOfFaces(n_faces, face_length*64) cdef uint64_t **maybe_newfaces = maybe_newfaces_mem.data diff --git a/src/sage/graphs/graph_decompositions/clique_separators.pyx b/src/sage/graphs/graph_decompositions/clique_separators.pyx index 3df6224d839..3c4e1b06723 100644 --- a/src/sage/graphs/graph_decompositions/clique_separators.pyx +++ b/src/sage/graphs/graph_decompositions/clique_separators.pyx @@ -157,6 +157,7 @@ cdef inline bint is_clique(short_digraph sd, vector[int] Hx): return False return True + def atoms_and_clique_separators(G, tree=False, rooted_tree=False, separators=False): r""" Return the atoms of the decomposition of `G` by clique minimal separators. @@ -200,7 +201,7 @@ def atoms_and_clique_separators(G, tree=False, rooted_tree=False, separators=Fal OUTPUT: - By default, return a tuple `(A, S_c)`, where `A` is the list of atoms of - the graph in the order of dicovery, and `S_c` is the list of clique + the graph in the order of discovery, and `S_c` is the list of clique separators, with possible repetitions, in the order the separator has been considered. If furthermore ``separators`` is ``True``, return a tuple `(A, S_h, S_c)`, where `S_c` is the list of considered separators of the graph diff --git a/src/sage/libs/flint/flint_ntl_wrap.h b/src/sage/libs/flint/flint_ntl_wrap.h index 058d13b2e92..841d990817d 100644 --- a/src/sage/libs/flint/flint_ntl_wrap.h +++ b/src/sage/libs/flint/flint_ntl_wrap.h @@ -15,7 +15,7 @@ #include /* If flint was already previously included via another header (e.g. - * arb_wrap.h) then it may be neessary to redefine ulong and slong again */ + * arb_wrap.h) then it may be necessary to redefine ulong and slong again */ #ifndef ulong #define ulong mp_limb_t diff --git a/src/sage/libs/flint/flint_wrap.h b/src/sage/libs/flint/flint_wrap.h index 179597d2d56..b68c93ce810 100644 --- a/src/sage/libs/flint/flint_wrap.h +++ b/src/sage/libs/flint/flint_wrap.h @@ -24,7 +24,7 @@ #include /* If flint was already previously included via another header (e.g. - * arb_wrap.h) then it may be neessary to redefine ulong and slong again */ + * arb_wrap.h) then it may be necessary to redefine ulong and slong again */ #ifndef ulong #define ulong mp_limb_t diff --git a/src/sage/manifolds/differentiable/degenerate_submanifold.py b/src/sage/manifolds/differentiable/degenerate_submanifold.py index 43e097f2e3c..2aada97535b 100644 --- a/src/sage/manifolds/differentiable/degenerate_submanifold.py +++ b/src/sage/manifolds/differentiable/degenerate_submanifold.py @@ -425,7 +425,7 @@ def list_of_screens(self): def set_transverse(self, rigging=None, normal=None): r""" - For setting a transversal disttribution of the degenerate submanifold. + For setting a transversal distribution of the degenerate submanifold. according to the type of the submanifold amoung the 4 possible types, one must enter a list of normal transversal vector fields and/or a list of transversal and not normal vector fields spanning a transverse diff --git a/src/sage/matrix/action.pyx b/src/sage/matrix/action.pyx index 12000c49764..14d2d5cc414 100644 --- a/src/sage/matrix/action.pyx +++ b/src/sage/matrix/action.pyx @@ -50,15 +50,15 @@ AUTHOR: - Robert Bradshaw (2007-09): Initial version. """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2007 Robert Bradshaw # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License 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/ +# **************************************************************************** import operator @@ -517,9 +517,10 @@ cdef class PolymapMatrixAction(MatrixMulAction): """ return f._polymap_times_matrix_(mat, self._codomain) + cdef class MatrixSchemePointAction(MatrixMulAction): r""" - Action class for left multiplication of schemes points by matricies. + Action class for left multiplication of schemes points by matrices. """ def __init__(self, G, S): """ diff --git a/src/sage/matroids/extension.pyx b/src/sage/matroids/extension.pyx index c0156678def..cb47076bebb 100644 --- a/src/sage/matroids/extension.pyx +++ b/src/sage/matroids/extension.pyx @@ -18,7 +18,7 @@ AUTHORS: Methods ======= """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2013 Rudi Pendavingh # Copyright (C) 2013 Stefan van Zwam # @@ -26,13 +26,14 @@ Methods # 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/ +# **************************************************************************** include 'sage/data_structures/bitset.pxi' from .basis_matroid cimport BasisMatroid from sage.arith.all import binomial + cdef class CutNode: """ An internal class used for creating linear subclasses of a matroids in a @@ -41,11 +42,11 @@ cdef class CutNode: A linear subclass is a set of hyperplanes `mc` with the property that certain sets of hyperplanes must either be fully contained in `mc` or intersect `mc` in at most 1 element. The way we generate them is by a - depth-first seach. This class represents a node in the search tree. + depth-first search. This class represents a node in the search tree. It contains the set of hyperplanes selected so far, as well as a collection of hyperplanes whose insertion has been explored elsewhere in - the seach tree. + the search tree. The class has methods for selecting a hyperplane to insert, for inserting hyperplanes and closing the set to become a linear subclass again, and for diff --git a/src/sage/modular/cusps_nf.py b/src/sage/modular/cusps_nf.py index da0cb670cc0..c4c414a0d2a 100644 --- a/src/sage/modular/cusps_nf.py +++ b/src/sage/modular/cusps_nf.py @@ -1100,7 +1100,7 @@ def number_of_Gamma0_NFCusps(N): OUTPUT: - ingeter -- the number of orbits of cusps under Gamma0(N)-action. + integer -- the number of orbits of cusps under Gamma0(N)-action. EXAMPLES:: diff --git a/src/sage/modular/modform_hecketriangle/readme.py b/src/sage/modular/modform_hecketriangle/readme.py index cc89da2da80..c5455b39a88 100644 --- a/src/sage/modular/modform_hecketriangle/readme.py +++ b/src/sage/modular/modform_hecketriangle/readme.py @@ -602,7 +602,7 @@ - Specifying the form as a rational function in the basic generators (see below) - For weakly holomorphic modular forms it is possible to exactly determine the form by specifying (sufficiently many) initial coefficients of its Fourier expansion. - - There is even hope (no garantuee) to determine a (exact) form from + - There is even hope (no guarantee) to determine a (exact) form from the initial numerical coefficients (see below). - By specifying the coefficients with respect to a basis of the space (if the corresponding space supports coordinate vectors) diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx index 1879407eb16..44936e6a6a4 100644 --- a/src/sage/rings/integer.pyx +++ b/src/sage/rings/integer.pyx @@ -7254,7 +7254,7 @@ cdef class int_to_Z(Morphism): sage: type(1 + 2r) - This is intented for internal use by the coercion system, + This is intended for internal use by the coercion system, to facilitate fast expressions mixing ints and more complex Python types. Note that (as with all morphisms) the input is forcably coerced to the domain ``int`` if it is not diff --git a/src/sage/rings/localization.py b/src/sage/rings/localization.py index 652d4898bb7..91cec331999 100644 --- a/src/sage/rings/localization.py +++ b/src/sage/rings/localization.py @@ -239,8 +239,6 @@ def normalize_additional_units(base_ring, add_units, warning=True): return sorted(set(add_units_result)) - - class LocalizationElement(IntegralDomainElement): """ Element class for localizations of integral domains @@ -476,13 +474,12 @@ class Localization(IntegralDomain, UniqueRepresentation): the exact division operator `//` (:meth:`sage.structure.element.Element.__floordiv__`) in order to guarantee an successful application. - INPUT: - ``base_ring`` -- an instance of :class:`Ring` allowing the construction of :meth:`fraction_field` (that is an integral domain) - ``additional_units`` -- tuple of elements of ``base_ring`` which should be turned into units - ``names`` -- passed to :class:`IntegralDomain` - - ``normalize`` -- (optinal, default: True) passed to :class:`IntegralDomain` + - ``normalize`` -- (optional, default: True) passed to :class:`IntegralDomain` - ``category`` -- (optional, default: None) passed to :class:`IntegralDomain` - ``warning`` -- (optional, default: True) to supress a warning which is thrown if self cannot be represented uniquely diff --git a/src/sage/rings/number_field/S_unit_solver.py b/src/sage/rings/number_field/S_unit_solver.py index 7612ed0ddc0..0365c4313f1 100644 --- a/src/sage/rings/number_field/S_unit_solver.py +++ b/src/sage/rings/number_field/S_unit_solver.py @@ -1931,7 +1931,7 @@ def ev_flatten(vec): rfv_to_ev = {} - # We build a second dictionary of dictiories. + # We build a second dictionary of dictionaries. # comp_exp_vec[q] is the dictionary mod q which assigns to each exponent vector # a list of 'complementary' exponent vectors. diff --git a/src/sage/rings/polynomial/skew_polynomial_ring.py b/src/sage/rings/polynomial/skew_polynomial_ring.py index 1c30938bc73..2b65396ce2d 100644 --- a/src/sage/rings/polynomial/skew_polynomial_ring.py +++ b/src/sage/rings/polynomial/skew_polynomial_ring.py @@ -5,7 +5,7 @@ which constructs a general dense skew univariate polynomials over commutative base rings with automorphisms over the base rings. This is the set of formal polynomials where the coefficients are written on the left of the variable of the skew polynomial ring. The modified multiplication -operation over elements of the base ring is extended to all elements of the skew poynomial ring +operation over elements of the base ring is extended to all elements of the skew polynomial ring by associativity and distributivity. This module also provides :class:`~sage.rings.polynomial.skew_polynomial_ring.SkewPolynomialRing_finite_order` @@ -1396,7 +1396,7 @@ def center(self, name=None, names=None, default=False): sage: P.parent() is S True - together with a converion map in the reverse direction:: + together with a conversion map in the reverse direction:: sage: Zy(x^6 + 2*x^3 + 3) y^2 + 2*y + 3 diff --git a/src/sage/rings/puiseux_series_ring_element.pyx b/src/sage/rings/puiseux_series_ring_element.pyx index 29be2de67af..d4bedc3428f 100644 --- a/src/sage/rings/puiseux_series_ring_element.pyx +++ b/src/sage/rings/puiseux_series_ring_element.pyx @@ -99,7 +99,7 @@ REFERENCES: # it under the terms of the GNU General Public License 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 sage.arith.functions import lcm @@ -141,7 +141,7 @@ cdef class PuiseuxSeries(AlgebraElement): - ``f`` -- one of the following types of inputs: * instance of :class:`PuiseuxSeries` - * instance that can be coerced into the Laurent sersies ring of the parent + * instance that can be coerced into the Laurent series ring of the parent - ``e`` -- integer (default: 1) the ramification index @@ -182,7 +182,7 @@ cdef class PuiseuxSeries(AlgebraElement): # -------------------------------------------------------- # choose a representative for this Puiseux series having - # minimal ramification index. This is neccessary because + # minimal ramification index. This is necessary because # some methods need it as minimal as possible (for example # :meth:`laurent_series' or :meth:`power_series`) # -------------------------------------------------------- diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index dc6556c8902..fb169169da8 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -877,7 +877,7 @@ def _factor_multivariate_polynomial(self, f, proof=True): # # As nbruin pointed out during the review of Trac #25390, # this can be accomplished more efficiently using the resultant - # of the polynomial with the number field's minimial polynomial. + # of the polynomial with the number field's minimal polynomial. # # We use two auxiliary polynomial rings: # diff --git a/src/sage/rings/valuation/inductive_valuation.py b/src/sage/rings/valuation/inductive_valuation.py index de73549d9d2..a3bf9ad3275 100644 --- a/src/sage/rings/valuation/inductive_valuation.py +++ b/src/sage/rings/valuation/inductive_valuation.py @@ -29,14 +29,14 @@ An introduction is also given in Chapter 4 of [Rüt2014]_. """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2016-2018 Julian Rüth # # 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 __future__ import absolute_import from .valuation import DiscreteValuation, InfiniteDiscretePseudoValuation @@ -676,7 +676,7 @@ def mac_lane_step(self, G, principal_part_bound=None, assume_squarefree=False, a INPUT: - - ``G`` -- a sqaurefree monic non-constant integral polynomial ``G`` + - ``G`` -- a squarefree monic non-constant integral polynomial ``G`` which is not an :meth:`equivalence unit ` - ``principal_part_bound`` -- an integer or ``None`` (default: diff --git a/src/sage/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py index 592bb68dc65..360fb88dc6a 100644 --- a/src/sage/schemes/curves/projective_curve.py +++ b/src/sage/schemes/curves/projective_curve.py @@ -2291,7 +2291,7 @@ def _coordinate_functions(self): sage: C._coordinate_functions (1, y, z) """ - # homogeneous cooridinate functions + # homogeneous coordinate functions coords = list(self._open_affine._coordinate_functions) coords.insert(self._open_affine_index, self._function_field.one()) return tuple(coords) diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index 6b661bd14aa..6a4e94c6285 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -147,7 +147,7 @@ AUTHOR: """ -#**************************************************************************** +# *************************************************************************** # Copyright (C) 2016 Chris Wuthrich # # Distributed under the terms of the GNU General Public License (GPL) @@ -159,8 +159,8 @@ AUTHOR: # # The full text of the GPL is available at: # -# http://www.gnu.org/licenses/ -#**************************************************************************** +# https://www.gnu.org/licenses/ +# *************************************************************************** from __future__ import print_function from cysignals.memory cimport sig_malloc, sig_free, sig_realloc @@ -1110,7 +1110,7 @@ cdef class ModularSymbolNumerical: # now to the bound for the unitary cusps # this is a bit better because they - # are definied over Q + # are defined over Q t0 = E0.torsion_order() if cinf == 1: t0 *= Integer(2) diff --git a/src/sage/schemes/generic/algebraic_scheme.py b/src/sage/schemes/generic/algebraic_scheme.py index 46d84da174b..b3af58476dc 100644 --- a/src/sage/schemes/generic/algebraic_scheme.py +++ b/src/sage/schemes/generic/algebraic_scheme.py @@ -1716,9 +1716,9 @@ def rational_points(self, **kwds): In the case of numerically approximated points, the points are returned over as points of the ambient space. - For a dimesion greater than 0 scheme, depending on bound size, either the + For a dimension greater than 0 scheme, depending on bound size, either the points in the ambient space are enumerated or a sieving algorithm lifting points - modulo primes is used. See the documention in homset for the details of the + modulo primes is used. See the documentation in homset for the details of the sieving algorithm. INPUT: diff --git a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py index 372d33a6007..62a7dc2b30a 100644 --- a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +++ b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py @@ -26,7 +26,7 @@ - Dean Bisogno (2017): Fixed Hasse-Witt computation """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2006 David Kohel # Copyright (C) 2007 Robert Bradshaw # Copyright (C) 2010 Alyson Deines , Marina Gresham @@ -45,10 +45,9 @@ # # The full text of the GPL is available at: # -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** from __future__ import absolute_import -from six.moves import range from sage.rings.all import ZZ, RR, QQ, GF from sage.arith.all import binomial @@ -62,6 +61,7 @@ from sage.schemes.curves.projective_curve import ProjectivePlaneCurve_finite_field + class HyperellipticCurve_finite_field(hyperelliptic_generic.HyperellipticCurve_generic, ProjectivePlaneCurve_finite_field): def _frobenius_coefficient_bound_charpoly(self): @@ -1299,7 +1299,7 @@ def cardinality_exhaustive(self, extension_degree=1, algorithm=None): def cardinality_hypellfrob(self, extension_degree=1, algorithm=None): r""" Count points on a single extension of the base field - using the ``hypellfrob`` prgoram. + using the ``hypellfrob`` program. EXAMPLES:: diff --git a/src/sage/structure/parent.pyx b/src/sage/structure/parent.pyx index eb0255bf171..55a5cec3635 100644 --- a/src/sage/structure/parent.pyx +++ b/src/sage/structure/parent.pyx @@ -144,8 +144,8 @@ cdef bint is_Integer(x): def is_Parent(x): """ - Return True if x is a parent object, i.e., derives from - sage.structure.parent.Parent and False otherwise. + Return ``True`` if x is a parent object, i.e., derives from + sage.structure.parent.Parent and ``False`` otherwise. EXAMPLES:: @@ -1346,7 +1346,7 @@ cdef class Parent(sage.structure.category_object.CategoryObject): codomain = im_gens.universe() if isinstance(im_gens, Sequence_generic): im_gens = list(im_gens) - # Not all homsets accept catgory/check/base_map as arguments + # Not all homsets accept category/check/base_map as arguments kwds = {} if check is not None: kwds['check'] = check From 3e7731380469787d4d1d3359dddce111a741a75a Mon Sep 17 00:00:00 2001 From: John Cremona Date: Mon, 4 May 2020 14:32:29 +0100 Subject: [PATCH 095/301] #29645: elliptic curve omega ignored prec parameter for complex embeddings --- src/sage/schemes/elliptic_curves/period_lattice.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/period_lattice.py b/src/sage/schemes/elliptic_curves/period_lattice.py index 18c197ccbf4..acc85b9740f 100644 --- a/src/sage/schemes/elliptic_curves/period_lattice.py +++ b/src/sage/schemes/elliptic_curves/period_lattice.py @@ -899,19 +899,21 @@ def omega(self, prec = None): A complex example (taken from J.E.Cremona and E.Whitley, *Periods of cusp forms and elliptic curves over imaginary quadratic fields*, Mathematics of Computation 62 No. 205 - (1994), 407-429):: + (1994), 407-429). See :trac:`29645`:: sage: K. = QuadraticField(-1) sage: E = EllipticCurve([0,1-i,i,-i,0]) sage: L = E.period_lattice(K.embeddings(CC)[0]) sage: L.omega() 8.80694160502647 + sage: L.omega(prec=200) + 8.8069416050264741493250743632295462227858630765392114070032 """ if self.is_real(): n_components = (self.real_flag+3)//2 return self.real_period(prec) * n_components else: - return self.complex_area() + return self.complex_area(prec) @cached_method def basis_matrix(self, prec=None, normalised=False): From 1c9e8f4196b96c443d3b3321c37b313b23cb5c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 4 May 2020 17:52:26 +0200 Subject: [PATCH 096/301] trac 29643 one little detail in categories/pushout --- src/sage/categories/pushout.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py index 6f9d44fea82..c69e8562dd4 100644 --- a/src/sage/categories/pushout.py +++ b/src/sage/categories/pushout.py @@ -2,7 +2,6 @@ Coercion via construction functors """ from __future__ import print_function, absolute_import -from six.moves import range import six from sage.misc.lazy_import import lazy_import @@ -646,7 +645,6 @@ def __eq__(self, other): """ c = (type(self) == type(other)) if not c: - from sage.categories.functor import IdentityFunctor_generic if isinstance(other, IdentityFunctor_generic): return True return c From 334fa3a97a1b30a5e56be3a6a8006872c03deec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 4 May 2020 20:15:26 +0200 Subject: [PATCH 097/301] trac 29643 one more detail --- .../geometry/polyhedron/combinatorial_polyhedron/base.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx index 83c922e05d2..dcb3c703339 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx @@ -1471,12 +1471,12 @@ cdef class CombinatorialPolyhedron(SageObject): else: facet_names = self.facet_names() if facet_names is None: - # No names where provided at initialisation. + # No names were provided at initialisation. facet_names = [("H", i) for i in range(n_facets)] Vrep = self.Vrep() if Vrep is None: - # No names where provided at initialisation. + # No names were provided at initialisation. Vrep = [("V", i) for i in range(n_Vrep)] vertices = Vrep + facet_names From 94203aa5be84a997a1fd0b37f4d58f6e8197e608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 4 May 2020 20:18:11 +0200 Subject: [PATCH 098/301] trac 29643 some more details --- src/sage/rings/valuation/inductive_valuation.py | 3 ++- .../schemes/hyperelliptic_curves/hyperelliptic_finite_field.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sage/rings/valuation/inductive_valuation.py b/src/sage/rings/valuation/inductive_valuation.py index a3bf9ad3275..de63cb9532b 100644 --- a/src/sage/rings/valuation/inductive_valuation.py +++ b/src/sage/rings/valuation/inductive_valuation.py @@ -1596,7 +1596,8 @@ def _test_is_equivalence_irreducible(self, **options): tester = self._tester(**options) S = tester.some_elements(self.domain().some_elements()) for f in S: - if f.is_constant(): continue + if f.is_constant(): + continue is_equivalence_irreducible = self.is_equivalence_irreducible(f) F = self.equivalence_decomposition(f) tester.assertEqual(is_equivalence_irreducible, len(F)==0 or (len(F)==1 and F[0][1]==1)) diff --git a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py index 62a7dc2b30a..f4dde5bf06e 100644 --- a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +++ b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py @@ -839,7 +839,8 @@ def points(self): from sage.rings.finite_rings.finite_field_constructor import zech_log_bound try: return self.__points - except AttributeError: pass + except AttributeError: + pass if self.base_ring().is_prime_field(): self.__points = self._points_cache_sqrt() From aeaf816c876e86435a075a07d320d9befa84929a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 4 May 2020 23:27:36 -0700 Subject: [PATCH 099/301] Update FAQ --- src/doc/en/faq/faq-general.rst | 49 +++++++++++++++------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/src/doc/en/faq/faq-general.rst b/src/doc/en/faq/faq-general.rst index c18c31576a7..f539d0dd56f 100644 --- a/src/doc/en/faq/faq-general.rst +++ b/src/doc/en/faq/faq-general.rst @@ -85,7 +85,7 @@ previous and ongoing work of many authors of included components. A list of (some) direct contributors can be found on the `Sage Development Map `_ -and the history of changes can be found in the high-level +and the history of changes can be found in the `changelogs `_. Refer to the `acknowledgment page `_ @@ -204,9 +204,11 @@ functionalities are made possible through FOSS projects such as statistical computing and graphics. * And many more too numerous to list here. -An up-to-date list can be found on the page for the -`standard packages repository `_. -The principle programming languages of Sage are +An up-to-date list can be found in the section +`External Packages <../reference/spkg/index.html>`_ +in the Sage Reference Manual. + +The principal programming languages of Sage are `Python `_ and `Cython `_. @@ -237,29 +239,22 @@ See http://www.sagemath.org/help.html for a listing of other resources. Wouldn't it be way better if Sage did not ship as a gigantic bundle? """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This topic has been discussed over and over again. So before you -resume the discussion, ensure you have read and understood the -arguments below. Sage is a distribution of over 90 FOSS packages for -symbolic, numerical, and scientific computation. In general, the -combinatorial explosion of configurations to debug is way too -large. It is next to impossible to find any Linux distribution -(e.g. Arch, CentOS, Debian, Fedora, Gentoo, Mandriva, Ubuntu) where -the version numbers of packages that Sage depends on even remotely -match. - -The majority of people who contribute to Sage do so in their free -time. These are people who hold day jobs that are not directly related -to computer programming or software development. It is next to -impossible for anyone to track down the correct versions of packages, -configure and compile them on Linux, Mac OS X, Solaris, or Windows, -just so that they could start using Sage or start working on their -first contribution to Sage. While the Sage project aims to be useful -to as wide an audience as possible, we believe that Sage first needs -to be as easy as possible to install by anyone with any level of -computer experience. If you want to help Sage realize this goal, -please email the -`sage-devel `_ -mailing list. +The SageMath distribution continues to vendor versions of required +software packages ("SPKGs") that work well together. + +However, in order to reduce compilation times and the size of the Sage +installation, a development effort ongoing since the 8.x release +series has made it possible to use many system packages provided by +the OS distribution (or by the Homebrew or conda-forge distributions) +instead of building SageMath's own copies. + +This so-called "spkg-configure" mechanism runs at the beginning of a +build from source, during the ``./configure`` phase. + +To ensure that SageMath builds and runs correctly on a wide variety of +systems, we use automated testing. See the chapter `Portability +testing <../developer/portability_testing.html>`_ in the Developer's +Guide for details. With so many bugs in Sage and hundreds of open tickets, why don't you produce a stabilization release? From 7207afe6132a866f5274dcbf558bec5538536f6e Mon Sep 17 00:00:00 2001 From: John Cremona Date: Tue, 5 May 2020 16:37:27 +0100 Subject: [PATCH 100/301] #29645: fix pycodestyle warnings --- .../schemes/elliptic_curves/period_lattice.py | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/period_lattice.py b/src/sage/schemes/elliptic_curves/period_lattice.py index acc85b9740f..d4863d9a16e 100644 --- a/src/sage/schemes/elliptic_curves/period_lattice.py +++ b/src/sage/schemes/elliptic_curves/period_lattice.py @@ -726,11 +726,14 @@ def _compute_periods_complex(self, prec=None, normalise=True): # precision used! pi = C.pi() a, b, c = (C(x) for x in self._abc) - if (a+b).abs() < (a-b).abs(): b=-b - if (a+c).abs() < (a-c).abs(): c=-c + if (a+b).abs() < (a-b).abs(): + b=-b + if (a+c).abs() < (a-c).abs(): + c=-c w1 = pi/a.agm(b) w2 = pi*C.gen()/a.agm(c) - if (w1/w2).imag()<0: w2=-w2 + if (w1/w2).imag()<0: + w2=-w2 if normalise: w1w2, mat = normalise_periods(w1,w2) return w1w2 @@ -1249,7 +1252,8 @@ def reduce(self, z): # NB We assume here that when the embedding is real then the # point is also real! - if self.real_flag == 0: return z + if self.real_flag == 0: + return z if self.real_flag == -1: k = (z.imag()/w2.imag()).round() z = z-k*w2 @@ -1392,9 +1396,11 @@ def e_log_RC(self, xP, yP, prec=None, reduce=True): a = C((e1-e3).sqrt()) b = C((e1-e2).sqrt()) - if (a+b).abs() < (a-b).abs(): b=-b + if (a+b).abs() < (a-b).abs(): + b=-b r = C(((xP-e3)/(xP-e2)).sqrt()) - if r.real()<0: r=-r + if r.real()<0: + r=-r t = -C(wP)/(2*r*(xP-e2)) # eps controls the end of the loop. Since we aim at a target # precision of prec bits, eps = 2^(-prec) is enough. @@ -1402,10 +1408,13 @@ def e_log_RC(self, xP, yP, prec=None, reduce=True): while True: s = b*r+a a, b = (a+b)/2, (a*b).sqrt() - if (a+b).abs() < (a-b).abs(): b=-b + if (a+b).abs() < (a-b).abs(): + b=-b r = (a*(r+1)/s).sqrt() - if (r.abs()-1).abs() < eps: break - if r.real()<0: r=-r + if (r.abs()-1).abs() < eps: + break + if r.real()<0: + r=-r t *= r z = ((a/t).arctan())/a z = ComplexField(prec)(z) @@ -1424,7 +1433,8 @@ def e_log_RC(self, xP, yP, prec=None, reduce=True): else: # real, disconnected case a = R(e3-e1).sqrt() b = R(e3-e2).sqrt() - if (a+b).abs() < (a-b).abs(): b=-b + if (a+b).abs() < (a-b).abs(): + b=-b on_egg = (xP Date: Tue, 5 May 2020 18:44:52 +0200 Subject: [PATCH 101/301] Cover multivariate case --- .../rings/polynomial/multi_polynomial.pyx | 34 ++++++++++++++++++- .../polynomial/multi_polynomial_element.py | 32 +++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 34762d8de41..76693fd472f 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -1465,6 +1465,38 @@ cdef class MPolynomial(CommutativeRingElement): an = self.coefficient(variable**n)**(n - k - 2) return self.parent()(u * self.resultant(d, variable) * an) + def subresultants(self, other, variable= None): + r""" + Return the nonzero subresultant polynomials of ``self`` and ``other``. + + INPUT: + + - ``other`` -- a polynomial + + OUTPUT: a list of polynomials in the same ring as ``self`` + + EXAMPLES:: + + sage: R. = QQ[] + sage: p = (y^2 + 6)*(x - 1) - y*(x^2 + 1) + sage: q = (x^2 + 6)*(y - 1) - x*(y^2 + 1) + sage: p.subresultants(q, y) + [2*x^6 - 22*x^5 + 102*x^4 - 274*x^3 + 488*x^2 - 552*x + 288, + -x^3 - x^2*y + 6*x^2 + 5*x*y - 11*x - 6*y + 6] + sage: p.subresultants(q, x) + [2*y^6 - 22*y^5 + 102*y^4 - 274*y^3 + 488*y^2 - 552*y + 288, + x*y^2 + y^3 - 5*x*y - 6*y^2 + 6*x + 11*y - 6] + + """ + R = self.parent() + if variable is None: + x = R.gen(0) + else: + x = variable + p = self.polynomial(x) + q = other.polynomial(x) + return [R(f) for f in p.subresultants(q)] + def macaulay_resultant(self, *args): r""" This is an implementation of the Macaulay Resultant. It computes @@ -2442,7 +2474,7 @@ cdef class MPolynomial(CommutativeRingElement): True """ # EXERCISE (Atiyah-McDonald, Ch 1): Let `A[x]` be a polynomial - # ring in one variable. Then `f=\sum a_i x^i \in A[x]` is + # ring in one variable. Then `f=\sum a_i x^i \in A[x]` is # nilpotent if and only if `a_0,\ldots, a_n` are nilpotent. # (Also noted in Dummit and Foote, "Abstract Algebra", 1991, # Section 7.3 Exercise 33). diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py index e5d692150c6..a92376a8c1b 100644 --- a/src/sage/rings/polynomial/multi_polynomial_element.py +++ b/src/sage/rings/polynomial/multi_polynomial_element.py @@ -2025,6 +2025,38 @@ def resultant(self, other, variable=None): else: return r + @coerce_binop + @handle_AA_and_QQbar + def subresultants(self, other, variable= None): + r""" + Return the nonzero subresultant polynomials of ``self`` and ``other``. + + INPUT: + + - ``other`` -- a polynomial + + OUTPUT: a list of polynomials in the same ring as ``self`` + + sage: R. = QQbar[] + sage: p = (y^2 + 6)*(x - 1) - y*(x^2 + 1) + sage: q = (x^2 + 6)*(y - 1) - x*(y^2 + 1) + sage: p.subresultants(q, y) + [2*x^6 - 22*x^5 + 102*x^4 - 274*x^3 + 488*x^2 - 552*x + 288, + -x^3 - x^2*y + 6*x^2 + 5*x*y - 11*x - 6*y + 6] + sage: p.subresultants(q, x) + [2*y^6 - 22*y^5 + 102*y^4 - 274*y^3 + 488*y^2 - 552*y + 288, + x*y^2 + y^3 - 5*x*y - 6*y^2 + 6*x + 11*y - 6] + + """ + R = self.parent() + if variable is None: + x = R.gen(0) + else: + x = variable + p = self.polynomial(x) + q = other.polynomial(x) + return [R(f) for f in p.subresultants(q)] + def reduce(self, I): """ Reduce this polynomial by the polynomials in `I`. From 8b37ba1fb54b4aae127e1ed43dae73bd52a94b53 Mon Sep 17 00:00:00 2001 From: Simon Brandhorst Date: Wed, 6 May 2020 09:01:11 +0200 Subject: [PATCH 102/301] error messages --- src/sage/quadratic_forms/genera/genus.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/sage/quadratic_forms/genera/genus.py b/src/sage/quadratic_forms/genera/genus.py index be9e12c4289..849d50d8dc6 100644 --- a/src/sage/quadratic_forms/genera/genus.py +++ b/src/sage/quadratic_forms/genera/genus.py @@ -2126,6 +2126,16 @@ def direct_sum(self, other): Genus symbol at 2: [1^-2 2^1 4^1]_6 sage: G2.direct_sum(G2) Genus symbol at 2: [1^4 2^2 4^2]_4 + + TESTS:: + + sage: G = Genus(matrix([6])) + sage: G2 = G.local_symbol(2) + sage: G3 = G.local_symbol(3) + sage: G2.direct_sum(G3) + Traceback (most recent call last): + ... + ValueError: the local genus symbols must be over the same prime """ if self.prime() != other.prime(): raise ValueError("the local genus symbols must be over the same prime") @@ -2928,7 +2938,7 @@ def mass(self, backend='sage'): sage: G.mass(backend='foo') Traceback (most recent call last): ... - ValueError: Unknown backend: foo + ValueError: unknown backend: foo sage: G = Genus(matrix(ZZ, 2, [0, 1, 1, 0])) sage: G.mass() Traceback (most recent call last): @@ -2954,7 +2964,7 @@ def mass(self, backend='sage'): L = L.LatticeWithGram() return QQ(L.Mass()) else: - raise ValueError("Unknown backend: %s"%backend) + raise ValueError("unknown backend: %s"%backend) def _gram_from_jordan_block(p, block, discr_form=False): From 0fb6294575c884b57f4578d5410609ddcd7fa134 Mon Sep 17 00:00:00 2001 From: Christian Wuthrich Date: Wed, 6 May 2020 10:11:54 +0100 Subject: [PATCH 103/301] trac #29476: one more 32-bit precision adjustment --- src/sage/schemes/elliptic_curves/mod_sym_num.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index d66fa6a2553..f56d3f424b2 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -2385,7 +2385,7 @@ cdef class ModularSymbolNumerical: sage: M = ModularSymbolNumerical(EllipticCurve("5077a1")) sage: M._transportable_approx( 0/1, -35/144, 0.001) #abs tol 1e-11 -6.22753189644996 + 3.23405342839145e-7*I - sage: M._from_r_to_rr_approx( 0/1, -35/144, 0.001) # abs tol 1e-11 + sage: M._from_r_to_rr_approx( 0/1, -35/144, 0.001) # abs tol 1e-10 -6.22753204310913 - 1.31710951034592e-8*I While this one goes via 0:: From 1b969d68ee22ecbcc12713f02636b5aa692e5b40 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Wed, 6 May 2020 16:20:52 +0200 Subject: [PATCH 104/301] PEP 8 corrections --- .../rings/polynomial/polynomial_element.pyx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index 0efc83b2a7a..2d7b8bec960 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -6450,7 +6450,7 @@ cdef class Polynomial(CommutativeAlgebraElement): if B.is_zero(): return S S = [ring(B)] + S - delta = d-e + delta = d - e if delta > 1: if len(S) > 1: n = S[1].degree() - S[0].degree() - 1 @@ -6463,26 +6463,23 @@ cdef class Polynomial(CommutativeAlgebraElement): c = x n = n - a while a > 1: - a = a/2 - c = c**2/y + a /= 2 + c = c**2 / y if n >= a: - c = c*x/y + c = c * x / y n = n - a - C = c*S[0]/y + C = c * S[0] / y else: - C = B.leading_coefficient()**(delta-1)*B/s**(delta-1) + C = B.leading_coefficient()**(delta-1) * B / s**(delta-1) S = [ring(C)] + S else: C = B if e == 0: return S - B = A.pseudo_quo_rem(-B)[1]/(s**delta*A.leading_coefficient()) + B = A.pseudo_quo_rem(-B)[1] / (s**delta * A.leading_coefficient()) A = C s = A.leading_coefficient() - - - def composed_op(p1, p2, op, algorithm=None, monic=False): r""" Return the composed sum, difference, product or quotient of this From 8501c36d6cf576c9524754b31114e5553be75535 Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Wed, 6 May 2020 18:52:41 -0700 Subject: [PATCH 105/301] trac 29658: update BRiAl --- build/pkgs/brial/checksums.ini | 6 +++--- build/pkgs/brial/package-version.txt | 2 +- build/pkgs/sage_brial/checksums.ini | 6 +++--- build/pkgs/sage_brial/package-version.txt | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build/pkgs/brial/checksums.ini b/build/pkgs/brial/checksums.ini index 32fcb25e9b1..2f3607207f7 100644 --- a/build/pkgs/brial/checksums.ini +++ b/build/pkgs/brial/checksums.ini @@ -1,5 +1,5 @@ tarball=brial-VERSION.tar.bz2 -sha1=5795c0d73b63e9daa5318b0f22514b7797c59823 -md5=fddbc0cebfbac161de110acf30a6b89d -cksum=2578889224 +sha1=ea69faff56fb7068536723f3fb5b3583b8467831 +md5=d6c6a01d4fc80062550e02d9185bfbff +cksum=318826732 upstream_url=https://github.com/BRiAl/BRiAl/releases/download/VERSION/brial-VERSION.tar.bz2 diff --git a/build/pkgs/brial/package-version.txt b/build/pkgs/brial/package-version.txt index c813fe116c9..db6fb4a9113 100644 --- a/build/pkgs/brial/package-version.txt +++ b/build/pkgs/brial/package-version.txt @@ -1 +1 @@ -1.2.5 +1.2.8 diff --git a/build/pkgs/sage_brial/checksums.ini b/build/pkgs/sage_brial/checksums.ini index 32fcb25e9b1..2f3607207f7 100644 --- a/build/pkgs/sage_brial/checksums.ini +++ b/build/pkgs/sage_brial/checksums.ini @@ -1,5 +1,5 @@ tarball=brial-VERSION.tar.bz2 -sha1=5795c0d73b63e9daa5318b0f22514b7797c59823 -md5=fddbc0cebfbac161de110acf30a6b89d -cksum=2578889224 +sha1=ea69faff56fb7068536723f3fb5b3583b8467831 +md5=d6c6a01d4fc80062550e02d9185bfbff +cksum=318826732 upstream_url=https://github.com/BRiAl/BRiAl/releases/download/VERSION/brial-VERSION.tar.bz2 diff --git a/build/pkgs/sage_brial/package-version.txt b/build/pkgs/sage_brial/package-version.txt index c813fe116c9..db6fb4a9113 100644 --- a/build/pkgs/sage_brial/package-version.txt +++ b/build/pkgs/sage_brial/package-version.txt @@ -1 +1 @@ -1.2.5 +1.2.8 From bfc9c572cc65a3de4b0cc3e9d9ade6f022b808f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Labb=C3=A9?= Date: Thu, 7 May 2020 10:14:45 +0200 Subject: [PATCH 106/301] 29523: changes by reviewer --- src/sage/plot/plot.py | 44 +++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py index 6697b5c9cd6..955b7a44c03 100644 --- a/src/sage/plot/plot.py +++ b/src/sage/plot/plot.py @@ -2250,8 +2250,9 @@ def golden_rainbow(i,lightness=0.4): plot_points = int(options.pop('plot_points')) exclude = options.pop('exclude') - initial_points = None - if exclude is not None: + if exclude is None: + initial_points = None + else: from sage.symbolic.expression import Expression if isinstance(exclude, Expression) and exclude.is_relational(): if len(exclude.variables()) > 1: @@ -2285,32 +2286,35 @@ def golden_rainbow(i,lightness=0.4): not parametric and options['scale'] in ['loglog', 'semilogx']) if is_log_scale: - f_orig = f - xrange_orig = xrange - f = lambda x: f_orig(exp(x)) - xrange = (log(xrange_orig[0]), log(xrange_orig[1])) - if not initial_points is None: - initial_points = [log(x) for x in initial_points] - - data = generate_plot_points(f, xrange, plot_points, - adaptive_tolerance, adaptive_recursion, - randomize, initial_points) + f_exp = lambda x: f(exp(x)) + log_xrange = (log(xrange[0]), log(xrange[1])) + if initial_points is None: + log_initial_points = None + else: + log_initial_points = [log(x) for x in initial_points] + data = generate_plot_points(f_exp, log_xrange, plot_points, + adaptive_tolerance, adaptive_recursion, + randomize, log_initial_points) + average_distance_between_points = abs(log_xrange[1] - log_xrange[0])/plot_points + else: + data = generate_plot_points(f, xrange, plot_points, + adaptive_tolerance, adaptive_recursion, + randomize, initial_points) + average_distance_between_points = abs(xrange[1] - xrange[0])/plot_points for i in range(len(data)-1): # If the difference between consecutive x-values is more than - # 2 times the difference between two consecutive plot points, then + # 2 times the average difference between two consecutive plot points, then # add an exclusion point. - if abs(data[i+1][0] - data[i][0]) > 2*abs(xrange[1] - xrange[0])/plot_points: + if abs(data[i+1][0] - data[i][0]) > 2*average_distance_between_points: excluded_points.append((data[i][0] + data[i+1][0])/2) # If we did a change in variables, undo it now if is_log_scale: - f = f_orig - xrange = xrange_orig - for i in range(len(data)): - data[i] = (exp(data[i][0]), data[i][1]) - for i in range(len(excluded_points)): - excluded_points[i] = exp(excluded_points[i]) + for i,(a,fa) in enumerate(data): + data[i] = (exp(a), fa) + for i,p in enumerate(excluded_points): + excluded_points[i] = exp(p) if parametric: # We need the original x-values to be able to exclude points in parametric plots From 7dbededec0ca47fd4cda07e8134aeb67e5bb6818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Labb=C3=A9?= Date: Thu, 7 May 2020 14:09:54 +0200 Subject: [PATCH 107/301] 29523: same if structure as before --- src/sage/plot/plot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py index 955b7a44c03..5296f60f65b 100644 --- a/src/sage/plot/plot.py +++ b/src/sage/plot/plot.py @@ -2250,9 +2250,7 @@ def golden_rainbow(i,lightness=0.4): plot_points = int(options.pop('plot_points')) exclude = options.pop('exclude') - if exclude is None: - initial_points = None - else: + if exclude is not None: from sage.symbolic.expression import Expression if isinstance(exclude, Expression) and exclude.is_relational(): if len(exclude.variables()) > 1: @@ -2279,6 +2277,8 @@ def golden_rainbow(i,lightness=0.4): initial_points = reduce(lambda a,b: a+b, [[x - epsilon, x + epsilon] for x in excluded_points], []) + else: + initial_points = None # If we are a log scale plot on the x axis, do a change of variables # so we sample the range in log scale From 38c4efcaff17e49d5071bec8a5d41a911bf1fac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Tue, 18 Feb 2020 21:58:27 +0100 Subject: [PATCH 108/301] trying to extract pari,sage,maxima code from OEIS program field --- src/sage/databases/oeis.py | 173 +++++++++++++++++++++++++++++++------ 1 file changed, 148 insertions(+), 25 deletions(-) diff --git a/src/sage/databases/oeis.py b/src/sage/databases/oeis.py index d774de7c0be..77cdce92fa9 100644 --- a/src/sage/databases/oeis.py +++ b/src/sage/databases/oeis.py @@ -168,9 +168,12 @@ from sage.misc.misc import verbose from sage.misc.cachefunc import cached_method from sage.misc.flatten import flatten +from sage.misc.temporary_file import tmp_filename from sage.misc.unknown import Unknown from sage.misc.misc import embedded from sage.misc.html import HtmlFragment +from sage.repl.preparse import preparse + from collections import defaultdict import re @@ -595,7 +598,7 @@ def _imaginary_entry(self, ident='A999999', keywords=''): '%o ' + ident + ' def ' + ident + '(n):\n' '%o ' + ident + ' assert(isinstance(n, (int, Integer))), "n must be an integer."\n' '%o ' + ident + ' if n < 38:\n' - '%o ' + ident + ' raise ValueError("The value %s is not accepted." %str(n)))\n' + '%o ' + ident + ' raise ValueError("The value %s is not accepted." %str(n))\n' '%o ' + ident + ' elif n == 42:\n' '%o ' + ident + ' return 2\n' '%o ' + ident + ' else:\n' @@ -632,6 +635,7 @@ def _imaginary_sequence(self, ident='A999999', keywords='sign,easy'): """ return self.find_by_entry(entry=self._imaginary_entry(ident=ident, keywords=keywords)) + class OEISSequence(SageObject, UniqueRepresentation): r""" The class of OEIS sequences. @@ -1076,7 +1080,7 @@ def natural_object(self): sage: s.natural_object().universe() Integer Ring """ - if 'cofr' in self.keywords() and not 'frac' in self.keywords(): + if 'cofr' in self.keywords() and 'frac' not in self.keywords(): from sage.rings.continued_fraction import continued_fraction return continued_fraction(self.first_terms()) elif 'cons' in self.keywords(): @@ -1832,55 +1836,174 @@ def show(self): print(re.sub('_', ' ', s).upper()) print(str(result) + '\n') - def programs(self, language='other'): + def programs(self, language='all', preparsing=True, keep_comments=False): r""" - Return programs implementing the sequence ``self`` in the given ``language``. + Return programs for the sequence ``self`` in the given ``language``. INPUT: - - ``language`` - string (default: 'other') - the language of the - program. Current values are: 'maple', 'mathematica' and 'other'. + - ``language`` -- string (default: 'all'), the chosen language. + Possible values are 'all' for the full list, or + any language name, for example 'sage', 'maple', 'mathematica', etc. + + Some further optional input is specific to sage code treatment: + + - ``preparsing`` -- boolean (default: ``True``) whether to preparse + sage code + - ``keep_comments`` -- boolean (default: ``False``) whether to keep + comments in sage code OUTPUT: - - tuple of strings (with fancy formatting). + If ``language`` is ``'all'``, this returns a sorted list of pairs + (language, code), where every language can appear several times. - .. TODO:: ask OEIS to add a "Sage program" field in the database ;) + Otherwise, this returns a list of programs in the ``language``, + each program being a tuple of strings (with fancy formatting). EXAMPLES:: sage: ee = oeis('A001113') ; ee # optional -- internet A001113: Decimal expansion of e. - sage: ee.programs()[0] # optional -- internet - '(PARI) default(realprecision, 50080); x=exp(1); for (n=1, 50000, d=floor(x); x=(x-d)*10; write("b001113.txt", n, " ", d)); \\\\ _Harry J. Smith_, Apr 15 2009' + sage: ee.programs('pari')[0] # optional -- internet + 0: default(realprecision, 50080); x=exp(1); for (n=1, 50000, d=floor(x); x=(x-d)*10; write("b001113.txt", n, " ", d)); \\ _Harry J. Smith_, Apr 15 2009 + + sage: G = oeis.find_by_id('A27642') # optional -- internet + sage: G.programs('all') # optional -- internet + [('haskell', ...), + ('magma', ...), + ... + ('python', ...), + ('sage', ...)] TESTS:: sage: s = oeis._imaginary_sequence() sage: s.programs() - 0: (Python) - 1: def A999999(n): - 2: assert(isinstance(n, (int, Integer))), "n must be an integer." - 3: if n < 38: - 4: raise ValueError("The value %s is not accepted." %str(n))) - 5: elif n == 42: - 6: return 2 - 7: else: - 8: return 1 - - sage: s.programs('maple') + [('maple', ...), + ('mathematica', ...), + ('python', + 0: def A999999(n): + 1: assert(isinstance(n, (int, Integer))), "n must be an integer." + 2: if n < 38: + 3: raise ValueError("The value %s is not accepted." %str(n)) + 4: elif n == 42: + 5: return 2 + 6: else: + 7: return 1)] + + sage: s.programs('maple')[0] 0: Do not even try, Maple is not able to produce such a sequence. - sage: s.programs('mathematica') + sage: s.programs('mathematica')[0] 0: Mathematica neither. """ + language = language.lower() if language == "maple": - return FancyTuple(self._field('p')) + return [FancyTuple(self._field('p'))] elif language == "mathematica": - return FancyTuple(self._field('t')) + return [FancyTuple(self._field('t'))] + if language == 'sagemath': + language = 'sage' + if language == 'all': + table = [('maple', FancyTuple(self._field('p'))), + ('mathematica', FancyTuple(self._field('t')))] else: - return FancyTuple(self._field('o')) + table = [] + + def is_starting_line(line): + """ + Help to split the big OEIS code block into blocks by language. + + This returns ``None`` if ``line`` is not a starting line. + """ + if not line.startswith('('): + return None + if ')' not in line: + return None + end = line.index(')') + language = line[1:end].lower() # to handle (Sage) versus (sage) + if '(' in language: + return None + if language == 'sagemath': + language = 'sage' + if language == 'c#' or language == 'c++': + language = 'c' + if language.replace(' ', '').isalnum() or language.startswith('scheme'): + # to cope with many wrong (Scheme xxx) separators in the OEIS + return (language, end) + return None + + def filter_sage(lines): + """ + Remove comments and preparse if required, only for sage code. + + This is an iterator. + """ + for line in lines: + if keep_comments or not line.strip().startswith('#'): + if preparsing: + yield preparse(line) + else: + yield line + + def flush_to_table(language, code_lines): + """ + Put a list of code lines into the appropriate box of the table. + + With special treatment for sage code blocks. + """ + if language == 'sage': + table.append((language, FancyTuple(filter_sage(code_lines)))) + elif language is not None: + table.append((language, FancyTuple(code_lines))) + + programs = FancyTuple(self._field('o')) + code_lines = [] + old_language = None + for line in programs: + new_language = is_starting_line(line) + if new_language is not None: + # flush the stock of code lines if any + flush_to_table(old_language, code_lines) + # start new stock of code lines + old_language, end = new_language + rest = line[end + 1:].strip() + code_lines = [rest] if rest else [] + else: + code_lines.append(line) + flush_to_table(old_language, code_lines) + + if language == 'all': + return sorted(table) + return sorted(prog for la, prog in table if la == language) + + def test_compile_sage_code(self): + """ + Try to compile the extracted sage code, if there is any. + + If there are several sage code fields, they are all considered. + + Dead sequences are considered to compile correctly by default. + + This returns ``True`` if the code compiles, and raises an error + otherwise. + + EXAMPLES:: + + sage: s = oeis.find_by_id('A27642') # optional -- internet + sage: s.test_compile_sage_code() # optional -- internet + True + """ + if self.is_dead(): + raise True + filt = self.programs(language='sage') + if filt: + for v in filt: + tp = tmp_filename(ext='.sage') + _ = compile('\n'.join(v), tp, 'exec') + return True class FancyTuple(tuple): From bf852a412f4f730b2b4e2eadd6e3d4c5f1f2b24c Mon Sep 17 00:00:00 2001 From: vipul79321 Date: Fri, 8 May 2020 01:59:34 +0530 Subject: [PATCH 109/301] radius, diameter, eccentricity, center, periphery moved to graph and digraph separately --- src/sage/graphs/digraph.py | 537 ++++++++++++++++++++++++++++++ src/sage/graphs/generic_graph.py | 540 ------------------------------ src/sage/graphs/graph.py | 542 +++++++++++++++++++++++++++++++ 3 files changed, 1079 insertions(+), 540 deletions(-) diff --git a/src/sage/graphs/digraph.py b/src/sage/graphs/digraph.py index 00d852010d6..e6275fa3895 100644 --- a/src/sage/graphs/digraph.py +++ b/src/sage/graphs/digraph.py @@ -38,6 +38,19 @@ :meth:`~DiGraph.is_directed` | Since digraph is directed, returns True. :meth:`~DiGraph.dig6_string` | Return the ``dig6`` representation of the digraph as an ASCII string. +**Distances:** + +.. csv-table:: + :class: contentstable + :widths: 30, 70 + :delim: | + + :meth:`~DiGraph.eccentricity` | Return the eccentricity of vertex (or vertices) ``v``. + :meth:`~DiGraph.radius` | Return the radius of the DiGraph. + :meth:`~DiGraph.diameter` | Return the diameter of the DiGraph. + :meth:`~DiGraph.center` | Return the set of vertices in the center of the DiGraph. + :meth:`~DiGraph.periphery` | Return the set of vertices in the periphery of the DiGraph. + **Paths and cycles:** .. csv-table:: @@ -2081,6 +2094,530 @@ def reverse_edges(self, edges, inplace=True, multiedges=None): if not inplace: return tempG + ### Distances + + def eccentricity(self, v=None, by_weight=False, algorithm=None, + weight_function=None, check_weight=True, dist_dict=None, + with_labels=False): + """ + Return the eccentricity of vertex (or vertices) ``v``. + + The eccentricity of a vertex is the maximum distance to any other + vertex. + + For more information and examples on how to use input variables, see + :meth:`~GenericGraph.shortest_path_all_pairs`, + :meth:`~GenericGraph.shortest_path_lengths` and + :meth:`~GenericGraph.shortest_paths` + + INPUT: + + - ``v`` - either a single vertex or a list of vertices. If it is not + specified, then it is taken to be all vertices. + + - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge + weights are taken into account; if False, all edges have weight 1 + + - ``algorithm`` -- string (default: ``None``); one of the following + algorithms: + + - ``'BFS'`` - the computation is done through a BFS centered on each + vertex successively. Works only if ``by_weight==False``. + + - ``'Floyd-Warshall-Cython'`` - a Cython implementation of the + Floyd-Warshall algorithm. Works only if ``by_weight==False`` and + ``v is None``. + + - ``'Floyd-Warshall-Python'`` - a Python implementation of the + Floyd-Warshall algorithm. Works also with weighted graphs, even with + negative weights (but no negative cycle is allowed). However, ``v`` + must be ``None``. + + - ``'Dijkstra_NetworkX'`` - the Dijkstra algorithm, implemented in + NetworkX. It works with weighted graphs, but no negative weight is + allowed. + + - ``'Dijkstra_Boost'`` - the Dijkstra algorithm, implemented in Boost + (works only with positive weights). + + - ``'Johnson_Boost'`` - the Johnson algorithm, implemented in + Boost (works also with negative weights, if there is no negative + cycle). + + - ``'From_Dictionary'`` - uses the (already computed) distances, that + are provided by input variable ``dist_dict``. + + - ``None`` (default): Sage chooses the best algorithm: + ``'From_Dictionary'`` if ``dist_dict`` is not None, ``'BFS'`` for + unweighted graphs, ``'Dijkstra_Boost'`` if all weights are + positive, ``'Johnson_Boost'`` otherwise. + + - ``weight_function`` -- function (default: ``None``); a function that + takes as input an edge ``(u, v, l)`` and outputs its weight. If not + ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` + and ``by_weight`` is ``True``, we use the edge label ``l`` as a + weight. + + - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check + that the ``weight_function`` outputs a number for each edge + + - ``dist_dict`` -- a dictionary (default: ``None``); a dict of dicts of + distances (used only if ``algorithm=='From_Dictionary'``) + + - ``with_labels`` -- boolean (default: ``False``); whether to return a + list or a dictionary keyed by vertices. + + EXAMPLES:: + + sage: G = graphs.KrackhardtKiteGraph().to_directed() + sage: G.eccentricity() + [4, 4, 4, 4, 4, 3, 3, 2, 3, 4] + sage: G.vertices() + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + sage: G.eccentricity(7) + 2 + sage: G.eccentricity([7,8,9]) + [2, 3, 4] + sage: G.eccentricity([7,8,9], with_labels=True) == {8: 3, 9: 4, 7: 2} + True + sage: G = DiGraph(3) + sage: G.eccentricity(with_labels=True) + {0: +Infinity, 1: +Infinity, 2: +Infinity} + sage: G = DiGraph({0:[]}) + sage: G.eccentricity(with_labels=True) + {0: 0} + sage: G = DiGraph([(0,1,2), (1,2,3), (2,0,2)]) + sage: G.eccentricity(algorithm = 'BFS') + [2, 2, 2] + sage: G.eccentricity(algorithm = 'Floyd-Warshall-Cython') + [2, 2, 2] + sage: G.eccentricity(by_weight = True, algorithm = 'Dijkstra_NetworkX') + [5, 5, 4] + sage: G.eccentricity(by_weight = True, algorithm = 'Dijkstra_Boost') + [5, 5, 4] + sage: G.eccentricity(by_weight = True, algorithm = 'Johnson_Boost') + [5, 5, 4] + sage: G.eccentricity(by_weight = True, algorithm = 'Floyd-Warshall-Python') + [5, 5, 4] + sage: G.eccentricity(dist_dict = G.shortest_path_all_pairs(by_weight = True)[0]) + [5, 5, 4] + + TESTS: + + A non-implemented algorithm:: + + sage: G.eccentricity(algorithm = 'boh') + Traceback (most recent call last): + ... + ValueError: unknown algorithm "boh" + + An algorithm that does not work with edge weights:: + + sage: G.eccentricity(by_weight = True, algorithm = 'BFS') + Traceback (most recent call last): + ... + ValueError: algorithm 'BFS' does not work with weights + sage: G.eccentricity(by_weight = True, algorithm = 'Floyd-Warshall-Cython') + Traceback (most recent call last): + ... + ValueError: algorithm 'Floyd-Warshall-Cython' does not work with weights + + An algorithm that computes the all-pair-shortest-paths when not all + vertices are needed:: + + sage: G.eccentricity(0, algorithm = 'Floyd-Warshall-Cython') + Traceback (most recent call last): + ... + ValueError: algorithm 'Floyd-Warshall-Cython' works only if all eccentricities are needed + sage: G.eccentricity(0, algorithm = 'Floyd-Warshall-Python') + Traceback (most recent call last): + ... + ValueError: algorithm 'Floyd-Warshall-Python' works only if all eccentricities are needed + sage: G.eccentricity(0, algorithm = 'Johnson_Boost') + Traceback (most recent call last): + ... + ValueError: algorithm 'Johnson_Boost' works only if all eccentricities are needed + """ + if weight_function is not None: + by_weight = True + elif by_weight: + def weight_function(e): + return e[2] + + if algorithm is None: + if dist_dict is not None: + algorithm = 'From_Dictionary' + elif not by_weight: + algorithm = 'BFS' + else: + for e in self.edge_iterator(): + try: + if float(weight_function(e)) < 0: + algorithm = 'Johnson_Boost' + break + except (ValueError, TypeError): + raise ValueError("the weight function cannot find the" + " weight of " + str(e)) + if algorithm is None: + algorithm = 'Dijkstra_Boost' + + if v is None: + # If we want to use BFS, we use the Cython routine + if algorithm == 'BFS': + if by_weight: + raise ValueError("algorithm 'BFS' does not work with weights") + from sage.graphs.distances_all_pairs import eccentricity + algo = 'standard' + if with_labels: + vertex_list = list(self) + return dict(zip(vertex_list, eccentricity(self, algorithm=algo, vertex_list=vertex_list))) + else: + return eccentricity(self, algorithm=algo) + + if algorithm in ['Floyd-Warshall-Python', 'Floyd-Warshall-Cython', 'Johnson_Boost']: + dist_dict = self.shortest_path_all_pairs(by_weight, algorithm, + weight_function, + check_weight)[0] + algorithm = 'From_Dictionary' + + v = self.vertices() + + elif algorithm in ['Floyd-Warshall-Python', 'Floyd-Warshall-Cython', 'Johnson_Boost']: + raise ValueError("algorithm '" + algorithm + "' works only if all" + + " eccentricities are needed") + + if not isinstance(v, list): + v = [v] + ecc = {} + + from sage.rings.infinity import Infinity + + for u in v: + if algorithm == 'From_Dictionary': + length = dist_dict[u] + else: + # If algorithm is wrong, the error is raised by the + # shortest_path_lengths function + length = self.shortest_path_lengths(u, by_weight=by_weight, + algorithm=algorithm, + weight_function=weight_function, + check_weight=check_weight) + + if len(length) != self.num_verts(): + ecc[u] = Infinity + else: + ecc[u] = max(length.values()) + + if with_labels: + return ecc + else: + if len(ecc) == 1: + # return single value + v, = ecc.values() + return v + return [ecc[u] for u in v] + + def radius(self, by_weight=False, algorithm=None, weight_function=None, + check_weight=True): + r""" + Return the radius of the DiGraph. + + The radius is defined to be the minimum eccentricity of any vertex, + where the eccentricity is the maximum distance to any other + vertex. For more information and examples on how to use input variables, + see :meth:`~GenericGraph.shortest_paths` and + :meth:`~DiGraph.eccentricity` + + INPUT: + + - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge + weights are taken into account; if False, all edges have weight 1 + + - ``algorithm`` -- string (default: ``None``); see method + :meth:`eccentricity` for the list of available algorithms + + - ``weight_function`` -- function (default: ``None``); a function that + takes as input an edge ``(u, v, l)`` and outputs its weight. If not + ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` + and ``by_weight`` is ``True``, we use the edge label ``l`` as a + weight. + + - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check + that the ``weight_function`` outputs a number for each edge + + EXAMPLES: + + The more symmetric a DiGraph is, the smaller (diameter - radius) is:: + + sage: G = graphs.BarbellGraph(9, 3).to_directed() + sage: G.radius() + 3 + sage: G.diameter() + 6 + + :: + + sage: G = digraphs.Circuit(9) + sage: G.radius() + 8 + sage: G.diameter() + 8 + + TESTS:: + + sage: G = DiGraph() + sage: G.radius() + Traceback (most recent call last): + ... + ValueError: radius is not defined for the empty DiGraph + """ + if not self.order(): + raise ValueError("radius is not defined for the empty DiGraph") + + return min(self.eccentricity(v=list(self), by_weight=by_weight, + weight_function=weight_function, + check_weight=check_weight, + algorithm=algorithm)) + + def diameter(self, by_weight=False, algorithm=None, weight_function=None, + check_weight=True): + r""" + Return the diameter of the DiGraph. + + The diameter is defined to be the maximum distance between two vertices. + It is infinite if the DiGraph is not strongly connected. + + For more information and examples on how to use input variables, see + :meth:`~GenericGraph.shortest_paths` and + :meth:`~DiGraph.eccentricity` + + INPUT: + + - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge + weights are taken into account; if False, all edges have weight 1 + + - ``algorithm`` -- string (default: ``None``); one of the following + algorithms: + + - ``'BFS'``: the computation is done through a BFS centered on each + vertex successively. Works only if ``by_weight==False``. + + - ``'Floyd-Warshall-Cython'``: a Cython implementation of the + Floyd-Warshall algorithm. Works only if ``by_weight==False`` and ``v + is None``. + + - ``'Floyd-Warshall-Python'``: a Python implementation of the + Floyd-Warshall algorithm. Works also with weighted graphs, even with + negative weights (but no negative cycle is allowed). However, ``v`` + must be ``None``. + + - ``'Dijkstra_NetworkX'``: the Dijkstra algorithm, implemented in + NetworkX. It works with weighted graphs, but no negative weight is + allowed. + + - ``'standard'``, ``'2Dsweep'``: these algorithms are implemented in + :func:`sage.graphs.distances_all_pairs.diameter`. + They work only if ``by_weight==False``. See the function + documentation for more information. + + - ``'Dijkstra_Boost'``: the Dijkstra algorithm, implemented in Boost + (works only with positive weights). + + - ``'Johnson_Boost'``: the Johnson algorithm, implemented in + Boost (works also with negative weights, if there is no negative + cycle). + + - ``None`` (default): Sage chooses the best algorithm: ``'iFUB'`` for + unweighted graphs, ``'Dijkstra_Boost'`` if all weights are positive, + ``'Johnson_Boost'`` otherwise. + + - ``weight_function`` -- function (default: ``None``); a function that + takes as input an edge ``(u, v, l)`` and outputs its weight. If not + ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` + and ``by_weight`` is ``True``, we use the edge label ``l`` as a + weight. + + - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check + that the ``weight_function`` outputs a number for each edge + + EXAMPLES:: + + sage: G = digraphs.DeBruijn(5,4) + sage: G.diameter() + 4 + sage: G = digraphs.GeneralizedDeBruijn(9, 3) + sage: G.diameter() + 2 + + TESTS:: + + sage: G = DiGraph() + sage: G.diameter() + Traceback (most recent call last): + ... + ValueError: diameter is not defined for the empty DiGraph + sage: g = DiGraph([(1, 2, {'weight': 1})]) + sage: g.diameter(algorithm='2Dsweep', weight_function=lambda e: e[2]['weight']) + Traceback (most recent call last): + ... + ValueError: algorithm '2Dsweep' does not work on weighted DiGraphs + """ + if not self.order(): + raise ValueError("diameter is not defined for the empty DiGraph") + + if weight_function is not None: + by_weight = True + + if algorithm is None and not by_weight: + algorithm = 'standard' + elif algorithm == 'BFS': + algorithm = 'standard' + + if algorithm in ['standard', '2Dsweep']: + if by_weight: + raise ValueError("algorithm '" + algorithm + "' does not work" + + " on weighted DiGraphs") + from sage.graphs.distances_all_pairs import diameter + return diameter(self, algorithm=algorithm) + + return max(self.eccentricity(v=list(self), by_weight=by_weight, + weight_function=weight_function, + check_weight=check_weight, + algorithm=algorithm)) + + def center(self, by_weight=False, algorithm=None, weight_function=None, + check_weight=True): + r""" + Return the set of vertices in the center of the DiGraph. + + The center is the set of vertices whose eccentricity is equal to the + radius of the DiGraph, i.e., achieving the minimum eccentricity. + + For more information and examples on how to use input variables, + see :meth:`~GenericGraph.shortest_paths` and + :meth:`~DiGraph.eccentricity` + + INPUT: + + - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge + weights are taken into account; if False, all edges have weight 1 + + - ``algorithm`` -- string (default: ``None``); see method + :meth:`eccentricity` for the list of available algorithms + + - ``weight_function`` -- function (default: ``None``); a function that + takes as input an edge ``(u, v, l)`` and outputs its weight. If not + ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` + and ``by_weight`` is ``True``, we use the edge label ``l`` as a + weight. + + - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check + that the ``weight_function`` outputs a number for each edge + + EXAMPLES: + + Every vertex is a center in a Circuit-DiGraph:: + + sage: G = digraphs.Circuit(9) + sage: G.center() + [0, 1, 2, 3, 4, 5, 6, 7, 8] + + Center can be the whole graph:: + + sage: G.subgraph(G.center()) == G + True + + Some other graphs:: + + sage: G = digraphs.Path(5) + sage: G.center() + [0] + sage: G = DiGraph([(0,1,2), (1,2,3), (2,0,2)]) + sage: G.center(by_weight=True) + [2] + + TESTS:: + + sage: G = DiGraph() + sage: G.center() + [] + sage: G = DiGraph(3) + sage: G.center() + [0, 1, 2] + """ + ecc = self.eccentricity(v=list(self), by_weight=by_weight, + weight_function=weight_function, + algorithm=algorithm, + check_weight=check_weight, + with_labels=True) + try: + r = min(ecc.values()) + except Exception: + return [] + return [v for v in self if ecc[v] == r] + + def periphery(self, by_weight=False, algorithm=None, weight_function=None, + check_weight=True): + r""" + Return the set of vertices in the periphery of the DiGraph. + + The periphery is the set of vertices whose eccentricity is equal to the + diameter of the DiGraph, i.e., achieving the maximum eccentricity. + + For more information and examples on how to use input variables, + see :meth:`~GenericGraph.shortest_paths` and + :meth:`~DiGraph.eccentricity` + + INPUT: + + - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge + weights are taken into account; if False, all edges have weight 1 + + - ``algorithm`` -- string (default: ``None``); see method + :meth:`eccentricity` for the list of available algorithms + + - ``weight_function`` -- function (default: ``None``); a function that + takes as input an edge ``(u, v, l)`` and outputs its weight. If not + ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` + and ``by_weight`` is ``True``, we use the edge label ``l`` as a + weight. + + - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check + that the ``weight_function`` outputs a number for each edge + + EXAMPLES:: + + sage: G = graphs.DiamondGraph().to_directed() + sage: G.periphery() + [0, 3] + sage: P = digraphs.Path(5) + sage: P.periphery() + [1, 2, 3, 4] + sage: G = digraphs.Complete(5) + sage: G.subgraph(G.periphery()) == G + True + + TESTS:: + + sage: G = DiGraph() + sage: G.periphery() + [] + sage: G.add_vertex() + 0 + sage: G.periphery() + [0] + """ + ecc = self.eccentricity(v=list(self), by_weight=by_weight, + weight_function=weight_function, + algorithm=algorithm, + check_weight=check_weight, + with_labels=True) + try: + d = max(ecc.values()) + except Exception: + return [] + return [v for v in self if ecc[v] == d] + ### Paths and cycles iterators def _all_cycles_iterator_vertex(self, vertex, starting_vertices=None, simple=False, diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py index e00570bc2cc..a832760c229 100644 --- a/src/sage/graphs/generic_graph.py +++ b/src/sage/graphs/generic_graph.py @@ -216,14 +216,9 @@ :meth:`~GenericGraph.distance` | Return the (directed) distance from u to v in the (di)graph :meth:`~GenericGraph.distance_all_pairs` | Return the distances between all pairs of vertices. :meth:`~GenericGraph.distances_distribution` | Return the distances distribution of the (di)graph in a dictionary. - :meth:`~GenericGraph.eccentricity` | Return the eccentricity of vertex (or vertices) v. - :meth:`~GenericGraph.radius` | Return the radius of the (di)graph. - :meth:`~GenericGraph.center` | Return the set of vertices in the center of the graph - :meth:`~GenericGraph.diameter` | Return the largest distance between any two vertices. :meth:`~GenericGraph.distance_graph` | Return the graph on the same vertex set as the original graph but vertices are adjacent in the returned graph if and only if they are at specified distances in the original graph. :meth:`~GenericGraph.girth` | Return the girth of the graph. :meth:`~GenericGraph.odd_girth` | Return the odd girth of the graph. - :meth:`~GenericGraph.periphery` | Return the set of vertices in the periphery :meth:`~GenericGraph.shortest_path` | Return a list of vertices representing some shortest path from `u` to `v` :meth:`~GenericGraph.shortest_path_length` | Return the minimal length of paths from u to v :meth:`~GenericGraph.shortest_paths` | Return a dictionary associating to each vertex v a shortest path from u to v, if it exists. @@ -14595,481 +14590,6 @@ def distance_all_pairs(self, by_weight=False, algorithm=None, weight_function=weight_function, check_weight=check_weight)[0] - def eccentricity(self, v=None, by_weight=False, algorithm=None, - weight_function=None, check_weight=True, dist_dict=None, - with_labels=False): - """ - Return the eccentricity of vertex (or vertices) ``v``. - - The eccentricity of a vertex is the maximum distance to any other - vertex. - - For more information and examples on how to use input variables, see - :meth:`~GenericGraph.shortest_paths` - - INPUT: - - - ``v`` - either a single vertex or a list of vertices. If it is not - specified, then it is taken to be all vertices. - - - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge - weights are taken into account; if False, all edges have weight 1 - - - ``algorithm`` -- string (default: ``None``); one of the following - algorithms: - - - ``'BFS'`` - the computation is done through a BFS centered on each - vertex successively. Works only if ``by_weight==False``. - - - ``'Floyd-Warshall-Cython'`` - a Cython implementation of the - Floyd-Warshall algorithm. Works only if ``by_weight==False`` and - ``v is None``. - - - ``'Floyd-Warshall-Python'`` - a Python implementation of the - Floyd-Warshall algorithm. Works also with weighted graphs, even with - negative weights (but no negative cycle is allowed). However, ``v`` - must be ``None``. - - - ``'Dijkstra_NetworkX'`` - the Dijkstra algorithm, implemented in - NetworkX. It works with weighted graphs, but no negative weight is - allowed. - - - ``'Dijkstra_Boost'`` - the Dijkstra algorithm, implemented in Boost - (works only with positive weights). - - - ``'Johnson_Boost'`` - the Johnson algorithm, implemented in - Boost (works also with negative weights, if there is no negative - cycle). - - - ``'From_Dictionary'`` - uses the (already computed) distances, that - are provided by input variable ``dist_dict``. - - - ``None`` (default): Sage chooses the best algorithm: - ``'From_Dictionary'`` if ``dist_dict`` is not None, ``'BFS'`` for - unweighted graphs, ``'Dijkstra_Boost'`` if all weights are - positive, ``'Johnson_Boost'`` otherwise. - - - ``weight_function`` -- function (default: ``None``); a function that - takes as input an edge ``(u, v, l)`` and outputs its weight. If not - ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` - and ``by_weight`` is ``True``, we use the edge label ``l`` as a - weight. - - - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check - that the ``weight_function`` outputs a number for each edge - - - ``dist_dict`` -- a dictionary (default: ``None``); a dict of dicts of - distances (used only if ``algorithm=='From_Dictionary'``) - - - ``with_labels`` -- boolean (default: ``False``); whether to return a - list or a dictionary keyed by vertices. - - EXAMPLES:: - - sage: G = graphs.KrackhardtKiteGraph() - sage: G.eccentricity() - [4, 4, 4, 4, 4, 3, 3, 2, 3, 4] - sage: G.vertices() - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - sage: G.eccentricity(7) - 2 - sage: G.eccentricity([7,8,9]) - [2, 3, 4] - sage: G.eccentricity([7,8,9], with_labels=True) == {8: 3, 9: 4, 7: 2} - True - sage: G = Graph( { 0 : [], 1 : [], 2 : [1] } ) - sage: G.eccentricity() - [+Infinity, +Infinity, +Infinity] - sage: G = Graph({0:[]}) - sage: G.eccentricity(with_labels=True) - {0: 0} - sage: G = Graph({0:[], 1:[]}) - sage: G.eccentricity(with_labels=True) - {0: +Infinity, 1: +Infinity} - sage: G = Graph([(0,1,1), (1,2,1), (0,2,3)]) - sage: G.eccentricity(algorithm = 'BFS') - [1, 1, 1] - sage: G.eccentricity(algorithm = 'Floyd-Warshall-Cython') - [1, 1, 1] - sage: G.eccentricity(by_weight = True, algorithm = 'Dijkstra_NetworkX') - [2, 1, 2] - sage: G.eccentricity(by_weight = True, algorithm = 'Dijkstra_Boost') - [2, 1, 2] - sage: G.eccentricity(by_weight = True, algorithm = 'Johnson_Boost') - [2, 1, 2] - sage: G.eccentricity(by_weight = True, algorithm = 'Floyd-Warshall-Python') - [2, 1, 2] - sage: G.eccentricity(dist_dict = G.shortest_path_all_pairs(by_weight = True)[0]) - [2, 1, 2] - - TESTS: - - A non-implemented algorithm:: - - sage: G.eccentricity(algorithm = 'boh') - Traceback (most recent call last): - ... - ValueError: unknown algorithm "boh" - - An algorithm that does not work with edge weights:: - - sage: G.eccentricity(by_weight = True, algorithm = 'BFS') - Traceback (most recent call last): - ... - ValueError: algorithm 'BFS' does not work with weights - sage: G.eccentricity(by_weight = True, algorithm = 'Floyd-Warshall-Cython') - Traceback (most recent call last): - ... - ValueError: algorithm 'Floyd-Warshall-Cython' does not work with weights - - An algorithm that computes the all-pair-shortest-paths when not all - vertices are needed:: - - sage: G.eccentricity(0, algorithm = 'Floyd-Warshall-Cython') - Traceback (most recent call last): - ... - ValueError: algorithm 'Floyd-Warshall-Cython' works only if all eccentricities are needed - sage: G.eccentricity(0, algorithm = 'Floyd-Warshall-Python') - Traceback (most recent call last): - ... - ValueError: algorithm 'Floyd-Warshall-Python' works only if all eccentricities are needed - sage: G.eccentricity(0, algorithm = 'Johnson_Boost') - Traceback (most recent call last): - ... - ValueError: algorithm 'Johnson_Boost' works only if all eccentricities are needed - """ - if weight_function is not None: - by_weight = True - elif by_weight: - def weight_function(e): - return e[2] - - if algorithm is None: - if dist_dict is not None: - algorithm = 'From_Dictionary' - elif not by_weight: - algorithm = 'BFS' - else: - for e in self.edge_iterator(): - try: - if float(weight_function(e)) < 0: - algorithm = 'Johnson_Boost' - break - except (ValueError, TypeError): - raise ValueError("the weight function cannot find the" - " weight of " + str(e)) - if algorithm is None: - algorithm = 'Dijkstra_Boost' - - if v is None: - # If we want to use BFS, we use the Cython routine - if algorithm == 'BFS': - if by_weight: - raise ValueError("algorithm 'BFS' does not work with weights") - from sage.graphs.distances_all_pairs import eccentricity - algo = 'standard' if self.is_directed() else 'bounds' - if with_labels: - vertex_list = list(self) - return dict(zip(vertex_list, eccentricity(self, algorithm=algo, vertex_list=vertex_list))) - else: - return eccentricity(self, algorithm=algo) - - if algorithm in ['Floyd-Warshall-Python', 'Floyd-Warshall-Cython', 'Johnson_Boost']: - dist_dict = self.shortest_path_all_pairs(by_weight, algorithm, - weight_function, - check_weight)[0] - algorithm = 'From_Dictionary' - - v = self.vertices() - - elif algorithm in ['Floyd-Warshall-Python', 'Floyd-Warshall-Cython', 'Johnson_Boost']: - raise ValueError("algorithm '" + algorithm + "' works only if all" + - " eccentricities are needed") - - if not isinstance(v, list): - v = [v] - ecc = {} - - from sage.rings.infinity import Infinity - - for u in v: - if algorithm == 'From_Dictionary': - length = dist_dict[u] - else: - # If algorithm is wrong, the error is raised by the - # shortest_path_lengths function - length = self.shortest_path_lengths(u, by_weight=by_weight, - algorithm=algorithm, - weight_function=weight_function, - check_weight=check_weight) - - if len(length) != self.num_verts(): - ecc[u] = Infinity - else: - ecc[u] = max(length.values()) - - if with_labels: - return ecc - else: - if len(ecc) == 1: - # return single value - v, = ecc.values() - return v - return [ecc[u] for u in v] - - def radius(self, by_weight=False, algorithm=None, weight_function=None, - check_weight=True): - r""" - Return the radius of the (di)graph. - - The radius is defined to be the minimum eccentricity of any vertex, - where the eccentricity is the maximum distance to any other - vertex. For more information and examples on how to use input variables, - see :meth:`~GenericGraph.shortest_paths` and - :meth:`~GenericGraph.eccentricity` - - INPUT: - - - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge - weights are taken into account; if False, all edges have weight 1 - - - ``algorithm`` -- string (default: ``None``); see method - :meth:`eccentricity` for the list of available algorithms - - - ``weight_function`` -- function (default: ``None``); a function that - takes as input an edge ``(u, v, l)`` and outputs its weight. If not - ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` - and ``by_weight`` is ``True``, we use the edge label ``l`` as a - weight. - - - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check - that the ``weight_function`` outputs a number for each edge - - EXAMPLES: - - The more symmetric a graph is, the smaller (diameter - radius) is:: - - sage: G = graphs.BarbellGraph(9, 3) - sage: G.radius() - 3 - sage: G.diameter() - 6 - - :: - - sage: G = graphs.OctahedralGraph() - sage: G.radius() - 2 - sage: G.diameter() - 2 - - TESTS:: - - sage: g = Graph() - sage: g.radius() - Traceback (most recent call last): - ... - ValueError: radius is not defined for the empty graph - """ - if not self.order(): - raise ValueError("radius is not defined for the empty graph") - - return min(self.eccentricity(v=list(self), by_weight=by_weight, - weight_function=weight_function, - check_weight=check_weight, - algorithm=algorithm)) - - def diameter(self, by_weight=False, algorithm=None, weight_function=None, - check_weight=True): - r""" - Return the diameter of the (di)graph. - - The diameter is defined to be the maximum distance between two vertices. - It is infinite if the (di)graph is not (strongly) connected. - - For more information and examples on how to use input variables, see - :meth:`~GenericGraph.shortest_paths` and - :meth:`~GenericGraph.eccentricity` - - INPUT: - - - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge - weights are taken into account; if False, all edges have weight 1 - - - ``algorithm`` -- string (default: ``None``); one of the following - algorithms: - - - ``'BFS'``: the computation is done through a BFS centered on each - vertex successively. Works only if ``by_weight==False``. - - - ``'Floyd-Warshall-Cython'``: a Cython implementation of the - Floyd-Warshall algorithm. Works only if ``by_weight==False`` and ``v - is None``. - - - ``'Floyd-Warshall-Python'``: a Python implementation of the - Floyd-Warshall algorithm. Works also with weighted graphs, even with - negative weights (but no negative cycle is allowed). However, ``v`` - must be ``None``. - - - ``'Dijkstra_NetworkX'``: the Dijkstra algorithm, implemented in - NetworkX. It works with weighted graphs, but no negative weight is - allowed. - - - ``'standard'``, ``'2sweep'``,``'2Dsweep'``, ``'multi-sweep'``, - ``'iFUB'``: these algorithms are implemented in - :func:`sage.graphs.distances_all_pairs.diameter` - They work only if ``by_weight==False``. See the function - documentation for more information. - - - ``'Dijkstra_Boost'``: the Dijkstra algorithm, implemented in Boost - (works only with positive weights). - - - ``'Johnson_Boost'``: the Johnson algorithm, implemented in - Boost (works also with negative weights, if there is no negative - cycle). - - - ``None`` (default): Sage chooses the best algorithm: ``'iFUB'`` for - unweighted graphs, ``'Dijkstra_Boost'`` if all weights are positive, - ``'Johnson_Boost'`` otherwise. - - - ``weight_function`` -- function (default: ``None``); a function that - takes as input an edge ``(u, v, l)`` and outputs its weight. If not - ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` - and ``by_weight`` is ``True``, we use the edge label ``l`` as a - weight. - - - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check - that the ``weight_function`` outputs a number for each edge - - EXAMPLES: - - The more symmetric a graph is, the smaller (diameter - radius) is:: - - sage: G = graphs.BarbellGraph(9, 3) - sage: G.radius() - 3 - sage: G.diameter() - 6 - - :: - - sage: G = graphs.OctahedralGraph() - sage: G.radius() - 2 - sage: G.diameter() - 2 - - TESTS:: - - sage: g = Graph() - sage: g.diameter() - Traceback (most recent call last): - ... - ValueError: diameter is not defined for the empty graph - sage: g = Graph([(1, 2, {'weight': 1})]) - sage: g.diameter(algorithm='iFUB', weight_function=lambda e: e[2]['weight']) - Traceback (most recent call last): - ... - ValueError: algorithm 'iFUB' does not work on weighted graphs - """ - if not self.order(): - raise ValueError("diameter is not defined for the empty graph") - - if weight_function is not None: - by_weight = True - - if algorithm is None and not by_weight: - if self.is_directed(): - algorithm = 'standard' - else: - algorithm = 'iFUB' - elif algorithm == 'BFS': - algorithm = 'standard' - - if algorithm in ['standard', '2sweep', 'multi-sweep', 'iFUB', '2Dsweep']: - if by_weight: - raise ValueError("algorithm '" + algorithm + "' does not work" + - " on weighted graphs") - from sage.graphs.distances_all_pairs import diameter - return diameter(self, algorithm=algorithm) - - return max(self.eccentricity(v=list(self), by_weight=by_weight, - weight_function=weight_function, - check_weight=check_weight, - algorithm=algorithm)) - - def center(self, by_weight=False, algorithm=None, weight_function=None, - check_weight=True): - r""" - Return the set of vertices in the center of the (di)graph. - - The center is the set of vertices whose eccentricity is equal to the - radius of the (di)graph, i.e., achieving the minimum eccentricity. - - For more information and examples on how to use input variables, - see :meth:`~GenericGraph.shortest_paths` and - :meth:`~GenericGraph.eccentricity` - - INPUT: - - - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge - weights are taken into account; if False, all edges have weight 1 - - - ``algorithm`` -- string (default: ``None``); see method - :meth:`eccentricity` for the list of available algorithms - - - ``weight_function`` -- function (default: ``None``); a function that - takes as input an edge ``(u, v, l)`` and outputs its weight. If not - ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` - and ``by_weight`` is ``True``, we use the edge label ``l`` as a - weight. - - - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check - that the ``weight_function`` outputs a number for each edge - - EXAMPLES: - - Is Central African Republic in the center of Africa in graph theoretic - sense? Yes:: - - sage: A = graphs.AfricaMap(continental=True) - sage: sorted(A.center()) - ['Cameroon', 'Central Africa'] - - Some other graphs. Center can be the whole graph:: - - sage: G = graphs.DiamondGraph() - sage: G.center() - [1, 2] - sage: P = graphs.PetersenGraph() - sage: P.subgraph(P.center()) == P - True - sage: S = graphs.StarGraph(19) - sage: S.center() - [0] - - TESTS:: - - sage: G = Graph() - sage: G.center() - [] - sage: G.add_vertex() - 0 - sage: G.center() - [0] - """ - ecc = self.eccentricity(v=list(self), by_weight=by_weight, - weight_function=weight_function, - algorithm=algorithm, - check_weight=check_weight, - with_labels=True) - try: - r = min(ecc.values()) - except Exception: - return [] - return [v for v in self if ecc[v] == r] - - def distance_graph(self, dist): r""" Return the graph on the same vertex set as the original graph but @@ -15543,66 +15063,6 @@ def _girth_bfs(self, odd=False, certificate=False): else: return best - - def periphery(self, by_weight=False, algorithm=None, weight_function=None, - check_weight=True): - r""" - Return the set of vertices in the periphery of the (di)graph. - - The periphery is the set of vertices whose eccentricity is equal to the - diameter of the (di)graph, i.e., achieving the maximum eccentricity. - - For more information and examples on how to use input variables, - see :meth:`~GenericGraph.shortest_paths` and - :meth:`~GenericGraph.eccentricity` - - INPUT: - - - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge - weights are taken into account; if False, all edges have weight 1 - - - ``algorithm`` -- string (default: ``None``); see method - :meth:`eccentricity` for the list of available algorithms - - - ``weight_function`` -- function (default: ``None``); a function that - takes as input an edge ``(u, v, l)`` and outputs its weight. If not - ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` - and ``by_weight`` is ``True``, we use the edge label ``l`` as a - weight. - - - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check - that the ``weight_function`` outputs a number for each edge - - EXAMPLES:: - - sage: G = graphs.DiamondGraph() - sage: G.periphery() - [0, 3] - sage: P = graphs.PetersenGraph() - sage: P.subgraph(P.periphery()) == P - True - sage: S = graphs.StarGraph(19) - sage: S.periphery() - [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] - sage: G = Graph() - sage: G.periphery() - [] - sage: G.add_vertex() - 0 - sage: G.periphery() - [0] - """ - ecc = self.eccentricity(v=list(self), by_weight=by_weight, - weight_function=weight_function, - algorithm=algorithm, - check_weight=check_weight, - with_labels=True) - try: - d = max(ecc.values()) - except Exception: - return [] - return [v for v in self if ecc[v] == d] - ### Centrality def centrality_betweenness(self, k=None, normalized=True, weight=None, diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py index cda883c7030..4189beb8eb7 100644 --- a/src/sage/graphs/graph.py +++ b/src/sage/graphs/graph.py @@ -5194,6 +5194,548 @@ def centrality_degree(self, v=None): else: return self.degree(v)/n_minus_one + # Eccentricity + @doc_index("Distances") + def eccentricity(self, v=None, by_weight=False, algorithm=None, + weight_function=None, check_weight=True, dist_dict=None, + with_labels=False): + """ + Return the eccentricity of vertex (or vertices) ``v``. + + The eccentricity of a vertex is the maximum distance to any other + vertex. + + For more information and examples on how to use input variables, see + :meth:`~GenericGraph.shortest_path_all_pairs`, + :meth:`~GenericGraph.shortest_path_lengths` and + :meth:`~GenericGraph.shortest_paths` + + INPUT: + + - ``v`` - either a single vertex or a list of vertices. If it is not + specified, then it is taken to be all vertices. + + - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge + weights are taken into account; if False, all edges have weight 1 + + - ``algorithm`` -- string (default: ``None``); one of the following + algorithms: + + - ``'BFS'`` - the computation is done through a BFS centered on each + vertex successively. Works only if ``by_weight==False``. + + - ``'Floyd-Warshall-Cython'`` - a Cython implementation of the + Floyd-Warshall algorithm. Works only if ``by_weight==False`` and + ``v is None``. + + - ``'Floyd-Warshall-Python'`` - a Python implementation of the + Floyd-Warshall algorithm. Works also with weighted graphs, even with + negative weights (but no negative cycle is allowed). However, ``v`` + must be ``None``. + + - ``'Dijkstra_NetworkX'`` - the Dijkstra algorithm, implemented in + NetworkX. It works with weighted graphs, but no negative weight is + allowed. + + - ``'Dijkstra_Boost'`` - the Dijkstra algorithm, implemented in Boost + (works only with positive weights). + + - ``'Johnson_Boost'`` - the Johnson algorithm, implemented in + Boost (works also with negative weights, if there is no negative + cycle). + + - ``'From_Dictionary'`` - uses the (already computed) distances, that + are provided by input variable ``dist_dict``. + + - ``None`` (default): Sage chooses the best algorithm: + ``'From_Dictionary'`` if ``dist_dict`` is not None, ``'BFS'`` for + unweighted graphs, ``'Dijkstra_Boost'`` if all weights are + positive, ``'Johnson_Boost'`` otherwise. + + - ``weight_function`` -- function (default: ``None``); a function that + takes as input an edge ``(u, v, l)`` and outputs its weight. If not + ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` + and ``by_weight`` is ``True``, we use the edge label ``l`` as a + weight. + + - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check + that the ``weight_function`` outputs a number for each edge + + - ``dist_dict`` -- a dictionary (default: ``None``); a dict of dicts of + distances (used only if ``algorithm=='From_Dictionary'``) + + - ``with_labels`` -- boolean (default: ``False``); whether to return a + list or a dictionary keyed by vertices. + + EXAMPLES:: + + sage: G = graphs.KrackhardtKiteGraph() + sage: G.eccentricity() + [4, 4, 4, 4, 4, 3, 3, 2, 3, 4] + sage: G.vertices() + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + sage: G.eccentricity(7) + 2 + sage: G.eccentricity([7,8,9]) + [2, 3, 4] + sage: G.eccentricity([7,8,9], with_labels=True) == {8: 3, 9: 4, 7: 2} + True + sage: G = Graph( { 0 : [], 1 : [], 2 : [1] } ) + sage: G.eccentricity() + [+Infinity, +Infinity, +Infinity] + sage: G = Graph({0:[]}) + sage: G.eccentricity(with_labels=True) + {0: 0} + sage: G = Graph({0:[], 1:[]}) + sage: G.eccentricity(with_labels=True) + {0: +Infinity, 1: +Infinity} + sage: G = Graph([(0,1,1), (1,2,1), (0,2,3)]) + sage: G.eccentricity(algorithm = 'BFS') + [1, 1, 1] + sage: G.eccentricity(algorithm = 'Floyd-Warshall-Cython') + [1, 1, 1] + sage: G.eccentricity(by_weight = True, algorithm = 'Dijkstra_NetworkX') + [2, 1, 2] + sage: G.eccentricity(by_weight = True, algorithm = 'Dijkstra_Boost') + [2, 1, 2] + sage: G.eccentricity(by_weight = True, algorithm = 'Johnson_Boost') + [2, 1, 2] + sage: G.eccentricity(by_weight = True, algorithm = 'Floyd-Warshall-Python') + [2, 1, 2] + sage: G.eccentricity(dist_dict = G.shortest_path_all_pairs(by_weight = True)[0]) + [2, 1, 2] + + TESTS: + + A non-implemented algorithm:: + + sage: G.eccentricity(algorithm = 'boh') + Traceback (most recent call last): + ... + ValueError: unknown algorithm "boh" + + An algorithm that does not work with edge weights:: + + sage: G.eccentricity(by_weight = True, algorithm = 'BFS') + Traceback (most recent call last): + ... + ValueError: algorithm 'BFS' does not work with weights + sage: G.eccentricity(by_weight = True, algorithm = 'Floyd-Warshall-Cython') + Traceback (most recent call last): + ... + ValueError: algorithm 'Floyd-Warshall-Cython' does not work with weights + + An algorithm that computes the all-pair-shortest-paths when not all + vertices are needed:: + + sage: G.eccentricity(0, algorithm = 'Floyd-Warshall-Cython') + Traceback (most recent call last): + ... + ValueError: algorithm 'Floyd-Warshall-Cython' works only if all eccentricities are needed + sage: G.eccentricity(0, algorithm = 'Floyd-Warshall-Python') + Traceback (most recent call last): + ... + ValueError: algorithm 'Floyd-Warshall-Python' works only if all eccentricities are needed + sage: G.eccentricity(0, algorithm = 'Johnson_Boost') + Traceback (most recent call last): + ... + ValueError: algorithm 'Johnson_Boost' works only if all eccentricities are needed + """ + if weight_function is not None: + by_weight = True + elif by_weight: + def weight_function(e): + return e[2] + + if algorithm is None: + if dist_dict is not None: + algorithm = 'From_Dictionary' + elif not by_weight: + algorithm = 'BFS' + else: + for e in self.edge_iterator(): + try: + if float(weight_function(e)) < 0: + algorithm = 'Johnson_Boost' + break + except (ValueError, TypeError): + raise ValueError("the weight function cannot find the" + " weight of " + str(e)) + if algorithm is None: + algorithm = 'Dijkstra_Boost' + + if v is None: + # If we want to use BFS, we use the Cython routine + if algorithm == 'BFS': + if by_weight: + raise ValueError("algorithm 'BFS' does not work with weights") + from sage.graphs.distances_all_pairs import eccentricity + algo = 'bounds' + if with_labels: + vertex_list = list(self) + return dict(zip(vertex_list, eccentricity(self, algorithm=algo, vertex_list=vertex_list))) + else: + return eccentricity(self, algorithm=algo) + + if algorithm in ['Floyd-Warshall-Python', 'Floyd-Warshall-Cython', 'Johnson_Boost']: + dist_dict = self.shortest_path_all_pairs(by_weight, algorithm, + weight_function, + check_weight)[0] + algorithm = 'From_Dictionary' + + v = self.vertices() + + elif algorithm in ['Floyd-Warshall-Python', 'Floyd-Warshall-Cython', 'Johnson_Boost']: + raise ValueError("algorithm '" + algorithm + "' works only if all" + + " eccentricities are needed") + + if not isinstance(v, list): + v = [v] + ecc = {} + + from sage.rings.infinity import Infinity + + for u in v: + if algorithm == 'From_Dictionary': + length = dist_dict[u] + else: + # If algorithm is wrong, the error is raised by the + # shortest_path_lengths function + length = self.shortest_path_lengths(u, by_weight=by_weight, + algorithm=algorithm, + weight_function=weight_function, + check_weight=check_weight) + + if len(length) != self.num_verts(): + ecc[u] = Infinity + else: + ecc[u] = max(length.values()) + + if with_labels: + return ecc + else: + if len(ecc) == 1: + # return single value + v, = ecc.values() + return v + return [ecc[u] for u in v] + + # Radius + @doc_index("Distances") + def radius(self, by_weight=False, algorithm=None, weight_function=None, + check_weight=True): + r""" + Return the radius of the graph. + + The radius is defined to be the minimum eccentricity of any vertex, + where the eccentricity is the maximum distance to any other + vertex. For more information and examples on how to use input variables, + see :meth:`~GenericGraph.shortest_paths` and + :meth:`~Graph.eccentricity` + + INPUT: + + - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge + weights are taken into account; if False, all edges have weight 1 + + - ``algorithm`` -- string (default: ``None``); see method + :meth:`eccentricity` for the list of available algorithms + + - ``weight_function`` -- function (default: ``None``); a function that + takes as input an edge ``(u, v, l)`` and outputs its weight. If not + ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` + and ``by_weight`` is ``True``, we use the edge label ``l`` as a + weight. + + - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check + that the ``weight_function`` outputs a number for each edge + + EXAMPLES: + + The more symmetric a graph is, the smaller (diameter - radius) is:: + + sage: G = graphs.BarbellGraph(9, 3) + sage: G.radius() + 3 + sage: G.diameter() + 6 + + :: + + sage: G = graphs.OctahedralGraph() + sage: G.radius() + 2 + sage: G.diameter() + 2 + + TESTS:: + + sage: g = Graph() + sage: g.radius() + Traceback (most recent call last): + ... + ValueError: radius is not defined for the empty graph + """ + if not self.order(): + raise ValueError("radius is not defined for the empty graph") + + return min(self.eccentricity(v=list(self), by_weight=by_weight, + weight_function=weight_function, + check_weight=check_weight, + algorithm=algorithm)) + + # Diameter + @doc_index("Distances") + def diameter(self, by_weight=False, algorithm=None, weight_function=None, + check_weight=True): + r""" + Return the diameter of the graph. + + The diameter is defined to be the maximum distance between two vertices. + It is infinite if the graph is not connected. + + For more information and examples on how to use input variables, see + :meth:`~GenericGraph.shortest_paths` and + :meth:`~Graph.eccentricity` + + INPUT: + + - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge + weights are taken into account; if False, all edges have weight 1 + + - ``algorithm`` -- string (default: ``None``); one of the following + algorithms: + + - ``'BFS'``: the computation is done through a BFS centered on each + vertex successively. Works only if ``by_weight==False``. + + - ``'Floyd-Warshall-Cython'``: a Cython implementation of the + Floyd-Warshall algorithm. Works only if ``by_weight==False`` and ``v + is None``. + + - ``'Floyd-Warshall-Python'``: a Python implementation of the + Floyd-Warshall algorithm. Works also with weighted graphs, even with + negative weights (but no negative cycle is allowed). However, ``v`` + must be ``None``. + + - ``'Dijkstra_NetworkX'``: the Dijkstra algorithm, implemented in + NetworkX. It works with weighted graphs, but no negative weight is + allowed. + + - ``'standard'``, ``'2sweep'``, ``'multi-sweep'``, ``'iFUB'``: + these algorithms are implemented in + :func:`sage.graphs.distances_all_pairs.diameter` + They work only if ``by_weight==False``. See the function + documentation for more information. + + - ``'Dijkstra_Boost'``: the Dijkstra algorithm, implemented in Boost + (works only with positive weights). + + - ``'Johnson_Boost'``: the Johnson algorithm, implemented in + Boost (works also with negative weights, if there is no negative + cycle). + + - ``None`` (default): Sage chooses the best algorithm: ``'iFUB'`` for + unweighted graphs, ``'Dijkstra_Boost'`` if all weights are positive, + ``'Johnson_Boost'`` otherwise. + + - ``weight_function`` -- function (default: ``None``); a function that + takes as input an edge ``(u, v, l)`` and outputs its weight. If not + ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` + and ``by_weight`` is ``True``, we use the edge label ``l`` as a + weight. + + - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check + that the ``weight_function`` outputs a number for each edge + + EXAMPLES: + + The more symmetric a graph is, the smaller (diameter - radius) is:: + + sage: G = graphs.BarbellGraph(9, 3) + sage: G.radius() + 3 + sage: G.diameter() + 6 + + :: + + sage: G = graphs.OctahedralGraph() + sage: G.radius() + 2 + sage: G.diameter() + 2 + + TESTS:: + + sage: g = Graph() + sage: g.diameter() + Traceback (most recent call last): + ... + ValueError: diameter is not defined for the empty graph + sage: g = Graph([(1, 2, {'weight': 1})]) + sage: g.diameter(algorithm='iFUB', weight_function=lambda e: e[2]['weight']) + Traceback (most recent call last): + ... + ValueError: algorithm 'iFUB' does not work on weighted graphs + """ + if not self.order(): + raise ValueError("diameter is not defined for the empty graph") + + if weight_function is not None: + by_weight = True + + if algorithm is None and not by_weight: + algorithm = 'iFUB' + elif algorithm == 'BFS': + algorithm = 'standard' + + if algorithm in ['standard', '2sweep', 'multi-sweep', 'iFUB']: + if by_weight: + raise ValueError("algorithm '" + algorithm + "' does not work" + + " on weighted graphs") + from sage.graphs.distances_all_pairs import diameter + return diameter(self, algorithm=algorithm) + + return max(self.eccentricity(v=list(self), by_weight=by_weight, + weight_function=weight_function, + check_weight=check_weight, + algorithm=algorithm)) + + # Center + @doc_index("Distances") + def center(self, by_weight=False, algorithm=None, weight_function=None, + check_weight=True): + r""" + Return the set of vertices in the center of the graph. + + The center is the set of vertices whose eccentricity is equal to the + radius of the graph, i.e., achieving the minimum eccentricity. + + For more information and examples on how to use input variables, + see :meth:`~GenericGraph.shortest_paths` and + :meth:`~Graph.eccentricity` + + INPUT: + + - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge + weights are taken into account; if False, all edges have weight 1 + + - ``algorithm`` -- string (default: ``None``); see method + :meth:`eccentricity` for the list of available algorithms + + - ``weight_function`` -- function (default: ``None``); a function that + takes as input an edge ``(u, v, l)`` and outputs its weight. If not + ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` + and ``by_weight`` is ``True``, we use the edge label ``l`` as a + weight. + + - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check + that the ``weight_function`` outputs a number for each edge + + EXAMPLES: + + Is Central African Republic in the center of Africa in graph theoretic + sense? Yes:: + + sage: A = graphs.AfricaMap(continental=True) + sage: sorted(A.center()) + ['Cameroon', 'Central Africa'] + + Some other graphs. Center can be the whole graph:: + + sage: G = graphs.DiamondGraph() + sage: G.center() + [1, 2] + sage: P = graphs.PetersenGraph() + sage: P.subgraph(P.center()) == P + True + sage: S = graphs.StarGraph(19) + sage: S.center() + [0] + + TESTS:: + + sage: G = Graph() + sage: G.center() + [] + sage: G.add_vertex() + 0 + sage: G.center() + [0] + """ + ecc = self.eccentricity(v=list(self), by_weight=by_weight, + weight_function=weight_function, + algorithm=algorithm, + check_weight=check_weight, + with_labels=True) + try: + r = min(ecc.values()) + except Exception: + return [] + return [v for v in self if ecc[v] == r] + + # Periphery + @doc_index("Distances") + def periphery(self, by_weight=False, algorithm=None, weight_function=None, + check_weight=True): + r""" + Return the set of vertices in the periphery of the graph. + + The periphery is the set of vertices whose eccentricity is equal to the + diameter of the graph, i.e., achieving the maximum eccentricity. + + For more information and examples on how to use input variables, + see :meth:`~GenericGraph.shortest_paths` and + :meth:`~Graph.eccentricity` + + INPUT: + + - ``by_weight`` -- boolean (default: ``False``); if ``True``, edge + weights are taken into account; if False, all edges have weight 1 + + - ``algorithm`` -- string (default: ``None``); see method + :meth:`eccentricity` for the list of available algorithms + + - ``weight_function`` -- function (default: ``None``); a function that + takes as input an edge ``(u, v, l)`` and outputs its weight. If not + ``None``, ``by_weight`` is automatically set to ``True``. If ``None`` + and ``by_weight`` is ``True``, we use the edge label ``l`` as a + weight. + + - ``check_weight`` -- boolean (default: ``True``); if ``True``, we check + that the ``weight_function`` outputs a number for each edge + + EXAMPLES:: + + sage: G = graphs.DiamondGraph() + sage: G.periphery() + [0, 3] + sage: P = graphs.PetersenGraph() + sage: P.subgraph(P.periphery()) == P + True + sage: S = graphs.StarGraph(19) + sage: S.periphery() + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] + sage: G = Graph() + sage: G.periphery() + [] + sage: G.add_vertex() + 0 + sage: G.periphery() + [0] + """ + ecc = self.eccentricity(v=list(self), by_weight=by_weight, + weight_function=weight_function, + algorithm=algorithm, + check_weight=check_weight, + with_labels=True) + try: + d = max(ecc.values()) + except Exception: + return [] + return [v for v in self if ecc[v] == d] + ### Constructors @doc_index("Basic methods") From 96ee52948e7209d6749b3ecd6b9d05f4df837fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Fri, 8 May 2020 13:55:12 +0200 Subject: [PATCH 110/301] get rid of deprecated _cmp_ in symbolic expressions --- src/sage/symbolic/expression.pyx | 335 ++++++++++++++----------------- 1 file changed, 153 insertions(+), 182 deletions(-) diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx index 01cbb51a39f..19da8508d27 100644 --- a/src/sage/symbolic/expression.pyx +++ b/src/sage/symbolic/expression.pyx @@ -139,8 +139,158 @@ Test if :trac:`24883` is fixed:: sage: b = 1 - exp(I*pi/4) sage: a*b 1/4*((I + 1)*sqrt(2) - 2)*(-(I + 1)*sqrt(2) - 2) -""" +Many tests about comparison. + +Use :func:`sage.symbolic.comparison.mixed_order`` instead of +the operators <=, <, etc. to compare symbolic expressions when +you do not want to get a formal inequality:: + + sage: from sage.symbolic.comparison import mixed_order + + sage: a = sqrt(3) + sage: b = x^2+1 + sage: mixed_order(a, b) # indirect doctest + -1 + + sage: x,y = var('x,y') + sage: x < y + x < y + sage: mixed_order(x, y) + 1 + + sage: mixed_order(SR(0.5), SR(0.7)) + -1 + sage: SR(0.5) < SR(0.7) + 0.500000000000000 < 0.700000000000000 + sage: mixed_order(SR(0.5), 0.7) + -1 + + sage: mixed_order(sin(SR(2)), sin(SR(1))) + 1 + sage: float(sin(SR(2))) + 0.9092974268256817 + sage: float(sin(SR(1))) + 0.8414709848078965 + +Check that :trac:`9880` is fixed:: + + sage: b = [var('b_%s'%i) for i in range(4)] + sage: precomp = (2^b_2 + 2)*(2^b_1 + 2^(-b_1) + 2^b_1*2^b_0 - \ + 2^b_1*2^(-b_0) - 2^(-b_1)*2^b_0 - 2^(-b_1)*2^(-b_0) + \ + 2^b_0 + 2^(-b_0) - 9) + (2^b_1 + 2^(-b_1) + \ + 2^b_1*2^b_0 - 2^b_1*2^(-b_0) - 2^(-b_1)*2^b_0 - \ + 2^(-b_1)*2^(-b_0) + 2^b_0 + 2^(-b_0) - 9)/2^b_2 + sage: repl_dict = {b_0: b_0, b_3: b_1, b_2: b_3, b_1: b_2} + sage: P = precomp.substitute(repl_dict) + sage: P.expand() + 2^b_0*2^b_2*2^b_3 + 2*2^b_0*2^b_2 + 2^b_0*2^b_3 + 2^b_2*2^b_3 + + 2*2^b_0 + 2*2^b_2 - 9*2^b_3 + 2^b_0*2^b_2/2^b_3 - + 2^b_0*2^b_3/2^b_2 - 2^b_2*2^b_3/2^b_0 - 2*2^b_0/2^b_2 - + 2*2^b_2/2^b_0 + 2^b_0/2^b_3 + 2^b_2/2^b_3 + 2^b_3/2^b_0 + + 2^b_3/2^b_2 + 2/2^b_0 + 2/2^b_2 - 2^b_0/(2^b_2*2^b_3) - + 2^b_2/(2^b_0*2^b_3) - 9/2^b_3 - 2^b_3/(2^b_0*2^b_2) - + 2/(2^b_0*2^b_2) + 1/(2^b_0*2^b_3) + 1/(2^b_2*2^b_3) - + 1/(2^b_0*2^b_2*2^b_3) - 18 + + sage: _0,b_1,b_2=var('b_0,b_1,b_2') + sage: f = 1/27*b_2^2/(2^b_2)^2 + 1/27*b_1^2/(2^b_1)^2 + \ + 1/27*b_0^2/(2^b_0)^2 + 1/27*b_2/(2^b_2)^2 - 2/81/(2^b_2)^2 + \ + 1/27*b_1/(2^b_1)^2 + 8/243/(2^b_2)^2 - 1/81*b_0/(2^b_0)^2 - \ + 1/27*b_1^2/((2^b_2)^2*(2^b_1)^2) - \ + 1/27*b_0^2/((2^b_2)^2*(2^b_0)^2) - 20/243/(2^b_1)^2 + 1/9/2^b_0 \ + + 4/81*b_0/(2^b_0)^2 - 8/243/(2^b_2)^2 - 2/9/(2^b_2*2^b_1) - \ + 2/9/(2^b_2*2^b_0) + 8/243/(2^b_1)^2 - 1/9/2^b_0 + \ + 2/9/(2^b_2*2^b_1) + 2/9/(2^b_2*2^b_0) - \ + 2/27*b_1*b_2/((2^b_2)^2*(2^b_1)^2) - \ + 1/27*b_2^2/((2^b_2)^2*(2^b_1)^2) - \ + 2/27*b_0*b_2/((2^b_2)^2*(2^b_0)^2) - \ + 1/27*b_2^2/((2^b_2)^2*(2^b_0)^2) + 2/81/(2^b_1)^2 - \ + 1/27*b_0^2/((2^b_1)^2*(2^b_0)^2) - \ + 2/27*b_0*b_1/((2^b_1)^2*(2^b_0)^2) - \ + 1/27*b_1^2/((2^b_1)^2*(2^b_0)^2) - 2/81/(2^b_0)^2 + \ + 5/27*b_1/((2^b_2)^2*(2^b_1)^2) + 5/27*b_2/((2^b_2)^2*(2^b_1)^2) \ + + 5/27*b_0/((2^b_2)^2*(2^b_0)^2) + \ + 5/27*b_2/((2^b_2)^2*(2^b_0)^2) + 5/27*b_0/((2^b_1)^2*(2^b_0)^2) \ + + 5/27*b_1/((2^b_1)^2*(2^b_0)^2) - 4/81/((2^b_2)^2*(2^b_1)^2) + \ + 1/27*b_0^2/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + \ + 2/27*b_0*b_1/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + \ + 2/27*b_0*b_2/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + \ + 1/27*b_1^2/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + \ + 2/27*b_1*b_2/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + \ + 1/27*b_2^2/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) - \ + 4/81/((2^b_2)^2*(2^b_0)^2) - 4/81/((2^b_1)^2*(2^b_0)^2) - \ + 11/27*b_0/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) - \ + 11/27*b_1/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) - \ + 11/27*b_2/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + \ + 64/81/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + 35/81 \ + sage: f.nops() + 38 + + sage: x,y,z = var('x y z') + sage: print((-x+z)*(3*x-3*z)) + -3*(x - z)^2 + + sage: t = var('t') + sage: (x-t)^3 + -(t - x)^3 + sage: (-t+x)^3 + -(t - x)^3 + sage: (-x+t)^3 + (t - x)^3 + +This example is from :trac:`10833`:: + + sage: R. = PolynomialRing(QQ,2) + sage: phi(x) = x^2 + c + sage: def iterkate(n): + ....: pol = x + ....: for i in range(1,n): + ....: pol = phi(pol) + ....: return pol + ....: + sage: g = expand(iterkate(7)) + sage: g.nops() + 480 + +Check if :trac:`10849` is fixed:: + + sage: t = I.pyobject().parent()(-1/2) + sage: t > 0 + False + sage: t = I*x-1/2; t + I*x - 1/2 + sage: t.subs(x=I*x).subs(x=0).is_positive() + False + +Check if :trac:`16397` is fixed: + + sage: mixed_order(1, sqrt(2)) + -1 + sage: mixed_order(SR(1), sqrt(2)) + -1 + sage: mixed_order(log(8), 3*log(2)) + 0 + sage: bool(RLF(1) < RLF(sqrt(2))) + True + sage: RealSet((0, pi),[pi, pi],(pi,4)) + (0, 4) + sage: RealSet((0, pi),[0, pi],(pi,4)) + [0, 4) + sage: RealSet((0, pi),[0, 3.5],(pi,4)) + [0, 4) + +More sanity tests:: + + sage: bool(pi < pi) + False + sage: bool(e < e) + False + sage: bool(sqrt(2) < sqrt(2)) + False + sage: bool(pi < SR.zero()) + False +""" # **************************************************************************** # Copyright (C) 2008 William Stein # Copyright (C) 2008 Burcin Erocal @@ -173,7 +323,6 @@ cimport sage.symbolic.comparison from sage.rings.rational import Rational from sage.misc.derivative import multi_derivative from sage.misc.decorators import sage_wraps -from sage.misc.superseded import deprecation from sage.rings.infinity import AnInfinity, infinity, minus_infinity, unsigned_infinity from sage.misc.decorators import rename_keyword from sage.structure.dynamic_class import dynamic_class @@ -198,6 +347,7 @@ cpdef bint is_Expression(x): """ return isinstance(x, Expression) + cpdef bint is_SymbolicEquation(x): """ Return True if *x* is a symbolic equation. @@ -292,6 +442,7 @@ def _dict_update_check_duplicate(dict d1, dict d2): d1.update(d2) + def _subs_make_dict(s): r""" There are a few ways we can represent a substitution. The first is @@ -3674,186 +3825,6 @@ cdef class Expression(CommutativeRingElement): """ return 1/self - cpdef int _cmp_(left, right) except -2: - """ - Compare self and right, returning -1, 0, or 1, depending on if - self < right, self == right, or self > right, respectively. - - This is deprecated by :trac:`23273` - - Use :func:`sage.symbolic.comparison.mixed_order`` instead of - the operators <=, <, etc. to compare symbolic expressions when - you do not want to get a formal inequality back. - - INPUT: - - - ``right`` -- A :class:`Expression` instance. - - OUTPUT: -1, 0 or 1 - - EXAMPLES: - - Using ``cmp`` to compare symbolic expressions should be avoided:: - - sage: SR(0)._cmp_(SR(1)) - doctest:...: DeprecationWarning: to compare symbolic expressions, - use mixed_order(a, b) or bool(a <= b) - See http://trac.sagemath.org/23273 for details. - -1 - - Instead, you can do the following:: - - sage: from sage.symbolic.comparison import mixed_order - - sage: a = sqrt(3) - sage: b = x^2+1 - sage: mixed_order(a, b) # indirect doctest - -1 - - sage: x,y = var('x,y') - sage: x < y - x < y - sage: mixed_order(x, y) - 1 - - sage: mixed_order(SR(0.5), SR(0.7)) - -1 - sage: SR(0.5) < SR(0.7) - 0.500000000000000 < 0.700000000000000 - sage: mixed_order(SR(0.5), 0.7) - -1 - - sage: mixed_order(sin(SR(2)), sin(SR(1))) - 1 - sage: float(sin(SR(2))) - 0.9092974268256817 - sage: float(sin(SR(1))) - 0.8414709848078965 - - TESTS: - - Check that :trac:`9880` is fixed:: - - sage: b = [var('b_%s'%i) for i in range(4)] - sage: precomp = (2^b_2 + 2)*(2^b_1 + 2^(-b_1) + 2^b_1*2^b_0 - \ - 2^b_1*2^(-b_0) - 2^(-b_1)*2^b_0 - 2^(-b_1)*2^(-b_0) + \ - 2^b_0 + 2^(-b_0) - 9) + (2^b_1 + 2^(-b_1) + \ - 2^b_1*2^b_0 - 2^b_1*2^(-b_0) - 2^(-b_1)*2^b_0 - \ - 2^(-b_1)*2^(-b_0) + 2^b_0 + 2^(-b_0) - 9)/2^b_2 - sage: repl_dict = {b_0: b_0, b_3: b_1, b_2: b_3, b_1: b_2} - sage: P = precomp.substitute(repl_dict) - sage: P.expand() - 2^b_0*2^b_2*2^b_3 + 2*2^b_0*2^b_2 + 2^b_0*2^b_3 + 2^b_2*2^b_3 + - 2*2^b_0 + 2*2^b_2 - 9*2^b_3 + 2^b_0*2^b_2/2^b_3 - - 2^b_0*2^b_3/2^b_2 - 2^b_2*2^b_3/2^b_0 - 2*2^b_0/2^b_2 - - 2*2^b_2/2^b_0 + 2^b_0/2^b_3 + 2^b_2/2^b_3 + 2^b_3/2^b_0 + - 2^b_3/2^b_2 + 2/2^b_0 + 2/2^b_2 - 2^b_0/(2^b_2*2^b_3) - - 2^b_2/(2^b_0*2^b_3) - 9/2^b_3 - 2^b_3/(2^b_0*2^b_2) - - 2/(2^b_0*2^b_2) + 1/(2^b_0*2^b_3) + 1/(2^b_2*2^b_3) - - 1/(2^b_0*2^b_2*2^b_3) - 18 - - sage: _0,b_1,b_2=var('b_0,b_1,b_2') - sage: f = 1/27*b_2^2/(2^b_2)^2 + 1/27*b_1^2/(2^b_1)^2 + \ - 1/27*b_0^2/(2^b_0)^2 + 1/27*b_2/(2^b_2)^2 - 2/81/(2^b_2)^2 + \ - 1/27*b_1/(2^b_1)^2 + 8/243/(2^b_2)^2 - 1/81*b_0/(2^b_0)^2 - \ - 1/27*b_1^2/((2^b_2)^2*(2^b_1)^2) - \ - 1/27*b_0^2/((2^b_2)^2*(2^b_0)^2) - 20/243/(2^b_1)^2 + 1/9/2^b_0 \ - + 4/81*b_0/(2^b_0)^2 - 8/243/(2^b_2)^2 - 2/9/(2^b_2*2^b_1) - \ - 2/9/(2^b_2*2^b_0) + 8/243/(2^b_1)^2 - 1/9/2^b_0 + \ - 2/9/(2^b_2*2^b_1) + 2/9/(2^b_2*2^b_0) - \ - 2/27*b_1*b_2/((2^b_2)^2*(2^b_1)^2) - \ - 1/27*b_2^2/((2^b_2)^2*(2^b_1)^2) - \ - 2/27*b_0*b_2/((2^b_2)^2*(2^b_0)^2) - \ - 1/27*b_2^2/((2^b_2)^2*(2^b_0)^2) + 2/81/(2^b_1)^2 - \ - 1/27*b_0^2/((2^b_1)^2*(2^b_0)^2) - \ - 2/27*b_0*b_1/((2^b_1)^2*(2^b_0)^2) - \ - 1/27*b_1^2/((2^b_1)^2*(2^b_0)^2) - 2/81/(2^b_0)^2 + \ - 5/27*b_1/((2^b_2)^2*(2^b_1)^2) + 5/27*b_2/((2^b_2)^2*(2^b_1)^2) \ - + 5/27*b_0/((2^b_2)^2*(2^b_0)^2) + \ - 5/27*b_2/((2^b_2)^2*(2^b_0)^2) + 5/27*b_0/((2^b_1)^2*(2^b_0)^2) \ - + 5/27*b_1/((2^b_1)^2*(2^b_0)^2) - 4/81/((2^b_2)^2*(2^b_1)^2) + \ - 1/27*b_0^2/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + \ - 2/27*b_0*b_1/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + \ - 2/27*b_0*b_2/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + \ - 1/27*b_1^2/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + \ - 2/27*b_1*b_2/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + \ - 1/27*b_2^2/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) - \ - 4/81/((2^b_2)^2*(2^b_0)^2) - 4/81/((2^b_1)^2*(2^b_0)^2) - \ - 11/27*b_0/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) - \ - 11/27*b_1/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) - \ - 11/27*b_2/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + \ - 64/81/((2^b_2)^2*(2^b_1)^2*(2^b_0)^2) + 35/81 \ - sage: f.nops() - 38 - - sage: x,y,z = var('x y z') - sage: print((-x+z)*(3*x-3*z)) - -3*(x - z)^2 - - sage: t = var('t') - sage: (x-t)^3 - -(t - x)^3 - sage: (-t+x)^3 - -(t - x)^3 - sage: (-x+t)^3 - (t - x)^3 - - This example is from :trac:`10833`:: - - sage: R. = PolynomialRing(QQ,2) - sage: phi(x) = x^2 + c - sage: def iterkate(n): - ....: pol = x - ....: for i in range(1,n): - ....: pol = phi(pol) - ....: return pol - ....: - sage: g = expand(iterkate(7)) - sage: g.nops() - 480 - - Check if :trac:`10849` is fixed:: - - sage: t = I.pyobject().parent()(-1/2) - sage: t > 0 - False - sage: t = I*x-1/2; t - I*x - 1/2 - sage: t.subs(x=I*x).subs(x=0).is_positive() - False - - Check if :trac:`16397` is fixed: - - sage: mixed_order(1, sqrt(2)) - -1 - sage: mixed_order(SR(1), sqrt(2)) - -1 - sage: mixed_order(log(8), 3*log(2)) - 0 - sage: bool(RLF(1) < RLF(sqrt(2))) - True - sage: RealSet((0, pi),[pi, pi],(pi,4)) - (0, 4) - sage: RealSet((0, pi),[0, pi],(pi,4)) - [0, 4) - sage: RealSet((0, pi),[0, 3.5],(pi,4)) - [0, 4) - - More sanity tests:: - - sage: bool(pi < pi) - False - sage: bool(e < e) - False - sage: bool(sqrt(2) < sqrt(2)) - False - sage: bool(pi < SR.zero()) - False - """ - deprecation(23273, 'to compare symbolic expressions, ' - 'use mixed_order(a, b) or bool(a <= b)') - return mixed_order(left, right) - cpdef int _cmp_add(Expression left, Expression right) except -2: """ Compare ``left`` and ``right`` in the print order. From 930743b9c023497d66025089caa56b1ec40acf58 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 8 May 2020 08:28:55 -0400 Subject: [PATCH 111/301] Trac #29656: add Gentoo package information for m4rie. --- build/pkgs/m4rie/distros/gentoo.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 build/pkgs/m4rie/distros/gentoo.txt diff --git a/build/pkgs/m4rie/distros/gentoo.txt b/build/pkgs/m4rie/distros/gentoo.txt new file mode 100644 index 00000000000..2030b99f9e7 --- /dev/null +++ b/build/pkgs/m4rie/distros/gentoo.txt @@ -0,0 +1 @@ +sci-libs/m4rie From 85045bc06f6714234d4adaf67818dc46319d273b Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 8 May 2020 08:29:16 -0400 Subject: [PATCH 112/301] Trac #29656: add Gentoo package information for eclib. --- build/pkgs/eclib/distros/gentoo.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 build/pkgs/eclib/distros/gentoo.txt diff --git a/build/pkgs/eclib/distros/gentoo.txt b/build/pkgs/eclib/distros/gentoo.txt new file mode 100644 index 00000000000..54cfd8df8ba --- /dev/null +++ b/build/pkgs/eclib/distros/gentoo.txt @@ -0,0 +1 @@ +sci-mathematics/eclib[flint] From 520078a330996193f1e8eb286e1ceaa7a7e2f71c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 9 May 2020 12:14:17 -0700 Subject: [PATCH 113/301] build/pkgs/python2: Remove --- build/pkgs/python2/SPKG.rst | 101 ---- build/pkgs/python2/checksums.ini | 4 - build/pkgs/python2/dependencies | 5 - build/pkgs/python2/package-version.txt | 1 - .../python2/patches/2.6.5-FD_SETSIZE.patch | 45 -- build/pkgs/python2/patches/cygwin64.patch | 32 -- .../patches/descr_ref-issue_25750.patch | 58 -- .../patches/getcallargs-issue_20108.patch | 26 - .../hashlibfallbacks-issue_18000.patch | 69 --- .../patches/linux_linking_issue_25229.patch | 13 - .../python2/patches/macos_no_include.patch | 72 --- .../python2/patches/ncurses-issue_14438.patch | 17 - .../python2/patches/ncurses-issue_9665.patch | 26 - .../patches/no_strict_proto-issue_5755.patch | 26 - build/pkgs/python2/patches/permissions.patch | 11 - .../patches/re_match_index-issue_27177.patch | 37 -- build/pkgs/python2/patches/socket.patch | 21 - build/pkgs/python2/patches/tinfo.patch | 123 ----- .../python2/patches/trashcan_heap_type.patch | 64 --- .../python2/patches/trashcan_subclass.patch | 496 ------------------ .../python2/patches/uuid-issue_11063.patch | 154 ------ build/pkgs/python2/spkg-build.in | 1 - build/pkgs/python2/spkg-check.in | 1 - build/pkgs/python2/spkg-install.in | 1 - build/pkgs/python2/type | 1 - 25 files changed, 1405 deletions(-) delete mode 100644 build/pkgs/python2/SPKG.rst delete mode 100644 build/pkgs/python2/checksums.ini delete mode 100644 build/pkgs/python2/dependencies delete mode 100644 build/pkgs/python2/package-version.txt delete mode 100644 build/pkgs/python2/patches/2.6.5-FD_SETSIZE.patch delete mode 100644 build/pkgs/python2/patches/cygwin64.patch delete mode 100644 build/pkgs/python2/patches/descr_ref-issue_25750.patch delete mode 100644 build/pkgs/python2/patches/getcallargs-issue_20108.patch delete mode 100644 build/pkgs/python2/patches/hashlibfallbacks-issue_18000.patch delete mode 100644 build/pkgs/python2/patches/linux_linking_issue_25229.patch delete mode 100644 build/pkgs/python2/patches/macos_no_include.patch delete mode 100644 build/pkgs/python2/patches/ncurses-issue_14438.patch delete mode 100644 build/pkgs/python2/patches/ncurses-issue_9665.patch delete mode 100644 build/pkgs/python2/patches/no_strict_proto-issue_5755.patch delete mode 100644 build/pkgs/python2/patches/permissions.patch delete mode 100644 build/pkgs/python2/patches/re_match_index-issue_27177.patch delete mode 100644 build/pkgs/python2/patches/socket.patch delete mode 100644 build/pkgs/python2/patches/tinfo.patch delete mode 100644 build/pkgs/python2/patches/trashcan_heap_type.patch delete mode 100644 build/pkgs/python2/patches/trashcan_subclass.patch delete mode 100644 build/pkgs/python2/patches/uuid-issue_11063.patch delete mode 120000 build/pkgs/python2/spkg-build.in delete mode 120000 build/pkgs/python2/spkg-check.in delete mode 120000 build/pkgs/python2/spkg-install.in delete mode 100644 build/pkgs/python2/type diff --git a/build/pkgs/python2/SPKG.rst b/build/pkgs/python2/SPKG.rst deleted file mode 100644 index 75411f544c0..00000000000 --- a/build/pkgs/python2/SPKG.rst +++ /dev/null @@ -1,101 +0,0 @@ -python -====== - -Description ------------ - -Python is a dynamic object-oriented programming language that can be -used for many kinds of software development. It offers strong support -for integration with other languages and tools, comes with extensive -standard libraries, and can be learned in a few days. Many Python -programmers report substantial productivity gains and feel the language -encourages the development of higher quality, more maintainable code. - -For more details see http://www.python.org - -License -------- - -Python is licensed under the PSF LICENSE. The Python license imposes -very few restrictions on what you can do with Python. Most of the source -code is copyrighted by the Python Software Foundation (PSF). A few files -have a different copyright owner, but the same license applies to all of -them. Python's licensing is GPL compatible. - -For more details see http://www.python.org/psf/license/ - - -Upstream Contact ----------------- - -There are a large number of community resources. For more details see -http://www.python.org/community/ - -Dependencies ------------- - -- GNU patch -- readline -- libpng -- SQLite - - -Special Update/Build Instructions ---------------------------------- - -- We keep a copy of the stdlib 'random' module in - - src/sage/cpython/_py2_random.py. Normally it shouldn't be necessary - to update this, but when upgrading Python make sure to bring over - any security updates from the upstream 'random' module in the - unlikely - chance there are any. This might mean updating any "random" test - results - that depend on the implementation details of the random module. - -- Spaces in SAGE_ROOT aren't yet fully supported by this package, - - since we put $SAGE_LOCAL/... into CPPFLAGS and LDFLAGS, which - wouldn't work then. - -Patches -~~~~~~~ - -- socket.patch: Work around an SSL issue. -- permissions.patch: Changes the permission of installed libraries - - to 0755 (like any other library) instead of 0555. - -- sys_path_security-issue_16202.patch: ensure that the current working - - directory or the script directory is prepended to sys.path only if - there is no security risk in doing so. - -- ncurses-issue_9665.patch: Fixes Python issue #9665 (by patching - configure - - and configure.in after running autotools). - -- ncurses-issue_14438.patch: Fixes Python issue #14438 (ncurses) -- disable_print_refs_debug.patch: Remove some unused debug output - - that breaks doctests. - -- no_strict_proto-issue_5755.patch: don't add -Wstrict-prototypes - compiler - - flag, which isn't valid for C++ (but Python uses the same compiler - flags - for C and C++). See http://bugs.python.org/issue5755. - -- hashlibfallbacks-issue_18000.patch: Fixed Python issue #18000. -- tinfo.patch: make sure tinfo is correctly linked in when needed on - Cygwin. -- uuid-issue_11063.patch: patch from Python issue 11063; reduce uuid - - module import side effects and fix thread related issues. - -- getcallargs-issue_20108.patch: fix inspect.getcallargs() when the - - function has a "func" keyword argument. Needed for @interact from - ipywidgets. diff --git a/build/pkgs/python2/checksums.ini b/build/pkgs/python2/checksums.ini deleted file mode 100644 index 186826b266a..00000000000 --- a/build/pkgs/python2/checksums.ini +++ /dev/null @@ -1,4 +0,0 @@ -tarball=Python-VERSION.tar.xz -sha1=f99348a095ec4a6411c84c0d15343d11920c9724 -md5=a80ae3cc478460b922242f43a1b4094d -cksum=3147661506 diff --git a/build/pkgs/python2/dependencies b/build/pkgs/python2/dependencies deleted file mode 100644 index f6d4a1622ab..00000000000 --- a/build/pkgs/python2/dependencies +++ /dev/null @@ -1,5 +0,0 @@ -zlib readline sqlite libpng bzip2 | xz - ----------- -All lines of this file are ignored except the first. -It is copied by SAGE_ROOT/build/make/install into SAGE_ROOT/build/make/Makefile. diff --git a/build/pkgs/python2/package-version.txt b/build/pkgs/python2/package-version.txt deleted file mode 100644 index cf7deab283c..00000000000 --- a/build/pkgs/python2/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -2.7.15.p1 diff --git a/build/pkgs/python2/patches/2.6.5-FD_SETSIZE.patch b/build/pkgs/python2/patches/2.6.5-FD_SETSIZE.patch deleted file mode 100644 index 1059ca4ad45..00000000000 --- a/build/pkgs/python2/patches/2.6.5-FD_SETSIZE.patch +++ /dev/null @@ -1,45 +0,0 @@ -This patch has never been submitted upstream for some reason, but it simply -increases the default number of file descriptors the Python process can have on -Cygwin, which mitigates some issues; see -https://cygwin.com/ml/cygwin/2011-03/msg00651.html ---- a/Modules/selectmodule.c 2012-02-02 22:35:21.835125000 -0500 -+++ b/Modules/selectmodule.c 2012-02-02 22:41:41.210125000 -0500 -@@ -6,6 +6,21 @@ - >= 0. - */ - -+/* Windows #defines FD_SETSIZE to 64 if FD_SETSIZE isn't already defined. -+ 64 is too small (too many people have bumped into that limit). -+ Here we boost it. -+ -+ Cygwin also defines FD_SETSIZE to 64, so also increase the limit on -+ Cygwin. We must do this before sys/types.h is included, which otherwise -+ sets FD_SETSIZE to the default. -+ -+ Users who want even more than the boosted limit should #define -+ FD_SETSIZE higher before this; e.g., via compiler /D switch. -+*/ -+#if (defined(MS_WINDOWS) || defined(__CYGWIN__)) && !defined(FD_SETSIZE) -+#define FD_SETSIZE 512 -+#endif -+ - #include "Python.h" - #include - -@@ -16,16 +31,6 @@ - #undef HAVE_BROKEN_POLL - #endif - --/* Windows #defines FD_SETSIZE to 64 if FD_SETSIZE isn't already defined. -- 64 is too small (too many people have bumped into that limit). -- Here we boost it. -- Users who want even more than the boosted limit should #define -- FD_SETSIZE higher before this; e.g., via compiler /D switch. --*/ --#if defined(MS_WINDOWS) && !defined(FD_SETSIZE) --#define FD_SETSIZE 512 --#endif -- - #if defined(HAVE_POLL_H) - #include - #elif defined(HAVE_SYS_POLL_H) diff --git a/build/pkgs/python2/patches/cygwin64.patch b/build/pkgs/python2/patches/cygwin64.patch deleted file mode 100644 index 345eeb17322..00000000000 --- a/build/pkgs/python2/patches/cygwin64.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/Modules/_ctypes/libffi/src/x86/ffi.c 2013-02-11 13:24:18.000000000 -0600 -+++ b/Modules/_ctypes/libffi/src/x86/ffi.c 2013-03-12 23:22:18.267762700 -0500 -@@ -28,7 +28,7 @@ - DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- */ - --#if !defined(__x86_64__) || defined(_WIN64) -+#if !defined(__x86_64__) || defined(_WIN64) || defined(__CYGWIN__) - - #ifdef _WIN64 - #include ---- a/Modules/_ctypes/libffi/src/x86/win64.S 2013-02-11 13:24:18.000000000 -0600 -+++ b/Modules/_ctypes/libffi/src/x86/win64.S 2013-03-13 04:50:09.526614600 -0500 -@@ -295,7 +295,7 @@ SYMBOL_NAME(ffi_closure_win64): - mov %rax, %rcx # context is first parameter - mov %rsp, %rdx # stack is second parameter - add $48, %rdx # point to start of arguments -- mov $SYMBOL_NAME(ffi_closure_win64_inner), %rax -+ lea SYMBOL_NAME(ffi_closure_win64_inner)(%rip), %rax - callq *%rax # call the real closure function - add $40, %rsp - movq %rax, %xmm0 # If the closure returned a float, ---- a/Modules/_ctypes/libffi/fficonfig.py.in 2013-05-12 05:32:49.000000000 +0200 -+++ b/Modules/_ctypes/libffi/fficonfig.py.in 2013-06-03 22:28:06.617994762 +0200 -@@ -23,6 +23,7 @@ - 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'], - 'S390': ['src/s390/sysv.S', 'src/s390/ffi.c'], - 'X86_64': ['src/x86/ffi64.c', 'src/x86/unix64.S', 'src/x86/ffi.c', 'src/x86/sysv.S'], -+ 'X86_WIN64': ['src/x86/ffi.c', 'src/x86/win64.S'], - 'SH': ['src/sh/sysv.S', 'src/sh/ffi.c'], - 'SH64': ['src/sh64/sysv.S', 'src/sh64/ffi.c'], - 'PA': ['src/pa/linux.S', 'src/pa/ffi.c'], diff --git a/build/pkgs/python2/patches/descr_ref-issue_25750.patch b/build/pkgs/python2/patches/descr_ref-issue_25750.patch deleted file mode 100644 index b55cf58a2d2..00000000000 --- a/build/pkgs/python2/patches/descr_ref-issue_25750.patch +++ /dev/null @@ -1,58 +0,0 @@ -When calling tp_descr_get(self, obj, type), make sure that we own a reference to "self" - -diff -ru Python-2.7.9/Objects/typeobject.c Python-2.7.9-fixed//Objects/typeobject.c ---- Python-2.7.9/Objects/typeobject.c 2014-12-10 16:59:57.000000000 +0100 -+++ Python-2.7.9-fixed//Objects/typeobject.c 2015-11-27 20:39:58.276156800 +0100 -@@ -2542,6 +2542,7 @@ - PyTypeObject *metatype = Py_TYPE(type); - PyObject *meta_attribute, *attribute; - descrgetfunc meta_get; -+ PyObject* res; - - if (!PyString_Check(name)) { - PyErr_Format(PyExc_TypeError, -@@ -2563,6 +2564,7 @@ - meta_attribute = _PyType_Lookup(metatype, name); - - if (meta_attribute != NULL) { -+ Py_INCREF(meta_attribute); - meta_get = Py_TYPE(meta_attribute)->tp_descr_get; - - if (meta_get != NULL && PyDescr_IsData(meta_attribute)) { -@@ -2570,10 +2572,11 @@ - * writes. Assume the attribute is not overridden in - * type's tp_dict (and bases): call the descriptor now. - */ -- return meta_get(meta_attribute, (PyObject *)type, -+ res = meta_get(meta_attribute, (PyObject *)type, - (PyObject *)metatype); -+ Py_DECREF(meta_attribute); -+ return res; - } -- Py_INCREF(meta_attribute); - } - - /* No data descriptor found on metatype. Look in tp_dict of this -@@ -2581,6 +2584,7 @@ - attribute = _PyType_Lookup(type, name); - if (attribute != NULL) { - /* Implement descriptor functionality, if any */ -+ Py_INCREF(attribute); - descrgetfunc local_get = Py_TYPE(attribute)->tp_descr_get; - - Py_XDECREF(meta_attribute); -@@ -2588,11 +2592,12 @@ - if (local_get != NULL) { - /* NULL 2nd argument indicates the descriptor was - * found on the target object itself (or a base) */ -- return local_get(attribute, (PyObject *)NULL, -+ res = local_get(attribute, (PyObject *)NULL, - (PyObject *)type); -+ Py_DECREF(attribute); -+ return res; - } - -- Py_INCREF(attribute); - return attribute; - } - diff --git a/build/pkgs/python2/patches/getcallargs-issue_20108.patch b/build/pkgs/python2/patches/getcallargs-issue_20108.patch deleted file mode 100644 index 5756041c93f..00000000000 --- a/build/pkgs/python2/patches/getcallargs-issue_20108.patch +++ /dev/null @@ -1,26 +0,0 @@ -# HG changeset patch -# User Benjamin Peterson -# Date 1388687048 21600 -# Node ID b0d472e3ff42de9fd2b1a702f5874202c2d2b27f -# Parent 8083b887068667a7b62443d56de310e7fe10d3df -avoid parameter name clash (closes #20108) - -diff -ru a/Lib/inspect.py b/Lib/inspect.py ---- a/Lib/inspect.py 2015-05-23 18:09:04.000000000 +0200 -+++ b/Lib/inspect.py 2016-09-21 11:34:16.491938401 +0200 -@@ -892,12 +892,14 @@ - specs.append(formatvarkw(varkw) + formatvalue(locals[varkw])) - return '(' + string.join(specs, ', ') + ')' - --def getcallargs(func, *positional, **named): -+def getcallargs(*func_and_positional, **named): - """Get the mapping of arguments to values. - - A dict is returned, with keys the function argument names (including the - names of the * and ** arguments, if any), and values the respective bound - values from 'positional' and 'named'.""" -+ func = func_and_positional[0] -+ positional = func_and_positional[1:] - args, varargs, varkw, defaults = getargspec(func) - f_name = func.__name__ - arg2value = {} diff --git a/build/pkgs/python2/patches/hashlibfallbacks-issue_18000.patch b/build/pkgs/python2/patches/hashlibfallbacks-issue_18000.patch deleted file mode 100644 index f9a2de2fdc1..00000000000 --- a/build/pkgs/python2/patches/hashlibfallbacks-issue_18000.patch +++ /dev/null @@ -1,69 +0,0 @@ -diff -ur src/Lib/test/test_hashlib.py new/Lib/test/test_hashlib.py ---- a/Lib/test/test_hashlib.py 2013-05-12 04:32:46.000000000 +0100 -+++ b/Lib/test/test_hashlib.py 2013-05-18 12:24:04.055336404 +0100 -@@ -21,9 +21,6 @@ - from test import test_support - from test.test_support import _4G, precisionbigmemtest - --# Were we compiled --with-pydebug or with #define Py_DEBUG? --COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') -- - - def hexstr(s): - import string -@@ -40,7 +37,7 @@ - 'sha224', 'SHA224', 'sha256', 'SHA256', - 'sha384', 'SHA384', 'sha512', 'SHA512' ) - -- _warn_on_extension_import = COMPILED_WITH_PYDEBUG -+ _warn_on_extension_import = True - - def _conditional_import_module(self, module_name): - """Import a module and return a reference to it or None on failure.""" -diff -ur src/setup.py new/setup.py ---- a/setup.py 2013-05-12 04:32:54.000000000 +0100 -+++ b/setup.py 2013-05-18 12:22:04.417057535 +0100 -@@ -29,9 +29,6 @@ - return sys.platform - host_platform = get_platform() - --# Were we compiled --with-pydebug or with #define Py_DEBUG? --COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) -- - # This global variable is used to hold the list of modules to be disabled. - disabled_module_list = [] - -@@ -854,21 +851,18 @@ - print ("warning: openssl 0x%08x is too old for _hashlib" % - openssl_ver) - missing.append('_hashlib') -- if COMPILED_WITH_PYDEBUG or not have_usable_openssl: -- # The _sha module implements the SHA1 hash algorithm. -- exts.append( Extension('_sha', ['shamodule.c']) ) -- # The _md5 module implements the RSA Data Security, Inc. MD5 -- # Message-Digest Algorithm, described in RFC 1321. The -- # necessary files md5.c and md5.h are included here. -- exts.append( Extension('_md5', -- sources = ['md5module.c', 'md5.c'], -- depends = ['md5.h']) ) -- -- min_sha2_openssl_ver = 0x00908000 -- if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver: -- # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash -- exts.append( Extension('_sha256', ['sha256module.c']) ) -- exts.append( Extension('_sha512', ['sha512module.c']) ) -+ -+ # We always compile these even when OpenSSL is available (issue #14693). -+ # It's harmless and the object code is tiny (40-50 KB per module, -+ # only loaded when actually used). -+ exts.append( Extension('_sha256', ['sha256module.c'], -+ depends=['hashlib.h']) ) -+ exts.append( Extension('_sha512', ['sha512module.c'], -+ depends=['hashlib.h']) ) -+ exts.append( Extension('_md5', ['md5module.c', 'md5.c'], -+ depends=['hashlib.h']) ) -+ exts.append( Extension('_sha', ['shamodule.c'], -+ depends=['hashlib.h']) ) - - # Modules that provide persistent dictionary-like semantics. You will - # probably want to arrange for at least one of them to be available on diff --git a/build/pkgs/python2/patches/linux_linking_issue_25229.patch b/build/pkgs/python2/patches/linux_linking_issue_25229.patch deleted file mode 100644 index 4d9fb35cc03..00000000000 --- a/build/pkgs/python2/patches/linux_linking_issue_25229.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py -index 3af540e..625f155 100644 ---- a/Lib/distutils/unixccompiler.py -+++ b/Lib/distutils/unixccompiler.py -@@ -238,7 +238,7 @@ class UnixCCompiler(CCompiler): - return ["+s", "-L" + dir] - elif sys.platform[:7] == "irix646" or sys.platform[:6] == "osf1V5": - return ["-rpath", dir] -- elif self._is_gcc(compiler): -+ elif sys.platform[:5] == "linux" or self._is_gcc(compiler): - return "-Wl,-R" + dir - else: - return "-R" + dir diff --git a/build/pkgs/python2/patches/macos_no_include.patch b/build/pkgs/python2/patches/macos_no_include.patch deleted file mode 100644 index 0003924e13c..00000000000 --- a/build/pkgs/python2/patches/macos_no_include.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/configure b/configure -index 4a047e6..e3c8bdf 100755 ---- a/configure -+++ b/configure -@@ -6102,6 +6102,12 @@ $as_echo "$ac_cv_no_strict_aliasing_ok" >&6; } - Darwin*) - # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd - # used to be here, but non-Apple gcc doesn't accept them. -+ -+cat >>confdefs.h <<_ACEOF -+#define Py_MACOS_SYSROOT `xcrun --show-sdk-path` -+_ACEOF -+ -+ - if test "${CC}" = gcc - then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5 -diff --git a/configure.ac b/configure.ac -index 913d546..6cb1f28 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1155,6 +1155,7 @@ yes) - Darwin*) - # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd - # used to be here, but non-Apple gcc doesn't accept them. -+ AC_DEFINE_UNQUOTED([Py_MACOS_SYSROOT], [`xcrun --show-sdk-path`], [Get the root dir of XCode]) - if test "${CC}" = gcc - then - AC_MSG_CHECKING(which compiler should be used) -diff --git a/pyconfig.h.in b/pyconfig.h.in -index 11c4a66..a4e12a2 100644 ---- a/pyconfig.h.in -+++ b/pyconfig.h.in -@@ -1016,6 +1016,9 @@ - /* Defined if Python is built as a shared library. */ - #undef Py_ENABLE_SHARED - -+/* Get the root dir of XCode */ -+#undef Py_MACOS_SYSROOT -+ - /* Define as the size of the unicode type. */ - #undef Py_UNICODE_SIZE - -diff --git a/setup.py b/setup.py -index 33cecc6..5d6a411 100644 ---- a/setup.py -+++ b/setup.py -@@ -50,7 +50,7 @@ def macosx_sdk_root(): - cflags = sysconfig.get_config_var('CFLAGS') - m = re.search(r'-isysroot\s+(\S+)', cflags) - if m is None: -- sysroot = '/' -+ sysroot = sysconfig.get_config_var('Py_MACOS_SYSROOT') - else: - sysroot = m.group(1) - return sysroot -@@ -92,7 +92,6 @@ def find_file(filename, std_dirs, paths): - # Check the additional directories - for dir in paths: - f = os.path.join(dir, filename) -- - if host_platform == 'darwin' and is_macosx_sdk_path(dir): - f = os.path.join(sysroot, dir[1:], filename) - -@@ -557,6 +556,7 @@ class PyBuildExt(build_ext): - # NOTE: using shlex.split would technically be more correct, but - # also gives a bootstrap problem. Let's hope nobody uses directories - # with whitespace in the name to store libraries. -+ inc_dirs += ['/usr/include'] - cflags, ldflags = sysconfig.get_config_vars( - 'CFLAGS', 'LDFLAGS') - for item in cflags.split(): diff --git a/build/pkgs/python2/patches/ncurses-issue_14438.patch b/build/pkgs/python2/patches/ncurses-issue_14438.patch deleted file mode 100644 index e2500d93401..00000000000 --- a/build/pkgs/python2/patches/ncurses-issue_14438.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -ru a/Include/py_curses.h b/Include/py_curses.h ---- a/Include/py_curses.h 2018-04-15 00:06:30.000000000 +0200 -+++ b/Include/py_curses.h 2018-04-19 14:50:07.967630196 +0200 -@@ -12,6 +12,13 @@ - #endif - #endif /* __APPLE__ */ - -+#ifdef __CYGWIN__ -+/* the following define is necessary for Cygwin; without it, the -+ Cygwin-supplied ncurses.h sets NCURSES_OPAQUE to 1, and then Python -+ can't get at the WINDOW flags field. */ -+#define NCURSES_INTERNALS -+#endif /* __CYGWIN__ */ -+ - #ifdef __FreeBSD__ - /* - ** On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards diff --git a/build/pkgs/python2/patches/ncurses-issue_9665.patch b/build/pkgs/python2/patches/ncurses-issue_9665.patch deleted file mode 100644 index e0d22792a3a..00000000000 --- a/build/pkgs/python2/patches/ncurses-issue_9665.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -ur src.orig/configure.ac src/configure.ac ---- src.orig/configure.ac 2012-09-30 19:16:16.208133911 +0200 -+++ src/configure.ac 2012-09-30 19:15:12.800599068 +0200 -@@ -1245,6 +1245,9 @@ - OSF*) - BASECFLAGS="$BASECFLAGS -mieee" - ;; -+ CYGWIN*) -+ BASECFLAGS="-I/usr/include/ncurses $BASECFLAGS" -+ ;; - esac - ;; - -diff -ur src.orig/configure src/configure ---- src.orig/configure 2012-09-30 19:16:16.216133852 +0200 -+++ src/configure 2012-09-30 19:15:44.876363826 +0200 -@@ -6146,6 +6146,9 @@ - OSF*) - BASECFLAGS="$BASECFLAGS -mieee" - ;; -+ CYGWIN*) -+ BASECFLAGS="-I/usr/include/ncurses $BASECFLAGS" -+ ;; - esac - ;; - diff --git a/build/pkgs/python2/patches/no_strict_proto-issue_5755.patch b/build/pkgs/python2/patches/no_strict_proto-issue_5755.patch deleted file mode 100644 index 2f83403b36a..00000000000 --- a/build/pkgs/python2/patches/no_strict_proto-issue_5755.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -ru src/configure.ac b/configure.ac ---- src/configure.ac 2013-04-06 16:02:41.000000000 +0200 -+++ b/configure.ac 2013-04-11 18:11:17.947929754 +0200 -@@ -1051,9 +1051,6 @@ - then - case $GCC in - yes) -- if test "$CC" != 'g++' ; then -- STRICT_PROTO="-Wstrict-prototypes" -- fi - # For gcc 4.x we need to use -fwrapv so lets check if its supported - if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then - WRAP="-fwrapv" -diff -ru src/configure b/configure ---- src/configure 2013-04-06 16:02:41.000000000 +0200 -+++ b/configure 2013-04-11 18:11:25.737930322 +0200 -@@ -5931,9 +5931,6 @@ - then - case $GCC in - yes) -- if test "$CC" != 'g++' ; then -- STRICT_PROTO="-Wstrict-prototypes" -- fi - # For gcc 4.x we need to use -fwrapv so lets check if its supported - if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then - WRAP="-fwrapv" diff --git a/build/pkgs/python2/patches/permissions.patch b/build/pkgs/python2/patches/permissions.patch deleted file mode 100644 index d982758d9e1..00000000000 --- a/build/pkgs/python2/patches/permissions.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src.orig/Makefile.pre.in 2013-04-06 15:02:34.000000000 +0100 -+++ src/Makefile.pre.in 2013-04-07 12:59:46.675111329 +0100 -@@ -59,7 +59,7 @@ - # Shared libraries must be installed with executable mode on some systems; - # rather than figuring out exactly which, we always give them executable mode. - # Also, making them read-only seems to be a good idea... --INSTALL_SHARED= ${INSTALL} -m 555 -+INSTALL_SHARED= ${INSTALL} -m 755 - - MKDIR_P= @MKDIR_P@ - diff --git a/build/pkgs/python2/patches/re_match_index-issue_27177.patch b/build/pkgs/python2/patches/re_match_index-issue_27177.patch deleted file mode 100644 index 0a6997642c7..00000000000 --- a/build/pkgs/python2/patches/re_match_index-issue_27177.patch +++ /dev/null @@ -1,37 +0,0 @@ -Fix http://bugs.python.org/issue27177 -diff -ru Python-2.7.10/Lib/test/test_index.py Python-2.7.10-fix-re//Lib/test/test_index.py ---- Python-2.7.10/Lib/test/test_index.py 2015-05-23 18:09:11.000000000 +0200 -+++ Python-2.7.10-fix-re//Lib/test/test_index.py 2016-06-01 15:50:07.274162354 +0200 -@@ -246,6 +246,20 @@ - self.assertEqual(xrange(1, 20)[n], 6) - self.assertEqual(xrange(1, 20).__getitem__(n), 6) - -+class MatchGroupTestCase(unittest.TestCase): -+ -+ def test_re_group(self): -+ n = newstyle() -+ n.ind = 0 -+ o = oldstyle() -+ o.ind = 1 -+ -+ import re -+ p = re.compile('(a)(b)') -+ m = p.match('ab') -+ self.assertEqual(m.group(0), m.group(n)) -+ self.assertEqual(m.group(1), m.group(o)) -+ - class OverflowTestCase(unittest.TestCase): - - def setUp(self): -diff -ru Python-2.7.10/Modules/_sre.c Python-2.7.10-fix-re//Modules/_sre.c ---- Python-2.7.10/Modules/_sre.c 2015-05-23 18:09:19.000000000 +0200 -+++ Python-2.7.10-fix-re//Modules/_sre.c 2016-06-01 15:50:58.614165047 +0200 -@@ -3303,6 +3303,8 @@ - - if (PyInt_Check(index) || PyLong_Check(index)) - return PyInt_AsSsize_t(index); -+ if (PyIndex_Check(index)) -+ return PyNumber_AsSsize_t(index, PyExc_IndexError); - - i = -1; - diff --git a/build/pkgs/python2/patches/socket.patch b/build/pkgs/python2/patches/socket.patch deleted file mode 100644 index 27e4dcb5c33..00000000000 --- a/build/pkgs/python2/patches/socket.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -ru a/Lib/socket.py b/Lib/socket.py ---- a/Lib/socket.py 2018-04-15 00:06:30.000000000 +0200 -+++ b/Lib/socket.py 2018-04-19 14:49:27.227076923 +0200 -@@ -51,6 +51,9 @@ - - try: - import _ssl -+ from _ssl import SSLError as sslerror -+ # we try this second line since sometimes the first -+ # passes even though the module isn't there - except ImportError: - # no SSL support - pass -@@ -64,7 +67,6 @@ - return _realssl.sslwrap_simple(sock, keyfile, certfile) - - # we need to import the same constants we used to... -- from _ssl import SSLError as sslerror - from _ssl import \ - RAND_add, \ - RAND_status, \ diff --git a/build/pkgs/python2/patches/tinfo.patch b/build/pkgs/python2/patches/tinfo.patch deleted file mode 100644 index bc152f51622..00000000000 --- a/build/pkgs/python2/patches/tinfo.patch +++ /dev/null @@ -1,123 +0,0 @@ -diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py -index 62506a6..f80230c 100644 ---- a/Lib/distutils/ccompiler.py -+++ b/Lib/distutils/ccompiler.py -@@ -842,9 +842,9 @@ main (int argc, char **argv) { - def library_filename(self, libname, lib_type='static', # or 'shared' - strip_dir=0, output_dir=''): - assert output_dir is not None -- if lib_type not in ("static", "shared", "dylib", "xcode_stub"): -+ if lib_type not in ("static", "shared", "dylib", "xcode_stub", "import"): - raise ValueError, ("""'lib_type' must be "static", "shared", """ -- """"dylib", or "xcode_stub".""") -+ """"dylib", "xcode_stub" or "import".""") - fmt = getattr(self, lib_type + "_lib_format") - ext = getattr(self, lib_type + "_lib_extension") - -diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py -index 4c35676..54f8356 100644 ---- a/Lib/distutils/unixccompiler.py -+++ b/Lib/distutils/unixccompiler.py -@@ -80,10 +80,12 @@ class UnixCCompiler(CCompiler): - shared_lib_extension = ".so" - dylib_lib_extension = ".dylib" - xcode_stub_lib_extension = ".tbd" -- static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s" -+ import_lib_extension = ".dll.a" -+ import_lib_format = static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s" - xcode_stub_lib_format = dylib_lib_format - if sys.platform == "cygwin": - exe_extension = ".exe" -+ shared_lib_extension = ".dll" - - def preprocess(self, source, - output_file=None, macros=None, include_dirs=None, -@@ -249,6 +251,7 @@ class UnixCCompiler(CCompiler): - dylib_f = self.library_filename(lib, lib_type='dylib') - xcode_stub_f = self.library_filename(lib, lib_type='xcode_stub') - static_f = self.library_filename(lib, lib_type='static') -+ import_f = self.library_filename(lib, lib_type='import') - - if sys.platform == 'darwin': - # On OSX users can specify an alternate SDK using -@@ -279,6 +282,7 @@ class UnixCCompiler(CCompiler): - - - for dir in dirs: -+ implib = os.path.join(dir, import_f) - shared = os.path.join(dir, shared_f) - dylib = os.path.join(dir, dylib_f) - static = os.path.join(dir, static_f) -@@ -297,7 +301,9 @@ class UnixCCompiler(CCompiler): - # data to go on: GCC seems to prefer the shared library, so I'm - # assuming that *all* Unix C compilers do. And of course I'm - # ignoring even GCC's "-static" option. So sue me. -- if os.path.exists(dylib): -+ if os.path.exists(implib): -+ return implib -+ elif os.path.exists(dylib): - return dylib - elif os.path.exists(xcode_stub): - return xcode_stub -@@ -308,3 +314,22 @@ class UnixCCompiler(CCompiler): - - # Oops, didn't find it in *any* of 'dirs' - return None -+ -+ def implib_to_dll(self, dirs, implib, debug=0): -+ fp = os.popen("dlltool -I %s" % implib) -+ dlltool_output = fp.readlines() -+ ret = fp.close() -+ -+ if ret is None or ret >> 8 == 0: -+ for ln in dlltool_output: -+ for dir in dirs: -+ dll = os.path.join(dir, ln.rstrip('\n')) -+ # We're second-guessing the linker here, with not much hard -+ # data to go on: GCC seems to prefer the shared library, so I'm -+ # assuming that *all* Unix C compilers do. And of course I'm -+ # ignoring even GCC's "-static" option. So sue me. -+ if os.path.exists(dll): -+ return dll -+ -+ # Oops, didn't find it in *any* of 'dirs' -+ return None -diff --git a/setup.py b/setup.py -index aa08ada..f41d200 100644 ---- a/setup.py -+++ b/setup.py -@@ -726,8 +726,12 @@ class PyBuildExt(build_ext): - do_readline = self.compiler.find_library_file(lib_dirs, 'readline') - readline_termcap_library = "" - curses_library = "" -- # Determine if readline is already linked against curses or tinfo. -+ # Determine if readline is linked against curses or tinfo. - if do_readline and find_executable('ldd'): -+ # On Cygwin we have to find out which dll the implib point to -+ if host_platform == "cygwin" and find_executable('dlltool'): -+ do_readline = self.compiler.implib_to_dll(os.getenv('PATH').split(os.pathsep) + lib_dirs, do_readline) -+ - fp = os.popen("ldd %s" % do_readline) - ldd_output = fp.readlines() - ret = fp.close() -@@ -778,7 +782,10 @@ class PyBuildExt(build_ext): - - readline_libs = ['readline'] - if readline_termcap_library: -- pass # Issue 7384: Already linked against curses or tinfo. -+ if host_platform != "cygwin": -+ pass # Issue 7384: Already linked against curses or tinfo. -+ else: -+ readline_libs.append(readline_termcap_library) - elif curses_library: - readline_libs.append(curses_library) - elif self.compiler.find_library_file(lib_dirs + -@@ -1370,6 +1377,8 @@ class PyBuildExt(build_ext): - # _curses_panel.so must link with panelw. - panel_library = 'panelw' - curses_libs = [curses_library] -+ if readline_termcap_library == 'tinfo' and host_platform == "cygwin": -+ curses_libs.append(readline_termcap_library) - curses_incs = find_file('curses.h', inc_dirs, - [os.path.join(d, 'ncursesw') for d in inc_dirs]) - exts.append( Extension('_curses', ['_cursesmodule.c'], diff --git a/build/pkgs/python2/patches/trashcan_heap_type.patch b/build/pkgs/python2/patches/trashcan_heap_type.patch deleted file mode 100644 index b8f3ead3968..00000000000 --- a/build/pkgs/python2/patches/trashcan_heap_type.patch +++ /dev/null @@ -1,64 +0,0 @@ -https://github.com/python/cpython/pull/12725 - -commit 6f8de0b75e0ca987cf5e734cf9c4bb91762efcf3 -Author: Jeroen Demeyer -Date: Mon Apr 8 14:08:37 2019 +0200 - - bpo-36556: trashcan should not cause duplicated __del__ - -diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py -index 7e47b2d..3e4d0f9 100644 ---- a/Lib/test/test_gc.py -+++ b/Lib/test/test_gc.py -@@ -307,6 +307,24 @@ class GCTests(unittest.TestCase): - v = {1: v, 2: Ouch()} - gc.disable() - -+ def test_no_double_del(self): -+ # bpo-36556: instances of heap types should be deallocated once, -+ # even if the trashcan and __del__ are involved -+ class ObjectCounter(object): -+ count = 0 -+ def __init__(self): -+ type(self).count += 1 -+ def __del__(self): -+ # create temporary involving self, whose deallocation -+ # uses the trashcan -+ L = [self] -+ type(self).count -= 1 -+ L = None -+ for i in range(10000): -+ L = (L, ObjectCounter()) -+ del L -+ self.assertEqual(ObjectCounter.count, 0) -+ - @unittest.skipUnless(threading, "test meaningless on builds without threads") - def test_trashcan_threads(self): - # Issue #13992: trashcan mechanism should be thread-safe -diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-04-08-14-32-28.bpo-36556.lp-8oV.rst b/Misc/NEWS.d/next/Core and Builtins/2019-04-08-14-32-28.bpo-36556.lp-8oV.rst -new file mode 100644 -index 0000000..496bdc5 ---- /dev/null -+++ b/Misc/NEWS.d/next/Core and Builtins/2019-04-08-14-32-28.bpo-36556.lp-8oV.rst -@@ -0,0 +1,2 @@ -+When deleting highly nested objects (where the trashcan mechanism is -+involved), it is less likely that ``__del__`` is called multiple times. -diff --git a/Objects/typeobject.c b/Objects/typeobject.c -index 844fb00..43b35b1 100644 ---- a/Objects/typeobject.c -+++ b/Objects/typeobject.c -@@ -917,6 +917,14 @@ subtype_clear(PyObject *self) - return 0; - } - -+/* bpo-36556: lower the trashcan recursion limit for heap types: this gives -+ * __del__ 10 additional stack frames to work with. This makes it less likely -+ * that the trashcan is used in __del__. Otherwise, an object might seemingly -+ * be resurrected by __del__ when it's still referenced by an object in the -+ * trashcan. */ -+#undef PyTrash_UNWIND_LEVEL -+#define PyTrash_UNWIND_LEVEL 40 -+ - static void - subtype_dealloc(PyObject *self) - { diff --git a/build/pkgs/python2/patches/trashcan_subclass.patch b/build/pkgs/python2/patches/trashcan_subclass.patch deleted file mode 100644 index 401bdb5b865..00000000000 --- a/build/pkgs/python2/patches/trashcan_subclass.patch +++ /dev/null @@ -1,496 +0,0 @@ -See https://github.com/python/cpython/pull/12699 - -commit 324fc4bd0b1fa9cb9e60ab58f8852e8b7fdd8689 -Author: Jeroen Demeyer -Date: Wed Feb 13 15:12:48 2019 +0100 - - [2.7] bpo-35983: skip trashcan for subclasses (GH-11841) - -diff --git a/Include/object.h b/Include/object.h -index 807b241..cc2f3c5 100644 ---- a/Include/object.h -+++ b/Include/object.h -@@ -969,11 +969,11 @@ times. - - When deallocating a container object, it's possible to trigger an unbounded - chain of deallocations, as each Py_DECREF in turn drops the refcount on "the --next" object in the chain to 0. This can easily lead to stack faults, and -+next" object in the chain to 0. This can easily lead to stack overflows, - especially in threads (which typically have less stack space to work with). - --A container object that participates in cyclic gc can avoid this by --bracketing the body of its tp_dealloc function with a pair of macros: -+A container object can avoid this by bracketing the body of its tp_dealloc -+function with a pair of macros: - - static void - mytype_dealloc(mytype *p) -@@ -981,14 +981,14 @@ mytype_dealloc(mytype *p) - ... declarations go here ... - - PyObject_GC_UnTrack(p); // must untrack first -- Py_TRASHCAN_SAFE_BEGIN(p) -+ Py_TRASHCAN_BEGIN(p, mytype_dealloc) - ... The body of the deallocator goes here, including all calls ... - ... to Py_DECREF on contained objects. ... -- Py_TRASHCAN_SAFE_END(p) -+ Py_TRASHCAN_END // there should be no code after this - } - - CAUTION: Never return from the middle of the body! If the body needs to --"get out early", put a label immediately before the Py_TRASHCAN_SAFE_END -+"get out early", put a label immediately before the Py_TRASHCAN_END - call, and goto it. Else the call-depth counter (see below) will stay - above 0 forever, and the trashcan will never get emptied. - -@@ -1004,6 +1004,12 @@ notices this, and calls another routine to deallocate all the objects that - may have been added to the list of deferred deallocations. In effect, a - chain of N deallocations is broken into N / PyTrash_UNWIND_LEVEL pieces, - with the call stack never exceeding a depth of PyTrash_UNWIND_LEVEL. -+ -+Since the tp_dealloc of a subclass typically calls the tp_dealloc of the base -+class, we need to ensure that the trashcan is only triggered on the tp_dealloc -+of the actual class being deallocated. Otherwise we might end up with a -+partially-deallocated object. To check this, the tp_dealloc function must be -+passed as second argument to Py_TRASHCAN_BEGIN(). - */ - - /* This is the old private API, invoked by the macros before 2.7.4. -@@ -1020,26 +1026,38 @@ PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void); - #define PyTrash_UNWIND_LEVEL 50 - - /* Note the workaround for when the thread state is NULL (issue #17703) */ --#define Py_TRASHCAN_SAFE_BEGIN(op) \ -+#define Py_TRASHCAN_BEGIN_CONDITION(op, cond) \ - do { \ -- PyThreadState *_tstate = PyThreadState_GET(); \ -- if (!_tstate || \ -- _tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \ -- if (_tstate) \ -- ++_tstate->trash_delete_nesting; -- /* The body of the deallocator is here. */ --#define Py_TRASHCAN_SAFE_END(op) \ -- if (_tstate) { \ -- --_tstate->trash_delete_nesting; \ -- if (_tstate->trash_delete_later \ -- && _tstate->trash_delete_nesting <= 0) \ -- _PyTrash_thread_destroy_chain(); \ -+ PyThreadState *_tstate = NULL; \ -+ /* If "cond" is false, then _tstate remains NULL and the deallocator \ -+ * is run normally without involving the trashcan */ \ -+ if (cond && (_tstate = PyThreadState_GET()) != NULL) { \ -+ if (_tstate->trash_delete_nesting >= PyTrash_UNWIND_LEVEL) { \ -+ /* Store the object (to be deallocated later) and jump past \ -+ * Py_TRASHCAN_END, skipping the body of the deallocator */ \ -+ _PyTrash_thread_deposit_object((PyObject*)op); \ -+ break; \ - } \ -+ ++_tstate->trash_delete_nesting; \ -+ } -+ /* The body of the deallocator is here. */ -+#define Py_TRASHCAN_END \ -+ if (_tstate) { \ -+ --_tstate->trash_delete_nesting; \ -+ if (_tstate->trash_delete_later && _tstate->trash_delete_nesting <= 0) \ -+ _PyTrash_thread_destroy_chain(); \ - } \ -- else \ -- _PyTrash_thread_deposit_object((PyObject*)op); \ - } while (0); - -+#define Py_TRASHCAN_BEGIN(op, dealloc) Py_TRASHCAN_BEGIN_CONDITION(op, \ -+ Py_TYPE(op)->tp_dealloc == (destructor)(dealloc)) -+ -+/* For backwards compatibility, these macros enable the trashcan -+ * unconditionally */ -+#define Py_TRASHCAN_SAFE_BEGIN(op) Py_TRASHCAN_BEGIN_CONDITION(op, 1) -+#define Py_TRASHCAN_SAFE_END(op) Py_TRASHCAN_END -+ -+ - #ifdef __cplusplus - } - #endif -diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py -index 5eb3f7d..7c63c55 100644 ---- a/Lib/test/test_capi.py -+++ b/Lib/test/test_capi.py -@@ -22,6 +22,41 @@ class CAPITest(unittest.TestCase): - def test_buildvalue_N(self): - _testcapi.test_buildvalue_N() - -+ def test_trashcan_subclass(self): -+ # bpo-35983: Check that the trashcan mechanism for "list" is NOT -+ # activated when its tp_dealloc is being called by a subclass -+ from _testcapi import MyList -+ L = None -+ for i in range(1000): -+ L = MyList((L,)) -+ -+ def test_trashcan_python_class(self): -+ # Check that the trashcan mechanism works properly for a Python -+ # subclass of a class using the trashcan (list in this test) -+ class PyList(list): -+ # Count the number of PyList instances to verify that there is -+ # no memory leak -+ num = 0 -+ def __init__(self, *args): -+ __class__.num += 1 -+ super().__init__(*args) -+ def __del__(self): -+ __class__.num -= 1 -+ -+ for parity in (0, 1): -+ L = None -+ # We need in the order of 2**20 iterations here such that a -+ # typical 8MB stack would overflow without the trashcan. -+ for i in range(2**20): -+ L = PyList((L,)) -+ L.attr = i -+ if parity: -+ # Add one additional nesting layer -+ L = (L,) -+ self.assertGreater(PyList.num, 0) -+ del L -+ self.assertEqual(PyList.num, 0) -+ - - @unittest.skipUnless(threading, 'Threading required for this test.') - class TestPendingCalls(unittest.TestCase): -diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-02-13-16-47-19.bpo-35983.bNxsXv.rst b/Misc/NEWS.d/next/Core and Builtins/2019-02-13-16-47-19.bpo-35983.bNxsXv.rst -new file mode 100644 -index 0000000..1138df6 ---- /dev/null -+++ b/Misc/NEWS.d/next/Core and Builtins/2019-02-13-16-47-19.bpo-35983.bNxsXv.rst -@@ -0,0 +1,3 @@ -+Added new trashcan macros to deal with a double deallocation that could occur -+when the `tp_dealloc` of a subclass calls the `tp_dealloc` of a base class -+and that base class uses the trashcan mechanism. Patch by Jeroen Demeyer. -diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c -index 67488e7..fb866fa 100644 ---- a/Modules/_testcapimodule.c -+++ b/Modules/_testcapimodule.c -@@ -2944,6 +2944,76 @@ static PyTypeObject test_structmembersType = { - }; - - -+/* Test bpo-35983: create a subclass of "list" which checks that instances -+ * are not deallocated twice */ -+ -+typedef struct { -+ PyListObject list; -+ int deallocated; -+} MyListObject; -+ -+static PyObject * -+MyList_new(PyTypeObject *type, PyObject *args, PyObject *kwds) -+{ -+ PyObject* op = PyList_Type.tp_new(type, args, kwds); -+ ((MyListObject*)op)->deallocated = 0; -+ return op; -+} -+ -+void -+MyList_dealloc(MyListObject* op) -+{ -+ if (op->deallocated) { -+ /* We cannot raise exceptions here but we still want the testsuite -+ * to fail when we hit this */ -+ Py_FatalError("MyList instance deallocated twice"); -+ } -+ op->deallocated = 1; -+ PyList_Type.tp_dealloc((PyObject *)op); -+} -+ -+static PyTypeObject MyList_Type = { -+ PyVarObject_HEAD_INIT(NULL, 0) -+ "MyList", -+ sizeof(MyListObject), -+ 0, -+ (destructor)MyList_dealloc, /* tp_dealloc */ -+ 0, /* tp_print */ -+ 0, /* tp_getattr */ -+ 0, /* tp_setattr */ -+ 0, /* tp_reserved */ -+ 0, /* tp_repr */ -+ 0, /* tp_as_number */ -+ 0, /* tp_as_sequence */ -+ 0, /* tp_as_mapping */ -+ 0, /* tp_hash */ -+ 0, /* tp_call */ -+ 0, /* tp_str */ -+ 0, /* tp_getattro */ -+ 0, /* tp_setattro */ -+ 0, /* tp_as_buffer */ -+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ -+ 0, /* tp_doc */ -+ 0, /* tp_traverse */ -+ 0, /* tp_clear */ -+ 0, /* tp_richcompare */ -+ 0, /* tp_weaklistoffset */ -+ 0, /* tp_iter */ -+ 0, /* tp_iternext */ -+ 0, /* tp_methods */ -+ 0, /* tp_members */ -+ 0, /* tp_getset */ -+ 0, /* &PyList_Type */ /* tp_base */ -+ 0, /* tp_dict */ -+ 0, /* tp_descr_get */ -+ 0, /* tp_descr_set */ -+ 0, /* tp_dictoffset */ -+ 0, /* tp_init */ -+ 0, /* tp_alloc */ -+ MyList_new, /* tp_new */ -+}; -+ -+ - PyMODINIT_FUNC - init_testcapi(void) - { -@@ -2961,6 +3031,12 @@ init_testcapi(void) - test_capi to automatically call this */ - PyModule_AddObject(m, "_test_structmembersType", (PyObject *)&test_structmembersType); - -+ MyList_Type.tp_base = &PyList_Type; -+ if (PyType_Ready(&MyList_Type) < 0) -+ return NULL; -+ Py_INCREF(&MyList_Type); -+ PyModule_AddObject(m, "MyList", (PyObject *)&MyList_Type); -+ - PyModule_AddObject(m, "CHAR_MAX", PyInt_FromLong(CHAR_MAX)); - PyModule_AddObject(m, "CHAR_MIN", PyInt_FromLong(CHAR_MIN)); - PyModule_AddObject(m, "UCHAR_MAX", PyInt_FromLong(UCHAR_MAX)); -diff --git a/Objects/descrobject.c b/Objects/descrobject.c -index 8d6e6e3..38f11e9 100644 ---- a/Objects/descrobject.c -+++ b/Objects/descrobject.c -@@ -940,11 +940,11 @@ static void - wrapper_dealloc(wrapperobject *wp) - { - PyObject_GC_UnTrack(wp); -- Py_TRASHCAN_SAFE_BEGIN(wp) -+ Py_TRASHCAN_BEGIN(wp, wrapper_dealloc) - Py_XDECREF(wp->descr); - Py_XDECREF(wp->self); - PyObject_GC_Del(wp); -- Py_TRASHCAN_SAFE_END(wp) -+ Py_TRASHCAN_END - } - - static int -diff --git a/Objects/dictobject.c b/Objects/dictobject.c -index c544ecd..fa2b4b7 100644 ---- a/Objects/dictobject.c -+++ b/Objects/dictobject.c -@@ -1078,7 +1078,7 @@ dict_dealloc(register PyDictObject *mp) - Py_ssize_t fill = mp->ma_fill; - /* bpo-31095: UnTrack is needed before calling any callbacks */ - PyObject_GC_UnTrack(mp); -- Py_TRASHCAN_SAFE_BEGIN(mp) -+ Py_TRASHCAN_BEGIN(mp, dict_dealloc) - for (ep = mp->ma_table; fill > 0; ep++) { - if (ep->me_key) { - --fill; -@@ -1092,7 +1092,7 @@ dict_dealloc(register PyDictObject *mp) - free_list[numfree++] = mp; - else - Py_TYPE(mp)->tp_free((PyObject *)mp); -- Py_TRASHCAN_SAFE_END(mp) -+ Py_TRASHCAN_END - } - - static int -diff --git a/Objects/listobject.c b/Objects/listobject.c -index 24eff76..dc57270 100644 ---- a/Objects/listobject.c -+++ b/Objects/listobject.c -@@ -298,7 +298,7 @@ list_dealloc(PyListObject *op) - { - Py_ssize_t i; - PyObject_GC_UnTrack(op); -- Py_TRASHCAN_SAFE_BEGIN(op) -+ Py_TRASHCAN_BEGIN(op, list_dealloc) - if (op->ob_item != NULL) { - /* Do it backwards, for Christian Tismer. - There's a simple test case where somehow this reduces -@@ -314,7 +314,7 @@ list_dealloc(PyListObject *op) - free_list[numfree++] = op; - else - Py_TYPE(op)->tp_free((PyObject *)op); -- Py_TRASHCAN_SAFE_END(op) -+ Py_TRASHCAN_END - } - - static int -diff --git a/Objects/setobject.c b/Objects/setobject.c -index 31da3db..3dbbcf3 100644 ---- a/Objects/setobject.c -+++ b/Objects/setobject.c -@@ -551,7 +551,7 @@ set_dealloc(PySetObject *so) - Py_ssize_t fill = so->fill; - /* bpo-31095: UnTrack is needed before calling any callbacks */ - PyObject_GC_UnTrack(so); -- Py_TRASHCAN_SAFE_BEGIN(so) -+ Py_TRASHCAN_BEGIN(so, set_dealloc) - if (so->weakreflist != NULL) - PyObject_ClearWeakRefs((PyObject *) so); - -@@ -567,7 +567,7 @@ set_dealloc(PySetObject *so) - free_list[numfree++] = so; - else - Py_TYPE(so)->tp_free(so); -- Py_TRASHCAN_SAFE_END(so) -+ Py_TRASHCAN_END - } - - static int -diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c -index 6f4b18c..ae82163 100644 ---- a/Objects/tupleobject.c -+++ b/Objects/tupleobject.c -@@ -215,7 +215,7 @@ tupledealloc(register PyTupleObject *op) - register Py_ssize_t i; - register Py_ssize_t len = Py_SIZE(op); - PyObject_GC_UnTrack(op); -- Py_TRASHCAN_SAFE_BEGIN(op) -+ Py_TRASHCAN_BEGIN(op, tupledealloc) - if (len > 0) { - i = len; - while (--i >= 0) -@@ -234,7 +234,7 @@ tupledealloc(register PyTupleObject *op) - } - Py_TYPE(op)->tp_free((PyObject *)op); - done: -- Py_TRASHCAN_SAFE_END(op) -+ Py_TRASHCAN_END - } - - static int -diff --git a/Objects/typeobject.c b/Objects/typeobject.c -index 844fb00..c8335ba 100644 ---- a/Objects/typeobject.c -+++ b/Objects/typeobject.c -@@ -922,7 +922,6 @@ subtype_dealloc(PyObject *self) - { - PyTypeObject *type, *base; - destructor basedealloc; -- PyThreadState *tstate = PyThreadState_GET(); - - /* Extract the type; we expect it to be a heap type */ - type = Py_TYPE(self); -@@ -971,16 +970,7 @@ subtype_dealloc(PyObject *self) - /* UnTrack and re-Track around the trashcan macro, alas */ - /* See explanation at end of function for full disclosure */ - PyObject_GC_UnTrack(self); -- ++_PyTrash_delete_nesting; -- ++ tstate->trash_delete_nesting; -- Py_TRASHCAN_SAFE_BEGIN(self); -- --_PyTrash_delete_nesting; -- -- tstate->trash_delete_nesting; -- /* DO NOT restore GC tracking at this point. weakref callbacks -- * (if any, and whether directly here or indirectly in something we -- * call) may trigger GC, and if self is tracked at that point, it -- * will look like trash to GC and GC will try to delete self again. -- */ -+ Py_TRASHCAN_BEGIN(self, subtype_dealloc); - - /* Find the nearest base with a different tp_dealloc */ - base = type; -@@ -1053,11 +1043,7 @@ subtype_dealloc(PyObject *self) - Py_DECREF(type); - - endlabel: -- ++_PyTrash_delete_nesting; -- ++ tstate->trash_delete_nesting; -- Py_TRASHCAN_SAFE_END(self); -- --_PyTrash_delete_nesting; -- -- tstate->trash_delete_nesting; -+ Py_TRASHCAN_END - - /* Explanation of the weirdness around the trashcan macros: - -@@ -1094,67 +1080,6 @@ subtype_dealloc(PyObject *self) - looks like trash to gc too, and gc also tries to delete self - then. But we're already deleting self. Double deallocation is - a subtle disaster. -- -- Q. Why the bizarre (net-zero) manipulation of -- _PyTrash_delete_nesting around the trashcan macros? -- -- A. Some base classes (e.g. list) also use the trashcan mechanism. -- The following scenario used to be possible: -- -- - suppose the trashcan level is one below the trashcan limit -- -- - subtype_dealloc() is called -- -- - the trashcan limit is not yet reached, so the trashcan level -- is incremented and the code between trashcan begin and end is -- executed -- -- - this destroys much of the object's contents, including its -- slots and __dict__ -- -- - basedealloc() is called; this is really list_dealloc(), or -- some other type which also uses the trashcan macros -- -- - the trashcan limit is now reached, so the object is put on the -- trashcan's to-be-deleted-later list -- -- - basedealloc() returns -- -- - subtype_dealloc() decrefs the object's type -- -- - subtype_dealloc() returns -- -- - later, the trashcan code starts deleting the objects from its -- to-be-deleted-later list -- -- - subtype_dealloc() is called *AGAIN* for the same object -- -- - at the very least (if the destroyed slots and __dict__ don't -- cause problems) the object's type gets decref'ed a second -- time, which is *BAD*!!! -- -- The remedy is to make sure that if the code between trashcan -- begin and end in subtype_dealloc() is called, the code between -- trashcan begin and end in basedealloc() will also be called. -- This is done by decrementing the level after passing into the -- trashcan block, and incrementing it just before leaving the -- block. -- -- But now it's possible that a chain of objects consisting solely -- of objects whose deallocator is subtype_dealloc() will defeat -- the trashcan mechanism completely: the decremented level means -- that the effective level never reaches the limit. Therefore, we -- *increment* the level *before* entering the trashcan block, and -- matchingly decrement it after leaving. This means the trashcan -- code will trigger a little early, but that's no big deal. -- -- Q. Are there any live examples of code in need of all this -- complexity? -- -- A. Yes. See SF bug 668433 for code that crashed (when Python was -- compiled in debug mode) before the trashcan level manipulations -- were added. For more discussion, see SF patches 581742, 575073 -- and bug 574207. - */ - } - -diff --git a/Python/traceback.c b/Python/traceback.c -index fd5309a..38327b6 100644 ---- a/Python/traceback.c -+++ b/Python/traceback.c -@@ -23,11 +23,11 @@ static void - tb_dealloc(PyTracebackObject *tb) - { - PyObject_GC_UnTrack(tb); -- Py_TRASHCAN_SAFE_BEGIN(tb) -+ Py_TRASHCAN_BEGIN(tb, tb_dealloc) - Py_XDECREF(tb->tb_next); - Py_XDECREF(tb->tb_frame); - PyObject_GC_Del(tb); -- Py_TRASHCAN_SAFE_END(tb) -+ Py_TRASHCAN_END - } - - static int diff --git a/build/pkgs/python2/patches/uuid-issue_11063.patch b/build/pkgs/python2/patches/uuid-issue_11063.patch deleted file mode 100644 index 731c4325cb8..00000000000 --- a/build/pkgs/python2/patches/uuid-issue_11063.patch +++ /dev/null @@ -1,154 +0,0 @@ -diff --git a/Lib/uuid.py b/Lib/uuid.py -index 7432032..0cbf9f1 100644 ---- a/Lib/uuid.py -+++ b/Lib/uuid.py -@@ -437,68 +437,86 @@ def _netbios_getnode(): - return ((bytes[0]<<40L) + (bytes[1]<<32L) + (bytes[2]<<24L) + - (bytes[3]<<16L) + (bytes[4]<<8L) + bytes[5]) - --# Thanks to Thomas Heller for ctypes and for his help with its use here. -+_ctypes_lib = None - --# If ctypes is available, use it to find system routines for UUID generation. --_uuid_generate_time = _UuidCreate = None --try: -- import ctypes, ctypes.util -- import sys -+def _uuid_generate(attr): -+ """Find system routines for UUID generation""" -+ -+ # Thanks to Thomas Heller for ctypes and for his help with its use here. -+ try: -+ import ctypes -+ import ctypes.util -+ -+ global _ctypes_lib -+ -+ uuid = None -+ # The uuid_generate_* routines are provided by libuuid on at least -+ # Linux and FreeBSD, and provided by libc on Mac OS X. -+ for libname in ['uuid', 'c']: -+ try: -+ if _ctypes_lib is None: -+ _ctypes_lib = ctypes.CDLL(ctypes.util.find_library(libname)) -+ lib = _ctypes_lib -+ except: -+ continue -+ if hasattr(lib, attr): -+ uuid = getattr(lib, attr) -+ break # found what we were looking for -+ -+ # The uuid_generate_* functions are broken on MacOS X 10.5, as noted -+ # in issue #8621 the function generates the same sequence of values -+ # in the parent process and all children created using fork (unless -+ # those children use exec as well). -+ # -+ # Assume that the uuid_generate functions are broken from 10.5 onward, -+ # the test can be adjusted when a later version is fixed. -+ import sys -+ if sys.platform == 'darwin': -+ import os -+ if int(os.uname()[2].split('.')[0]) >= 9: -+ uuid = None -+ return uuid -+ except: -+ pass - -- # The uuid_generate_* routines are provided by libuuid on at least -- # Linux and FreeBSD, and provided by libc on Mac OS X. -- _libnames = ['uuid'] -- if not sys.platform.startswith('win'): -- _libnames.append('c') -- for libname in _libnames: -+ -+def _uuid_create(): -+ """Get random UUID on Windows platform.""" -+ -+ try: -+ # On Windows prior to 2000, UuidCreate gives a UUID containing the -+ # hardware address. On Windows 2000 and later, UuidCreate makes a -+ # random UUID and UuidCreateSequential gives a UUID containing the -+ # hardware address. These routines are provided by the RPC runtime. -+ # NOTE: at least on Tim's WinXP Pro SP2 desktop box, while the last -+ # 6 bytes returned by UuidCreateSequential are fixed, they don't appear -+ # to bear any relationship to the MAC address of any network device -+ # on the box. - try: -- lib = ctypes.CDLL(ctypes.util.find_library(libname)) -+ import ctypes -+ lib = ctypes.windll.rpcrt4 - except: -- continue -- if hasattr(lib, 'uuid_generate_time'): -- _uuid_generate_time = lib.uuid_generate_time -- break -- del _libnames -- -- # The uuid_generate_* functions are broken on MacOS X 10.5, as noted -- # in issue #8621 the function generates the same sequence of values -- # in the parent process and all children created using fork (unless -- # those children use exec as well). -- # -- # Assume that the uuid_generate functions are broken from 10.5 onward, -- # the test can be adjusted when a later version is fixed. -- if sys.platform == 'darwin': -- import os -- if int(os.uname()[2].split('.')[0]) >= 9: -- _uuid_generate_time = None -- -- # On Windows prior to 2000, UuidCreate gives a UUID containing the -- # hardware address. On Windows 2000 and later, UuidCreate makes a -- # random UUID and UuidCreateSequential gives a UUID containing the -- # hardware address. These routines are provided by the RPC runtime. -- # NOTE: at least on Tim's WinXP Pro SP2 desktop box, while the last -- # 6 bytes returned by UuidCreateSequential are fixed, they don't appear -- # to bear any relationship to the MAC address of any network device -- # on the box. -- try: -- lib = ctypes.windll.rpcrt4 -+ lib = None -+ uuid = getattr(lib, 'UuidCreateSequential', -+ getattr(lib, 'UuidCreate', None)) -+ return uuid - except: -- lib = None -- _UuidCreate = getattr(lib, 'UuidCreateSequential', -- getattr(lib, 'UuidCreate', None)) --except: -- pass -+ pass - - def _unixdll_getnode(): - """Get the hardware address on Unix using ctypes.""" -+ import ctypes - _buffer = ctypes.create_string_buffer(16) -- _uuid_generate_time(_buffer) -+ uuid_generate_time = _uuid_generate("uuid_generate_time") -+ uuid_generate_time(_buffer) - return UUID(bytes=_buffer.raw).node - - def _windll_getnode(): - """Get the hardware address on Windows using ctypes.""" -+ import ctypes - _buffer = ctypes.create_string_buffer(16) -- if _UuidCreate(_buffer) == 0: -+ UuidCreate = _uuid_create() -+ if UuidCreate(_buffer) == 0: - return UUID(bytes=_buffer.raw).node - - def _random_getnode(): -@@ -546,9 +564,12 @@ def uuid1(node=None, clock_seq=None): - - # When the system provides a version-1 UUID generator, use it (but don't - # use UuidCreate here because its UUIDs don't conform to RFC 4122). -- if _uuid_generate_time and node is clock_seq is None: -+ uuid_generate_time = _uuid_generate("uuid_generate_time") -+ -+ if uuid_generate_time and node is clock_seq is None: -+ import ctypes - _buffer = ctypes.create_string_buffer(16) -- _uuid_generate_time(_buffer) -+ uuid_generate_time(_buffer) - return UUID(bytes=_buffer.raw) - - global _last_timestamp diff --git a/build/pkgs/python2/spkg-build.in b/build/pkgs/python2/spkg-build.in deleted file mode 120000 index ab563dea917..00000000000 --- a/build/pkgs/python2/spkg-build.in +++ /dev/null @@ -1 +0,0 @@ -../python3/spkg-build.in \ No newline at end of file diff --git a/build/pkgs/python2/spkg-check.in b/build/pkgs/python2/spkg-check.in deleted file mode 120000 index 68c37d2fdc8..00000000000 --- a/build/pkgs/python2/spkg-check.in +++ /dev/null @@ -1 +0,0 @@ -../python3/spkg-check.in \ No newline at end of file diff --git a/build/pkgs/python2/spkg-install.in b/build/pkgs/python2/spkg-install.in deleted file mode 120000 index 98b9bc31360..00000000000 --- a/build/pkgs/python2/spkg-install.in +++ /dev/null @@ -1 +0,0 @@ -../python3/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/python2/type b/build/pkgs/python2/type deleted file mode 100644 index 134d9bc32d5..00000000000 --- a/build/pkgs/python2/type +++ /dev/null @@ -1 +0,0 @@ -optional From f712bb5507287ed4933875413b729b0ae0cfe8fd Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 9 May 2020 12:17:15 -0700 Subject: [PATCH 114/301] configure.ac: Remove option --with-python=2 --- configure.ac | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 64a29d5728b..3ac40767733 100644 --- a/configure.ac +++ b/configure.ac @@ -402,17 +402,14 @@ SAGE_CHECK_OSX_SUPPORTED() # Python version AC_MSG_CHECKING([Python version to install]) AC_ARG_WITH([python], -[AS_HELP_STRING([--with-python=2], - [build and use Python 2])] [AS_HELP_STRING([--with-python=3], [build and use Python 3 (default)])]) case "$with_python" in - 2*) SAGE_PYTHON_VERSION=2;; 3*) SAGE_PYTHON_VERSION=3;; "") SAGE_PYTHON_VERSION=3;; *) - AC_MSG_ERROR([allowed values for --with-python are 2 and 3]);; + AC_MSG_ERROR([the only allowed value for --with-python is 3. Support for Python 2 has been removed in Sage 9.2.]);; esac AC_MSG_RESULT([$SAGE_PYTHON_VERSION]) From 96a5e762dc6f229e2280b9e6bf5be5cb1b8a137b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 9 May 2020 12:21:43 -0700 Subject: [PATCH 115/301] Remove python2 from tox and GitHub CI scripts --- .../workflows/ci-cygwin-standard-python2.yml | 950 ------------------ .github/workflows/tox-optional.yml | 2 +- .github/workflows/tox.yml | 6 +- tox.ini | 5 +- 4 files changed, 6 insertions(+), 957 deletions(-) delete mode 100644 .github/workflows/ci-cygwin-standard-python2.yml diff --git a/.github/workflows/ci-cygwin-standard-python2.yml b/.github/workflows/ci-cygwin-standard-python2.yml deleted file mode 100644 index a4460b6e11f..00000000000 --- a/.github/workflows/ci-cygwin-standard-python2.yml +++ /dev/null @@ -1,950 +0,0 @@ -name: CI cygwin-standard-python2 - -on: - pull_request: - types: [opened, synchronize] - push: - tags: - - '*' - -env: - MAKE: make -j8 - SAGE_NUM_THREADS: 3 - SAGE_CHECK: warn - SAGE_CHECK_PACKAGES: "!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl" - CYGWIN: winsymlinks:native - CONFIGURE_ARGS: --enable-experimental-packages --enable-download-from-upstream-url - SAGE_FAT_BINARY: yes - -jobs: - -############################################## stage-i ########################################## - - cygwin-stage-i-a: - env: - STAGE: i-a - # builds openblas - TARGETS: iml gsl - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' - if: always() - - uses: actions/upload-artifact@v2 - # upload-artifact@v2 does not support whitespace in file names. - # so we tar up the directory ourselves - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-i-b: - env: - STAGE: i-b - TARGETS: cython setuptools_scm kiwisolver dateutil cycler pyparsing nose certifi singledispatch pkgconfig pplpy - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' - if: always() - - uses: actions/upload-artifact@v2 - # upload-artifact@v2 does not support whitespace in file names. - # so we tar up the directory ourselves - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - -############################################## stage-ii ########################################## - - cygwin-stage-ii-a: - env: - STAGE: ii-a - PREVIOUS_STAGES: i-* - TARGETS: cvxopt rpy2 networkx - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-i-a, cygwin-stage-i-b] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' - if: always() - - uses: actions/upload-artifact@v2 - # upload-artifact@v2 does not support whitespace in file names. - # so we tar up the directory ourselves - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-ii-b: - env: - STAGE: ii-b - PREVIOUS_STAGES: i-* - TARGETS: singular maxima gap pari gfan palp flintqs ratpoints arb ecm givaro - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-i-a, cygwin-stage-i-b] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-ii-c: - env: - STAGE: ii-c - PREVIOUS_STAGES: i-* - TARGETS: cypari eclib fplll linbox giac - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-i-a, cygwin-stage-i-b] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-ii-d: - env: - STAGE: ii-d - PREVIOUS_STAGES: i-* - TARGETS: ipython ipywidgets notebook thebe - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-i-a, cygwin-stage-i-b] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-ii-e: - env: - STAGE: ii-e - PREVIOUS_STAGES: i-* - TARGETS: threejs tachyon pillow jmol m4rie sage_brial sympy lrcalc lcalc symmetrica cliquer libbraiding planarity rw elliptic_curves combinatorial_designs zn_poly sympow - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-i-a, cygwin-stage-i-b] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 base-toolchain && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - -############################################## stage-iii ########################################## - - cygwin-stage-iii: - env: - STAGE: iii - PREVIOUS_STAGES: ii-* - TARGETS: build - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-ii-a, cygwin-stage-ii-b, cygwin-stage-ii-c, cygwin-stage-ii-d, cygwin-stage-ii-e] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - -############################################## stage-iv ########################################## - - cygwin-stage-iv-a: - env: - STAGE: iv-a - PREVIOUS_STAGES: iii - TARGETS: ptest - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-iii] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-iv-b: - env: - STAGE: iv-b - PREVIOUS_STAGES: iii - TARGETS: 4ti2 pynormaliz topcom lrslib latte_int cryptominisat - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-iii] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-iv-c: - env: - STAGE: iv-c - PREVIOUS_STAGES: iii - TARGETS: sage_numerical_backends_coin - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-iii] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-${{ env.PREVIOUS_STAGES }}.tar' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() - - cygwin-stage-iv-d: - env: - STAGE: iv-d - PREVIOUS_STAGES: iii - TARGETS: qepcad barvinok isl qhull primecount plantri kenzo libsemigroups mcqd meataxe mpfrcx openssl p_group_cohomology rst2ipynb sirocco tdlib tides - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-cygwin-${{ matrix.pkgs }} - - needs: [cygwin-stage-iii] - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - pkgs: [standard-python2] - steps: - - run: | - git config --global core.autocrlf false - git config --global core.symlinks true - - uses: actions/checkout@v1 - - name: install cygwin and minimal prerequisites with choco - shell: bash {0} - run: | - choco --version - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/cygwin.txt ./build/pkgs/cygwin-bootstrap.txt) - choco install $PACKAGES --source cygwin - - name: bootstrap - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && env && ./bootstrap' - - name: install additional cygwin packages with choco - if: contains(matrix.pkgs, 'standard') - shell: bash {0} - run: | - PACKAGES=$(sed 's/#.*//;' ./build/pkgs/*/distros/cygwin.txt) - choco install $PACKAGES --source cygwin - - uses: actions/download-artifact@v2 - with: - name: ${{ env.LOCAL_ARTIFACT_NAME }} - path: C:\\tools\\cygwin\\tmp - - name: Extract sage-local artifact - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh' - - name: configure - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure $CONFIGURE_ARGS' - - name: make - run: | - C:\\tools\\cygwin\\bin\\bash -l -x -c 'export PATH=/usr/local/bin:/usr/bin && cd $(cygpath -u "$GITHUB_WORKSPACE") && make -k -w V=0 $TARGETS' - - name: Prepare logs artifact - shell: bash - run: | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in local/var/tmp/sage/build/*; do if [ -d $a ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/$(basename $a).tar" $a; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME" - if: always() - - uses: actions/upload-artifact@v2 - with: - path: artifacts - name: ${{ env.LOGS_ARTIFACT_NAME }} - if: always() - - name: Print out logs for immediate inspection - # The markup in the output is a GitHub Actions logging command - # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions - shell: bash - run: | - find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \; - if: always() - - name: Prepare sage-local artifact - # We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows. - # We remove the local/lib64 link, which will be recreated by the next stage. - run: | - C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f local/lib64; tar -cf /tmp/sage-local-${{ env.STAGE }}.tar --remove-files local' - if: always() - - uses: actions/upload-artifact@v2 - with: - path: C:\\tools\\cygwin\\tmp\\sage-local-${{ env.STAGE }}.tar - name: ${{ env.LOCAL_ARTIFACT_NAME }} - if: always() diff --git a/.github/workflows/tox-optional.yml b/.github/workflows/tox-optional.yml index 742ea890b47..445840229ef 100644 --- a/.github/workflows/tox-optional.yml +++ b/.github/workflows/tox-optional.yml @@ -102,7 +102,7 @@ jobs: fail-fast: false max-parallel: 3 matrix: - tox_system_factor: [homebrew-macos-python2, homebrew-macos, homebrew-macos-python3_xcode, homebrew-macos-python3_xcode-nokegonly, homebrew-macos-python3_pythonorg, conda-forge-macos] + tox_system_factor: [homebrew-macos, homebrew-macos-python3_xcode, homebrew-macos-python3_xcode-nokegonly, homebrew-macos-python3_pythonorg, conda-forge-macos] tox_packages_factor: [maximal] env: TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 12e357dac53..67ad95c4c93 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -37,7 +37,7 @@ jobs: max-parallel: 20 matrix: tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-eoan, ubuntu-focal, debian-jessie, debian-stretch, debian-buster, debian-bullseye, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, centos-7, centos-8, archlinux-latest, slackware-14.2, conda-forge, ubuntu-bionic-i386, ubuntu-eoan-i386, debian-buster-i386, centos-7-i386] - tox_packages_factor: [minimal, standard, standard-python2] + tox_packages_factor: [minimal, standard] env: TOX_ENV: docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} @@ -102,7 +102,7 @@ jobs: fail-fast: false max-parallel: 4 matrix: - tox_system_factor: [homebrew-macos-python2, homebrew-macos, homebrew-macos-python3_xcode, homebrew-macos-python3_xcode-nokegonly, homebrew-macos-python3_pythonorg, homebrew-macos-python3_xcode-gcc_spkg, conda-forge-macos] + tox_system_factor: [homebrew-macos, homebrew-macos-python3_xcode, homebrew-macos-python3_xcode-nokegonly, homebrew-macos-python3_pythonorg, homebrew-macos-python3_xcode-gcc_spkg, conda-forge-macos] tox_packages_factor: [minimal, standard] env: TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} @@ -147,7 +147,7 @@ jobs: max-parallel: 1 matrix: tox_system_factor: [conda-forge-ubuntu] - tox_packages_factor: [minimal, standard, standard-python2] + tox_packages_factor: [minimal, standard] env: TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} diff --git a/tox.ini b/tox.ini index b260e8193da..dca633fb504 100644 --- a/tox.ini +++ b/tox.ini @@ -83,7 +83,7 @@ envlist = -{### ### Configuration factors: ### - python2 # configure Sage to use Python 2 instead of the default (Python 3) + python3_spkg } skipsdist = true @@ -279,7 +279,6 @@ setenv = # # - python # - python2: CONFIG_CONFIGURE_ARGS_1=--with-python=2 python3: CONFIG_CONFIGURE_ARGS_1= python3_spkg: CONFIG_CONFIGURE_ARGS_1=--without-system-python3 macos-python3_xcode: CONFIG_CONFIGURE_ARGS_1=--with-python=3 PYTHON3=/usr/bin/python3 @@ -368,7 +367,7 @@ commands = docker: done' # pathpy checksuite needs tox. #28728: gap fails its test suite. # linbox/cysignals testsuites fail. ppl takes very long. - local: bash -c 'export PATH={env:PATH} && {env:SETENV} && {env:BOOTSTRAP:./bootstrap} && ./configure --prefix={envdir}/local {env:CONFIGURE_ARGS} && make -k V=0 base-toolchain && make -k V=0 SAGE_SPKG="sage-spkg -y -o" SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl,!cmake" {env:TARGETS_PRE:} {posargs:build} && (make -k V=0 SAGE_SPKG="sage-spkg -y -o" SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl,!cmake" {env:TARGETS_OPTIONAL:} || echo "(error ignored)" ) ' + local: bash -c 'export PATH={env:PATH} && {env:SETENV} && {env:BOOTSTRAP:./bootstrap} && ./configure --prefix={envdir}/local {env:CONFIGURE_ARGS} && make -k V=0 base-toolchain && make -k V=0 SAGE_SPKG="sage-spkg -y -o" SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl,!cmake" {env:TARGETS_PRE:} {posargs:build} && (make -k V=0 SAGE_SPKG="sage-spkg -y -o" SAGE_CHECK=warn SAGE_CHECK_PACKAGES="!cython,!r,!python3,!nose,!pathpy,!gap,!cysignals,!linbox,!git,!ppl,!cmake" {env:TARGETS_OPTIONAL:} || echo "(error ignored)" ) ' [testenv:check_configure] ## Test that configure behaves properly From ea7df3e0b9059f2b22b2dc04ec0d913bc8945195 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 9 May 2020 13:40:09 -0700 Subject: [PATCH 116/301] configure.ac: Remove message 'Checking for Python version to install...' --- configure.ac | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure.ac b/configure.ac index 3ac40767733..0af7d785af5 100644 --- a/configure.ac +++ b/configure.ac @@ -400,7 +400,6 @@ SAGE_CHECK_OSX_SUPPORTED() ############################################################################### # Python version -AC_MSG_CHECKING([Python version to install]) AC_ARG_WITH([python], [AS_HELP_STRING([--with-python=3], [build and use Python 3 (default)])]) @@ -411,8 +410,6 @@ case "$with_python" in *) AC_MSG_ERROR([the only allowed value for --with-python is 3. Support for Python 2 has been removed in Sage 9.2.]);; esac - -AC_MSG_RESULT([$SAGE_PYTHON_VERSION]) AC_SUBST(SAGE_PYTHON_VERSION) # $(TOOLCHAIN) variable containing prerequisites for the build From ff4181753269bd64d4b27da0a13936c88d041aaf Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 9 May 2020 13:40:41 -0700 Subject: [PATCH 117/301] configure.ac: Warn on 'configure --with-python=3.x' --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0af7d785af5..ec459e01c0a 100644 --- a/configure.ac +++ b/configure.ac @@ -405,7 +405,9 @@ AC_ARG_WITH([python], [build and use Python 3 (default)])]) case "$with_python" in - 3*) SAGE_PYTHON_VERSION=3;; + 3) SAGE_PYTHON_VERSION=3;; + 3*) AC_MSG_WARN([the only allowed value for --with-python is 3; specific Python 3.x versions cannot be requested using --with-python. For compatibility reasons, this is only a warning. Use './configure PYTHON3=/path/to/python3' to use a specific Python 3 binary for the Sage venv.]) + SAGE_PYTHON_VERSION=3;; "") SAGE_PYTHON_VERSION=3;; *) AC_MSG_ERROR([the only allowed value for --with-python is 3. Support for Python 2 has been removed in Sage 9.2.]);; From db6e482dd08a2dc21024bc94d0cc4ef45e48685d Mon Sep 17 00:00:00 2001 From: Dave Witte Morris Date: Sat, 9 May 2020 21:29:57 -0600 Subject: [PATCH 118/301] doctest for #19010 --- src/sage/groups/libgap_wrapper.pyx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx index d4ad92b6be4..33a50836d04 100644 --- a/src/sage/groups/libgap_wrapper.pyx +++ b/src/sage/groups/libgap_wrapper.pyx @@ -253,6 +253,14 @@ class ParentLibGAP(SageObject): sage: G.subgroup(subgroup_gens) Subgroup with 8 generators of Matrix group over Rational Field with 48 generators + TESTS: + + Check that :trac:`19010` is fixed:: + + sage: G = WeylGroup(['B',3]) + sage: H = G.subgroup([G[14], G[17]]) + sage: all([(g*h in G) and (h*g in G) for g in G for h in H]) + True """ generators = [ g if isinstance(g, GapElement) else self(g).gap() for g in generators ] From 83ddfcd14314b04858618f7cfa2c39208a0f80ef Mon Sep 17 00:00:00 2001 From: Dave Witte Morris Date: Sun, 10 May 2020 02:07:12 -0600 Subject: [PATCH 119/301] reviewer correction --- src/sage/groups/libgap_wrapper.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx index 33a50836d04..d06bebe881b 100644 --- a/src/sage/groups/libgap_wrapper.pyx +++ b/src/sage/groups/libgap_wrapper.pyx @@ -259,7 +259,7 @@ class ParentLibGAP(SageObject): sage: G = WeylGroup(['B',3]) sage: H = G.subgroup([G[14], G[17]]) - sage: all([(g*h in G) and (h*g in G) for g in G for h in H]) + sage: all(g*h in G and h*g in G for g in G for h in H) True """ generators = [ g if isinstance(g, GapElement) else self(g).gap() From edc386cbd523b8f49b1490ada7514af54fe3e9b6 Mon Sep 17 00:00:00 2001 From: Simon Brandhorst Date: Sun, 10 May 2020 12:12:46 +0200 Subject: [PATCH 120/301] remove a blank line --- src/sage/quadratic_forms/genera/genus.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sage/quadratic_forms/genera/genus.py b/src/sage/quadratic_forms/genera/genus.py index 849d50d8dc6..685ac3ceab2 100644 --- a/src/sage/quadratic_forms/genera/genus.py +++ b/src/sage/quadratic_forms/genera/genus.py @@ -2115,7 +2115,6 @@ def direct_sum(self, other): r""" Return the local genus of the direct sum of two representatives. - EXAMPLES:: sage: from sage.quadratic_forms.genera.genus import p_adic_symbol @@ -2146,7 +2145,7 @@ def direct_sum(self, other): sym2 = dict([[s[0], s] for s in sym2]) symbol = [] - for k in range(m+1): + for k in range(m + 1): if self.prime() == 2: b = [k, 0, 1, 0, 0] else: From 8d2c07004fe257328c1a43bc9c6860aa41b6f659 Mon Sep 17 00:00:00 2001 From: John Cremona Date: Sun, 10 May 2020 17:41:05 +0100 Subject: [PATCH 121/301] #29666: fix precision of elliptic curve point height computation --- src/sage/schemes/elliptic_curves/ell_point.py | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/ell_point.py b/src/sage/schemes/elliptic_curves/ell_point.py index fdd20ab16fd..69a519af208 100644 --- a/src/sage/schemes/elliptic_curves/ell_point.py +++ b/src/sage/schemes/elliptic_curves/ell_point.py @@ -2784,30 +2784,36 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): return h from sage.rings.number_field.number_field import refine_embedding + from sage.all import RealField, ComplexField, Infinity prec_v = v.codomain().prec() if prec is None: prec = prec_v if K is rings.QQ: - vv = K.embeddings(rings.RealField(max(2*prec, prec_v)))[0] - else: - vv = refine_embedding(v, 2*prec) # vv.prec() = max(2*prec, prec_v) + v = K.embeddings(RealField())[0] + v_inf = refine_embedding(v, Infinity) + + v_is_real = v_inf(K.gen()).imag().is_zero() + working_prec = prec+100 + RC = RealField(working_prec) if v_is_real else ComplexField(working_prec) - absdisc = vv(E.discriminant()).abs() - while absdisc==0: - vv = refine_embedding(vv) - # print("doubling precision") - absdisc = vv(E.discriminant()).abs() - temp = 0 if absdisc>=1 else absdisc.log()/3 + # NB We risk losing much precision if we compute the embedding + # of K into RR or CC to some precision and then apply that to + # elements of K. Instead we map elements of K into AA or Qbar + # (with infinite precision) and then trim back to RR or CC. - b2, b4, b6, b8 = [vv(b) for b in E.b_invariants()] - H = max(vv(4), abs(b2), 2*abs(b4), 2*abs(b6), abs(b8)) + x = RC(v_inf(self[0])) + b2, b4, b6, b8 = [RC(v_inf(b)) for b in E.b_invariants()] # The following comes from Silverman Theorem 4.2. Silverman # uses decimal precision d, so his term (5/3)d = # (5/3)*(log(2)/log(10))*prec = 0.5017*prec, which we round # up. The rest of the expression was wrongly transcribed in # Sage versions <5.6 (see #12509). - nterms = int(math.ceil(0.51*prec + 0.5 + 0.75 * (7 + 4*H.log()/3 - temp).log())) + + H = max(RC(4).abs(), b2.abs(), 2*b4.abs(), 2*b6.abs(), b8.abs()) + absdisc = RC(v_inf(E.discriminant())).abs() + adl3 = 0 if absdisc>=1 else absdisc.log()/3 + nterms = int(math.ceil(0.51*working_prec + 0.5 + 0.75 * (7 + 4*H.log()/3 - adl3).log())) b2p = b2 - 12 b4p = b4 - b2 + 6 @@ -2819,7 +2825,6 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): fw = lambda T: T*(4 + T*(b2 + T*(2*b4 + T*b6))) fwp = lambda T: T*(4 + T*(b2p + T*(2*b4p + T*b6p))) - x = vv(self[0]) if abs(x) >= .5: t = 1/x beta = True @@ -2834,7 +2839,7 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): if beta: w = fw(t) z = fz(t) - if abs(w) <= 2 * abs(z): + if abs(w) <= 2 * z.abs(): mu += four_to_n * z.abs().log() t = w/z else: @@ -2844,7 +2849,7 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): else: w = fwp(t) z = fzp(t) - if abs(w) <= 2 * abs(z): + if abs(w) <= 2 * z.abs(): mu += four_to_n * z.abs().log() t = w/z else: @@ -2852,8 +2857,9 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): t = w/(z-w) beta = not beta four_to_n >>= 2 - h = rings.RealField(prec)(lam + mu/4) - if weighted and not v.im_gens()[0] in rings.RR: + + h = RealField(prec)(lam + mu/4) + if weighted and not v_is_real: h *= 2 return h From a5c17a86af01597655d6a99d0f2b68793048253d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 29 Mar 2020 20:34:28 -0400 Subject: [PATCH 122/301] build/pkgs/cython: Update to 0.29.16 --- build/pkgs/cython/checksums.ini | 7 ++++--- build/pkgs/cython/package-version.txt | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build/pkgs/cython/checksums.ini b/build/pkgs/cython/checksums.ini index 7e9b0490f41..6e5583857fd 100644 --- a/build/pkgs/cython/checksums.ini +++ b/build/pkgs/cython/checksums.ini @@ -1,4 +1,5 @@ tarball=Cython-VERSION.tar.gz -sha1=1c0c6cb9ebb875e8769863e1720683b24a755a7c -md5=f212574687a52706ff53738a64f91398 -cksum=1612385007 +sha1=5a557bd74d5781c4252675a2805ef2742e88b0cb +md5=a899abaa48b68bb679aef45ceb4b89d3 +cksum=2101179202 +upstream_url=https://files.pythonhosted.org/packages/49/8a/6a4135469372da2e3d9f88f71c6d00d8a07ef65f121eeca0c7ae21697219/Cython-0.29.16.tar.gz diff --git a/build/pkgs/cython/package-version.txt b/build/pkgs/cython/package-version.txt index fe14ade44a2..a711eb84906 100644 --- a/build/pkgs/cython/package-version.txt +++ b/build/pkgs/cython/package-version.txt @@ -1 +1 @@ -0.29.12.p0 +0.29.16 From c7cc999e75ebcb3cff0c976cdf8010c8831589f3 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 29 Mar 2020 21:58:33 -0400 Subject: [PATCH 123/301] build/pkgs/cython/checksums.ini: Use predictable URL for upstream_url pattern --- build/pkgs/cython/checksums.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/cython/checksums.ini b/build/pkgs/cython/checksums.ini index 6e5583857fd..3eb2ff218e6 100644 --- a/build/pkgs/cython/checksums.ini +++ b/build/pkgs/cython/checksums.ini @@ -2,4 +2,4 @@ tarball=Cython-VERSION.tar.gz sha1=5a557bd74d5781c4252675a2805ef2742e88b0cb md5=a899abaa48b68bb679aef45ceb4b89d3 cksum=2101179202 -upstream_url=https://files.pythonhosted.org/packages/49/8a/6a4135469372da2e3d9f88f71c6d00d8a07ef65f121eeca0c7ae21697219/Cython-0.29.16.tar.gz +upstream_url=https://pypi.io/packages/source/C/Cython/Cython-VERSION.tar.gz From d54b715814ca3dfb8f5c6421f3a101e30bf14945 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 10 May 2020 13:02:37 -0700 Subject: [PATCH 124/301] Update Cython to 0.29.17 --- build/pkgs/cython/checksums.ini | 6 +++--- build/pkgs/cython/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/cython/checksums.ini b/build/pkgs/cython/checksums.ini index 3eb2ff218e6..93cd5fb718a 100644 --- a/build/pkgs/cython/checksums.ini +++ b/build/pkgs/cython/checksums.ini @@ -1,5 +1,5 @@ tarball=Cython-VERSION.tar.gz -sha1=5a557bd74d5781c4252675a2805ef2742e88b0cb -md5=a899abaa48b68bb679aef45ceb4b89d3 -cksum=2101179202 +sha1=02278e5a972ffc4856451f507903db68d08cfd6e +md5=0936311ccd09f1164ab2f46ca5cd8c3b +cksum=1144843552 upstream_url=https://pypi.io/packages/source/C/Cython/Cython-VERSION.tar.gz diff --git a/build/pkgs/cython/package-version.txt b/build/pkgs/cython/package-version.txt index a711eb84906..9fe45285805 100644 --- a/build/pkgs/cython/package-version.txt +++ b/build/pkgs/cython/package-version.txt @@ -1 +1 @@ -0.29.16 +0.29.17 From f5caca8f5ca473385300b5d8007f48e7fc88f8fe Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Fri, 24 Apr 2020 11:16:28 +0200 Subject: [PATCH 125/301] migrate neighborly to combinatorial polyhedron --- src/sage/geometry/polyhedron/base.py | 18 +--- .../combinatorial_polyhedron/base.pyx | 101 ++++++++++++++++++ 2 files changed, 105 insertions(+), 14 deletions(-) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 01989bbd80e..40a86080809 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -32,7 +32,7 @@ from sage.modules.free_module_element import vector from sage.modules.vector_space_morphism import linear_transformation from sage.matrix.constructor import matrix -from sage.functions.other import sqrt, floor, ceil, binomial +from sage.functions.other import sqrt, floor, ceil from sage.groups.matrix_gps.finitely_generated import MatrixGroup from sage.graphs.graph import Graph @@ -7675,23 +7675,16 @@ def neighborliness(self): [6, 2, 2, 2] """ - if self.is_simplex(): - return self.dim() + 1 - else: - k = 1 - while len(self.faces(k)) == binomial(self.n_vertices(), k + 1): - k += 1 - return k + return self.combinatorial_polyhedron().neighborliness() def is_neighborly(self, k=None): r""" Return whether the polyhedron is neighborly. - If the input ``k`` is provided then return whether the polyhedron is ``k``-neighborly + If the input ``k`` is provided, then return whether the polyhedron is ``k``-neighborly See :wikipedia:`Neighborly_polytope` - INPUT: - ``k`` -- the dimension up to which to check if every set of ``k`` @@ -7730,10 +7723,7 @@ def is_neighborly(self, k=None): [True, True, True] """ - if k is None: - k = self.dim() // 2 - return all(len(self.faces(i)) == binomial(self.n_vertices(), i + 1) - for i in range(1, k)) + return self.combinatorial_polyhedron().is_neighborly() @cached_method def is_lattice_polytope(self): diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx index d7d27efc5f0..95a7fa2ee59 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx @@ -728,6 +728,7 @@ cdef class CombinatorialPolyhedron(SageObject): dim = dimension + @cached_method def n_vertices(self): r""" Return the number of vertices. @@ -1483,6 +1484,7 @@ cdef class CombinatorialPolyhedron(SageObject): edges = tuple((Vrep[j], facet_names[n_facets - 1 - i]) for i,facet in enumerate(facet_iter) for j in facet.ambient_V_indices()) return DiGraph([vertices, edges], format='vertices_and_edges', immutable=True) + @cached_method def f_vector(self): r""" Compute the ``f_vector`` of the polyhedron. @@ -1663,6 +1665,105 @@ cdef class CombinatorialPolyhedron(SageObject): return flag + @cached_method + def neighborliness(self): + r""" + Returns the largest ``k``, such that the polyhedron is ``k``-neighborly. + + In case of the ``d``-dimensional simplex, it returns ``d + 1``. + + See :wikipedia:`Neighborly_polytope` + + .. SEEALSO:: + + :meth:`is_neighborly` + + EXAMPLES:: + + sage: P = polytopes.cyclic_polytope(8,12) + sage: C = P.combinatorial_polyhedron() + sage: C.neighborliness() + 4 + sage: P = polytopes.simplex(6) + sage: C = P.combinatorial_polyhedron() + sage: C.neighborliness() + 7 + sage: P = polytopes.cyclic_polytope(4,10) + sage: P = P.join(P) + sage: C = P.combinatorial_polyhedron() + sage: C.neighborliness() + 2 + """ + if self.is_simplex(): + return self.dim() + 1 + else: + from sage.functions.other import binomial + k = 1 + while self.f_vector()[k+1] == binomial(self.n_vertices(), k + 1): + k += 1 + return k + + @cached_method + def is_neighborly(self, k=None): + r""" + Return whether the polyhedron is neighborly. + + If the input ``k`` is provided, then return whether the polyhedron is ``k``-neighborly + + See :wikipedia:`Neighborly_polytope` + + INPUT: + + - ``k`` -- the dimension up to which to check if every set of ``k`` + vertices forms a face. If no ``k`` is provided, check up to floor + of half the dimension of the polyhedron. + + OUTPUT: + + - ``True`` if the every set of up to ``k`` vertices forms a face, + - ``False`` otherwise + + .. SEEALSO:: + + :meth:`neighborliness` + + EXAMPLES:: + + sage: P = polytopes.cyclic_polytope(8,12) + sage: C = P.combinatorial_polyhedron() + sage: C.is_neighborly() + True + sage: P = polytopes.simplex(6) + sage: C = P.combinatorial_polyhedron() + sage: C.is_neighborly() + True + sage: P = polytopes.cyclic_polytope(4,10) + sage: P = P.join(P) + sage: C = P.combinatorial_polyhedron() + sage: C.is_neighborly() + False + sage: C.is_neighborly(k=2) + True + """ + from sage.functions.other import binomial + if k is None: + k = self.dim() // 2 + return all(self.f_vector()[i+1] == binomial(self.n_vertices(), i + 1) + for i in range(1, k)) + + def is_simplex(self): + r""" + Return whether the polyhedron is a simplex. + + EXAMPLES:: + + sage: CombinatorialPolyhedron(2).is_simplex() + False + sage: CombinatorialPolyhedron([[0,1],[0,2],[1,2]]).is_simplex() + True + """ + return self.is_bounded() and (self.dim()+1 == self.n_vertices()) + def is_simplicial(self): r""" Test whether the polytope is simplicial. From 80ce9f989a8ef6c0d690704544fddfbcf3e711b3 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Fri, 24 Apr 2020 17:12:37 +0200 Subject: [PATCH 126/301] improvements in the documentation --- src/sage/geometry/polyhedron/base.py | 14 ++++++++++---- .../polyhedron/combinatorial_polyhedron/base.pyx | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 40a86080809..30d30b1f3ba 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -7623,6 +7623,9 @@ def is_simplex(self): r""" Return whether the polyhedron is a simplex. + A simplex is a bounded polyhedron with `d+1` vertices, where + `d` is the dimension. + EXAMPLES:: sage: Polyhedron([(0,0,0), (1,0,0), (0,1,0)]).is_simplex() @@ -7638,9 +7641,10 @@ def neighborliness(self): r""" Returns the largest ``k``, such that the polyhedron is ``k``-neighborly. - In case of the ``d``-dimensional simplex, it returns ``d + 1``. + A polyhedron is `k`-neighborly if every set of `n` vertices forms a face + for `n` up to `k`. - See :wikipedia:`Neighborly_polytope` + In case of the `d`-dimensional simplex, it returns `d + 1`. .. SEEALSO:: @@ -7683,7 +7687,9 @@ def is_neighborly(self, k=None): If the input ``k`` is provided, then return whether the polyhedron is ``k``-neighborly - See :wikipedia:`Neighborly_polytope` + A polyhedron is neighborly if every set of `n` vertices forms a face + for `n` up to floor of half the dimension of the polyhedron. + It is `k`-neighborly if this is true for `n` up to `k`. INPUT: @@ -7693,7 +7699,7 @@ def is_neighborly(self, k=None): OUTPUT: - - ``True`` if the every set of up to ``k`` vertices forms a face, + - ``True`` if every set of up to ``k`` vertices forms a face, - ``False`` otherwise .. SEEALSO:: diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx index 95a7fa2ee59..447e63873eb 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx @@ -1670,9 +1670,10 @@ cdef class CombinatorialPolyhedron(SageObject): r""" Returns the largest ``k``, such that the polyhedron is ``k``-neighborly. - In case of the ``d``-dimensional simplex, it returns ``d + 1``. + A polyhedron is `k`-neighborly if every set of `n` vertices forms a face + for `n` up to `k`. - See :wikipedia:`Neighborly_polytope` + In case of the `d`-dimensional simplex, it returns `d + 1`. .. SEEALSO:: @@ -1708,9 +1709,11 @@ cdef class CombinatorialPolyhedron(SageObject): r""" Return whether the polyhedron is neighborly. - If the input ``k`` is provided, then return whether the polyhedron is ``k``-neighborly + If the input `k` is provided, then return whether the polyhedron is `k`-neighborly. - See :wikipedia:`Neighborly_polytope` + A polyhedron is neighborly if every set of `n` vertices forms a face + for `n` up to floor of half the dimension of the polyhedron. + It is `k`-neighborly if this is true for `n` up to `k`. INPUT: @@ -1755,6 +1758,9 @@ cdef class CombinatorialPolyhedron(SageObject): r""" Return whether the polyhedron is a simplex. + A simplex is a bounded polyhedron with `d+1` vertices, where + `d` is the dimension. + EXAMPLES:: sage: CombinatorialPolyhedron(2).is_simplex() From 7e5ecaf79d9a90d36e4b83cd58846dcd6a13365e Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Tue, 5 May 2020 16:15:03 +0200 Subject: [PATCH 127/301] initalize cdd with both Hrep and Vrep to deal with numerical inconsistency --- src/sage/geometry/polyhedron/backend_cdd.py | 105 ++++++++++++++++++++ src/sage/geometry/polyhedron/base.py | 6 +- 2 files changed, 108 insertions(+), 3 deletions(-) diff --git a/src/sage/geometry/polyhedron/backend_cdd.py b/src/sage/geometry/polyhedron/backend_cdd.py index 0b9d007df7e..682a6fe3aed 100644 --- a/src/sage/geometry/polyhedron/backend_cdd.py +++ b/src/sage/geometry/polyhedron/backend_cdd.py @@ -513,3 +513,108 @@ def __init__(self, parent, Vrep, Hrep, **kwds): sage: TestSuite(p).run() """ Polyhedron_cdd.__init__(self, parent, Vrep, Hrep, **kwds) + + def _init_from_Vrepresentation_and_Hrepresentation(self, Vrep, Hrep, verbose=False): + """ + Construct polyhedron from Vrepresentation and Hrepresentation data. + + See :class:`Polyhedron_base` for a description of ``Vrep`` and ``Hrep``. + + .. NOTE:: + + The representation is assumed to be correct. + + As long as cdd can obtain a consistent object with Vrepresentation + or Hrepresentation no warning is raised. Consistency is checked by + comparing the output length of Vrepresentation and Hrepresentation + with the input. + + In comparison, the "normal" initialization from Vrepresentation over RDF + expects the output length to be consistent with the computed length + when re-feeding cdd the outputed Hrepresentation. + + EXAMPLES:: + + sage: from sage.geometry.polyhedron.parent import Polyhedra_RDF_cdd + sage: from sage.geometry.polyhedron.backend_cdd import Polyhedron_RDF_cdd + sage: parent = Polyhedra_RDF_cdd(RDF, 1, 'cdd') + sage: Vrep = [[[0.0], [1.0]], [], []] + sage: Hrep = [[[0.0, 1.0], [1.0, -1.0]], []] + sage: p = Polyhedron_RDF_cdd(parent, Vrep, Hrep, + ....: Vrep_minimal=True, Hrep_minimal=True) # indirect doctest + sage: p + A 1-dimensional polyhedron in RDF^1 defined as the convex hull of 2 vertices + + TESTS: + + Test that :trac:`29568` is fixed:: + + sage: P = polytopes.buckyball(exact=False) + sage: Q = P + P.center() + sage: P.is_combinatorially_isomorphic(Q) + True + sage: R = 2*P + sage: P.is_combinatorially_isomorphic(R) + True + """ + def parse_Vrep(intro, data): + count = int(data[0][0]) + if count != len(vertices) + len(rays) + len(lines): + # Upstream claims that nothing can be done about these + # cases/that they are features not bugs. Imho, cddlib is + # not really suitable for automatic parsing of its output, + # the implementation backed by doubles has not really been + # optimized for numerical stability, and makes some + # somewhat random numerical choices. (But I am not an + # expert in that field by any means.) See also + # https://github.com/cddlib/cddlib/pull/7. + from warnings import warn + warn("This polyhedron data is numerically complicated; cdd could not convert between the inexact V and H representation without loss of data. The resulting object might show inconsistencies.") + + def parse_Hrep(intro, data): + count = int(data[0][0]) + infinite_count = len([d for d in data[1:] if d[0] == '1' and all(c == '0' for c in d[1:])]) + if count - infinite_count != len(ieqs) + len(eqns): + # Upstream claims that nothing can be done about these + # cases/that they are features not bugs. Imho, cddlib is + # not really suitable for automatic parsing of its output, + # the implementation backed by doubles has not really been + # optimized for numerical stability, and makes some + # somewhat random numerical choices. (But I am not an + # expert in that field by any means.) + from warnings import warn + warn("This polyhedron data is numerically complicated; cdd could not convert between the inexact V and H representation without loss of data. The resulting object might show inconsistencies.") + + def try_init(rep): + if rep == "Vrep": + from .cdd_file_format import cdd_Vrepresentation + s = cdd_Vrepresentation(self._cdd_type, vertices, rays, lines) + else: + from .cdd_file_format import cdd_Hrepresentation + s = cdd_Hrepresentation(self._cdd_type, ieqs, eqns) + + s = self._run_cdd(s, '--redcheck', verbose=verbose) + s = self._run_cdd(s, '--repall', verbose=verbose) + Polyhedron_cdd._parse_block(s.splitlines(), 'V-representation', parse_Vrep) + Polyhedron_cdd._parse_block(s.splitlines(), 'H-representation', parse_Hrep) + self._init_from_cdd_output(s) + + from warnings import catch_warnings, simplefilter + + vertices, rays, lines = (tuple(x) for x in Vrep) + ieqs, eqns = (tuple(x) for x in Hrep) + + # We prefer the shorter representation. + # Note that for the empty polyhedron we prefer Hrepresentation. + prim = "Hrep" if len(ieqs) <= len(vertices) + len(rays) else "Vrep" + sec = "Vrep" if len(ieqs) <= len(vertices) + len(rays) else "Hrep" + + with catch_warnings(): + # Raise an error and try the other representation in case of + # numerical inconsistency. + simplefilter("error") + try: + try_init(prim) + except UserWarning: + simplefilter("once") # Only print the first warning. + try_init(sec) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 01989bbd80e..0e03be228ce 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -558,9 +558,9 @@ def change_ring(self, base_ring, backend=None): sage: P = Polyhedron([[2/3,0],[6666666666666667/10^16,0]], base_ring=AA); P A 1-dimensional polyhedron in AA^2 defined as the convex hull of 2 vertices - sage: P.change_ring(RDF) + sage: Q = P.change_ring(RDF); Q A 0-dimensional polyhedron in RDF^2 defined as the convex hull of 1 vertex - sage: P == P.change_ring(RDF) + sage: P.n_vertices() == Q.n_vertices() False """ @@ -7185,7 +7185,7 @@ def volume(self, measure='ambient', engine='auto', **kwds): sage: Dinexact = polytopes.dodecahedron(exact=False) sage: w = Dinexact.faces(2)[2].as_polyhedron().volume(measure='induced', engine='internal'); RDF(w) # abs tol 1e-9 - 1.534062710738235 + 1.5340627082974878 sage: [polytopes.simplex(d).volume(measure='induced') for d in range(1,5)] == [sqrt(d+1)/factorial(d) for d in range(1,5)] True From 6cedfb6ba750bc6b74dbcbb7e557112bc5583647 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Fri, 24 Apr 2020 12:01:34 +0200 Subject: [PATCH 128/301] get only the new double descpription from translation --- src/sage/geometry/polyhedron/base.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 0e03be228ce..3eab65a34ac 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -4285,8 +4285,14 @@ def translation(self, displacement): sage: P + vector([1,2,3,4,5/2]) == Q + vector([1,2,3,4,5/2]) True """ + Vrep, Hrep, parent = self._translation_double_description(displacement) + + return parent.element_class(parent, Vrep, Hrep, + Vrep_minimal=True, Hrep_minimal=True) + + def _translation_double_description(self, displacement): displacement = vector(displacement) - new_vertices = tuple(x.vector()+displacement for x in self.vertex_generator()) + new_vertices = (x.vector()+displacement for x in self.vertex_generator()) new_rays = self.rays() new_lines = self.lines() parent = self.parent().base_extend(displacement) @@ -4299,12 +4305,9 @@ def get_new(x): y[0] -= x.A()*displacement return y - new_ieqs = tuple(get_new(x) for x in self.inequality_generator()) - new_eqns = tuple(get_new(x) for x in self.equation_generator()) - - return parent.element_class(parent, [new_vertices, new_rays, new_lines], - [new_ieqs, new_eqns], - Vrep_minimal=True, Hrep_minimal=True) + new_ieqs = (get_new(x) for x in self.inequality_generator()) + new_eqns = (get_new(x) for x in self.equation_generator()) + return [new_vertices, new_rays, new_lines], [new_ieqs, new_eqns], parent def product(self, other): """ From 803b6aca353b1958522e76bf96f44f65fdde789a Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Fri, 24 Apr 2020 12:07:20 +0200 Subject: [PATCH 129/301] documentation for `_translation_double_description` --- src/sage/geometry/polyhedron/base.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 3eab65a34ac..0bdf63cf61b 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -4291,6 +4291,29 @@ def translation(self, displacement): Vrep_minimal=True, Hrep_minimal=True) def _translation_double_description(self, displacement): + r""" + Return the input parameters for the translation. + + INPUT: + + - ``displacement`` -- a displacement vector or a list/tuple of + coordinates that determines a displacement vector + + OUTPUT: Tuple of consisting of new Vrepresentation, Hrepresentation and parent. + + .. SEEALSO:: + + :meth:`translation` + + EXAMPLES:: + + sage: P = Polyhedron([[0,0],[1,0],[0,1]], base_ring=ZZ) + sage: Vrep, Hrep, parent = P._translation_double_description([2,1]) + sage: [tuple(x) for x in Vrep], [tuple(x) for x in Hrep], parent + ([((2, 1), (2, 2), (3, 1)), (), ()], + [((-2, 1, 0), (-1, 0, 1), (4, -1, -1)), ()], + Polyhedra in ZZ^2) + """ displacement = vector(displacement) new_vertices = (x.vector()+displacement for x in self.vertex_generator()) new_rays = self.rays() From 3e4ab32bcc31d6d40e2cbb91185ee1d2bdeda1a5 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Fri, 24 Apr 2020 16:59:56 +0200 Subject: [PATCH 130/301] use precomputed data for polar --- src/sage/geometry/polyhedron/base.py | 68 +++++++++++++++++++++++-- src/sage/geometry/polyhedron/base_ZZ.py | 22 ++++++-- src/sage/geometry/polyhedron/plot.py | 23 +++++---- 3 files changed, 94 insertions(+), 19 deletions(-) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 0bdf63cf61b..e45469b555d 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -4287,8 +4287,10 @@ def translation(self, displacement): """ Vrep, Hrep, parent = self._translation_double_description(displacement) + pref_rep = 'Vrep' if self.n_vertices() + self.n_rays() <= self.n_inequalities() else 'Hrep' + return parent.element_class(parent, Vrep, Hrep, - Vrep_minimal=True, Hrep_minimal=True) + Vrep_minimal=True, Hrep_minimal=True, pref_rep=pref_rep) def _translation_double_description(self, displacement): r""" @@ -6579,15 +6581,73 @@ def polar(self, in_affine_span=False): Traceback (most recent call last): ... ValueError: not full-dimensional; try with 'in_affine_span=True' + + Check that the double description is set up correctly:: + + sage: P = Polyhedron([[1,0],[0,1],[-1,-1]], backend='field') + sage: Q = P.change_ring(QQ, backend='ppl') + sage: P.polar() == Q.polar() + True + + sage: P = polytopes.simplex(4, backend='field') + sage: Q = P.change_ring(QQ, backend='ppl') + sage: P.polar(in_affine_span=True) == Q.polar(in_affine_span=True) + True + + Check that it works, even when the equations are not orthogonal to each other:: + + sage: P = polytopes.cube()*Polyhedron([[0,0,0]]) + sage: P = P.change_ring(QQ) + + sage: from sage.geometry.polyhedron.backend_field import Polyhedron_field + sage: from sage.geometry.polyhedron.parent import Polyhedra_field + sage: parent = Polyhedra_field(QQ, 6, 'field') + sage: equations = [[0, 0, 0, 0, 1, 1, 1], [0, 0, 0, 0, -1, 1, -1], [0, 0, 0, 0, 1, -1, -1]] + sage: Q = Polyhedron_field(parent, [P.vertices(), [], []], [P.inequalities(), equations], + ....: Vrep_minimal=True, Hrep_minimal=True) + sage: Q == P + True + sage: Q.polar(in_affine_span=True) == P.polar(in_affine_span=True) + True """ if not self.is_compact(): raise ValueError("not a polytope") if not in_affine_span and not self.dim() == self.ambient_dim(): raise ValueError("not full-dimensional; try with 'in_affine_span=True'") - verts = [list(self.center() - v.vector()) for v in self.vertex_generator()] - parent = self.parent().base_extend(self.center().parent()) - return parent.element_class(parent, None, [[[1] + list(v) for v in verts], self.equations()]) + t_Vrep, t_Hrep, parent = self._translation_double_description(-self.center()) + t_verts = t_Vrep[0] + t_ieqs = t_Hrep[0] + t_eqns = t_Hrep[1] + + new_ieqs = ((1,) + tuple(-v) for v in t_verts) + if self.n_vertices() == 1: + new_verts = self.vertices() + elif not self.n_equations(): + new_verts = ((-h/h[0])[1:] for h in t_ieqs) + else: + # Transform the equations such that the normals are pairwise orthogonal. + t_eqns = list(t_eqns) + for i,h in enumerate(t_eqns): + for h1 in t_eqns[:i]: + a = h[1:]*h1[1:] + if a: + b = h1[1:]*h1[1:] + t_eqns[i] = b*h - a*h1 + + def move_vertex_to_subspace(vertex): + for h in t_eqns: + offset = vertex*h[1:]+h[0] + vertex = vertex-h[1:]*offset/(h[1:]*h[1:]) + return vertex + + new_verts = (move_vertex_to_subspace((-h/h[0])[1:]) for h in t_ieqs) + + pref_rep = 'Hrep' if self.n_vertices() <= self.n_inequalities() else 'Vrep' + + return parent.element_class(parent, [new_verts, [], []], + [new_ieqs, t_eqns], + Vrep_minimal=True, Hrep_minimal=True, pref_rep=pref_rep) def is_self_dual(self): r""" diff --git a/src/sage/geometry/polyhedron/base_ZZ.py b/src/sage/geometry/polyhedron/base_ZZ.py index 2802cf6ec5a..2823d965f79 100644 --- a/src/sage/geometry/polyhedron/base_ZZ.py +++ b/src/sage/geometry/polyhedron/base_ZZ.py @@ -509,17 +509,31 @@ def polar(self): sage: polytopes.cube(backend='normaliz').polar().backend() # optional - pynormaliz 'normaliz' + + Check that the polar is computed correctly, see :trac:`29569`:: + + sage: P = Polyhedron([[1,0],[0,1],[-1,-1]]) + sage: P.polar().vertices() + (A vertex at (1, 1), A vertex at (1, -2), A vertex at (-2, 1)) """ if not self.has_IP_property(): raise ValueError('The polytope must have the IP property.') - vertices = [ ieq.A()/ieq.b() for - ieq in self.inequality_generator() ] + vertices = tuple( -ieq.A()/ieq.b() for + ieq in self.inequality_generator() ) + + ieqs = ((1,) + tuple(-v[:]) for v in self.vertices()) + + pref_rep = 'Hrep' if self.n_vertices() <= self.n_inequalities() else 'Vrep' if all( all(v_i in ZZ for v_i in v) for v in vertices): - return Polyhedron(vertices=vertices, base_ring=ZZ, backend=self.backend()) + parent = self.parent() + vertices = (v.change_ring(ZZ) for v in vertices) else: - return Polyhedron(vertices=vertices, base_ring=QQ, backend=self.backend()) + parent = self.parent().change_ring(QQ) + + return parent.element_class(parent, [vertices, [], []], [ieqs, []], + Vrep_minimal=True, Hrep_minimal=True, pref_rep=pref_rep) @cached_method def is_reflexive(self): diff --git a/src/sage/geometry/polyhedron/plot.py b/src/sage/geometry/polyhedron/plot.py index dc8ccf3fd4e..558b5c9940d 100644 --- a/src/sage/geometry/polyhedron/plot.py +++ b/src/sage/geometry/polyhedron/plot.py @@ -1506,18 +1506,19 @@ def _tikz_3d_in_3d(self, view, angle, scale, edge_color, sage: Associahedron = Polyhedron(vertices=[[1,0,1],[1,0,0],[1,1,0],[0,0,-1],[0,1,0],[-1,0,0],[0,1,1],[0,0,1],[0,-1,0]]).polar() sage: ImageAsso = Associahedron.projection().tikz([-15,-755,-655], 116, scale=1) - sage: print('\n'.join(ImageAsso.splitlines()[29:41])) - %% Drawing edges in the back + sage: print('\n'.join(ImageAsso.splitlines()[51:64])) + %% Drawing edges in the front %% - \draw[edge,back] (-0.50000, -0.50000, -0.50000) -- (-1.00000, 0.00000, 0.00000); - \draw[edge,back] (-0.50000, -0.50000, -0.50000) -- (0.00000, -1.00000, 0.00000); - \draw[edge,back] (-0.50000, -0.50000, -0.50000) -- (0.00000, 0.00000, -1.00000); - \draw[edge,back] (-1.00000, 0.00000, 0.00000) -- (-1.00000, 0.00000, 1.00000); - \draw[edge,back] (-1.00000, 0.00000, 0.00000) -- (-1.00000, 1.00000, 0.00000); - \draw[edge,back] (0.00000, -1.00000, 0.00000) -- (0.00000, -1.00000, 1.00000); - \draw[edge,back] (0.00000, -1.00000, 0.00000) -- (1.00000, -1.00000, 0.00000); - \draw[edge,back] (0.00000, 0.00000, -1.00000) -- (0.00000, 1.00000, -1.00000); - \draw[edge,back] (0.00000, 0.00000, -1.00000) -- (1.00000, 0.00000, -1.00000); + \draw[edge] (1.00000, -1.00000, 0.00000) -- (1.00000, 0.00000, 0.00000); + \draw[edge] (1.00000, -1.00000, 0.00000) -- (1.00000, -1.00000, -1.00000); + \draw[edge] (1.00000, -1.00000, 0.00000) -- (0.00000, -1.00000, 1.00000); + \draw[edge] (0.00000, 1.00000, -1.00000) -- (0.00000, 1.00000, 0.00000); + \draw[edge] (0.00000, 1.00000, -1.00000) -- (1.00000, 0.00000, -1.00000); + \draw[edge] (0.00000, 1.00000, -1.00000) -- (-1.00000, 1.00000, -1.00000); + \draw[edge] (0.00000, 0.00000, 1.00000) -- (0.50000, 0.50000, 0.50000); + \draw[edge] (0.00000, 0.00000, 1.00000) -- (0.00000, -1.00000, 1.00000); + \draw[edge] (0.00000, 0.00000, 1.00000) -- (-1.00000, 0.00000, 1.00000); + \draw[edge] (0.00000, 1.00000, 0.00000) -- (0.50000, 0.50000, 0.50000); %% """ view_vector = vector(RDF, view) From 8bbd5cbb50948364e94064d8bf76fd1b320afa72 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Tue, 5 May 2020 16:24:51 +0200 Subject: [PATCH 131/301] fix doctets --- .../en/thematic_tutorials/geometry/polyhedra_tutorial.rst | 7 +++++-- src/sage/geometry/polyhedron/plot.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst b/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst index 6ff4a38e0fa..f3cfd069784 100644 --- a/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst +++ b/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst @@ -166,9 +166,12 @@ The following example demonstrates the limitations of :code:`RDF`. sage: D A 3-dimensional polyhedron in (Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?)^3 defined as the convex hull of 20 vertices sage: D_RDF = Polyhedron(vertices = [n(v.vector(),digits=6) for v in D.vertices()], base_ring=RDF) - Traceback (most recent call last): + doctest:warning ... - ValueError: *Error: Numerical inconsistency is found. Use the GMP exact arithmetic. + UserWarning: This polyhedron data is numerically complicated; cdd + could not convert between the inexact V and H representation + without loss of data. The resulting object might show + inconsistencies. .. end of output diff --git a/src/sage/geometry/polyhedron/plot.py b/src/sage/geometry/polyhedron/plot.py index 558b5c9940d..6cbf445d8a5 100644 --- a/src/sage/geometry/polyhedron/plot.py +++ b/src/sage/geometry/polyhedron/plot.py @@ -1519,7 +1519,7 @@ def _tikz_3d_in_3d(self, view, angle, scale, edge_color, \draw[edge] (0.00000, 0.00000, 1.00000) -- (0.00000, -1.00000, 1.00000); \draw[edge] (0.00000, 0.00000, 1.00000) -- (-1.00000, 0.00000, 1.00000); \draw[edge] (0.00000, 1.00000, 0.00000) -- (0.50000, 0.50000, 0.50000); - %% + \draw[edge] (0.00000, 1.00000, 0.00000) -- (-1.00000, 1.00000, 0.00000); """ view_vector = vector(RDF, view) rot = rotate_arbitrary(view_vector, -(angle/360)*2*pi) From a39af8b81072f9255678a956d118dc87c6db12d9 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 May 2020 10:30:03 +0200 Subject: [PATCH 132/301] fixed failing doctest --- src/sage/plot/plot3d/base.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sage/plot/plot3d/base.pyx b/src/sage/plot/plot3d/base.pyx index 81e7018681a..23fcee0014e 100644 --- a/src/sage/plot/plot3d/base.pyx +++ b/src/sage/plot/plot3d/base.pyx @@ -1739,11 +1739,11 @@ end_scene""" % (render_params.antialiasing, sage: Q = P.plot().all[-1] sage: print(Q.stl_ascii_string().splitlines()[:7]) ['solid surface', - 'facet normal 0.8506508083520398 -0.0 0.5257311121191338', + 'facet normal 0.0 0.5257311121191338 0.8506508083520399', ' outer loop', - ' vertex 1.2360679774997898 -0.4721359549995796 0.0', - ' vertex 1.2360679774997898 0.4721359549995796 0.0', - ' vertex 0.7639320225002102 0.7639320225002102 0.7639320225002102', + ' vertex -0.7639320225002102 0.7639320225002102 0.7639320225002102', + ' vertex -0.4721359549995796 0.0 1.2360679774997898', + ' vertex 0.4721359549995796 0.0 1.2360679774997898', ' endloop'] """ from sage.modules.free_module import FreeModule From 758902c944cc17207f953298afad238856bb1804 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 May 2020 10:32:38 +0200 Subject: [PATCH 133/301] removed redundant import --- src/sage/geometry/polyhedron/base_ZZ.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sage/geometry/polyhedron/base_ZZ.py b/src/sage/geometry/polyhedron/base_ZZ.py index 2823d965f79..099394f0375 100644 --- a/src/sage/geometry/polyhedron/base_ZZ.py +++ b/src/sage/geometry/polyhedron/base_ZZ.py @@ -18,7 +18,6 @@ from sage.modules.free_module_element import vector from .base_QQ import Polyhedron_QQ from sage.arith.all import gcd -from .constructor import Polyhedron ######################################################################### From 17c5712695c544a8973ba462f3cace6f8663b7b9 Mon Sep 17 00:00:00 2001 From: John Cremona Date: Mon, 11 May 2020 12:18:40 +0100 Subject: [PATCH 134/301] #29666: further minor improvement and added doctest --- src/sage/schemes/elliptic_curves/ell_point.py | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/ell_point.py b/src/sage/schemes/elliptic_curves/ell_point.py index 69a519af208..ff4d5b68baf 100644 --- a/src/sage/schemes/elliptic_curves/ell_point.py +++ b/src/sage/schemes/elliptic_curves/ell_point.py @@ -2755,7 +2755,7 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): sage: E = EllipticCurve(v) sage: P = E([72*a - 509/5, -682/25*a - 434/25]) sage: P.archimedean_local_height() - -0.2206607955468278492183362746930 + -0.220660795546828 See :trac:`19276`:: @@ -2763,28 +2763,46 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): sage: E = EllipticCurve([1, a - 1, 1, -816765673272*a - 7931030674178, 1478955604013312315*a + 14361086227143654561]) sage: P = E(5393511/49*a + 52372721/49 , -33896210324/343*a - 329141996591/343 ) sage: P.height() - 0.974232017827740 + 0.974232017827741 + + See :trac:`29966`:: + + sage: K. = NumberField(x^3 - x^2 - 6*x + 2) + sage: E = EllipticCurve([1, -a^2 + 2*a + 4, 0, -6056450500590472699700624*a^2 - 11239394326797569935861742*a + 4241549693833829432516231, 1904879037869682826729875958079326124520*a^2 + 3535022146945771697732350459284777382011*a - 1334055169621036218710397707677347972626]) + sage: P = E([1033399668533*a^2 + 1917754693229*a - 723726883800 , 12536493059202326563*a^2 + 23264879148900575548*a - 8779756111574815918 , 1]) + sage: P.height() + 0.297318833424763 + sage: (2*P).height() / P.height() + 4.00000000000000 + sage: P.height(200) + 0.29731883342476341806143743594519935578696537745294661858984 + sage: (2*P).height(200) / P.height(200) + 4.0000000000000000000000000000000000000000000000000000000000 """ + from sage.rings.number_field.number_field import refine_embedding + from sage.all import RealField, ComplexField, Infinity + E = self.curve() K = E.base_ring() if v is None: + + if prec is None: + prec = 53 if K is rings.QQ: v = K.embeddings(rings.RR)[0] - h = self.archimedean_local_height(v, prec) + h = self.archimedean_local_height(v, prec+10) else: r1, r2 = K.signature() pl = K.places() - h = (sum(self.archimedean_local_height(pl[i], prec, weighted=False) + h = (sum(self.archimedean_local_height(pl[i], prec+10, weighted=False) for i in range(r1)) - + 2 * sum(self.archimedean_local_height(pl[i], prec, weighted=False) + + 2 * sum(self.archimedean_local_height(pl[i], prec+10, weighted=False) for i in range(r1, r1 + r2))) if not weighted: h /= K.degree() - return h + return RealField(prec)(h) - from sage.rings.number_field.number_field import refine_embedding - from sage.all import RealField, ComplexField, Infinity prec_v = v.codomain().prec() if prec is None: prec = prec_v From 79e5f80e6d386438f5ff7fa8eff956f7d3062366 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Thu, 7 May 2020 21:04:10 +0200 Subject: [PATCH 135/301] optimize region computation of hyperplane arrangements --- .../hyperplane_arrangement/arrangement.py | 58 ++++++++++++++++--- 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/src/sage/geometry/hyperplane_arrangement/arrangement.py b/src/sage/geometry/hyperplane_arrangement/arrangement.py index 740a7a56b4e..67faeb8c3b7 100644 --- a/src/sage/geometry/hyperplane_arrangement/arrangement.py +++ b/src/sage/geometry/hyperplane_arrangement/arrangement.py @@ -1218,13 +1218,13 @@ def center(self): def is_simplicial(self): r""" Test whether the arrangement is simplicial. - + A region is simplicial if the normal vectors of its bounding hyperplanes are linearly independent. A hyperplane arrangement is said to be simplicial if every region is simplicial. OUTPUT: - + A boolean whether the hyperplane arrangement is simplicial. EXAMPLES:: @@ -1609,18 +1609,62 @@ def regions(self): dim = self.dimension() universe = Polyhedron(eqns=[[0] + [0] * dim], base_ring=R) regions = [universe] + if self.is_linear(): + # We only take the positive half w.r. to the first hyperplane. + # We fix this by appending all negative regions in the end. + regions = None + for hyperplane in self: ieq = vector(R, hyperplane.dense_coefficient_list()) pos_half = Polyhedron(ieqs=[ ieq], base_ring=R) neg_half = Polyhedron(ieqs=[-ieq], base_ring=R) + if not regions: + # See comment above. + regions = [pos_half] + continue subdivided = [] for region in regions: - for half_space in pos_half, neg_half: - part = region.intersection(half_space) - if part.dim() == dim: - subdivided.append(part) + splits = False + direction = 0 + for v in region.vertices(): + x = ieq[0] + ieq[1:]*v[:] + if x: + if x*direction < 0: + splits = True + break + else: + direction = x + + if not splits: + # All vertices lie in one closed halfspace of the hyperplane. + if direction == 0: + # In this case all vertices lie on the hyperplane and we must + # check if rays are contained in one closed halfspace given by the hyperplane. + valuations = tuple(ieq[1:]*ray[:] for ray in region.rays()) + if region.lines(): + valuations += tuple(ieq[1:]*line[:] for line in region.lines()) + valuations += tuple(-ieq[1:]*line[:] for line in region.lines()) + if any(x > 0 for x in valuations) and any(x < 0 for x in valuations): + splits = True + else: + # In this case, at least one of the vertices is not on the hyperplane. + # So we check if any ray or line poke the hyperplane. + if any(ieq[1:]*r[:]*direction < 0 for r in region.rays()) or \ + any(ieq[1:]*l[:]*direction != 0 for l in region.lines()): + splits = True + + if splits: + subdivided.append(region.intersection(pos_half)) + subdivided.append(region.intersection(neg_half)) + else: + subdivided.append(region) regions = subdivided - return tuple(regions) + + if self.is_linear(): + # We have treated so far only the positive half space w.r. to the first hyperplane. + return tuple(regions) + tuple(-x for x in regions) + else: + return tuple(regions) @cached_method def poset_of_regions(self, B=None, numbered_labels=True): From 61da5b6a479d75bf6d08be9aebcb635573575c5f Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 May 2020 14:19:57 +0200 Subject: [PATCH 136/301] readability of code --- .../hyperplane_arrangement/arrangement.py | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/sage/geometry/hyperplane_arrangement/arrangement.py b/src/sage/geometry/hyperplane_arrangement/arrangement.py index 67faeb8c3b7..1b1c7a4442a 100644 --- a/src/sage/geometry/hyperplane_arrangement/arrangement.py +++ b/src/sage/geometry/hyperplane_arrangement/arrangement.py @@ -1624,16 +1624,20 @@ def regions(self): continue subdivided = [] for region in regions: + # For each region we determine, if the hyperplane splits it. splits = False + + # Determine if all vertices lie on one side of the hyperplane. + # If so, we determine on which side. + valuations = tuple(ieq[0] + ieq[1:]*v[:] for v in region.vertices()) direction = 0 - for v in region.vertices(): - x = ieq[0] + ieq[1:]*v[:] - if x: - if x*direction < 0: - splits = True - break - else: - direction = x + if any(x > 0 for x in valuations): + direction = 1 + if any(x < 0 for x in valuations): + if direction: + splits = True + else: + direction = -1 if not splits: # All vertices lie in one closed halfspace of the hyperplane. @@ -1648,9 +1652,9 @@ def regions(self): splits = True else: # In this case, at least one of the vertices is not on the hyperplane. - # So we check if any ray or line poke the hyperplane. + # So we check if any ray or line pokes the hyperplane. if any(ieq[1:]*r[:]*direction < 0 for r in region.rays()) or \ - any(ieq[1:]*l[:]*direction != 0 for l in region.lines()): + any(ieq[1:]*l[:] != 0 for l in region.lines()): splits = True if splits: From b05df006ca52e7943b73df4b63124aad5b9654f8 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 May 2020 14:32:42 +0200 Subject: [PATCH 137/301] added example --- src/doc/en/reference/references/index.rst | 3 +++ .../hyperplane_arrangement/arrangement.py | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 91aeb96553b..153158b3f6a 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -3246,6 +3246,9 @@ REFERENCES: .. [KP2011] Manuel Kauers and Peter Paule. The Concrete Tetrahedron. Springer-Verlag, 2011. +.. [KP2020] Lars Kastner and Marta Panizzut, *Hyperplane arrangements + in polymake*, arxiv:`2003.13548`. + .. [KP2002b] James Kuzmanovich; Andrey Pavlichenkov, *Finite Groups of Matrices Whose Entries Are Integers*, The American Mathematical Monthly, Vol. 109, No. 2. (2002) pp. 173-186 diff --git a/src/sage/geometry/hyperplane_arrangement/arrangement.py b/src/sage/geometry/hyperplane_arrangement/arrangement.py index 1b1c7a4442a..19bd37d7254 100644 --- a/src/sage/geometry/hyperplane_arrangement/arrangement.py +++ b/src/sage/geometry/hyperplane_arrangement/arrangement.py @@ -1601,6 +1601,31 @@ def regions(self): sage: chessboard = H(chessboard) sage: len(chessboard.bounded_regions()) # long time, 359 ms on a Core i7 64 + + Example 6 of [KP2020]:: + + sage: from itertools import product + sage: def zero_one(d): + ....: for x in product([0,1], repeat=d): + ....: if any(y for y in x): + ....: yield [0] + list(x) + ....: + sage: K. = HyperplaneArrangements(QQ) + sage: A = K(*zero_one(2)) + sage: len(A.regions()) + 6 + sage: K. = HyperplaneArrangements(QQ) + sage: A = K(*zero_one(3)) + sage: len(A.regions()) + 32 + sage: K. = HyperplaneArrangements(QQ) + sage: A = K(*zero_one(4)) + sage: len(A.regions()) + 370 + sage: K. = HyperplaneArrangements(QQ) + sage: A = K(*zero_one(5)) + sage: len(A.regions()) # not tested (~25s) + 11292 """ if self.base_ring().characteristic() != 0: raise ValueError('base field must have characteristic zero') From 9a690e4b96331cf9e66128e8326d088d81fdf347 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 May 2020 14:37:21 +0200 Subject: [PATCH 138/301] sorting entries by appearance year --- src/doc/en/reference/references/index.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 153158b3f6a..a9cd18509b1 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -3243,16 +3243,16 @@ REFERENCES: http://portal.acm.org/citation.cfm?id=763203 and free of charge at :arxiv:`math/0106043` +.. [KP2002b] James Kuzmanovich; Andrey Pavlichenkov, *Finite + Groups of Matrices Whose Entries Are Integers*, The American + Mathematical Monthly, Vol. 109, No. 2. (2002) pp. 173-186 + .. [KP2011] Manuel Kauers and Peter Paule. The Concrete Tetrahedron. Springer-Verlag, 2011. .. [KP2020] Lars Kastner and Marta Panizzut, *Hyperplane arrangements in polymake*, arxiv:`2003.13548`. -.. [KP2002b] James Kuzmanovich; Andrey Pavlichenkov, *Finite - Groups of Matrices Whose Entries Are Integers*, The American - Mathematical Monthly, Vol. 109, No. 2. (2002) pp. 173-186 - .. [KPRWZ2010] \M. H. Klin, C. Pech, S. Reichard, A. Woldar, M. Zvi-Av, *Examples of computer experimentation in algebraic combinatorics*, ARS MATHEMATICA CONTEMPORANEA 3 (2010) 237–258. From aa535d84ce1eefcaca325c9afa4c3bd10007e790 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 May 2020 16:02:16 +0200 Subject: [PATCH 139/301] coding style --- src/sage/geometry/polyhedron/base.py | 2 +- src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 30d30b1f3ba..b255342f0b4 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -7639,7 +7639,7 @@ def is_simplex(self): def neighborliness(self): r""" - Returns the largest ``k``, such that the polyhedron is ``k``-neighborly. + Return the largest ``k``, such that the polyhedron is ``k``-neighborly. A polyhedron is `k`-neighborly if every set of `n` vertices forms a face for `n` up to `k`. diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx index 447e63873eb..870c733ea14 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx @@ -1668,7 +1668,7 @@ cdef class CombinatorialPolyhedron(SageObject): @cached_method def neighborliness(self): r""" - Returns the largest ``k``, such that the polyhedron is ``k``-neighborly. + Return the largest ``k``, such that the polyhedron is ``k``-neighborly. A polyhedron is `k`-neighborly if every set of `n` vertices forms a face for `n` up to `k`. From 630e83ade7f2fe4b1870f24f76cfc6bdb2c9a9f0 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 May 2020 17:00:49 +0200 Subject: [PATCH 140/301] undo non-fix for polar ZZ --- src/sage/geometry/polyhedron/base_ZZ.py | 12 +++--------- src/sage/geometry/polyhedron/plot.py | 25 ++++++++++++------------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/src/sage/geometry/polyhedron/base_ZZ.py b/src/sage/geometry/polyhedron/base_ZZ.py index 099394f0375..5f346963bbe 100644 --- a/src/sage/geometry/polyhedron/base_ZZ.py +++ b/src/sage/geometry/polyhedron/base_ZZ.py @@ -508,20 +508,14 @@ def polar(self): sage: polytopes.cube(backend='normaliz').polar().backend() # optional - pynormaliz 'normaliz' - - Check that the polar is computed correctly, see :trac:`29569`:: - - sage: P = Polyhedron([[1,0],[0,1],[-1,-1]]) - sage: P.polar().vertices() - (A vertex at (1, 1), A vertex at (1, -2), A vertex at (-2, 1)) """ if not self.has_IP_property(): raise ValueError('The polytope must have the IP property.') - vertices = tuple( -ieq.A()/ieq.b() for - ieq in self.inequality_generator() ) + vertices = tuple( ieq.A()/ieq.b() for + ieq in self.inequality_generator() ) - ieqs = ((1,) + tuple(-v[:]) for v in self.vertices()) + ieqs = ((1,) + tuple(v[:]) for v in self.vertices()) pref_rep = 'Hrep' if self.n_vertices() <= self.n_inequalities() else 'Vrep' diff --git a/src/sage/geometry/polyhedron/plot.py b/src/sage/geometry/polyhedron/plot.py index 6cbf445d8a5..6b167bfdf6c 100644 --- a/src/sage/geometry/polyhedron/plot.py +++ b/src/sage/geometry/polyhedron/plot.py @@ -1506,20 +1506,19 @@ def _tikz_3d_in_3d(self, view, angle, scale, edge_color, sage: Associahedron = Polyhedron(vertices=[[1,0,1],[1,0,0],[1,1,0],[0,0,-1],[0,1,0],[-1,0,0],[0,1,1],[0,0,1],[0,-1,0]]).polar() sage: ImageAsso = Associahedron.projection().tikz([-15,-755,-655], 116, scale=1) - sage: print('\n'.join(ImageAsso.splitlines()[51:64])) - %% Drawing edges in the front + sage: print('\n'.join(ImageAsso.splitlines()[29:41])) + %% Drawing edges in the back + %% + \draw[edge,back] (0.00000, 1.00000, -1.00000) -- (0.00000, 0.00000, -1.00000); + \draw[edge,back] (1.00000, -1.00000, 0.00000) -- (0.00000, -1.00000, 0.00000); + \draw[edge,back] (1.00000, 0.00000, -1.00000) -- (0.00000, 0.00000, -1.00000); + \draw[edge,back] (0.00000, 0.00000, -1.00000) -- (-0.50000, -0.50000, -0.50000); + \draw[edge,back] (-1.00000, 1.00000, 0.00000) -- (-1.00000, 0.00000, 0.00000); + \draw[edge,back] (-1.00000, 0.00000, 0.00000) -- (-1.00000, 0.00000, 1.00000); + \draw[edge,back] (-1.00000, 0.00000, 0.00000) -- (-0.50000, -0.50000, -0.50000); + \draw[edge,back] (0.00000, -1.00000, 1.00000) -- (0.00000, -1.00000, 0.00000); + \draw[edge,back] (0.00000, -1.00000, 0.00000) -- (-0.50000, -0.50000, -0.50000); %% - \draw[edge] (1.00000, -1.00000, 0.00000) -- (1.00000, 0.00000, 0.00000); - \draw[edge] (1.00000, -1.00000, 0.00000) -- (1.00000, -1.00000, -1.00000); - \draw[edge] (1.00000, -1.00000, 0.00000) -- (0.00000, -1.00000, 1.00000); - \draw[edge] (0.00000, 1.00000, -1.00000) -- (0.00000, 1.00000, 0.00000); - \draw[edge] (0.00000, 1.00000, -1.00000) -- (1.00000, 0.00000, -1.00000); - \draw[edge] (0.00000, 1.00000, -1.00000) -- (-1.00000, 1.00000, -1.00000); - \draw[edge] (0.00000, 0.00000, 1.00000) -- (0.50000, 0.50000, 0.50000); - \draw[edge] (0.00000, 0.00000, 1.00000) -- (0.00000, -1.00000, 1.00000); - \draw[edge] (0.00000, 0.00000, 1.00000) -- (-1.00000, 0.00000, 1.00000); - \draw[edge] (0.00000, 1.00000, 0.00000) -- (0.50000, 0.50000, 0.50000); - \draw[edge] (0.00000, 1.00000, 0.00000) -- (-1.00000, 1.00000, 0.00000); """ view_vector = vector(RDF, view) rot = rotate_arbitrary(view_vector, -(angle/360)*2*pi) From 81cf70f32da929c2d6b8dba5756bd936e4ad0072 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 May 2020 17:08:34 +0200 Subject: [PATCH 141/301] fix limitations of RDF example --- .../thematic_tutorials/geometry/polyhedra_tutorial.rst | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst b/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst index f3cfd069784..8c828a103d0 100644 --- a/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst +++ b/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst @@ -165,13 +165,10 @@ The following example demonstrates the limitations of :code:`RDF`. sage: D = polytopes.dodecahedron() sage: D A 3-dimensional polyhedron in (Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?)^3 defined as the convex hull of 20 vertices - sage: D_RDF = Polyhedron(vertices = [n(v.vector(),digits=6) for v in D.vertices()], base_ring=RDF) - doctest:warning + sage: D_RDF = Polyhedron(vertices = sorted([n(v.vector(),digits=6) for v in D.vertices()]), base_ring=RDF) + Traceback (most recent call last): ... - UserWarning: This polyhedron data is numerically complicated; cdd - could not convert between the inexact V and H representation - without loss of data. The resulting object might show - inconsistencies. + ValueError: *Error: Numerical inconsistency is found. Use the GMP exact arithmetic. .. end of output From 80766a2318b6580d903af490f913ce6a6552e9f4 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Sat, 25 Apr 2020 22:59:55 +0200 Subject: [PATCH 142/301] set up product with both Vrep and Hrep --- src/sage/geometry/polyhedron/base.py | 50 ++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 01989bbd80e..c3eb81e48e8 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -4356,6 +4356,17 @@ def product(self, other): 'ppl' sage: (P * polytopes.dodecahedron(backend='field')).backend() 'field' + + Check that double description is set up correctly:: + + sage: P = polytopes.permutahedron(4).base_extend(QQ) + sage: P1 = Polyhedron(rays=[[1,0,0,0],[0,1,1,0]], lines=[[0,1,0,1]]) + sage: Q = P.base_extend(QQ, 'field') + sage: Q1 = P1.base_extend(QQ, 'field') + sage: P*P1 == Q*Q1 + True + sage: P.polar(in_affine_span=True)*P1 == Q.polar(in_affine_span=True)*Q1 + True """ try: new_ring = self.parent()._coerce_base_ring(other) @@ -4363,21 +4374,34 @@ def product(self, other): raise TypeError("no common canonical parent for objects with parents: " + str(self.parent()) \ + " and " + str(other.parent())) - new_vertices = [ list(x)+list(y) - for x in self.vertex_generator() for y in other.vertex_generator()] - new_rays = [] - new_rays.extend( [ r+[0]*other.ambient_dim() - for r in self.ray_generator() ] ) - new_rays.extend( [ [0]*self.ambient_dim()+r - for r in other.ray_generator() ] ) - new_lines = [] - new_lines.extend( [ l+[0]*other.ambient_dim() - for l in self.line_generator() ] ) - new_lines.extend( [ [0]*self.ambient_dim()+l - for l in other.line_generator() ] ) + from itertools import chain + + new_vertices = (tuple(x)+tuple(y) + for x in self.vertex_generator() for y in other.vertex_generator()) + + self_zero = tuple(0 for _ in range( self.ambient_dim())) + other_zero = tuple(0 for _ in range(other.ambient_dim())) + + rays = chain((tuple(r) + other_zero for r in self.ray_generator()), + (self_zero + tuple(r) for r in other.ray_generator())) + + lines = chain((tuple(l) + other_zero for l in self.line_generator()), + (self_zero + tuple(l) for l in other.line_generator())) + + ieqs = chain((tuple(i) + other_zero for i in self.inequality_generator()), + ((i.b(),) + self_zero + tuple(i.A()) for i in other.inequality_generator())) + + eqns = chain((tuple(e) + other_zero for e in self.equation_generator()), + ((e.b(),) + self_zero + tuple(e.A()) for e in other.equation_generator())) + + + pref_rep = 'Vrep' if self.n_vertices() + self.n_rays() + other.n_vertices() + other.n_rays() \ + <= self.n_inequalities() + other.n_inequalities() else 'Hrep' parent = self.parent().change_ring(new_ring, ambient_dim=self.ambient_dim() + other.ambient_dim()) - return parent.element_class(parent, [new_vertices, new_rays, new_lines], None) + return parent.element_class(parent, [new_vertices, rays, lines], + [ieqs, eqns], + Vrep_minimal=True, Hrep_minimal=True, pref_rep=pref_rep) _mul_ = product From bda2219713aef3dce503111aa17b553215cd2823 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 May 2020 17:14:41 +0200 Subject: [PATCH 143/301] spaces between binary operators --- src/sage/geometry/polyhedron/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index c3eb81e48e8..12143c7bd38 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -4363,9 +4363,9 @@ def product(self, other): sage: P1 = Polyhedron(rays=[[1,0,0,0],[0,1,1,0]], lines=[[0,1,0,1]]) sage: Q = P.base_extend(QQ, 'field') sage: Q1 = P1.base_extend(QQ, 'field') - sage: P*P1 == Q*Q1 + sage: P * P1 == Q * Q1 True - sage: P.polar(in_affine_span=True)*P1 == Q.polar(in_affine_span=True)*Q1 + sage: P.polar(in_affine_span=True) * P1 == Q.polar(in_affine_span=True) * Q1 True """ try: @@ -4376,7 +4376,7 @@ def product(self, other): from itertools import chain - new_vertices = (tuple(x)+tuple(y) + new_vertices = (tuple(x) + tuple(y) for x in self.vertex_generator() for y in other.vertex_generator()) self_zero = tuple(0 for _ in range( self.ambient_dim())) From b4ec8dea6bfca5a98095af0b764db3b1790e45e3 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 May 2020 17:22:51 +0200 Subject: [PATCH 144/301] coding style --- src/sage/geometry/polyhedron/base.py | 69 +++++++++++++++++----------- 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 12143c7bd38..72f88f74683 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -1028,22 +1028,32 @@ def _repr_(self): if self.n_vertices() > 0: desc += ' defined as the convex hull of ' desc += repr(self.n_vertices()) - if self.n_vertices() == 1: desc += ' vertex' - else: desc += ' vertices' + if self.n_vertices() == 1: + desc += ' vertex' + else: + desc += ' vertices' if self.n_rays() > 0: - if self.n_lines() > 0: desc += ", " - else: desc += " and " + if self.n_lines() > 0: + desc += ", " + else: + desc += " and " desc += repr(self.n_rays()) - if self.n_rays() == 1: desc += ' ray' - else: desc += ' rays' + if self.n_rays() == 1: + desc += ' ray' + else: + desc += ' rays' if self.n_lines() > 0: - if self.n_rays() > 0: desc += ", " - else: desc += " and " + if self.n_rays() > 0: + desc += ", " + else: + desc += " and " desc += repr(self.n_lines()) - if self.n_lines() == 1: desc += ' line' - else: desc += ' lines' + if self.n_lines() == 1: + desc += ' line' + else: + desc += ' lines' return desc @@ -2225,10 +2235,13 @@ def bounded_edges(self): """ obj = self.Vrepresentation() for i in range(len(obj)): - if not obj[i].is_vertex(): continue + if not obj[i].is_vertex(): + continue for j in range(i+1, len(obj)): - if not obj[j].is_vertex(): continue - if self.vertex_adjacency_matrix()[i, j] == 0: continue + if not obj[j].is_vertex(): + continue + if self.vertex_adjacency_matrix()[i, j] == 0: + continue yield (obj[i], obj[j]) def Vrepresentation_space(self): @@ -3702,7 +3715,8 @@ def gale_transform(self): sage: sum(P.gale_transform()).norm() < 1e-15 True """ - if not self.is_compact(): raise ValueError('not a polytope') + if not self.is_compact(): + raise ValueError('not a polytope') A = matrix(self.n_vertices(), [ [1]+x for x in self.vertex_generator()]) @@ -6951,11 +6965,11 @@ def _volume_lrs(self, verbose=False): EXAMPLES:: - sage: polytopes.hypercube(3)._volume_lrs() #optional - lrslib + sage: polytopes.hypercube(3)._volume_lrs() # optional - lrslib 8.0 - sage: (polytopes.hypercube(3)*2)._volume_lrs() #optional - lrslib + sage: (polytopes.hypercube(3)*2)._volume_lrs() # optional - lrslib 64.0 - sage: polytopes.twenty_four_cell()._volume_lrs() #optional - lrslib + sage: polytopes.twenty_four_cell()._volume_lrs() # optional - lrslib 2.0 REFERENCES: @@ -6974,7 +6988,8 @@ def _volume_lrs(self, verbose=False): in_file = open(in_filename, 'w') in_file.write(in_str) in_file.close() - if verbose: print(in_str) + if verbose: + print(in_str) lrs_procs = Popen(['lrs', in_filename], stdin=PIPE, stdout=PIPE, stderr=PIPE) @@ -7021,30 +7036,30 @@ def _volume_latte(self, verbose=False, algorithm='triangulate', **kwargs): EXAMPLES:: - sage: polytopes.hypercube(3)._volume_latte() #optional - latte_int + sage: polytopes.hypercube(3)._volume_latte() # optional - latte_int 8 - sage: (polytopes.hypercube(3)*2)._volume_latte() #optional - latte_int + sage: (polytopes.hypercube(3)*2)._volume_latte() # optional - latte_int 64 - sage: polytopes.twenty_four_cell()._volume_latte() #optional - latte_int + sage: polytopes.twenty_four_cell()._volume_latte() # optional - latte_int 2 - sage: polytopes.cuboctahedron()._volume_latte() #optional - latte_int + sage: polytopes.cuboctahedron()._volume_latte() # optional - latte_int 20/3 TESTS: Testing triangulate algorithm:: - sage: polytopes.cuboctahedron()._volume_latte(algorithm='triangulate') #optional - latte_int + sage: polytopes.cuboctahedron()._volume_latte(algorithm='triangulate') # optional - latte_int 20/3 Testing cone decomposition algorithm:: - sage: polytopes.cuboctahedron()._volume_latte(algorithm='cone-decompose') #optional - latte_int + sage: polytopes.cuboctahedron()._volume_latte(algorithm='cone-decompose') # optional - latte_int 20/3 Testing raw output:: - sage: polytopes.cuboctahedron()._volume_latte(raw_output=True) #optional - latte_int + sage: polytopes.cuboctahedron()._volume_latte(raw_output=True) # optional - latte_int '20/3' Testing inexact rings:: @@ -7137,10 +7152,10 @@ def volume(self, measure='ambient', engine='auto', **kwds): reasons, Sage casts lrs's exact answer to a float:: sage: I3 = polytopes.hypercube(3) - sage: I3.volume(engine='lrs') #optional - lrslib + sage: I3.volume(engine='lrs') # optional - lrslib 8.0 sage: C24 = polytopes.twenty_four_cell() - sage: C24.volume(engine='lrs') #optional - lrslib + sage: C24.volume(engine='lrs') # optional - lrslib 2.0 If the base ring is exact, the answer is exact:: From c4f9dbac6a8eeb3a77384a46fd06d9ce0ffdc3ee Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 May 2020 17:31:19 +0200 Subject: [PATCH 145/301] give both examples: Error and Warning --- .../en/thematic_tutorials/geometry/polyhedra_tutorial.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst b/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst index 8c828a103d0..bf6ff21766b 100644 --- a/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst +++ b/src/doc/en/thematic_tutorials/geometry/polyhedra_tutorial.rst @@ -165,6 +165,13 @@ The following example demonstrates the limitations of :code:`RDF`. sage: D = polytopes.dodecahedron() sage: D A 3-dimensional polyhedron in (Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?)^3 defined as the convex hull of 20 vertices + sage: D_RDF = Polyhedron(vertices = [n(v.vector(),digits=6) for v in D.vertices()], base_ring=RDF) + doctest:warning + ... + UserWarning: This polyhedron data is numerically complicated; cdd + could not convert between the inexact V and H representation + without loss of data. The resulting object might show + inconsistencies. sage: D_RDF = Polyhedron(vertices = sorted([n(v.vector(),digits=6) for v in D.vertices()]), base_ring=RDF) Traceback (most recent call last): ... From 00103d0a6a3aeb0c1512a241316b8904d825de8e Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 11 May 2020 18:11:31 +0200 Subject: [PATCH 146/301] fix empty hyperplane arrangement --- .../geometry/hyperplane_arrangement/arrangement.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sage/geometry/hyperplane_arrangement/arrangement.py b/src/sage/geometry/hyperplane_arrangement/arrangement.py index 19bd37d7254..3298885c5f2 100644 --- a/src/sage/geometry/hyperplane_arrangement/arrangement.py +++ b/src/sage/geometry/hyperplane_arrangement/arrangement.py @@ -1626,6 +1626,13 @@ def regions(self): sage: A = K(*zero_one(5)) sage: len(A.regions()) # not tested (~25s) 11292 + + TESTS:: + + sage: K. = HyperplaneArrangements(QQ) + sage: A = K() + sage: A.regions() + (A 5-dimensional polyhedron in QQ^5 defined as the convex hull of 1 vertex and 5 lines,) """ if self.base_ring().characteristic() != 0: raise ValueError('base field must have characteristic zero') @@ -1634,7 +1641,7 @@ def regions(self): dim = self.dimension() universe = Polyhedron(eqns=[[0] + [0] * dim], base_ring=R) regions = [universe] - if self.is_linear(): + if self.is_linear() and self.n_hyperplanes(): # We only take the positive half w.r. to the first hyperplane. # We fix this by appending all negative regions in the end. regions = None @@ -1689,7 +1696,7 @@ def regions(self): subdivided.append(region) regions = subdivided - if self.is_linear(): + if self.is_linear() and self.n_hyperplanes(): # We have treated so far only the positive half space w.r. to the first hyperplane. return tuple(regions) + tuple(-x for x in regions) else: From f18fd2ab164f6abf95fd4e75219e17c85a5b75d6 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Tue, 12 May 2020 07:35:03 +0200 Subject: [PATCH 147/301] small improvments --- .../geometry/hyperplane_arrangement/arrangement.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sage/geometry/hyperplane_arrangement/arrangement.py b/src/sage/geometry/hyperplane_arrangement/arrangement.py index 3298885c5f2..002715bae78 100644 --- a/src/sage/geometry/hyperplane_arrangement/arrangement.py +++ b/src/sage/geometry/hyperplane_arrangement/arrangement.py @@ -1602,7 +1602,7 @@ def regions(self): sage: len(chessboard.bounded_regions()) # long time, 359 ms on a Core i7 64 - Example 6 of [KP2020]:: + Example 6 of [KP2020]_:: sage: from itertools import product sage: def zero_one(d): @@ -1673,20 +1673,21 @@ def regions(self): if not splits: # All vertices lie in one closed halfspace of the hyperplane. + region_lines = region.lines() if direction == 0: # In this case all vertices lie on the hyperplane and we must # check if rays are contained in one closed halfspace given by the hyperplane. valuations = tuple(ieq[1:]*ray[:] for ray in region.rays()) - if region.lines(): - valuations += tuple(ieq[1:]*line[:] for line in region.lines()) - valuations += tuple(-ieq[1:]*line[:] for line in region.lines()) + if region_lines: + valuations += tuple(ieq[1:]*line[:] for line in region_lines) + valuations += tuple(-ieq[1:]*line[:] for line in region_lines) if any(x > 0 for x in valuations) and any(x < 0 for x in valuations): splits = True else: # In this case, at least one of the vertices is not on the hyperplane. # So we check if any ray or line pokes the hyperplane. if any(ieq[1:]*r[:]*direction < 0 for r in region.rays()) or \ - any(ieq[1:]*l[:] != 0 for l in region.lines()): + any(ieq[1:]*l[:] != 0 for l in region_lines): splits = True if splits: From 59dc0740b561563f81e8bfb0731ea5e90245da92 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Tue, 12 May 2020 08:32:02 +0200 Subject: [PATCH 148/301] backslash and alignment --- src/sage/geometry/hyperplane_arrangement/arrangement.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/geometry/hyperplane_arrangement/arrangement.py b/src/sage/geometry/hyperplane_arrangement/arrangement.py index 002715bae78..1910bded5d8 100644 --- a/src/sage/geometry/hyperplane_arrangement/arrangement.py +++ b/src/sage/geometry/hyperplane_arrangement/arrangement.py @@ -1686,8 +1686,8 @@ def regions(self): else: # In this case, at least one of the vertices is not on the hyperplane. # So we check if any ray or line pokes the hyperplane. - if any(ieq[1:]*r[:]*direction < 0 for r in region.rays()) or \ - any(ieq[1:]*l[:] != 0 for l in region_lines): + if (any(ieq[1:]*r[:]*direction < 0 for r in region.rays()) or + any(ieq[1:]*l[:] != 0 for l in region_lines)): splits = True if splits: From a2da77530b455059013f3ab6201df939d662f921 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Tue, 12 May 2020 08:36:45 +0200 Subject: [PATCH 149/301] alignment --- src/sage/geometry/hyperplane_arrangement/arrangement.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/geometry/hyperplane_arrangement/arrangement.py b/src/sage/geometry/hyperplane_arrangement/arrangement.py index 1910bded5d8..0ca3fe7636f 100644 --- a/src/sage/geometry/hyperplane_arrangement/arrangement.py +++ b/src/sage/geometry/hyperplane_arrangement/arrangement.py @@ -1686,8 +1686,8 @@ def regions(self): else: # In this case, at least one of the vertices is not on the hyperplane. # So we check if any ray or line pokes the hyperplane. - if (any(ieq[1:]*r[:]*direction < 0 for r in region.rays()) or - any(ieq[1:]*l[:] != 0 for l in region_lines)): + if ( any(ieq[1:]*r[:]*direction < 0 for r in region.rays()) or + any(ieq[1:]*l[:] != 0 for l in region_lines)): splits = True if splits: From 930217fb8b5979ee798da8fd8542048bc1e1a90f Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Tue, 12 May 2020 08:39:54 +0200 Subject: [PATCH 150/301] alignment again --- src/sage/geometry/hyperplane_arrangement/arrangement.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/geometry/hyperplane_arrangement/arrangement.py b/src/sage/geometry/hyperplane_arrangement/arrangement.py index 0ca3fe7636f..d7455f1f8ab 100644 --- a/src/sage/geometry/hyperplane_arrangement/arrangement.py +++ b/src/sage/geometry/hyperplane_arrangement/arrangement.py @@ -1686,8 +1686,8 @@ def regions(self): else: # In this case, at least one of the vertices is not on the hyperplane. # So we check if any ray or line pokes the hyperplane. - if ( any(ieq[1:]*r[:]*direction < 0 for r in region.rays()) or - any(ieq[1:]*l[:] != 0 for l in region_lines)): + if ( any(ieq[1:]*r[:]*direction < 0 for r in region.rays()) or + any(ieq[1:]*l[:] != 0 for l in region_lines)): splits = True if splits: From 8802873fc4ba4e6d2e17acd092d75bc4357dd4c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Philippe=20Labb=C3=A9?= Date: Tue, 12 May 2020 12:12:32 +0200 Subject: [PATCH 151/301] Forgot 1 pyflake --- src/sage/geometry/polyhedron/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 72f88f74683..b3eb1441a8e 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -3268,7 +3268,8 @@ def is_simple(self): False """ - if not self.is_compact(): return False + if not self.is_compact(): + return False return self.combinatorial_polyhedron().is_simple() def simpliciality(self): From dfb3144ac1aeef57e97aa4ac6e5b4f710d1d118b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Philippe=20Labb=C3=A9?= Date: Tue, 12 May 2020 12:33:11 +0200 Subject: [PATCH 152/301] More pep8 --- src/sage/geometry/polyhedron/base.py | 52 ++++++++++++++-------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index b3eb1441a8e..0281edad992 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -1573,7 +1573,7 @@ def Hrepresentation_str(self, separator='\n', latex=False, style='>=', align=Non if align is None: align = separator == "\n" if align: - lengths = [(len(s[0]), len(s[1]), len(s[2])) for s in pretty_hs] + lengths = [(len(s[0]), len(s[1]), len(s[2])) for s in pretty_hs] from operator import itemgetter length_left = max(lengths, key=itemgetter(0))[0] length_middle = max(lengths, key=itemgetter(1))[1] @@ -2089,7 +2089,7 @@ def an_affine_basis(self): # We use in the following that elements in ``chain_indices`` are sorted lists # of V-indices. # Thus for each two faces we can easily find the first vertex that differs. - for dim,face in enumerate(chain_indices): + for dim, face in enumerate(chain_indices): if dim == 0: # Append the vertex. basis_indices.append(face[0]) @@ -2547,7 +2547,7 @@ def boundary_complex(self): ineq_indices = [inc_mat_cols[i].nonzero_positions() for i in range(self.n_Hrepresentation()) if self.Hrepresentation()[i].is_inequality()] - return SimplicialComplex(ineq_indices,maximality_check=False) + return SimplicialComplex(ineq_indices, maximality_check=False) else: raise NotImplementedError("this function is only implemented for simplicial polytopes") @@ -2678,10 +2678,10 @@ def incidence_matrix(self): incidence_matrix = matrix(ZZ, self.n_Vrepresentation(), self.n_Hrepresentation(), 0) - Vvectors_vertices = tuple((v.vector(),v.index()) + Vvectors_vertices = tuple((v.vector(), v.index()) for v in self.Vrep_generator() if v.is_vertex()) - Vvectors_rays_lines = tuple((v.vector(),v.index()) + Vvectors_rays_lines = tuple((v.vector(), v.index()) for v in self.Vrep_generator() if not v.is_vertex()) @@ -2691,13 +2691,13 @@ def incidence_matrix(self): Hindex = H.index() for Vvec, Vindex in Vvectors_vertices: if self._is_zero(Hvec*Vvec + Hconst): - incidence_matrix[Vindex, Hindex] = 1 + incidence_matrix[Vindex, Hindex] = 1 # A ray or line is considered incident with a hyperplane, # if it is orthogonal to the normal vector of the hyperplane. for Vvec, Vindex in Vvectors_rays_lines: if self._is_zero(Hvec*Vvec): - incidence_matrix[Vindex, Hindex] = 1 + incidence_matrix[Vindex, Hindex] = 1 incidence_matrix.set_immutable() return incidence_matrix @@ -2868,11 +2868,11 @@ def centroid(self, engine='auto', **kwds): pc = triangulation.point_configuration() else: from sage.geometry.triangulation.point_configuration import PointConfiguration - A,b = self.affine_hull_projection(as_affine_map=True, orthogonal=True, orthonormal=True, extend=True) + A, b = self.affine_hull_projection(as_affine_map=True, orthogonal=True, orthonormal=True, extend=True) pc = PointConfiguration((A(v.vector()) for v in self.Vrep_generator())) barycenters = [sum(self.Vrepresentation(i).vector() for i in simplex)/(self.dim() + 1) for simplex in triangulation] - volumes = [pc.volume(simplex) for simplex in triangulation] + volumes = [pc.volume(simplex) for simplex in triangulation] centroid = sum(volumes[i]*barycenters[i] for i in range(len(volumes)))/sum(volumes) if self.ambient_dim() != self.dim(): @@ -3629,7 +3629,7 @@ def is_prism(self, certificate=False): # We have found two candidates for base faces. # Remove from each vertex ``index1`` resp. ``index2``. test_verts = set(frozenset(vert_inc.difference({index1, index2})) - for vert_inc in verts_incidences) + for vert_inc in verts_incidences) if len(test_verts) == n_verts/2: # For each vertex containing `index1` there is # another one contained in `index2` @@ -3720,7 +3720,7 @@ def gale_transform(self): raise ValueError('not a polytope') A = matrix(self.n_vertices(), - [ [1]+x for x in self.vertex_generator()]) + [[1]+x for x in self.vertex_generator()]) A = A.transpose() A_ker = A.right_kernel_matrix(basis='computed') return tuple(A_ker.columns()) @@ -4386,8 +4386,8 @@ def product(self, other): try: new_ring = self.parent()._coerce_base_ring(other) except TypeError: - raise TypeError("no common canonical parent for objects with parents: " + str(self.parent()) \ - + " and " + str(other.parent())) + raise TypeError("no common canonical parent for objects with parents: " + str(self.parent()) + + " and " + str(other.parent())) from itertools import chain @@ -4409,7 +4409,6 @@ def product(self, other): eqns = chain((tuple(e) + other_zero for e in self.equation_generator()), ((e.b(),) + self_zero + tuple(e.A()) for e in other.equation_generator())) - pref_rep = 'Vrep' if self.n_vertices() + self.n_rays() + other.n_vertices() + other.n_rays() \ <= self.n_inequalities() + other.n_inequalities() else 'Hrep' @@ -4704,8 +4703,8 @@ def dilation(self, scalar): one = parent.base_ring().one() sign = one if scalar > 0 else -one - make_new_Hrep = lambda h : tuple(scalar*sign*x if i == 0 else sign*x - for i,x in enumerate(h._vector)) + make_new_Hrep = lambda h: tuple(scalar*sign*x if i == 0 else sign*x + for i, x in enumerate(h._vector)) new_vertices = (tuple(scalar*x for x in v._vector) for v in self.vertex_generator()) new_rays = (tuple(sign*x for x in r._vector) for r in self.ray_generator()) @@ -5195,8 +5194,8 @@ def face_truncation(self, face, linear_coefficients=None, cut_frac=None): normal_vectors.append(facet.A()) if linear_coefficients is not None: - normal_vector = sum(linear_coefficients[i]*normal_vectors[i] for i - in range(len(normal_vectors))) + normal_vector = sum(linear_coefficients[i]*normal_vectors[i] + for i in range(len(normal_vectors))) else: normal_vector = sum(normal_vectors) @@ -5570,7 +5569,7 @@ def lawrence_extension(self, v): raise ValueError("{} must not be a vertex or outside self".format(v)) lambda_V = [u + [0] for u in V if u != v] + [v+[1]] + [v+[2]] - parent = self.parent().change_ring(self.base_ring(), ambient_dim = self.ambient_dim() + 1) + parent = self.parent().change_ring(self.base_ring(), ambient_dim=self.ambient_dim()+1) return parent.element_class(parent, [lambda_V, [], []], None) def lawrence_polytope(self): @@ -5632,7 +5631,7 @@ def lawrence_polytope(self): n = self.n_vertices() I_n = matrix.identity(n) lambda_V = block_matrix([[V, I_n], [V, 2*I_n]]) - parent = self.parent().change_ring(self.base_ring(), ambient_dim = self.ambient_dim() + n) + parent = self.parent().change_ring(self.base_ring(), ambient_dim=self.ambient_dim()+n) return parent.element_class(parent, [lambda_V, [], []], None) def is_lawrence_polytope(self): @@ -5944,9 +5943,9 @@ def face_constructor(atoms, coatoms): if not atoms: Vindices = () else: - Vindices = tuple(sorted([ atom_to_Vindex[i] for i in atoms ]+lines)) - Hindices = tuple(sorted([ coatom_to_Hindex[i] for i in coatoms ]+equations)) - return PolyhedronFace(self,Vindices, Hindices) + Vindices = tuple(sorted([atom_to_Vindex[i] for i in atoms] + lines)) + Hindices = tuple(sorted([coatom_to_Hindex[i] for i in coatoms] + equations)) + return PolyhedronFace(self, Vindices, Hindices) from sage.geometry.hasse_diagram import lattice_from_incidences return lattice_from_incidences(atoms_incidences, coatoms_incidences, @@ -6950,7 +6949,7 @@ def schlegel_projection(self, projection_dir=None, height=1.1): if projection_dir is None: vertices = self.vertices() facet = self.Hrepresentation(0) - f0 = [ v.index() for v in facet.incident() ] + f0 = [v.index() for v in facet.incident()] projection_dir = [sum([vertices[f0[i]][j]/len(f0) for i in range(len(f0))]) for j in range(self.ambient_dim())] return proj.schlegel(projection_direction=projection_dir, height=height) @@ -8070,7 +8069,7 @@ def bounding_box(self, integral=False, integral_hull=False): if self.n_vertices() == 0: raise ValueError("empty polytope is not allowed") for i in range(self.ambient_dim()): - coords = [ v[i] for v in self.vertex_generator() ] + coords = [v[i] for v in self.vertex_generator()] max_coord = max(coords) min_coord = min(coords) if integral_hull: @@ -8262,7 +8261,7 @@ def integral_points(self, threshold=100000): triangulation = self.triangulate() points = set() for simplex in triangulation: - triang_vertices = [ self.Vrepresentation(i) for i in simplex ] + triang_vertices = [self.Vrepresentation(i) for i in simplex] new_points = simplex_points(triang_vertices) for p in new_points: p.set_immutable() @@ -8794,6 +8793,7 @@ def rational_approximation(c): return c else: c_list = [] + def rational_approximation(c): # Implementation detail: Return unique integer if two # c-values are the same up to machine precision. But From 6c9e848e542b08660bf633293fc0155bef6c3304 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Tue, 12 May 2020 17:37:27 +0200 Subject: [PATCH 153/301] cleanup of 28757 --- .../bit_vector_operations.pxd | 63 ------------------- .../polyhedron_face_lattice.pyx | 5 +- 2 files changed, 2 insertions(+), 66 deletions(-) delete mode 100644 src/sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.pxd diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.pxd b/src/sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.pxd deleted file mode 100644 index ad4e8dd129d..00000000000 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.pxd +++ /dev/null @@ -1,63 +0,0 @@ -# distutils: language = c++ - -cimport cython -from libc.stdint cimport uint64_t - -cdef extern from "bit_vector_operations.cc": - # Any Bit-representation is assumed to be `chunksize`-Bit aligned. - cdef const size_t chunksize - cdef void intersection(uint64_t *A, uint64_t *B, uint64_t *C, - size_t face_length) -# Return ``A & ~B == 0``. -# A is not subset of B, iff there is a vertex in A, which is not in B. -# ``face_length`` is the length of A and B in terms of uint64_t. - - cdef size_t get_next_level( - uint64_t **faces, const size_t n_faces, uint64_t **nextfaces, - uint64_t **nextfaces2, uint64_t **visited_all, - size_t n_visited_all, size_t face_length) -# Set ``newfaces`` to be the facets of ``faces[n_faces -1]`` -# that are not contained in a face of ``visited_all``. - -# INPUT: - -# - ``maybe_newfaces`` -- quasi of type ``uint64_t[n_faces -1][face_length]``, -# needs to be ``chunksize``-Bit aligned -# - ``newfaces`` -- quasi of type ``*uint64_t[n_faces -1] -# - ``visited_all`` -- quasi of type ``*uint64_t[n_visited_all] -# - ``face_length`` -- length of the faces - -# OUTPUT: - -# - return number of ``newfaces`` -# - set ``newfaces`` to point to the new faces - -# ALGORITHM: - -# To get all facets of ``faces[n_faces-1]``, we would have to: -# - Intersect the first ``n_faces-1`` faces of ``faces`` with the last face. -# - Add all the intersection of ``visited_all`` with the last face -# - Out of both the inclusion-maximal ones are of codimension 1, i.e. facets. - -# As we have visited all faces of ``visited_all``, we alter the algorithm -# to not revisit: -# Step 1: Intersect the first ``n_faces-1`` faces of ``faces`` with the last face. -# Step 2: Out of thosse the inclusion-maximal ones are some of the facets. -# At least we obtain all of those, that we have not already visited. -# Maybe, we get some more. -# Step 3: Only keep those that we have not already visited. -# We obtain exactly the facets of ``faces[n_faces-1]`` that we have -# not visited yet. - - cdef size_t count_atoms(uint64_t *A, size_t face_length) -# Return the number of atoms/vertices in A. -# This is the number of set bits in A. -# ``face_length`` is the length of A in terms of uint64_t. - - cdef size_t bit_rep_to_coatom_rep( - uint64_t *face, uint64_t **coatoms, size_t n_coatoms, - size_t face_length, size_t *output) -# Write the coatom-representation of face in output. Return length. -# ``face_length`` is the length of ``face`` and ``coatoms[i]`` -# in terms of uint64_t. -# ``n_coatoms`` length of ``coatoms``. diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx index f7af68746e5..26fb1da4257 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx @@ -72,9 +72,8 @@ from .face_iterator cimport FaceIterator cdef extern from "bit_vector_operations.cc": cdef void intersection(uint64_t *A, uint64_t *B, uint64_t *C, size_t face_length) -# Return ``A & ~B == 0``. -# A is not subset of B, iff there is a vertex in A, which is not in B. -# ``face_length`` is the length of A and B in terms of uint64_t. +# Set ``C = A & B``, i.e. C is the intersection of A and B. +# ``face_length`` is the length of A, B and C in terms of uint64_t. cdef size_t bit_rep_to_coatom_rep( uint64_t *face, uint64_t **coatoms, size_t n_coatoms, From 9e2dcc8af873970454449639cb7ee253289447c9 Mon Sep 17 00:00:00 2001 From: vipul79321 Date: Tue, 12 May 2020 22:31:55 +0530 Subject: [PATCH 154/301] unneccessary comments removed --- src/sage/graphs/graph.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py index 4189beb8eb7..655cb950789 100644 --- a/src/sage/graphs/graph.py +++ b/src/sage/graphs/graph.py @@ -5194,7 +5194,8 @@ def centrality_degree(self, v=None): else: return self.degree(v)/n_minus_one - # Eccentricity + ### Distances + @doc_index("Distances") def eccentricity(self, v=None, by_weight=False, algorithm=None, weight_function=None, check_weight=True, dist_dict=None, @@ -5420,7 +5421,6 @@ def weight_function(e): return v return [ecc[u] for u in v] - # Radius @doc_index("Distances") def radius(self, by_weight=False, algorithm=None, weight_function=None, check_weight=True): @@ -5484,7 +5484,6 @@ def radius(self, by_weight=False, algorithm=None, weight_function=None, check_weight=check_weight, algorithm=algorithm)) - # Diameter @doc_index("Distances") def diameter(self, by_weight=False, algorithm=None, weight_function=None, check_weight=True): @@ -5602,7 +5601,6 @@ def diameter(self, by_weight=False, algorithm=None, weight_function=None, check_weight=check_weight, algorithm=algorithm)) - # Center @doc_index("Distances") def center(self, by_weight=False, algorithm=None, weight_function=None, check_weight=True): @@ -5675,7 +5673,6 @@ def center(self, by_weight=False, algorithm=None, weight_function=None, return [] return [v for v in self if ecc[v] == r] - # Periphery @doc_index("Distances") def periphery(self, by_weight=False, algorithm=None, weight_function=None, check_weight=True): From f368e3288aa51a7cb0eac7b28145986eb4baaa8a Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Tue, 12 May 2020 20:02:54 -0700 Subject: [PATCH 155/301] trac 28000: rebase commits from Erik M. Bray : Trac #28000: Get rid of most __nonzero__ references and/or replace them with __bool__ Trac #28000: One Python 2-specific block that did not use six.PY2. Trac #28000: Remove sagelib dependency on six Removes all use of six within sagelib, as well as a few documentation examples and other bits of Python 2-only code around places where six was used. This keeps all currently known-passing tests on Python 3 passing, but is such a large patch that it's hard to guarantee there are no small mistakes. --- build/make/deps | 1 - src/doc/en/reference/conf_sub.py | 2 - src/doc/en/reference/misc/index.rst | 8 -- .../tutorial-comprehensions.rst | 7 +- src/sage/algebras/clifford_algebra.py | 54 ++------ src/sage/algebras/cluster_algebra.py | 2 - src/sage/algebras/commutative_dga.py | 9 +- .../finite_dimensional_algebra.py | 1 - src/sage/algebras/free_algebra.py | 11 +- src/sage/algebras/free_algebra_element.py | 3 +- .../algebras/free_algebra_quotient_element.py | 12 +- .../algebras/lie_algebras/free_lie_algebra.py | 21 ++- src/sage/algebras/lie_algebras/lie_algebra.py | 7 +- .../lie_algebras/structure_coefficients.py | 4 +- .../quantum_matrix_coordinate_algebra.py | 1 - .../algebras/quatalg/quaternion_algebra.py | 4 +- src/sage/algebras/schur_algebra.py | 1 - .../algebras/steenrod/steenrod_algebra.py | 1 - .../steenrod/steenrod_algebra_mult.py | 1 - src/sage/arith/functions.pyx | 1 - src/sage/arith/long.pxd | 5 +- src/sage/arith/misc.py | 5 +- src/sage/calculus/calculus.py | 91 +++++++------ src/sage/categories/additive_magmas.py | 6 - src/sage/categories/algebras_with_basis.py | 8 +- src/sage/categories/cartesian_product.py | 4 +- src/sage/categories/coxeter_groups.py | 1 - src/sage/categories/crystals.py | 1 - src/sage/categories/enumerated_sets.py | 2 - ...ite_dimensional_lie_algebras_with_basis.py | 5 +- .../categories/examples/finite_weyl_groups.py | 1 - .../filtered_hopf_algebras_with_basis.py | 4 +- .../categories/graded_modules_with_basis.py | 4 +- src/sage/categories/magmatic_algebras.py | 10 +- src/sage/categories/modules_with_basis.py | 20 ++- src/sage/categories/monoids.py | 1 - src/sage/categories/primer.py | 5 +- src/sage/categories/pushout.py | 10 +- src/sage/categories/sets_cat.py | 6 +- src/sage/coding/channel.py | 5 +- src/sage/coding/databases.py | 4 +- src/sage/coding/grs_code.py | 1 - src/sage/coding/information_set_decoder.py | 1 - src/sage/coding/linear_code.py | 7 +- src/sage/coding/reed_muller_code.py | 1 - src/sage/coding/source_coding/huffman.py | 4 +- src/sage/combinat/affine_permutation.py | 2 - src/sage/combinat/alternating_sign_matrix.py | 12 +- src/sage/combinat/baxter_permutations.py | 1 - .../combinat/binary_recurrence_sequences.py | 2 - src/sage/combinat/binary_tree.py | 5 +- src/sage/combinat/cartesian_product.py | 2 - .../cluster_algebra_quiver/cluster_seed.py | 50 ++++--- .../cluster_algebra_quiver/mutation_class.py | 1 - .../cluster_algebra_quiver/mutation_type.py | 7 +- .../combinat/cluster_algebra_quiver/quiver.py | 8 +- .../quiver_mutation_type.py | 7 +- src/sage/combinat/colored_permutations.py | 1 - src/sage/combinat/combinat.py | 11 +- src/sage/combinat/combination.py | 1 - src/sage/combinat/combinatorial_algebra.py | 10 +- src/sage/combinat/composition.py | 3 +- src/sage/combinat/composition_signed.py | 3 +- src/sage/combinat/composition_tableau.py | 5 +- src/sage/combinat/constellation.py | 5 +- .../combinat/crystals/kirillov_reshetikhin.py | 1 - .../combinat/crystals/monomial_crystals.py | 32 +++-- .../combinat/cyclic_sieving_phenomenon.py | 1 - src/sage/combinat/derangements.py | 1 - src/sage/combinat/designs/bibd.py | 2 - src/sage/combinat/designs/block_design.py | 7 +- src/sage/combinat/designs/covering_design.py | 2 +- src/sage/combinat/designs/database.py | 6 +- .../combinat/designs/difference_family.py | 3 - src/sage/combinat/designs/ext_rep.py | 15 +-- .../designs/group_divisible_designs.py | 1 - .../combinat/designs/incidence_structures.py | 15 +-- src/sage/combinat/designs/latin_squares.py | 4 +- .../combinat/designs/orthogonal_arrays.py | 12 +- .../orthogonal_arrays_build_recursive.py | 2 - src/sage/combinat/designs/resolvable_bibd.py | 1 - .../designs/steiner_quadruple_systems.py | 1 - src/sage/combinat/designs/twographs.py | 1 - src/sage/combinat/diagram_algebras.py | 1 - src/sage/combinat/dyck_word.py | 1 - src/sage/combinat/e_one_star.py | 1 - src/sage/combinat/finite_state_machine.py | 40 +++--- src/sage/combinat/free_dendriform_algebra.py | 8 +- src/sage/combinat/free_module.py | 11 +- src/sage/combinat/free_prelie_algebra.py | 3 +- src/sage/combinat/fully_packed_loop.py | 5 +- src/sage/combinat/gelfand_tsetlin_patterns.py | 6 +- src/sage/combinat/gray_codes.py | 1 - src/sage/combinat/growth.py | 5 +- src/sage/combinat/integer_list_old.py | 9 +- src/sage/combinat/integer_lists/lists.py | 7 +- src/sage/combinat/integer_vector.py | 7 +- src/sage/combinat/interval_posets.py | 6 +- src/sage/combinat/k_tableau.py | 10 +- src/sage/combinat/lr_tableau.py | 3 +- src/sage/combinat/matrices/hadamard_matrix.py | 3 +- src/sage/combinat/matrices/latin.py | 1 - src/sage/combinat/misc.py | 1 - .../multiset_partition_into_sets_ordered.py | 22 ++- src/sage/combinat/ncsym/dual.py | 1 - src/sage/combinat/ncsym/ncsym.py | 1 - src/sage/combinat/necklace.py | 1 - src/sage/combinat/ordered_tree.py | 10 +- src/sage/combinat/output.py | 2 - src/sage/combinat/parallelogram_polyomino.py | 6 +- src/sage/combinat/parking_functions.py | 1 - src/sage/combinat/partition.py | 4 +- src/sage/combinat/partition_algebra.py | 1 - src/sage/combinat/partition_tuple.py | 2 - src/sage/combinat/perfect_matching.py | 1 - src/sage/combinat/permutation.py | 3 - src/sage/combinat/plane_partition.py | 6 +- src/sage/combinat/posets/hasse_diagram.py | 2 - src/sage/combinat/posets/lattices.py | 4 +- src/sage/combinat/posets/linear_extensions.py | 6 +- src/sage/combinat/posets/poset_examples.py | 6 +- src/sage/combinat/posets/posets.py | 13 +- src/sage/combinat/ranker.py | 1 - .../rigged_configurations/kleber_tree.py | 1 - .../tensor_product_kr_tableaux_element.py | 4 +- .../combinat/root_system/ambient_space.py | 4 +- .../combinat/root_system/cartan_matrix.py | 6 +- src/sage/combinat/root_system/cartan_type.py | 24 ++-- .../combinat/root_system/coxeter_matrix.py | 4 +- src/sage/combinat/root_system/coxeter_type.py | 4 +- .../combinat/root_system/pieri_factors.py | 5 +- src/sage/combinat/root_system/plot.py | 5 +- .../root_system/reflection_group_complex.py | 2 - .../root_system/reflection_group_real.py | 4 +- .../root_lattice_realization_algebras.py | 5 +- .../root_system/root_lattice_realizations.py | 3 +- src/sage/combinat/root_system/type_E.py | 2 - src/sage/combinat/root_system/type_F.py | 2 - src/sage/combinat/root_system/type_folded.py | 4 +- src/sage/combinat/root_system/type_relabel.py | 1 - src/sage/combinat/root_system/type_super_A.py | 6 +- src/sage/combinat/rooted_tree.py | 5 +- src/sage/combinat/set_partition.py | 10 +- src/sage/combinat/set_partition_ordered.py | 5 +- src/sage/combinat/sf/k_dual.py | 3 +- src/sage/combinat/sf/schur.py | 1 - src/sage/combinat/sf/sfa.py | 18 ++- src/sage/combinat/shifted_primed_tableau.py | 5 +- src/sage/combinat/similarity_class_type.py | 6 +- src/sage/combinat/skew_partition.py | 6 +- src/sage/combinat/skew_tableau.py | 6 +- src/sage/combinat/sloane_functions.py | 4 +- .../species/characteristic_species.py | 1 - .../combinat/species/permutation_species.py | 1 - src/sage/combinat/species/series.py | 3 +- src/sage/combinat/species/set_species.py | 1 - src/sage/combinat/species/subset_species.py | 1 - src/sage/combinat/subset.py | 1 - src/sage/combinat/subword.py | 1 - src/sage/combinat/subword_complex.py | 1 - src/sage/combinat/superpartition.py | 5 +- src/sage/combinat/symmetric_group_algebra.py | 10 +- .../symmetric_group_representations.py | 4 +- src/sage/combinat/tableau.py | 7 +- src/sage/combinat/tableau_residues.py | 5 +- src/sage/combinat/tableau_tuple.py | 5 +- src/sage/combinat/tiling.py | 12 +- src/sage/combinat/words/abstract_word.py | 3 - src/sage/combinat/words/alphabet.py | 6 +- src/sage/combinat/words/finite_word.py | 8 +- src/sage/combinat/words/lyndon_word.py | 3 +- src/sage/combinat/words/morphism.py | 5 +- src/sage/combinat/words/suffix_trees.py | 22 ++- src/sage/combinat/words/word_generators.py | 2 - .../combinat/words/word_infinite_datatypes.py | 1 - src/sage/combinat/yang_baxter_graph.py | 1 - src/sage/cpython/string.pxd | 12 +- src/sage/crypto/block_cipher/des.py | 7 +- src/sage/crypto/block_cipher/miniaes.py | 1 - src/sage/crypto/block_cipher/present.py | 7 +- src/sage/crypto/block_cipher/sdes.py | 1 - src/sage/crypto/classical.py | 1 - src/sage/crypto/classical_cipher.py | 1 - src/sage/crypto/lwe.py | 1 - src/sage/crypto/mq/rijndael_gf.py | 25 ++-- src/sage/crypto/mq/sr.py | 4 +- src/sage/crypto/public_key/blum_goldwasser.py | 1 - src/sage/crypto/sbox.py | 4 +- src/sage/crypto/stream.py | 1 - src/sage/crypto/util.py | 1 - src/sage/databases/conway.py | 6 +- src/sage/databases/findstat.py | 35 +++-- src/sage/databases/oeis.py | 4 +- src/sage/databases/sloane.py | 3 +- src/sage/databases/stein_watkins.py | 1 - src/sage/docs/conf.py | 4 +- src/sage/docs/instancedoc.pyx | 5 +- src/sage/doctest/control.py | 9 +- src/sage/doctest/external.py | 19 +-- src/sage/doctest/forker.py | 72 ++++------ src/sage/doctest/parsing.py | 39 +++--- src/sage/doctest/util.py | 3 +- .../endPN_automorphism_group.py | 1 - .../arithmetic_dynamics/generic_ds.py | 11 +- src/sage/dynamics/finite_dynamical_system.py | 4 +- src/sage/features/__init__.py | 4 +- src/sage/finance/stock.py | 5 +- src/sage/functions/hypergeometric.py | 1 - src/sage/functions/log.py | 1 - src/sage/functions/min_max.py | 2 +- src/sage/functions/orthogonal_polys.py | 5 +- src/sage/functions/other.py | 10 +- src/sage/functions/piecewise.py | 4 +- src/sage/games/sudoku.py | 4 +- src/sage/geometry/cone.py | 1 - src/sage/geometry/lattice_polytope.py | 12 +- src/sage/geometry/linear_expression.py | 1 - src/sage/geometry/point_collection.pyx | 4 +- src/sage/geometry/polyhedron/backend_cdd.py | 9 +- .../geometry/polyhedron/backend_normaliz.py | 3 +- src/sage/geometry/polyhedron/base.py | 3 +- src/sage/geometry/polyhedron/palp_database.py | 21 +-- src/sage/geometry/toric_plotter.py | 7 +- src/sage/geometry/triangulation/element.py | 6 +- src/sage/graphs/bipartite_graph.py | 7 +- src/sage/graphs/digraph_generators.py | 9 +- src/sage/graphs/generators/basic.py | 1 - src/sage/graphs/generators/chessboard.py | 1 - .../graphs/generators/classical_geometries.py | 2 - src/sage/graphs/generators/families.py | 6 +- src/sage/graphs/generators/intersection.py | 2 - src/sage/graphs/generators/random.py | 2 +- src/sage/graphs/generators/smallgraphs.py | 20 ++- src/sage/graphs/generic_graph.py | 39 +++--- src/sage/graphs/graph.py | 24 ++-- src/sage/graphs/graph_coloring.pyx | 3 +- src/sage/graphs/graph_generators.py | 60 ++------- src/sage/graphs/graph_input.py | 10 +- src/sage/graphs/graph_plot.py | 24 ++-- src/sage/graphs/isgci.py | 12 +- src/sage/graphs/line_graph.pyx | 1 + src/sage/graphs/tutte_polynomial.py | 1 + src/sage/groups/abelian_gps/abelian_group.py | 6 +- .../additive_abelian_group.py | 4 +- .../additive_abelian_wrapper.py | 1 - src/sage/groups/artin.py | 3 +- src/sage/groups/braid.py | 3 +- src/sage/groups/free_group.py | 3 +- src/sage/groups/generic.py | 2 - src/sage/groups/indexed_free_group.py | 9 +- src/sage/groups/matrix_gps/coxeter_group.py | 1 - src/sage/groups/perm_gps/cubegroup.py | 1 - src/sage/groups/perm_gps/permgroup.py | 6 +- src/sage/groups/perm_gps/permgroup_named.py | 1 - .../groups/perm_gps/symgp_conjugacy_class.py | 3 +- src/sage/groups/raag.py | 3 +- .../homology/algebraic_topological_model.py | 9 +- src/sage/homology/cell_complex.py | 1 - src/sage/homology/chain_complex.py | 23 ++-- src/sage/homology/cubical_complex.py | 1 - src/sage/homology/delta_complex.py | 4 +- src/sage/homology/examples.py | 3 +- src/sage/homology/homology_group.py | 3 +- src/sage/homology/koszul_complex.py | 1 - src/sage/homology/matrix_utils.py | 1 - src/sage/homology/simplicial_complex.py | 4 +- src/sage/homology/simplicial_set.py | 1 - src/sage/homology/simplicial_set_morphism.py | 1 - src/sage/interacts/debugger.py | 1 - src/sage/interfaces/ecm.py | 21 +-- src/sage/interfaces/expect.py | 14 +- src/sage/interfaces/four_ti_2.py | 3 +- src/sage/interfaces/gap.py | 9 +- src/sage/interfaces/gfan.py | 9 +- src/sage/interfaces/interface.py | 11 +- src/sage/interfaces/latte.py | 4 +- src/sage/interfaces/macaulay2.py | 3 +- src/sage/interfaces/magma.py | 3 +- src/sage/interfaces/magma_free.py | 5 +- src/sage/interfaces/maxima.py | 3 +- src/sage/interfaces/maxima_abstract.py | 7 +- src/sage/interfaces/maxima_lib.py | 16 +-- src/sage/interfaces/polymake.py | 9 +- src/sage/interfaces/povray.py | 3 +- src/sage/interfaces/qepcad.py | 7 +- src/sage/interfaces/qsieve.py | 9 +- src/sage/interfaces/r.py | 12 +- src/sage/interfaces/sage0.py | 15 +-- src/sage/interfaces/singular.py | 11 +- src/sage/knots/knot.py | 5 +- src/sage/knots/link.py | 2 - src/sage/libs/coxeter3/coxeter_group.py | 3 +- src/sage/libs/gap/assigned_names.py | 7 +- src/sage/libs/symmetrica/symmetrica.pxi | 2 +- src/sage/manifolds/differentiable/metric.py | 1 - .../manifolds/differentiable/tensorfield.py | 3 +- src/sage/manifolds/scalarfield.py | 1 + src/sage/matrix/constructor.pyx | 1 - src/sage/matrix/matrix_integer_dense_hnf.py | 1 - .../matrix/matrix_integer_dense_saturation.py | 1 - src/sage/matrix/matrix_misc.py | 10 +- src/sage/matrix/matrix_space.py | 6 +- src/sage/matrix/operation_table.py | 17 ++- src/sage/matrix/special.py | 12 +- src/sage/matroids/catalog.py | 5 +- src/sage/matroids/utilities.py | 13 +- src/sage/media/wav.py | 1 - src/sage/misc/bindable_class.py | 5 +- src/sage/misc/classcall_metaclass.pyx | 50 ++----- src/sage/misc/converting_dict.py | 3 +- src/sage/misc/cython.py | 8 +- src/sage/misc/decorators.py | 3 +- src/sage/misc/dev_tools.py | 10 +- src/sage/misc/explain_pickle.py | 16 +-- src/sage/misc/fpickle.pyx | 17 +-- src/sage/misc/functional.py | 14 +- src/sage/misc/gperftools.py | 3 +- src/sage/misc/inline_fortran.py | 48 ++----- src/sage/misc/latex.py | 28 ++-- src/sage/misc/lazy_import.pyx | 5 +- src/sage/misc/lazy_list.pyx | 1 - src/sage/misc/mathml.py | 19 +-- src/sage/misc/messaging.py | 8 +- src/sage/misc/misc.py | 4 +- src/sage/misc/mrange.py | 4 +- src/sage/misc/nested_class.pyx | 5 +- src/sage/misc/nested_class_test.py | 16 +-- src/sage/misc/persist.pyx | 3 +- src/sage/misc/prandom.py | 1 - src/sage/misc/random_testing.py | 1 - src/sage/misc/remote_file.py | 5 +- src/sage/misc/rest_index_of_methods.py | 4 +- src/sage/misc/sage_eval.py | 3 +- src/sage/misc/sage_input.py | 35 +---- src/sage/misc/sage_ostools.pyx | 8 +- src/sage/misc/sage_timeit.py | 10 +- src/sage/misc/sagedoc.py | 10 +- src/sage/misc/sageinspect.py | 127 +++++++----------- src/sage/misc/session.pyx | 2 +- src/sage/misc/six.py | 100 -------------- src/sage/misc/sphinxify.py | 4 +- src/sage/misc/superseded.py | 5 +- src/sage/misc/table.py | 6 +- src/sage/misc/temporary_file.py | 3 +- src/sage/misc/test_class_pickling.py | 9 +- src/sage/modular/abvar/constructor.py | 3 +- .../modular/arithgroup/arithgroup_generic.py | 1 - .../modular/arithgroup/arithgroup_perm.py | 1 - src/sage/modular/arithgroup/congroup_gamma.py | 1 - .../modular/arithgroup/congroup_gamma0.py | 5 +- .../modular/arithgroup/congroup_gammaH.py | 1 - src/sage/modular/arithgroup/tests.py | 1 - .../modular/btquotients/pautomorphicform.py | 2 - src/sage/modular/cusps.py | 5 +- src/sage/modular/cusps_nf.py | 7 +- src/sage/modular/dims.py | 11 +- src/sage/modular/dirichlet.py | 1 - src/sage/modular/etaproducts.py | 4 - src/sage/modular/hecke/algebra.py | 1 - src/sage/modular/hecke/hecke_operator.py | 3 +- src/sage/modular/local_comp/smoothchar.py | 1 - src/sage/modular/local_comp/type_space.py | 1 - .../modular/modform/cuspidal_submodule.py | 1 - src/sage/modular/modform/eis_series.py | 3 +- .../modular/modform/eisenstein_submodule.py | 1 - src/sage/modular/modform/element.py | 1 - src/sage/modular/modform/find_generators.py | 4 +- src/sage/modular/modform/numerical.py | 3 +- src/sage/modular/modform/theta.py | 1 - src/sage/modular/modform/vm_basis.py | 1 - .../graded_ring_element.py | 7 +- src/sage/modular/modsym/ambient.py | 1 - src/sage/modular/modsym/boundary.py | 1 - src/sage/modular/modsym/g1list.py | 1 - src/sage/modular/modsym/manin_symbol_list.py | 1 - src/sage/modular/modsym/modular_symbols.py | 1 - src/sage/modular/modsym/relation_matrix.py | 1 - src/sage/modular/modsym/space.py | 1 - src/sage/modular/modsym/tests.py | 1 - src/sage/modular/overconvergent/genus0.py | 4 +- .../modular/overconvergent/hecke_series.py | 6 +- .../modular/overconvergent/weightspace.py | 5 +- .../modular/pollack_stevens/distributions.py | 1 - .../modular/pollack_stevens/fund_domain.py | 3 +- src/sage/modular/pollack_stevens/manin_map.py | 14 +- src/sage/modules/filtered_vector_space.py | 10 +- src/sage/modules/free_module.py | 3 +- .../modules/multi_filtered_vector_space.py | 3 +- src/sage/modules/tensor_operations.py | 1 - src/sage/modules/with_basis/morphism.py | 8 +- src/sage/monoids/free_abelian_monoid.py | 3 +- .../monoids/free_abelian_monoid_element.py | 5 +- src/sage/monoids/free_monoid.py | 5 +- src/sage/monoids/free_monoid_element.py | 9 +- src/sage/monoids/indexed_free_monoid.py | 9 +- src/sage/monoids/string_monoid_element.py | 5 +- src/sage/numerical/optimize.py | 21 ++- src/sage/parallel/decorate.py | 3 +- src/sage/parallel/map_reduce.py | 20 +-- src/sage/plot/animate.py | 10 +- src/sage/plot/colors.py | 5 +- src/sage/plot/graphics.py | 4 +- src/sage/plot/matrix_plot.py | 3 +- src/sage/plot/plot.py | 6 +- src/sage/plot/plot3d/base.pyx | 2 +- src/sage/plot/plot3d/list_plot3d.py | 1 - src/sage/plot/plot3d/plot3d.py | 4 +- src/sage/plot/polygon.py | 1 - src/sage/quadratic_forms/quadratic_form.py | 1 - .../quadratic_form__local_field_invariants.py | 1 - .../quadratic_form__ternary_Tornaria.py | 1 - src/sage/quivers/algebra.py | 3 +- src/sage/quivers/path_semigroup.py | 7 +- src/sage/repl/attach.py | 3 +- src/sage/repl/display/fancy_repr.py | 2 +- src/sage/repl/display/formatter.py | 11 +- src/sage/repl/display/pretty_print.py | 12 +- src/sage/repl/display/util.py | 3 +- .../repl/ipython_kernel/widgets_sagenb.py | 13 +- src/sage/repl/preparse.py | 11 +- src/sage/repl/rich_output/backend_base.py | 4 +- src/sage/repl/rich_output/backend_doctest.py | 7 +- src/sage/repl/rich_output/buffer.py | 6 +- .../rings/algebraic_closure_finite_field.py | 3 +- src/sage/rings/asymptotic/asymptotic_ring.py | 6 +- ...otics_multivariate_generating_functions.py | 1 - src/sage/rings/asymptotic/misc.py | 1 - src/sage/rings/big_oh.py | 3 +- src/sage/rings/cfinite_sequence.py | 8 +- src/sage/rings/complex_interval_field.py | 8 +- src/sage/rings/continued_fraction.py | 1 - .../rings/finite_rings/conway_polynomials.py | 8 +- src/sage/rings/fraction_field.py | 6 +- src/sage/rings/infinity.py | 3 +- .../rings/multi_power_series_ring_element.py | 9 +- src/sage/rings/number_field/S_unit_solver.py | 1 - src/sage/rings/number_field/bdd_height.py | 7 +- src/sage/rings/number_field/class_group.py | 1 - src/sage/rings/number_field/number_field.py | 6 +- .../rings/number_field/number_field_ideal.py | 1 - .../rings/number_field/number_field_rel.py | 3 +- src/sage/rings/number_field/order.py | 4 +- src/sage/rings/padics/generic_nodes.py | 7 +- src/sage/rings/padics/misc.py | 6 +- src/sage/rings/polynomial/flatten.py | 13 +- .../polynomial/infinite_polynomial_element.py | 1 - .../polynomial/infinite_polynomial_ring.py | 12 +- .../polynomial/laurent_polynomial_ring.py | 3 +- .../polynomial/multi_polynomial_element.py | 16 +-- .../polynomial/multi_polynomial_ideal.py | 8 +- .../rings/polynomial/multi_polynomial_ring.py | 1 - .../polynomial/multi_polynomial_sequence.py | 3 +- src/sage/rings/polynomial/omega.py | 11 +- .../polynomial/padics/polynomial_padic.py | 2 - .../polynomial_padic_capped_relative_dense.py | 14 +- .../rings/polynomial/polynomial_element.pyx | 7 - .../polynomial/polynomial_element_generic.py | 36 +++-- .../polynomial/polynomial_quotient_ring.py | 8 +- .../polynomial_quotient_ring_element.py | 1 - src/sage/rings/polynomial/polynomial_ring.py | 2 - src/sage/rings/polynomial/symmetric_ideal.py | 1 - src/sage/rings/polynomial/toy_variety.py | 2 +- src/sage/rings/power_series_ring.py | 5 +- src/sage/rings/qqbar.py | 8 +- src/sage/rings/qqbar_decorators.py | 2 - src/sage/rings/quotient_ring.py | 1 - src/sage/rings/rational_field.py | 10 +- src/sage/rings/universal_cyclotomic_field.py | 1 - src/sage/sandpiles/sandpile.py | 1 - src/sage/sat/boolean_polynomials.py | 11 +- src/sage/sat/converters/polybori.py | 6 +- src/sage/sat/solvers/satsolver.pyx | 6 +- .../schemes/affine/affine_rational_point.py | 1 - src/sage/schemes/affine/affine_space.py | 3 +- .../schemes/elliptic_curves/constructor.py | 5 +- .../elliptic_curves/ell_curve_isogeny.py | 1 - .../elliptic_curves/ell_finite_field.py | 2 - .../schemes/elliptic_curves/ell_generic.py | 3 +- .../schemes/elliptic_curves/ell_local_data.py | 3 +- .../elliptic_curves/ell_number_field.py | 6 +- .../elliptic_curves/ell_rational_field.py | 10 +- src/sage/schemes/elliptic_curves/ell_wp.py | 1 - .../elliptic_curves/gal_reps_number_field.py | 1 - src/sage/schemes/elliptic_curves/heegner.py | 7 - src/sage/schemes/elliptic_curves/height.py | 1 - .../schemes/elliptic_curves/isogeny_class.py | 6 +- .../schemes/elliptic_curves/lseries_ell.py | 7 +- .../hyperelliptic_finite_field.py | 1 - .../hyperelliptic_padic_field.py | 1 - .../hyperelliptic_curves/jacobian_homset.py | 3 +- src/sage/schemes/product_projective/space.py | 5 +- .../schemes/projective/projective_space.py | 4 +- .../riemann_surfaces/riemann_surface.py | 5 +- src/sage/schemes/toric/divisor.py | 15 +-- src/sage/schemes/toric/fano_variety.py | 7 +- src/sage/schemes/toric/ideal.py | 7 +- src/sage/schemes/toric/library.py | 3 +- src/sage/schemes/toric/morphism.py | 5 +- src/sage/schemes/toric/variety.py | 3 +- src/sage/schemes/toric/weierstrass.py | 4 +- .../schemes/toric/weierstrass_covering.py | 13 +- src/sage/sets/family.py | 2 - src/sage/sets/set.py | 14 +- src/sage/sets/set_from_iterator.py | 2 - src/sage/stats/basic_stats.py | 9 +- .../discrete_gaussian_integer.pyx | 9 -- .../discrete_gaussian_lattice.py | 1 - src/sage/structure/dynamic_class.py | 7 +- src/sage/structure/factorization.py | 12 +- src/sage/structure/global_options.py | 17 ++- src/sage/structure/graphics_file.py | 21 ++- src/sage/structure/sequence.py | 1 - src/sage/structure/unique_representation.py | 3 +- src/sage/symbolic/benchmark.py | 3 - src/sage/symbolic/function_factory.py | 3 +- src/sage/symbolic/integration/external.py | 4 +- src/sage/symbolic/relation.py | 7 +- src/sage/symbolic/units.py | 12 +- src/sage/tensor/differential_form_element.py | 8 +- src/sage/tensor/differential_forms.py | 1 - src/sage/tensor/modules/comp.py | 7 +- src/sage/tensor/modules/format_utilities.py | 5 +- ...ticle_heuberger_krenn_kropf_fsm-in-sage.py | 2 +- src/sage/tests/arxiv_0812_2725.py | 1 - src/sage/tests/benchmark.py | 1 - src/sage/tests/cmdline.py | 9 +- src/sage/typeset/character_art_factory.py | 20 ++- src/sage/typeset/unicode_art.py | 11 +- .../autogen/interpreters/generator.py | 11 +- .../autogen/interpreters/instructions.py | 5 +- src/sage_setup/autogen/interpreters/memory.py | 4 +- src/sage_setup/clean.py | 9 +- src/sage_setup/docbuild/__init__.py | 13 +- src/sage_setup/docbuild/ext/multidocs.py | 24 ++-- src/sage_setup/docbuild/ext/sage_autodoc.py | 21 ++- src/sage_setup/find.py | 51 +++---- 536 files changed, 1297 insertions(+), 2458 deletions(-) delete mode 100644 src/sage/misc/six.py diff --git a/build/make/deps b/build/make/deps index 8d649f576c0..9455d8d625e 100644 --- a/build/make/deps +++ b/build/make/deps @@ -193,7 +193,6 @@ sagelib-build-deps: \ $(inst_sage_brial) \ $(inst_sage_conf) \ $(inst_singular) \ - $(inst_six) \ $(inst_symmetrica) \ $(inst_zn_poly) \ $(PCFILES) diff --git a/src/doc/en/reference/conf_sub.py b/src/doc/en/reference/conf_sub.py index fae7bf63b35..9ca45fad1a4 100644 --- a/src/doc/en/reference/conf_sub.py +++ b/src/doc/en/reference/conf_sub.py @@ -16,8 +16,6 @@ from sage.docs.conf import release, exclude_patterns from sage.docs.conf import * -from six.moves import range - ref_src = os.path.join(SAGE_DOC_SRC, 'en', 'reference') ref_out = os.path.join(SAGE_DOC, 'html', 'en', 'reference') diff --git a/src/doc/en/reference/misc/index.rst b/src/doc/en/reference/misc/index.rst index 2c57c6ba62d..9e5b3f1f337 100644 --- a/src/doc/en/reference/misc/index.rst +++ b/src/doc/en/reference/misc/index.rst @@ -16,14 +16,6 @@ General Infrastructure Programming Utilities --------------------- -Python 2 and 3 Compatibility -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. toctree:: - :maxdepth: 1 - - sage/misc/six - Special Base Classes, Decorators, etc. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/doc/en/thematic_tutorials/tutorial-comprehensions.rst b/src/doc/en/thematic_tutorials/tutorial-comprehensions.rst index f2168ba287c..d7dc8a9b4f0 100644 --- a/src/doc/en/thematic_tutorials/tutorial-comprehensions.rst +++ b/src/doc/en/thematic_tutorials/tutorial-comprehensions.rst @@ -236,15 +236,12 @@ not Sage integers. The behaviour of the functions :func:`map` and :func:`filter` has changed between Python 2 and Python 3. In Python 3, they return an -iterator. If you want to use this new behaviour in Python 2, and keep -your code compatible with Python3, you can use the compatibility -library ``six`` as follows:: +iterator. If you want to return a list like in Python 2 you need to explicitly +wrap them in :func:`list`:: - sage: from six.moves import map sage: list(map(lambda z: z.cycle_type(), Permutations(3))) [[1, 1, 1], [2, 1], [2, 1], [3], [3], [2, 1]] - sage: from six.moves import filter sage: list(filter(lambda z: z.has_pattern([1,2]), Permutations(3))) [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2]] diff --git a/src/sage/algebras/clifford_algebra.py b/src/sage/algebras/clifford_algebra.py index e86d1672ba9..dfb3ff479b6 100644 --- a/src/sage/algebras/clifford_algebra.py +++ b/src/sage/algebras/clifford_algebra.py @@ -16,9 +16,7 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six import iteritems -from sage.misc.six import with_metaclass from sage.misc.cachefunc import cached_method from sage.structure.unique_representation import UniqueRepresentation from copy import copy @@ -124,7 +122,7 @@ def _mul_(self, other): # the dictionary describing the element # ``e[i]`` * (the element described by the dictionary ``cur``) # (where ``e[i]`` is the ``i``-th standard basis vector). - for mr,cr in iteritems(cur): + for mr,cr in cur.items(): # Commute the factor as necessary until we are in order pos = 0 for j in mr: @@ -160,7 +158,7 @@ def _mul_(self, other): cur = next # Add the distributed terms to the total - for index,coeff in iteritems(cur): + for index,coeff in cur.items(): d[index] = d.get(index, zero) + cl * coeff if d[index] == zero: del d[index] @@ -734,8 +732,8 @@ def _element_constructor_(self, x): if x in self.free_module(): R = self.base_ring() if x.parent().base_ring() is R: - return self.element_class(self, {(i,): c for i,c in iteritems(x)}) - return self.element_class(self, {(i,): R(c) for i,c in iteritems(x) if R(c) != R.zero()}) + return self.element_class(self, {(i,): c for i,c in x.items()}) + return self.element_class(self, {(i,): R(c) for i,c in x.items() if R(c) != R.zero()}) if (isinstance(x, CliffordAlgebraElement) and self.has_coerce_map_from(x.parent())): @@ -1253,24 +1251,10 @@ def center_basis(self): for m,c in (Bi*Bj - Bj*Bi): d[(a, K.index(m)+k*b)] = c m = Matrix(R, d, nrows=k, ncols=k*k, sparse=True) - from_vector = lambda x: self.sum_of_terms(((K[i], c) for i,c in iteritems(x)), + from_vector = lambda x: self.sum_of_terms(((K[i], c) for i,c in x.items()), distinct=True) return tuple(map( from_vector, m.kernel().basis() )) - # Dense version - # R = self.base_ring() - # B = self.basis() - # K = list(B.keys()) - # eqns = [[] for dummy in range(k)] - # for a,i in enumerate(K): - # for b,j in enumerate(K): - # v = B[i]*B[j] - B[j]*B[i] - # eqns[a].extend([v[k] for k in K]) - # m = Matrix(R, eqns) - # from_vector = lambda x: self.sum_of_terms(((K[i], c) for i,c in iteritems(x)), - # distinct=True) - # return tuple(map( from_vector, m.kernel().basis() )) - # Same as center except for superalgebras @cached_method def supercenter_basis(self): @@ -1350,24 +1334,10 @@ def supercenter_basis(self): for m,c in supercommutator: d[(a, K.index(m)+k*b)] = c m = Matrix(R, d, nrows=k, ncols=k*k, sparse=True) - from_vector = lambda x: self.sum_of_terms(((K[i], c) for i,c in iteritems(x)), + from_vector = lambda x: self.sum_of_terms(((K[i], c) for i,c in x.items()), distinct=True) return tuple(map( from_vector, m.kernel().basis() )) - # Dense version - # R = self.base_ring() - # B = self.basis() - # K = list(B.keys()) - # eqns = [[] for dummy in range(k)] - # for a,i in enumerate(K): - # for b,j in enumerate(K): - # v = B[i].supercommutator(B[j]) # or better an if-loop as above - # eqns[a].extend([v[k] for k in K]) - # m = Matrix(R, eqns) - # from_vector = lambda x: self.sum_of_terms(((K[i], c) for i,c in iteritems(x)), - # distinct=True) - # return tuple(map( from_vector, m.kernel().basis() )) - Element = CliffordAlgebraElement class ExteriorAlgebra(CliffordAlgebra): @@ -2252,10 +2222,8 @@ def scalar(self, other): ##################################################################### ## Differentials -class ExteriorAlgebraDifferential(with_metaclass( - InheritComparisonClasscallMetaclass, - ModuleMorphismByLinearity, UniqueRepresentation - )): +class ExteriorAlgebraDifferential(ModuleMorphismByLinearity, + UniqueRepresentation, metaclass=InheritComparisonClasscallMetaclass): r""" Internal class to store the data of a boundary or coboundary of an exterior algebra `\Lambda(L)` defined by the structure @@ -2294,13 +2262,13 @@ def __classcall__(cls, E, s_coeff): """ d = {} - for k,v in iteritems(dict(s_coeff)): + for k, v in dict(s_coeff).items(): if not v: # Strip terms with 0 continue if isinstance(v, dict): R = E.base_ring() - v = E._from_dict({(i,): R(c) for i,c in iteritems(v)}) + v = E._from_dict({(i,): R(c) for i,c in v.items()}) else: # Make sure v is in ``E`` v = E(v) @@ -2738,7 +2706,7 @@ def __init__(self, E, s_coeff): self._cos_coeff = {} zero = E.zero() B = E.basis() - for k, v in iteritems(dict(s_coeff)): + for k, v in dict(s_coeff).items(): k = B[k] for m,c in v: self._cos_coeff[m] = self._cos_coeff.get(m, zero) + c * k diff --git a/src/sage/algebras/cluster_algebra.py b/src/sage/algebras/cluster_algebra.py index 4054bd5d9a5..e3c7b1ea99d 100644 --- a/src/sage/algebras/cluster_algebra.py +++ b/src/sage/algebras/cluster_algebra.py @@ -353,8 +353,6 @@ # **************************************************************************** from __future__ import absolute_import -from six.moves import range, map - from copy import copy from sage.categories.homset import Hom diff --git a/src/sage/algebras/commutative_dga.py b/src/sage/algebras/commutative_dga.py index 24d0c041a8d..7780d8c563e 100644 --- a/src/sage/algebras/commutative_dga.py +++ b/src/sage/algebras/commutative_dga.py @@ -72,9 +72,7 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six import string_types -from sage.misc.six import with_metaclass from sage.structure.unique_representation import UniqueRepresentation, CachedRepresentation from sage.structure.sage_object import SageObject from sage.misc.cachefunc import cached_method @@ -139,8 +137,9 @@ def sorting_keys(element): V = CR.V() return list(CR(V(x.basis_coefficients()))) -class Differential(with_metaclass( - InheritComparisonClasscallMetaclass, UniqueRepresentation, Morphism)): + +class Differential(UniqueRepresentation, Morphism, + metaclass=InheritComparisonClasscallMetaclass): r""" Differential of a commutative graded algebra. @@ -942,7 +941,7 @@ def __classcall__(cls, base, names=None, degrees=None, R=None, I=None): else: n = len(degrees) names = tuple('x{}'.format(i) for i in range(n)) - elif isinstance(names, string_types): + elif isinstance(names, str): names = tuple(names.split(',')) n = len(names) else: diff --git a/src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py b/src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py index d55fb21cf3c..a83abe8514e 100644 --- a/src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py +++ b/src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py @@ -12,7 +12,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six.moves import range from .finite_dimensional_algebra_element import FiniteDimensionalAlgebraElement from .finite_dimensional_algebra_ideal import FiniteDimensionalAlgebraIdeal diff --git a/src/sage/algebras/free_algebra.py b/src/sage/algebras/free_algebra.py index 2ba6b721c6f..a16cb9b3d29 100644 --- a/src/sage/algebras/free_algebra.py +++ b/src/sage/algebras/free_algebra.py @@ -132,9 +132,6 @@ #***************************************************************************** from __future__ import absolute_import -from six.moves import range -from six import integer_types -import six from sage.categories.rings import Rings @@ -289,7 +286,7 @@ def create_key(self, base_ring, arg1=None, arg2=None, return tuple(degrees), R # normalise the generator names from sage.all import Integer - if isinstance(arg1, (Integer,) + integer_types): + if isinstance(arg1, (Integer, int)): arg1, arg2 = arg2, arg1 if not names is None: arg1 = names @@ -591,9 +588,9 @@ def exp_to_monomial(T): if T[i]: out.append((i%ngens,T[i])) return M(out) - return self.element_class(self, {exp_to_monomial(T):c for T,c in six.iteritems(x.letterplace_polynomial().dict())}) + return self.element_class(self, {exp_to_monomial(T):c for T,c in x.letterplace_polynomial().dict().items()}) # ok, not a free algebra element (or should not be viewed as one). - if isinstance(x, six.string_types): + if isinstance(x, str): from sage.all import sage_eval G = self.gens() d = {str(v): G[i] for i,v in enumerate(self.variable_names())} @@ -850,7 +847,7 @@ def g_algebra(self, relations, names=None, order='degrevlex', check=True): for i in range(n): for j in range(i + 1, n): cmat[i,j] = 1 - for (to_commute,commuted) in six.iteritems(relations): + for (to_commute,commuted) in relations.items(): #This is dirty, coercion is broken assert isinstance(to_commute, FreeAlgebraElement), to_commute.__class__ assert isinstance(commuted, FreeAlgebraElement), commuted diff --git a/src/sage/algebras/free_algebra_element.py b/src/sage/algebras/free_algebra_element.py index b7ee988da71..456732d6ced 100644 --- a/src/sage/algebras/free_algebra_element.py +++ b/src/sage/algebras/free_algebra_element.py @@ -34,7 +34,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six import iteritems from sage.misc.misc import repr_lincomb from sage.monoids.free_monoid_element import FreeMonoidElement @@ -170,7 +169,7 @@ def extract_from(kwds,g): # I don't start with 0, because I don't want to preclude evaluation with # arbitrary objects (e.g. matrices) because of funny coercion. result = None - for m, c in iteritems(self._monomial_coefficients): + for m, c in self._monomial_coefficients.items(): if result is None: result = c*m(x) else: diff --git a/src/sage/algebras/free_algebra_quotient_element.py b/src/sage/algebras/free_algebra_quotient_element.py index a44d42e8f85..f5216b525d4 100644 --- a/src/sage/algebras/free_algebra_quotient_element.py +++ b/src/sage/algebras/free_algebra_quotient_element.py @@ -21,7 +21,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six import integer_types from sage.misc.misc import repr_lincomb from sage.structure.element import RingElement, AlgebraElement @@ -33,9 +32,6 @@ from sage.algebras.free_algebra_element import FreeAlgebraElement -import six - - def is_FreeAlgebraQuotientElement(x): """ EXAMPLES:: @@ -79,7 +75,7 @@ def __init__(self, A, x): if isinstance(x, FreeAlgebraQuotientElement) and x.parent() == Q: self.__vector = Q.module()(x.vector()) return - if isinstance(x, (Integer,) + integer_types): + if isinstance(x, (Integer, int)): self.__vector = Q.module().gen(0) * x return elif isinstance(x, FreeModuleElement) and x.parent() is Q.module(): @@ -93,7 +89,7 @@ def __init__(self, A, x): F = A.monoid() B = A.monomial_basis() - if isinstance(x, (Integer,) + integer_types): + if isinstance(x, (Integer, int)): self.__vector = x*M.gen(0) elif isinstance(x, RingElement) and not isinstance(x, AlgebraElement) and x in R: self.__vector = x * M.gen(0) @@ -111,11 +107,11 @@ def __init__(self, A, x): # Need to do more work here to include monomials not # represented in the monomial basis. self.__vector = M(0) - for m, c in six.iteritems(x._FreeAlgebraElement__monomial_coefficients): + for m, c in x._FreeAlgebraElement__monomial_coefficients.items(): self.__vector += c*M.gen(B.index(m)) elif isinstance(x, dict): self.__vector = M(0) - for m, c in six.iteritems(x): + for m, c in x.items(): self.__vector += c*M.gen(B.index(m)) elif isinstance(x, AlgebraElement) and x.parent().ambient_algebra() is A: self.__vector = x.ambient_algebra_element().vector() diff --git a/src/sage/algebras/lie_algebras/free_lie_algebra.py b/src/sage/algebras/lie_algebras/free_lie_algebra.py index 3a547e1a360..fbdc3504f86 100644 --- a/src/sage/algebras/lie_algebras/free_lie_algebra.py +++ b/src/sage/algebras/lie_algebras/free_lie_algebra.py @@ -18,9 +18,8 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# https://www.gnu.org/licenses/ -# **************************************************************************** -from six import iteritems +# http://www.gnu.org/licenses/ +#***************************************************************************** from sage.misc.abstract_method import abstract_method from sage.misc.cachefunc import cached_method @@ -596,7 +595,7 @@ def _rewrite_bracket(self, l, r): # Rewrite [a, [b, c]] = [b, [a, c]] + [[a, b], c] with a < b < c # Compute the left summand - for m, inner_coeff in iteritems(self._rewrite_bracket(l, r._right)): + for m, inner_coeff in self._rewrite_bracket(l, r._right).items(): if r._left == m: continue elif r._left < m: @@ -604,11 +603,11 @@ def _rewrite_bracket(self, l, r): else: # r._left > m x, y = m, r._left inner_coeff = -inner_coeff - for b_elt, coeff in iteritems(self._rewrite_bracket(x, y)): + for b_elt, coeff in self._rewrite_bracket(x, y).items(): ret[b_elt] = ret.get(b_elt, 0) + coeff * inner_coeff # Compute the right summand - for m, inner_coeff in iteritems(self._rewrite_bracket(l, r._left)): + for m, inner_coeff in self._rewrite_bracket(l, r._left).items(): if m == r._right: continue elif m < r._right: @@ -616,7 +615,7 @@ def _rewrite_bracket(self, l, r): else: # m > r._right x, y = r._right, m inner_coeff = -inner_coeff - for b_elt, coeff in iteritems(self._rewrite_bracket(x, y)): + for b_elt, coeff in self._rewrite_bracket(x, y).items(): ret[b_elt] = ret.get(b_elt, 0) + coeff * inner_coeff return ret @@ -703,7 +702,7 @@ def _rewrite_bracket(self, l, r): # caught us. # For a similar reason, we have b >= c. # Compute the left summand - for m, inner_coeff in iteritems(self._rewrite_bracket(l._right, r)): + for m, inner_coeff in self._rewrite_bracket(l._right, r).items(): if l._left == m: continue elif l._left < m: @@ -711,11 +710,11 @@ def _rewrite_bracket(self, l, r): else: # l._left > m x, y = m, l._left inner_coeff = -inner_coeff - for b_elt, coeff in iteritems(self._rewrite_bracket(x, y)): + for b_elt, coeff in self._rewrite_bracket(x, y).items(): ret[b_elt] = ret.get(b_elt, 0) + coeff * inner_coeff # Compute the right summand - for m, inner_coeff in iteritems(self._rewrite_bracket(l._left, r)): + for m, inner_coeff in self._rewrite_bracket(l._left, r).items(): if m == l._right: continue elif m < l._right: @@ -723,7 +722,7 @@ def _rewrite_bracket(self, l, r): else: # m > l._right x, y = l._right, m inner_coeff = -inner_coeff - for b_elt, coeff in iteritems(self._rewrite_bracket(x, y)): + for b_elt, coeff in self._rewrite_bracket(x, y).items(): ret[b_elt] = ret.get(b_elt, 0) + coeff * inner_coeff return ret diff --git a/src/sage/algebras/lie_algebras/lie_algebra.py b/src/sage/algebras/lie_algebras/lie_algebra.py index a75ab2c3dec..ad1a76d123f 100644 --- a/src/sage/algebras/lie_algebras/lie_algebra.py +++ b/src/sage/algebras/lie_algebras/lie_algebra.py @@ -16,9 +16,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range -from six import iteritems - from sage.misc.cachefunc import cached_method from sage.misc.lazy_attribute import lazy_attribute from sage.structure.indexed_generators import standardize_names_index_set @@ -713,9 +710,9 @@ def _from_dict(self, d, coerce=False, remove_zeros=True): assert isinstance(d, dict) if coerce: R = self.base_ring() - d = {key: R(coeff) for key,coeff in iteritems(d)} + d = {key: R(coeff) for key,coeff in d.items()} if remove_zeros: - d = {key: coeff for key, coeff in iteritems(d) if coeff} + d = {key: coeff for key, coeff in d.items() if coeff} return self.element_class(self, d) def monomial(self, i): diff --git a/src/sage/algebras/lie_algebras/structure_coefficients.py b/src/sage/algebras/lie_algebras/structure_coefficients.py index d1d7c2ed98f..822da88a86a 100644 --- a/src/sage/algebras/lie_algebras/structure_coefficients.py +++ b/src/sage/algebras/lie_algebras/structure_coefficients.py @@ -16,8 +16,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** -from six import iteritems - from sage.misc.cachefunc import cached_method #from sage.misc.lazy_attribute import lazy_attribute from sage.structure.indexed_generators import (IndexedGenerators, @@ -422,7 +420,7 @@ def _sorted_items_for_printing(self): """ print_options = self.parent().print_options() pos_to_index = dict(enumerate(self.parent()._indices)) - v = [(pos_to_index[k], c) for k, c in iteritems(self.value)] + v = [(pos_to_index[k], c) for k, c in self.value.items()] try: v.sort(key=lambda monomial_coeff: print_options['sorting_key'](monomial_coeff[0]), diff --git a/src/sage/algebras/quantum_matrix_coordinate_algebra.py b/src/sage/algebras/quantum_matrix_coordinate_algebra.py index 7df5fc5970b..498aa34811d 100644 --- a/src/sage/algebras/quantum_matrix_coordinate_algebra.py +++ b/src/sage/algebras/quantum_matrix_coordinate_algebra.py @@ -15,7 +15,6 @@ # # https://www.gnu.org/licenses/ ############################################################################## -from six.moves import range from sage.misc.cachefunc import cached_method from sage.misc.lazy_attribute import lazy_attribute diff --git a/src/sage/algebras/quatalg/quaternion_algebra.py b/src/sage/algebras/quatalg/quaternion_algebra.py index e2c5f0cd005..fed19456b1b 100644 --- a/src/sage/algebras/quatalg/quaternion_algebra.py +++ b/src/sage/algebras/quatalg/quaternion_algebra.py @@ -32,8 +32,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import zip -from six import integer_types from sage.arith.all import (hilbert_conductor_inverse, hilbert_conductor, factor, gcd, kronecker_symbol, valuation) @@ -221,7 +219,7 @@ def create_key(self, arg0, arg1=None, arg2=None, names='i,j,k'): for a in [arg0,arg1]: if is_RingElement(a): L.append(a) - elif isinstance(a, integer_types): + elif isinstance(a, int): L.append(Integer(a)) elif isinstance(a, float): L.append(RR(a)) diff --git a/src/sage/algebras/schur_algebra.py b/src/sage/algebras/schur_algebra.py index e1cabc71f0d..3b604fa442f 100644 --- a/src/sage/algebras/schur_algebra.py +++ b/src/sage/algebras/schur_algebra.py @@ -28,7 +28,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range import itertools diff --git a/src/sage/algebras/steenrod/steenrod_algebra.py b/src/sage/algebras/steenrod/steenrod_algebra.py index 6c41164a5f8..088924240be 100644 --- a/src/sage/algebras/steenrod/steenrod_algebra.py +++ b/src/sage/algebras/steenrod/steenrod_algebra.py @@ -452,7 +452,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range from sage.combinat.free_module import CombinatorialFreeModule from sage.misc.lazy_attribute import lazy_attribute diff --git a/src/sage/algebras/steenrod/steenrod_algebra_mult.py b/src/sage/algebras/steenrod/steenrod_algebra_mult.py index 99c77be38cd..2215c243520 100644 --- a/src/sage/algebras/steenrod/steenrod_algebra_mult.py +++ b/src/sage/algebras/steenrod/steenrod_algebra_mult.py @@ -197,7 +197,6 @@ # Copyright (C) 2008-2010 John H. Palmieri # Distributed under the terms of the GNU General Public License (GPL) #***************************************************************************** -from six.moves import range from sage.misc.cachefunc import cached_function diff --git a/src/sage/arith/functions.pyx b/src/sage/arith/functions.pyx index 1c184b02a9e..74b95dee846 100644 --- a/src/sage/arith/functions.pyx +++ b/src/sage/arith/functions.pyx @@ -168,7 +168,6 @@ cpdef LCM_list(v): sage: LCM_list(Sequence(srange(100))) 0 - sage: from six.moves import range sage: LCM_list(range(100)) 0 diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd index 887c6fde677..8c918cc30af 100644 --- a/src/sage/arith/long.pxd +++ b/src/sage/arith/long.pxd @@ -136,12 +136,11 @@ cdef inline bint integer_check_long(x, long* value, int* err) except -1: ....: def long_max(): ....: return smallInteger(LONG_MAX) ....: ''') - sage: import six - sage: types = (ZZ, QQ) + six.integer_types + sage: types = (ZZ, QQ, int) sage: L = [1, 12345, 10^9, 2^30, long_max()//9, long_max()//3, long_max()] sage: L += [-x for x in L] + [0, long_min()] sage: for v in L: - ....: for t in (Integer,) + six.integer_types: + ....: for t in (Integer, int): ....: assert check_long(t(v)) == v sage: check_long(2^100) Traceback (most recent call last): diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py index 2fa75704313..83f85789339 100644 --- a/src/sage/arith/misc.py +++ b/src/sage/arith/misc.py @@ -14,7 +14,6 @@ # **************************************************************************** from __future__ import absolute_import, print_function -from six.moves import range import math import collections @@ -2023,8 +2022,8 @@ def xkcd(n=""): from sage.misc.html import html # import compatible with py2 and py3 - from six.moves.urllib.request import urlopen - from six.moves.urllib.error import HTTPError, URLError + from urllib.request import urlopen + from urllib.error import HTTPError, URLError data = None url = "http://dynamic.xkcd.com/api-0/jsonp/comic/{}".format(n) diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py index e4e3d363972..61a98c0b16b 100644 --- a/src/sage/calculus/calculus.py +++ b/src/sage/calculus/calculus.py @@ -394,7 +394,6 @@ sage: sage.calculus.calculus.maxima('f1') f1 """ -from six import iteritems import re from sage.arith.all import algdep @@ -1409,15 +1408,15 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv): ################################################################### def laplace(ex, t, s, algorithm='maxima'): r""" - Return the Laplace transform with respect to the variable `t` and + Return the Laplace transform with respect to the variable `t` and transform parameter `s`, if possible. - - If this function cannot find a solution, a formal function is returned. + + If this function cannot find a solution, a formal function is returned. The function that is returned may be viewed as a function of `s`. DEFINITION: - The Laplace transform of a function `f(t)`, defined for all real numbers + The Laplace transform of a function `f(t)`, defined for all real numbers `t \geq 0`, is the function `F(s)` defined by .. MATH:: @@ -1439,9 +1438,9 @@ def laplace(ex, t, s, algorithm='maxima'): - ``'sympy'`` - use SymPy - ``'giac'`` - use Giac - + .. NOTE:: - + The ``'sympy'`` algorithm returns the tuple (`F`, `a`, ``cond``) where `F` is the Laplace transform of `f(t)`, `Re(s)>a` is the half-plane of convergence, and ``cond`` are @@ -1528,17 +1527,17 @@ def laplace(ex, t, s, algorithm='maxima'): sage: laplace(heaviside(t-1), t, s) laplace(heaviside(t - 1), t, s) - - Heaviside step function can be handled with different interfaces. + + Heaviside step function can be handled with different interfaces. Try with giac:: - + sage: laplace(heaviside(t-1), t, s, algorithm='giac') e^(-s)/s - + Try with SymPy:: - + sage: laplace(heaviside(t-1), t, s, algorithm='sympy') - (e^(-s)/s, 0, True) + (e^(-s)/s, 0, True) TESTS: @@ -1548,7 +1547,7 @@ def laplace(ex, t, s, algorithm='maxima'): (t, s) sage: laplace(5*cos(3*t-2)*heaviside(t-2), t, s, algorithm='giac') 5*(s*cos(4)*e^(-2*s) - 3*e^(-2*s)*sin(4))/(s^2 + 9) - + Check unevaluated expression from Giac (it is locale-dependent, see :trac:`22833`):: @@ -1622,15 +1621,15 @@ def laplace(ex, t, s, algorithm='maxima'): def inverse_laplace(ex, s, t, algorithm='maxima'): r""" - Return the inverse Laplace transform with respect to the variable `t` and + Return the inverse Laplace transform with respect to the variable `t` and transform parameter `s`, if possible. - - If this function cannot find a solution, a formal function is returned. + + If this function cannot find a solution, a formal function is returned. The function that is returned may be viewed as a function of `t`. - DEFINITION: - - The inverse Laplace transform of a function `F(s)` is the function + DEFINITION: + + The inverse Laplace transform of a function `F(s)` is the function `f(t)`, defined by .. MATH:: @@ -1678,75 +1677,75 @@ def inverse_laplace(ex, s, t, algorithm='maxima'): sage: inverse_laplace(1/(s^3+1), s, t) 1/3*(sqrt(3)*sin(1/2*sqrt(3)*t) - cos(1/2*sqrt(3)*t))*e^(1/2*t) + 1/3*e^(-t) - No explicit inverse Laplace transform, so one is returned formally a + No explicit inverse Laplace transform, so one is returned formally a function ``ilt``:: sage: inverse_laplace(cos(s), s, t) ilt(cos(s), s, t) - + Transform an expression involving a time-shift, via SymPy:: sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy') -(log(e^(-t)) + 1)*heaviside(t - 1) The same instance with Giac:: - + sage: inverse_laplace(1/s^2*exp(-s), s, t, algorithm='giac') (t - 1)*heaviside(t - 1) - + Transform a rational expression:: - + sage: inverse_laplace((2*s^2*exp(-2*s) - exp(-s))/(s^3+1), s, t, algorithm='giac') - -1/3*(sqrt(3)*e^(1/2*t - 1/2)*sin(1/2*sqrt(3)*(t - 1)) - cos(1/2*sqrt(3)*(t - 1))*e^(1/2*t - 1/2) + + -1/3*(sqrt(3)*e^(1/2*t - 1/2)*sin(1/2*sqrt(3)*(t - 1)) - cos(1/2*sqrt(3)*(t - 1))*e^(1/2*t - 1/2) + e^(-t + 1))*heaviside(t - 1) + 2/3*(2*cos(1/2*sqrt(3)*(t - 2))*e^(1/2*t - 1) + e^(-t + 2))*heaviside(t - 2) - + Dirac delta function can also be handled:: - + sage: inverse_laplace(1, s, t, algorithm='giac') dirac_delta(t) - + TESTS: Testing unevaluated expression from Maxima:: - + sage: var('t, s') (t, s) sage: inverse_laplace(exp(-s)/s, s, t) ilt(e^(-s)/s, s, t) - + Testing Giac:: sage: inverse_laplace(exp(-s)/s, s, t, algorithm='giac') heaviside(t - 1) - + Testing SymPy:: - + sage: inverse_laplace(exp(-s)/s, s, t, algorithm='sympy') - heaviside(t - 1) - + heaviside(t - 1) + Testing unevaluated expression from Giac:: - + sage: n = var('n') sage: inverse_laplace(1/s^n, s, t, algorithm='giac') ilt(1/(s^n), t, s) Try with Maxima:: - + sage: inverse_laplace(1/s^n, s, t, algorithm='maxima') ilt(1/(s^n), s, t) - + Try with SymPy:: - + sage: inverse_laplace(1/s^n, s, t, algorithm='sympy') t^(n - 1)*heaviside(t)/gamma(n) - + Testing unevaluated expression from SymPy:: - + sage: inverse_laplace(cos(s), s, t, algorithm='sympy') ilt(cos(s), t, s) - + Testing the same with Giac:: - + sage: inverse_laplace(cos(s), s, t, algorithm='giac') ilt(cos(s), t, s) """ @@ -1776,7 +1775,7 @@ def inverse_laplace(ex, s, t, algorithm='maxima'): try: result = giac.invlaplace(ex, s, t) except TypeError: - raise ValueError("Giac cannot make sense of: %s" % ex) + raise ValueError("Giac cannot make sense of: %s" % ex) if 'ilaplace' in format(result): return dummy_inverse_laplace(ex, t, s) else: @@ -1856,7 +1855,7 @@ def at(ex, *args, **kwds): if not isinstance(ex, (Expression, Function)): ex = SR(ex) kwds = {(k[10:] if k[:10] == "_SAGE_VAR_" else k): v - for k, v in iteritems(kwds)} + for k, v in kwds.items()} if len(args) == 1 and isinstance(args[0], list): for c in args[0]: kwds[str(c.lhs())] = c.rhs() @@ -2250,7 +2249,7 @@ def maxima_options(**kwds): 'an_option=true,another=false,foo=bar' """ return ','.join('%s=%s' % (key, mapped_opts(val)) - for key, val in sorted(iteritems(kwds))) + for key, val in sorted(kwds.items())) # Parser for symbolic ring elements diff --git a/src/sage/categories/additive_magmas.py b/src/sage/categories/additive_magmas.py index 03f795bb97d..64d14aeded3 100644 --- a/src/sage/categories/additive_magmas.py +++ b/src/sage/categories/additive_magmas.py @@ -8,8 +8,6 @@ # https://www.gnu.org/licenses/ # ***************************************************************************** -import six - from sage.misc.lazy_import import LazyImport from sage.misc.abstract_method import abstract_method from sage.misc.cachefunc import cached_method @@ -782,10 +780,6 @@ def __bool__(self): True """ - if six.PY2: - __nonzero__ = __bool__ - del __bool__ - def _test_nonzero_equal(self, **options): r""" Test that ``.__bool__()`` behave consistently diff --git a/src/sage/categories/algebras_with_basis.py b/src/sage/categories/algebras_with_basis.py index 7b0a6524467..5606ab39da0 100644 --- a/src/sage/categories/algebras_with_basis.py +++ b/src/sage/categories/algebras_with_basis.py @@ -18,8 +18,6 @@ from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring from .unital_algebras import UnitalAlgebras -import six - class AlgebrasWithBasis(CategoryWithAxiom_over_base_ring): """ @@ -155,8 +153,8 @@ def _product_from_combinatorial_algebra_multiply(self,left,right): #Do the case where the user specifies how to multiply basis elements if hasattr(self, '_multiply_basis'): - for (left_m, left_c) in six.iteritems(left._monomial_coefficients): - for (right_m, right_c) in six.iteritems(right._monomial_coefficients): + for (left_m, left_c) in left._monomial_coefficients.items(): + for (right_m, right_c) in right._monomial_coefficients.items(): res = self._multiply_basis(left_m, right_m) #Handle the case where the user returns a dictionary #where the keys are the monomials and the values are @@ -189,7 +187,7 @@ def _product_from_combinatorial_algebra_multiply(self,left,right): BR = self.base_ring() zero = BR(0) del_list = [] - for m, c in six.iteritems(z_elt): + for m, c in z_elt.items(): if c == zero: del_list.append(m) for m in del_list: diff --git a/src/sage/categories/cartesian_product.py b/src/sage/categories/cartesian_product.py index 571f3624159..38c9246885a 100644 --- a/src/sage/categories/cartesian_product.py +++ b/src/sage/categories/cartesian_product.py @@ -11,7 +11,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.misc.lazy_import import lazy_import from sage.categories.covariant_functorial_construction import CovariantFunctorialConstruction, CovariantConstructionCategory @@ -165,8 +164,7 @@ def __call__(self, args, **kwds): Check that Python3 ``range`` is handled correctly:: - sage: from six.moves import range as py3range - sage: C = cartesian_product([py3range(2), py3range(2)]) + sage: C = cartesian_product([range(2), range(2)]) sage: list(C) [(0, 0), (0, 1), (1, 0), (1, 1)] sage: C.category() diff --git a/src/sage/categories/coxeter_groups.py b/src/sage/categories/coxeter_groups.py index 17cd57f2e1f..5826337bf17 100644 --- a/src/sage/categories/coxeter_groups.py +++ b/src/sage/categories/coxeter_groups.py @@ -10,7 +10,6 @@ # https://www.gnu.org/licenses/ # ***************************************************************************** # With contributions from Dan Bump, Steve Pon, Qiang Wang, Anne Schilling, Christian Stump, Mark Shimozono -from six.moves import range from sage.misc.abstract_method import abstract_method from sage.misc.cachefunc import cached_method, cached_in_parent_method diff --git a/src/sage/categories/crystals.py b/src/sage/categories/crystals.py index cc2b5042969..7af4ec76dab 100644 --- a/src/sage/categories/crystals.py +++ b/src/sage/categories/crystals.py @@ -20,7 +20,6 @@ #***************************************************************************** from __future__ import print_function -from builtins import zip from sage.misc.cachefunc import cached_method from sage.misc.abstract_method import abstract_method diff --git a/src/sage/categories/enumerated_sets.py b/src/sage/categories/enumerated_sets.py index 60291d47138..20de7fcb01a 100644 --- a/src/sage/categories/enumerated_sets.py +++ b/src/sage/categories/enumerated_sets.py @@ -7,7 +7,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # https://www.gnu.org/licenses/ # ***************************************************************************** -from six.moves import range from sage.misc.cachefunc import cached_method from sage.misc.lazy_import import LazyImport @@ -142,7 +141,6 @@ def _call_(self, X): Also Python3 range are now accepted:: - sage: from six.moves import range sage: S = EnumeratedSets()(range(4)); S {0, 1, 2, 3} """ diff --git a/src/sage/categories/examples/finite_dimensional_lie_algebras_with_basis.py b/src/sage/categories/examples/finite_dimensional_lie_algebras_with_basis.py index b815aeb9112..5218f15acf6 100644 --- a/src/sage/categories/examples/finite_dimensional_lie_algebras_with_basis.py +++ b/src/sage/categories/examples/finite_dimensional_lie_algebras_with_basis.py @@ -7,7 +7,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #***************************************************************************** -from six import iteritems from sage.misc.cachefunc import cached_method from sage.sets.family import Family @@ -318,7 +317,7 @@ def __iter__(self): [(0, 2), (2, -1)] """ zero = self.parent().base_ring().zero() - for i, c in iteritems(self.value): + for i, c in self.value.items(): if c != zero: yield (i, c) @@ -368,7 +367,7 @@ def lift(self): """ UEA = self.parent().universal_enveloping_algebra() gens = UEA.gens() - return UEA.sum(c * gens[i] for i, c in iteritems(self.value)) + return UEA.sum(c * gens[i] for i, c in self.value.items()) def to_vector(self): """ diff --git a/src/sage/categories/examples/finite_weyl_groups.py b/src/sage/categories/examples/finite_weyl_groups.py index 721c30f1f7a..d3d50c9af89 100644 --- a/src/sage/categories/examples/finite_weyl_groups.py +++ b/src/sage/categories/examples/finite_weyl_groups.py @@ -7,7 +7,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #****************************************************************************** -from six.moves import range from sage.misc.cachefunc import cached_method from sage.structure.parent import Parent diff --git a/src/sage/categories/filtered_hopf_algebras_with_basis.py b/src/sage/categories/filtered_hopf_algebras_with_basis.py index 5e6355b01d4..dcfb8ba05f8 100644 --- a/src/sage/categories/filtered_hopf_algebras_with_basis.py +++ b/src/sage/categories/filtered_hopf_algebras_with_basis.py @@ -14,8 +14,6 @@ from sage.categories.with_realizations import WithRealizationsCategory from sage.misc.cachefunc import cached_method -import six - class FilteredHopfAlgebrasWithBasis(FilteredModulesCategory): """ @@ -132,7 +130,7 @@ def antipode(self, elem): """ return self.linear_combination( (self.antipode_on_basis(mon), coeff) - for mon, coeff in six.iteritems(elem.monomial_coefficients(copy=False)) + for mon, coeff in elem.monomial_coefficients(copy=False).items() ) class ElementMethods: diff --git a/src/sage/categories/graded_modules_with_basis.py b/src/sage/categories/graded_modules_with_basis.py index 319fe479f6e..ec6f4e7590c 100644 --- a/src/sage/categories/graded_modules_with_basis.py +++ b/src/sage/categories/graded_modules_with_basis.py @@ -11,8 +11,6 @@ from sage.categories.graded_modules import GradedModulesCategory -import six - class GradedModulesWithBasis(GradedModulesCategory): """ @@ -67,7 +65,7 @@ def degree_negation(self, element): else base_minusone) return self.sum_of_terms([(key, diag(key) * value) for key, value in - six.iteritems(element.monomial_coefficients(copy=False))]) + element.monomial_coefficients(copy=False).items()]) class ElementMethods: def degree_negation(self): diff --git a/src/sage/categories/magmatic_algebras.py b/src/sage/categories/magmatic_algebras.py index 09d8ce35bdf..5f6a0cd32a0 100644 --- a/src/sage/categories/magmatic_algebras.py +++ b/src/sage/categories/magmatic_algebras.py @@ -19,8 +19,6 @@ from sage.categories.additive_magmas import AdditiveMagmas from sage.categories.modules import Modules -import six - class MagmaticAlgebras(Category_over_base_ring): """ @@ -142,7 +140,7 @@ def algebra_generators(self): sage: P.algebra_generators() Lazy family (Term map from Partition diagrams of order 1 to Partition Algebra of rank 1 with parameter x over Univariate Polynomial Ring in x - over Integer Ring(i))_{i in Partition diagrams of order 1} + over Integer Ring(i))_{i in Partition diagrams of order 1} """ return self.basis() @@ -217,9 +215,9 @@ def _product_from_product_on_basis_multiply( self, left, right ): B[word: aba] - B[word: abb] + 2*B[word: ca] - 2*B[word: cb] """ - return self.linear_combination( ( self.product_on_basis( mon_left, mon_right ), coeff_left * coeff_right ) - for ( mon_left, coeff_left ) in six.iteritems(left.monomial_coefficients()) - for ( mon_right, coeff_right ) in six.iteritems(right.monomial_coefficients()) ) + return self.linear_combination((self.product_on_basis(mon_left, mon_right), coeff_left * coeff_right ) + for (mon_left, coeff_left) in left.monomial_coefficients().items() + for (mon_right, coeff_right) in right.monomial_coefficients().items() ) class FiniteDimensional(CategoryWithAxiom_over_base_ring): class ParentMethods: diff --git a/src/sage/categories/modules_with_basis.py b/src/sage/categories/modules_with_basis.py index 1c0fd5a61db..b111b76f96e 100644 --- a/src/sage/categories/modules_with_basis.py +++ b/src/sage/categories/modules_with_basis.py @@ -32,8 +32,6 @@ from sage.rings.infinity import Infinity from sage.structure.element import Element, parent -import six - lazy_import('sage.modules.with_basis.morphism', ['ModuleMorphismByLinearity', @@ -1099,12 +1097,12 @@ def _apply_module_morphism(self, x, on_basis, codomain=False): if hasattr( codomain, 'linear_combination' ): mc = x.monomial_coefficients(copy=False) - return codomain.linear_combination( (on_basis(key), coeff) - for key, coeff in six.iteritems(mc) ) + return codomain.linear_combination((on_basis(key), coeff) + for key, coeff in mc.items()) else: return_sum = codomain.zero() mc = x.monomial_coefficients(copy=False) - for key, coeff in six.iteritems(mc): + for key, coeff in mc.items(): return_sum += coeff * on_basis(key) return return_sum @@ -1122,7 +1120,7 @@ def _apply_module_endomorphism(self, x, on_basis): """ mc = x.monomial_coefficients(copy=False) return self.linear_combination( (on_basis(key), coeff) - for key, coeff in six.iteritems(mc) ) + for key, coeff in mc.items()) def dimension(self): """ @@ -1414,7 +1412,7 @@ def __len__(self): 4 """ zero = self.parent().base_ring().zero() - return len([key for key, coeff in six.iteritems(self.monomial_coefficients(copy=False)) + return len([key for key, coeff in self.monomial_coefficients(copy=False).items() if coeff != zero]) def length(self): @@ -1463,7 +1461,7 @@ def support(self): [[1], [1, 1, 1], [2, 1], [4]] """ zero = self.parent().base_ring().zero() - return [key for key, coeff in six.iteritems(self.monomial_coefficients(copy=False)) + return [key for key, coeff in self.monomial_coefficients(copy=False).items() if coeff != zero] def monomials(self): @@ -1507,7 +1505,7 @@ def terms(self): P = self.parent() zero = P.base_ring().zero() return [P.term(key, value) - for key, value in six.iteritems(self.monomial_coefficients(copy=False)) + for key, value in self.monomial_coefficients(copy=False).items() if value != zero] def coefficients(self, sort=True): @@ -1545,9 +1543,9 @@ def coefficients(self, sort=True): zero = self.parent().base_ring().zero() mc = self.monomial_coefficients(copy=False) if not sort: - return [value for key, value in six.iteritems(mc) if value != zero] + return [value for key, value in mc.items() if value != zero] - v = sorted([(key, value) for key, value in six.iteritems(mc) + v = sorted([(key, value) for key, value in mc.items() if value != zero]) return [value for key, value in v] diff --git a/src/sage/categories/monoids.py b/src/sage/categories/monoids.py index 100d04d44d4..87ce88a693d 100644 --- a/src/sage/categories/monoids.py +++ b/src/sage/categories/monoids.py @@ -11,7 +11,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #****************************************************************************** -from six.moves import range from sage.misc.cachefunc import cached_method from sage.misc.misc_c import prod diff --git a/src/sage/categories/primer.py b/src/sage/categories/primer.py index a125fc602b3..74b17110f0a 100644 --- a/src/sage/categories/primer.py +++ b/src/sage/categories/primer.py @@ -948,10 +948,7 @@ class SubcategoryMethods: sage: x._mul_?? # not tested sage: x._mul_.__module__ 'sage.categories.coercion_methods' - sage: from six import get_method_function as gmf - sage: gmf(x._mul_) is gmf(Magmas.ElementMethods._mul_parent) # py2 - True - sage: gmf(x._mul_) is Magmas.ElementMethods._mul_parent # py3 + sage: x._mul_.__func__ is Magmas.ElementMethods._mul_parent # py3 True ``product`` is a mathematical method implemented by the parent:: diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py index 27e436c6360..d3280aad2cb 100644 --- a/src/sage/categories/pushout.py +++ b/src/sage/categories/pushout.py @@ -2,8 +2,6 @@ Coercion via construction functors """ from __future__ import print_function, absolute_import -from six.moves import range -import six from sage.misc.lazy_import import lazy_import from sage.structure.coerce_exceptions import CoercionException @@ -1715,10 +1713,10 @@ def __init__(self, var, multi_variate=False): """ Functor.__init__(self, Rings(), Rings()) - if not isinstance(var, (six.string_types,tuple,list)): + if not isinstance(var, (str, tuple, list)): raise TypeError("variable name or list of variable names expected") self.var = var - self.multi_variate = multi_variate or not isinstance(var, six.string_types) + self.multi_variate = multi_variate or not isinstance(var, str) def _apply_functor(self, R): """ @@ -2715,7 +2713,7 @@ def __init__(self, I, names=None, as_field=False): self.I = I if names is None: self.names = None - elif isinstance(names, six.string_types): + elif isinstance(names, str): self.names = (names,) else: self.names = tuple(names) @@ -4342,7 +4340,7 @@ def type_to_parent(P): TypeError: Not a scalar type. """ import sage.rings.all - if P in six.integer_types: + if P is int: return sage.rings.all.ZZ elif P is float: return sage.rings.all.RDF diff --git a/src/sage/categories/sets_cat.py b/src/sage/categories/sets_cat.py index 7d48c100d57..8a5f2e38884 100644 --- a/src/sage/categories/sets_cat.py +++ b/src/sage/categories/sets_cat.py @@ -11,7 +11,6 @@ # https://www.gnu.org/licenses/ # ***************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range from sage.misc.cachefunc import cached_method from sage.misc.sage_unittest import TestSuite @@ -1760,10 +1759,7 @@ def is_finite(self): TESTS:: - sage: from six import get_method_function as gmf - sage: gmf(C.is_finite) is gmf(sage.categories.sets_cat.Sets.Infinite.ParentMethods.is_finite) # py2 - True - sage: gmf(C.is_finite) is sage.categories.sets_cat.Sets.Infinite.ParentMethods.is_finite # py3 + sage: C.is_finite.__func__ is sage.categories.sets_cat.Sets.Infinite.ParentMethods.is_finite True """ return False diff --git a/src/sage/coding/channel.py b/src/sage/coding/channel.py index d4605319d24..db63b66ff2d 100644 --- a/src/sage/coding/channel.py +++ b/src/sage/coding/channel.py @@ -44,9 +44,8 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# https://www.gnu.org/licenses/ -# **************************************************************************** -from six.moves import range +# http://www.gnu.org/licenses/ +#***************************************************************************** from sage.structure.sage_object import SageObject from sage.rings.integer import Integer diff --git a/src/sage/coding/databases.py b/src/sage/coding/databases.py index 6f19175f4fd..e0bce13871c 100644 --- a/src/sage/coding/databases.py +++ b/src/sage/coding/databases.py @@ -2,7 +2,7 @@ r""" Access functions to online databases for coding theory """ -from six.moves import range + from sage.interfaces.all import gap from sage.features.gap import GapPackage @@ -155,7 +155,7 @@ def best_linear_code_in_codetables_dot_de(n, k, F, verbose=False): - Steven Sivek (2005-11-14) - David Joyner (2008-03) """ - from six.moves.urllib.request import urlopen + from urllib.request import urlopen from sage.cpython.string import bytes_to_str q = F.order() if not q in [2, 3, 4, 5, 7, 8, 9]: diff --git a/src/sage/coding/grs_code.py b/src/sage/coding/grs_code.py index a8d9dc504df..427c96fced9 100644 --- a/src/sage/coding/grs_code.py +++ b/src/sage/coding/grs_code.py @@ -48,7 +48,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import range from sage.categories.cartesian_product import cartesian_product diff --git a/src/sage/coding/information_set_decoder.py b/src/sage/coding/information_set_decoder.py index b0fe180bce3..0846c1fa67d 100644 --- a/src/sage/coding/information_set_decoder.py +++ b/src/sage/coding/information_set_decoder.py @@ -41,7 +41,6 @@ #****************************************************************************** # python3 from __future__ import division, print_function, absolute_import -from six.moves import range from sage.all import ZZ, Integer, vector, SageObject, binomial from .decoder import Decoder diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py index dc27b109203..4b8f04dc4ed 100644 --- a/src/sage/coding/linear_code.py +++ b/src/sage/coding/linear_code.py @@ -203,8 +203,10 @@ class should inherit from this class. Also ``AbstractLinearCode`` should never # ***************************************************************************** from __future__ import division, print_function, absolute_import -from six.moves import range +import os +import subprocess +from io import StringIO from copy import copy from sage.cpython.string import bytes_to_str @@ -1913,10 +1915,7 @@ def weight_distribution(self, algorithm=None): guava_bin_dir = gap.eval('DirectoriesPackagePrograms("guava")[1]') guava_bin_dir = guava_bin_dir[guava_bin_dir.index('"') + 1:guava_bin_dir.rindex('"')] input = _dump_code_in_leon_format(self) + "::code" - import os - import subprocess lines = subprocess.check_output([os.path.join(guava_bin_dir, 'wtdist'), input]) - from six import StringIO # to use the already present output parser wts = [0] * (n + 1) for L in StringIO(bytes_to_str(lines)).readlines(): diff --git a/src/sage/coding/reed_muller_code.py b/src/sage/coding/reed_muller_code.py index bf24a23838e..d5bc085fe52 100644 --- a/src/sage/coding/reed_muller_code.py +++ b/src/sage/coding/reed_muller_code.py @@ -24,7 +24,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from operator import mul from sage.matrix.constructor import matrix diff --git a/src/sage/coding/source_coding/huffman.py b/src/sage/coding/source_coding/huffman.py index 3849ff4cb46..884b50648a6 100644 --- a/src/sage/coding/source_coding/huffman.py +++ b/src/sage/coding/source_coding/huffman.py @@ -31,8 +31,6 @@ from collections import defaultdict -import six - from sage.structure.sage_object import SageObject ########################################################################### @@ -251,7 +249,7 @@ def __init__(self, source): # index of each alphabetic symbol self._index = None - if isinstance(source, six.string_types): + if isinstance(source, str): self._build_code(frequency_table(source)) elif isinstance(source, dict): self._build_code(source) diff --git a/src/sage/combinat/affine_permutation.py b/src/sage/combinat/affine_permutation.py index fdecf4e1a4b..f550c1413e0 100644 --- a/src/sage/combinat/affine_permutation.py +++ b/src/sage/combinat/affine_permutation.py @@ -12,8 +12,6 @@ #***************************************************************************** from __future__ import print_function, division -from six.moves import range - from sage.misc.cachefunc import cached_method from sage.misc.misc_c import prod from sage.misc.constant_function import ConstantFunction diff --git a/src/sage/combinat/alternating_sign_matrix.py b/src/sage/combinat/alternating_sign_matrix.py index 1489cc7221c..cd248abcdd9 100644 --- a/src/sage/combinat/alternating_sign_matrix.py +++ b/src/sage/combinat/alternating_sign_matrix.py @@ -31,8 +31,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import division -from six.moves import range, zip -from six import add_metaclass import copy from sage.misc.classcall_metaclass import ClasscallMetaclass @@ -79,8 +77,8 @@ def _inplace_height_function_gyration(hf): hf[i,j] -= 2 -@add_metaclass(InheritComparisonClasscallMetaclass) -class AlternatingSignMatrix(Element): +class AlternatingSignMatrix(Element, + metaclass=InheritComparisonClasscallMetaclass): r""" An alternating sign matrix. @@ -1798,8 +1796,7 @@ def _is_a_cover(mt0, mt1): register_unpickle_override('sage.combinat.alternating_sign_matrix', 'MonotoneTriangles_n', MonotoneTriangles) -@add_metaclass(ClasscallMetaclass) -class ContreTableaux(Parent): +class ContreTableaux(Parent, metaclass=ClasscallMetaclass): """ Factory class for the combinatorial class of contre tableaux of size `n`. @@ -1960,8 +1957,7 @@ def _previous_column_iterator(column, height, max_value): return _next_column_iterator(new_column, height) -@add_metaclass(ClasscallMetaclass) -class TruncatedStaircases(Parent): +class TruncatedStaircases(Parent, metaclass=ClasscallMetaclass): """ Factory class for the combinatorial class of truncated staircases of size ``n`` with last column ``last_column``. diff --git a/src/sage/combinat/baxter_permutations.py b/src/sage/combinat/baxter_permutations.py index f31ad486eb7..8464f8d27b3 100644 --- a/src/sage/combinat/baxter_permutations.py +++ b/src/sage/combinat/baxter_permutations.py @@ -2,7 +2,6 @@ """ Baxter permutations """ -from six.moves import range from sage.structure.unique_representation import UniqueRepresentation from sage.structure.parent import Parent diff --git a/src/sage/combinat/binary_recurrence_sequences.py b/src/sage/combinat/binary_recurrence_sequences.py index 9b3aa121faa..1932f4f057b 100644 --- a/src/sage/combinat/binary_recurrence_sequences.py +++ b/src/sage/combinat/binary_recurrence_sequences.py @@ -59,8 +59,6 @@ from __future__ import division -from six.moves import range - from sage.structure.sage_object import SageObject from sage.matrix.constructor import matrix from sage.rings.number_field.number_field import QuadraticField diff --git a/src/sage/combinat/binary_tree.py b/src/sage/combinat/binary_tree.py index 07e9ec1a28d..cb2b1376c77 100644 --- a/src/sage/combinat/binary_tree.py +++ b/src/sage/combinat/binary_tree.py @@ -25,7 +25,6 @@ # **************************************************************************** # python3 from __future__ import division, absolute_import -from six import add_metaclass from sage.structure.list_clone import ClonableArray from sage.combinat.abstract_tree import (AbstractClonableTree, @@ -45,8 +44,8 @@ from sage.misc.cachefunc import cached_method -@add_metaclass(InheritComparisonClasscallMetaclass) -class BinaryTree(AbstractClonableTree, ClonableArray): +class BinaryTree(AbstractClonableTree, ClonableArray, + metaclass=InheritComparisonClasscallMetaclass): """ Binary trees. diff --git a/src/sage/combinat/cartesian_product.py b/src/sage/combinat/cartesian_product.py index c1c10c843a2..e3310cfa56a 100644 --- a/src/sage/combinat/cartesian_product.py +++ b/src/sage/combinat/cartesian_product.py @@ -17,8 +17,6 @@ # **************************************************************************** from __future__ import absolute_import -from six.moves import range - from sage.categories.enumerated_sets import EnumeratedSets from sage.sets.set_from_iterator import EnumeratedSetFromIterator diff --git a/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py b/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py index aec20b0687f..beee549e25c 100644 --- a/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py +++ b/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py @@ -33,8 +33,6 @@ # **************************************************************************** from __future__ import print_function -from six.moves import range - import itertools import time from itertools import islice @@ -1665,7 +1663,7 @@ def c_matrix(self,show_warnings=True): [ 0 -1 0] sage: S = ClusterSeed(['A',4]) - sage: S.use_g_vectors(False); S.use_fpolys(False); S.use_c_vectors(False); S.use_d_vectors(False); S.track_mutations(False); + sage: S.use_g_vectors(False); S.use_fpolys(False); S.use_c_vectors(False); S.use_d_vectors(False); S.track_mutations(False); sage: S.c_matrix() Traceback (most recent call last): ... @@ -1806,7 +1804,7 @@ def _d_mutate(self, k): def coefficient(self,k): r""" - Return the *coefficient* of ``self`` at index ``k``, + Return the *coefficient* of ``self`` at index ``k``, or vertex ``k`` if ``k`` is not an index. EXAMPLES:: @@ -3216,7 +3214,7 @@ def set_cluster( self, cluster, force=False ): """ if len(cluster) < self._n + self._m: raise ValueError('The number of given cluster variables is wrong') - if self._use_fpolys: + if self._use_fpolys: if any(c not in FractionField(self._R) for c in cluster): raise ValueError('The cluster variables are not all contained in %s'%FractionField(self._R)) if not force: # if already have f_polynomials, using set_cluster might yield data inconsistent with them. @@ -3226,7 +3224,7 @@ def set_cluster( self, cluster, force=False ): for x in cluster][0:self._n] self._is_principal = None else: - print("Warning: clusters not being tracked so this command is ignored.") + print("Warning: clusters not being tracked so this command is ignored.") def reset_cluster( self ): r""" @@ -4393,7 +4391,7 @@ def LLM_gen_set(self, size_limit=-1): OUTPUT: - An array of elements in the upper cluster algebra. + An array of elements in the upper cluster algebra. EXAMPLES:: @@ -4436,7 +4434,7 @@ def _compute_compatible_vectors(self, vd): OUTPUT: - a 2-dimensional array containing all the vectors compatible with each vector in ``vd.`` + a 2-dimensional array containing all the vectors compatible with each vector in ``vd.`` .. NOTE:: @@ -4483,7 +4481,7 @@ def _compute_compatible_vectors(self, vd): E.append([i, j]) elif B[i][j] < 0: E.append([j, i]) - # Checks for edges to frozen vertices. + # Checks for edges to frozen vertices. num_frozens = num_rows - num_cols for k in range(num_frozens): for j in range(i, num_cols): @@ -4526,7 +4524,7 @@ def _compute_compatible_vectors(self, vd): def _produce_upper_cluster_algebra_element(self, vd, cList): r""" - Takes the compatible vectors and uses them to produce a Laurent polynomial in the upper cluster algebra. + Takes the compatible vectors and uses them to produce a Laurent polynomial in the upper cluster algebra. EXAMPLES:: @@ -4555,16 +4553,16 @@ def _produce_upper_cluster_algebra_element(self, vd, cList): #Computes the Laurent Polynomial for each vector in the decomposition. finalP = [] #Laurent polynomial for each vector in {0,1}^n - for i in range(len(vd)): + for i in range(len(vd)): final = 1 numerator = 0 - if cList[i] != []: + if cList[i] != []: #If the vector in vd is negative then it did not contribute any compatible vectors. It will only contribute a Laurent monomial. This is the case when cList[i]=[] #Each compatible sequence gives a term in the numerator of the Laurent polynomial. - for s in cList[i]: + for s in cList[i]: term = 1 - #Calulates the monomial in the term. - for j in range(num_rows): + #Calulates the monomial in the term. + for j in range(num_rows): x = R.gen(j) expn = 0 #The exponent is determined by the vectors a,s, and the matrix B. @@ -4572,19 +4570,19 @@ def _produce_upper_cluster_algebra_element(self, vd, cList): expn += (vd[i][0][k]-s[k])*max(0, B[j][k])+s[k]*max(0, -B[j][k]) term *= x ** expn numerator += term - #Gives a numerator for the negative vector, or else the product would be zero. + #Gives a numerator for the negative vector, or else the product would be zero. else: numerator = 1 - - #Uses the vectors in vd to calculates the denominator of the Laurent. + + #Uses the vectors in vd to calculates the denominator of the Laurent. denominator = 1 for l in range(num_cols): denominator = denominator * (R.gen(l))**vd[i][0][l] - #Each copy of a vector in vd contributes a factor of the Laurent polynomial calculated from it. + #Each copy of a vector in vd contributes a factor of the Laurent polynomial calculated from it. final = (numerator/denominator)**vd[i][1] finalP.append(final) laurentP = 1 - #The UCA element for the vector a is the product of the elements produced from the vectors in its decomposition. + #The UCA element for the vector a is the product of the elements produced from the vectors in its decomposition. for p in finalP: laurentP *= p return laurentP @@ -4816,7 +4814,7 @@ def _vector_decomposition(a, length): A decomposition of `a` into vectors `b_i \in \{0,1\}^n` such that `a= \sum c_i b_i` for `c_i \in \ZZ.` - Returns an array of tuples `\right[b_i,c_i\left].` + Returns an array of tuples `\right[b_i,c_i\left].` EXAMPLES:: @@ -4848,7 +4846,7 @@ def _vector_decomposition(a, length): mini = min(mini, api) diff = maxi - mini - # Creates a copy of a that will be edited when decomposing the vector. + # Creates a copy of a that will be edited when decomposing the vector. ap = copy(a_plus) if maxi == 0 == mini: ap = [] @@ -4878,13 +4876,13 @@ def _vector_decomposition(a, length): cols[i].reverse() mat = matrix(cols) - # Adds a zero to the end of every vector for each frozen vertex. + # Adds a zero to the end of every vector for each frozen vertex. froz_mat = matrix(length - mat.nrows(), mat.ncols()) mat = mat.stack(froz_mat) mat = mat.transpose() vects = mat.rows() - # Collects identical decomposition vectors and counts their multiplicities. + # Collects identical decomposition vectors and counts their multiplicities. while vects: vect = vects[0] count = vects.count(vect) @@ -4902,7 +4900,7 @@ def _power_set(n): - `n` -- an integer. - OUTPUT: + OUTPUT: A 2-dimensional array containing all elements of `\{0,1\}^n`. @@ -4981,7 +4979,7 @@ def _multi_concatenate(l1, l2): [0, 1, 2, 8], [3, 4, 5, 6], [3, 4, 5, 7], - [3, 4, 5, 8]] + [3, 4, 5, 8]] """ plist = [] for i in l1: diff --git a/src/sage/combinat/cluster_algebra_quiver/mutation_class.py b/src/sage/combinat/cluster_algebra_quiver/mutation_class.py index d19b17e0ced..0105e820940 100644 --- a/src/sage/combinat/cluster_algebra_quiver/mutation_class.py +++ b/src/sage/combinat/cluster_algebra_quiver/mutation_class.py @@ -18,7 +18,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six.moves import range import time from sage.groups.perm_gps.partn_ref.refinement_graphs import search_tree, get_orbits diff --git a/src/sage/combinat/cluster_algebra_quiver/mutation_type.py b/src/sage/combinat/cluster_algebra_quiver/mutation_type.py index 12449c22935..693c5f3ea88 100644 --- a/src/sage/combinat/cluster_algebra_quiver/mutation_type.py +++ b/src/sage/combinat/cluster_algebra_quiver/mutation_type.py @@ -20,10 +20,12 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six.moves import range import os +import pickle + from copy import copy + from sage.misc.all import cached_function from sage.misc.flatten import flatten from sage.graphs.all import DiGraph @@ -1269,7 +1271,6 @@ def load_data(n, user=True): ('BKO', (((1, 0), (3, -1)), ((2, 1), (1, -3)))), ('BP_', (((0, 1), (2, -2)), ((1, 2), (1, -3)), ((2, 0), (3, -1))))])] """ - from six.moves import cPickle from sage.env import DOT_SAGE, SAGE_SHARE # we check @@ -1283,7 +1284,7 @@ def load_data(n, user=True): filename = os.path.join(path, 'cluster_algebra_quiver', 'mutation_classes_%s.dig6'%n) try: with open(filename, 'rb') as fobj: - data_new = cPickle.load(fobj) + data_new = pickle.load(fobj) except Exception: # File does not exist, corrupt pickle, wrong Python version... pass diff --git a/src/sage/combinat/cluster_algebra_quiver/quiver.py b/src/sage/combinat/cluster_algebra_quiver/quiver.py index 5c86061663d..fd2bc616018 100644 --- a/src/sage/combinat/cluster_algebra_quiver/quiver.py +++ b/src/sage/combinat/cluster_algebra_quiver/quiver.py @@ -37,8 +37,6 @@ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range - from sage.structure.sage_object import SageObject from copy import copy from sage.rings.all import ZZ, CC, infinity @@ -1080,7 +1078,7 @@ def free_vertices(self): ['a', 'c', 'e'] """ return self._nlist - + def frozen_vertices(self): """ Return the list of frozen vertices of ``self``. @@ -1319,7 +1317,7 @@ def mutate(self, data, inplace=True): - ``sequence`` -- a vertex of ``self``, an iterator of vertices of ``self``, a function which takes in the ClusterQuiver and returns a vertex or an iterator of vertices, - or a string of the parameter wanting to be called on ClusterQuiver that will return a vertex or + or a string of the parameter wanting to be called on ClusterQuiver that will return a vertex or an iterator of vertices. - ``inplace`` -- (default: True) if False, the result is returned, otherwise ``self`` is modified. @@ -1384,7 +1382,7 @@ def mutate(self, data, inplace=True): [ 0 0 0 1] [ 0 0 -1 0] [ 0 -1 1 0] - sage: Q2.mutate('a'); Q2.b_matrix() + sage: Q2.mutate('a'); Q2.b_matrix() [ 0 -1 0 0] [ 1 0 0 0] [ 0 0 0 1] diff --git a/src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py b/src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py index 22f34600c86..c2fb7bd6674 100644 --- a/src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py +++ b/src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py @@ -17,7 +17,8 @@ # *************************************************************************** from __future__ import division, print_function, absolute_import -from six.moves import range +import os +import pickle from sage.structure.sage_object import SageObject from copy import copy @@ -2254,8 +2255,6 @@ def _save_data_dig6(n, types='ClassicalExceptional', verbose=False): sage: save_quiver_data(2,up_to=False, verbose=False) # indirect doctest """ - import os.path - from six.moves import cPickle data = {} possible_types = ['Classical', 'ClassicalExceptional', 'Exceptional'] if types not in possible_types: @@ -2274,7 +2273,7 @@ def _save_data_dig6(n, types='ClassicalExceptional', verbose=False): sage_makedirs(types_path) from sage.misc.temporary_file import atomic_write with atomic_write(types_file, binary=True) as f: - cPickle.dump(data, f) + pickle.dump(data, f) if verbose: keys = sorted(data.keys(),key=str) print("\nThe following types are saved to file", types_file,"and will now be used to determine quiver mutation types:") diff --git a/src/sage/combinat/colored_permutations.py b/src/sage/combinat/colored_permutations.py index dc5bd6ef7f8..2227ee6f293 100644 --- a/src/sage/combinat/colored_permutations.py +++ b/src/sage/combinat/colored_permutations.py @@ -7,7 +7,6 @@ generalized to `G \wr S_n` """ import itertools -from six.moves import range from sage.structure.element import MultiplicativeGroupElement from sage.structure.parent import Parent diff --git a/src/sage/combinat/combinat.py b/src/sage/combinat/combinat.py index 4d16b1ce599..636b0525e4d 100644 --- a/src/sage/combinat/combinat.py +++ b/src/sage/combinat/combinat.py @@ -147,8 +147,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import range -from six import iteritems, add_metaclass from sage.interfaces.all import maxima from sage.rings.all import ZZ, QQ, Integer, infinity @@ -1368,8 +1366,8 @@ def index(self, key): return self._list.index(key) -@add_metaclass(InheritComparisonClasscallMetaclass) -class CombinatorialElement(CombinatorialObject, Element): +class CombinatorialElement(CombinatorialObject, Element, + metaclass=InheritComparisonClasscallMetaclass): """ ``CombinatorialElement`` is both a :class:`CombinatorialObject` and an :class:`Element`. So it represents a list which is an @@ -1456,8 +1454,7 @@ def __init__(self, parent, *args, **kwds): super(CombinatorialObject, self).__init__(parent) -@add_metaclass(ClasscallMetaclass) -class CombinatorialClass(Parent): +class CombinatorialClass(Parent, metaclass=ClasscallMetaclass): """ This class is deprecated, and will disappear as soon as all derived classes in Sage's library will have been fixed. Please derive @@ -2858,7 +2855,7 @@ def bell_polynomial(n, k): for p in Partitions(n, length=k): factorial_product = 1 power_factorial_product = 1 - for part, count in iteritems(p.to_exp_dict()): + for part, count in p.to_exp_dict().items(): factorial_product *= factorial(count) power_factorial_product *= factorial(part)**count coefficient = factorial(n) // (factorial_product * power_factorial_product) diff --git a/src/sage/combinat/combination.py b/src/sage/combinat/combination.py index b2a68056554..3722147f14a 100644 --- a/src/sage/combinat/combination.py +++ b/src/sage/combinat/combination.py @@ -25,7 +25,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six.moves import range from sage.interfaces.all import gap from sage.rings.all import ZZ, Integer diff --git a/src/sage/combinat/combinatorial_algebra.py b/src/sage/combinat/combinatorial_algebra.py index 948cfe9d907..a473c23813e 100644 --- a/src/sage/combinat/combinatorial_algebra.py +++ b/src/sage/combinat/combinatorial_algebra.py @@ -65,8 +65,6 @@ from sage.categories.all import AlgebrasWithBasis from sage.structure.element import Element -import six - # TODO: migrate this completely to the combinatorial free module + categories framework @@ -299,8 +297,8 @@ def product(self, left, right): #Do the case where the user specifies how to multiply basis elements if hasattr(self, '_multiply_basis'): - for (left_m, left_c) in six.iteritems(left._monomial_coefficients): - for (right_m, right_c) in six.iteritems(right._monomial_coefficients): + for (left_m, left_c) in left._monomial_coefficients.items(): + for (right_m, right_c) in right._monomial_coefficients.items(): res = self._multiply_basis(left_m, right_m) coeffprod = left_c * right_c #Handle the case where the user returns a dictionary @@ -313,7 +311,7 @@ def product(self, left, right): else: z_elt[res] = z_elt.get(res, ABRzero) + coeffprod continue - for m, c in six.iteritems(res): + for m, c in res.items(): z_elt[m] = z_elt.get(m, ABRzero) + coeffprod * c #We assume that the user handles the multiplication correctly on @@ -332,7 +330,7 @@ def product(self, left, right): BR = self.base_ring() zero = BR(0) del_list = [] - for m, c in six.iteritems(z_elt): + for m, c in z_elt.items(): if c == zero: del_list.append(m) for m in del_list: diff --git a/src/sage/combinat/composition.py b/src/sage/combinat/composition.py index 33bee8a475c..dea047aa63d 100644 --- a/src/sage/combinat/composition.py +++ b/src/sage/combinat/composition.py @@ -40,7 +40,6 @@ from sage.categories.cartesian_product import cartesian_product from .integer_lists import IntegerListsLex -from six.moves import builtins from sage.rings.integer import Integer from sage.combinat.combinatorial_map import combinatorial_map @@ -1668,7 +1667,7 @@ def __contains__(self, x): """ if isinstance(x, Composition): return True - elif isinstance(x, builtins.list): + elif isinstance(x, list): for i in x: if (not isinstance(i, (int, Integer))) and i not in ZZ: return False diff --git a/src/sage/combinat/composition_signed.py b/src/sage/combinat/composition_signed.py index a1c85faec26..4d4fbc201f6 100644 --- a/src/sage/combinat/composition_signed.py +++ b/src/sage/combinat/composition_signed.py @@ -16,7 +16,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six.moves import builtins import itertools @@ -91,7 +90,7 @@ def __contains__(self, x): sage: [-2, 1, -3] in SignedCompositions(6) True """ - if isinstance(x, builtins.list): + if isinstance(x, list): for z in x: if (not isinstance(z, (int, Integer))) and z not in ZZ: return False diff --git a/src/sage/combinat/composition_tableau.py b/src/sage/combinat/composition_tableau.py index f283845a02d..7c563bfffd1 100644 --- a/src/sage/combinat/composition_tableau.py +++ b/src/sage/combinat/composition_tableau.py @@ -5,8 +5,6 @@ - Chris Berg, Jeff Ferreira (2012-9): Initial version """ -from six.moves import range -from six import add_metaclass from sage.sets.disjoint_union_enumerated_sets import DisjointUnionEnumeratedSets from sage.sets.non_negative_integers import NonNegativeIntegers @@ -23,8 +21,7 @@ import copy -@add_metaclass(ClasscallMetaclass) -class CompositionTableau(CombinatorialElement): +class CompositionTableau(CombinatorialElement, metaclass=ClasscallMetaclass): r""" A composition tableau. diff --git a/src/sage/combinat/constellation.py b/src/sage/combinat/constellation.py index 5a67d7ebe80..50c40540dc6 100644 --- a/src/sage/combinat/constellation.py +++ b/src/sage/combinat/constellation.py @@ -49,9 +49,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from six.moves import range -from six import integer_types - from sage.structure.element import parent from sage.structure.parent import Parent from sage.structure.element import Element @@ -1509,7 +1506,7 @@ def perms_sym_init(g, sym=None): if sym is None: domain = set().union(*[perm_sym_domain(gg) for gg in g]) - if all(isinstance(s, (Integer,) + integer_types) and s > 0 + if all(isinstance(s, (int, Integer)) and s > 0 for s in domain): domain = max(domain) else: diff --git a/src/sage/combinat/crystals/kirillov_reshetikhin.py b/src/sage/combinat/crystals/kirillov_reshetikhin.py index afcc1fc669b..28b76b6f9c2 100644 --- a/src/sage/combinat/crystals/kirillov_reshetikhin.py +++ b/src/sage/combinat/crystals/kirillov_reshetikhin.py @@ -21,7 +21,6 @@ # library is heavily inspired from MuPAD-Combinat. # *************************************************************************** from __future__ import division, print_function -from six.moves import range from sage.misc.cachefunc import cached_method from sage.misc.lazy_attribute import lazy_attribute diff --git a/src/sage/combinat/crystals/monomial_crystals.py b/src/sage/combinat/crystals/monomial_crystals.py index 3e74b89dbd2..73c810bd594 100644 --- a/src/sage/combinat/crystals/monomial_crystals.py +++ b/src/sage/combinat/crystals/monomial_crystals.py @@ -99,8 +99,6 @@ from sage.rings.integer_ring import ZZ from sage.matrix.matrix_space import MatrixSpace -import six - class NakajimaMonomial(Element): r""" @@ -177,7 +175,7 @@ def _repr_Y(self): if not self._Y: return "1" - L = sorted(six.iteritems(self._Y), key=lambda x: (x[0][0], x[0][1])) + L = sorted(self._Y.items(), key=lambda x: (x[0][0], x[0][1])) exp = lambda e: "^{}".format(e) if e != 1 else "" return ' '.join("Y({},{})".format(mon[0][0], mon[0][1]) + exp(mon[1]) for mon in L) @@ -201,7 +199,7 @@ def _repr_A(self): if not Y and not self._A: return "1" - L = sorted(six.iteritems(Y), key=lambda x: (x[0][0], x[0][1])) + L = sorted(Y.items(), key=lambda x: (x[0][0], x[0][1])) exp = lambda e: "^{}".format(e) if e != 1 else "" ret = ' '.join("Y({},{})".format(mon[0][0], mon[0][1]) + exp(mon[1]) for mon in L) @@ -209,7 +207,7 @@ def _repr_A(self): return ret if Y: ret += ' ' - L = sorted(six.iteritems(self._A), key=lambda x: (x[0][0], x[0][1])) + L = sorted(self._A.items(), key=lambda x: (x[0][0], x[0][1])) return ret + ' '.join("A({},{})".format(mon[0][0], mon[0][1]) + exp(mon[1]) for mon in L) @@ -223,7 +221,7 @@ def __hash__(self): sage: hash(m1) != hash(m2) True """ - return hash(frozenset(tuple(six.iteritems(self._Y)))) + return hash(frozenset(tuple(self._Y.items()))) def __eq__(self, other): r""" @@ -300,7 +298,7 @@ def _latex_Y(self): if not self._Y: return "\\boldsymbol{1}" - L = sorted(six.iteritems(self._Y), key=lambda x:(x[0][0],x[0][1])) + L = sorted(self._Y.items(), key=lambda x:(x[0][0],x[0][1])) return_str = '' for x in L: if x[1] != 1: @@ -328,14 +326,14 @@ def _latex_A(self): if not Y and not self._A: return "\\boldsymbol{1}" - L = sorted(six.iteritems(Y), key=lambda x:(x[0][0],x[0][1])) + L = sorted(Y.items(), key=lambda x:(x[0][0],x[0][1])) return_str = '' for x in L: if x[1] != 1: return_str += "Y_{%s,%s}"%(x[0][0],x[0][1]) + "^{%s} "%x[1] else: return_str += "Y_{%s,%s} "%(x[0][0],x[0][1]) - L = sorted(six.iteritems(self._A), key=lambda x:(x[0][0],x[0][1])) + L = sorted(self._A.items(), key=lambda x:(x[0][0],x[0][1])) for x in L: if x[1] != 1: return_str += "A_{%s,%s}"%(x[0][0],x[0][1]) + "^{%s} "%x[1] @@ -362,7 +360,7 @@ def _classical_weight(self): """ P = self.parent().weight_lattice_realization() La = P.fundamental_weights() - return P(sum(v*La[k[0]] for k,v in six.iteritems(self._Y))) + return P(sum(v*La[k[0]] for k,v in self._Y.items())) def weight_in_root_lattice(self): r""" @@ -388,7 +386,7 @@ def weight_in_root_lattice(self): """ Q = RootSystem(self.parent().cartan_type()).root_lattice() al = Q.simple_roots() - return Q.sum(e*al[k[0]] for k,e in six.iteritems(self._A)) + return Q.sum(e*al[k[0]] for k,e in self._A.items()) def weight(self): r""" @@ -466,7 +464,7 @@ def phi(self, i): continue else: d[(i,a)] = 0 - S = sorted((x for x in six.iteritems(d) if x[0][0] == i), key=lambda x: x[0][1]) + S = sorted((x for x in d.items() if x[0][0] == i), key=lambda x: x[0][1]) return max(sum(S[k][1] for k in range(s)) for s in range(1,len(S)+1)) def _ke(self, i): @@ -498,7 +496,7 @@ def _ke(self, i): d[(i,a)] = 0 total = ZZ.zero() L = [] - S = sorted((x for x in six.iteritems(d) if x[0][0] == i), key=lambda x: x[0][1]) + S = sorted((x for x in d.items() if x[0][0] == i), key=lambda x: x[0][1]) for var,exp in S: total += exp if total == phi: @@ -531,7 +529,7 @@ def _kf(self, i): continue else: d[(i,a)] = 0 - S = sorted((x for x in six.iteritems(d) if x[0][0] == i), key=lambda x: x[0][1]) + S = sorted((x for x in d.items() if x[0][0] == i), key=lambda x: x[0][1]) sum = 0 phi = self.phi(i) for var,exp in S: @@ -601,7 +599,7 @@ def e(self, i): if cm[j_index,i-shift] != 0: Aik[(j, ke+c)] = cm[j_index,i-shift] # Multiply by Aik - for key,value in six.iteritems(Aik): + for key,value in Aik.items(): if key in newdict: if newdict[key] == -value: # The result would be a 0 exponent del newdict[key] @@ -650,7 +648,7 @@ def f(self, i): if cm[j_index,i-shift] != 0: Aik[(j, kf+c)] = -cm[j_index,i-shift] # Multiply by Aik - for key,value in six.iteritems(Aik): + for key,value in Aik.items(): if key in newdict: if newdict[key] == -value: # The result would be a 0 exponent del newdict[key] @@ -902,7 +900,7 @@ def _element_constructor_(self, Y=None, A=None): if ct.is_finite(): shift = 1 Y = {} - for k,v in six.iteritems(A): + for k,v in A.items(): Y[k] = Y.get(k, 0) + v Y[(k[0],k[1]+1)] = Y.get((k[0],k[1]+1), 0) + v for j_index,j in enumerate(I): diff --git a/src/sage/combinat/cyclic_sieving_phenomenon.py b/src/sage/combinat/cyclic_sieving_phenomenon.py index 5a826929614..e4e64868730 100644 --- a/src/sage/combinat/cyclic_sieving_phenomenon.py +++ b/src/sage/combinat/cyclic_sieving_phenomenon.py @@ -24,7 +24,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # https://www.gnu.org/licenses/ # **************************************************************************** -from six.moves import range from sage.rings.all import ZZ from sage.arith.all import lcm from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing diff --git a/src/sage/combinat/derangements.py b/src/sage/combinat/derangements.py index 42fe5133611..cf792e091a2 100644 --- a/src/sage/combinat/derangements.py +++ b/src/sage/combinat/derangements.py @@ -22,7 +22,6 @@ # # http://www.gnu.org/licenses/ # **************************************************************************** -from six.moves import range from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation diff --git a/src/sage/combinat/designs/bibd.py b/src/sage/combinat/designs/bibd.py index f37cac384d6..b1545bd9a53 100644 --- a/src/sage/combinat/designs/bibd.py +++ b/src/sage/combinat/designs/bibd.py @@ -53,8 +53,6 @@ from __future__ import division, print_function from __future__ import absolute_import -from six.moves import range - from sage.categories.sets_cat import EmptySetError from sage.misc.unknown import Unknown from .design_catalog import transversal_design diff --git a/src/sage/combinat/designs/block_design.py b/src/sage/combinat/designs/block_design.py index 047d6977db7..07a39e3e709 100644 --- a/src/sage/combinat/designs/block_design.py +++ b/src/sage/combinat/designs/block_design.py @@ -67,9 +67,6 @@ from sage.matrix.matrix_space import MatrixSpace -import six - - BlockDesign = IncidenceStructure ### utility functions ------------------------------------------------------- @@ -275,7 +272,7 @@ def ProjectiveGeometryDesign(n, d, F, algorithm=None, point_coordinates=True, ch blocks.append(b) B = BlockDesign(len(points), blocks, name="ProjectiveGeometryDesign", check=check) if point_coordinates: - B.relabel({i:p[0] for p,i in six.iteritems(points)}) + B.relabel({i:p[0] for p,i in points.items()}) elif algorithm == "gap": # Requires GAP's Design from sage.interfaces.gap import gap @@ -874,7 +871,7 @@ def AffineGeometryDesign(n, d, F, point_coordinates=True, check=True): B = BlockDesign(len(points), blocks, name="AffineGeometryDesign", check=check) if point_coordinates: - rd = {i:p[0][1:] for p,i in six.iteritems(points)} + rd = {i:p[0][1:] for p,i in points.items()} for v in rd.values(): v.set_immutable() B.relabel(rd) diff --git a/src/sage/combinat/designs/covering_design.py b/src/sage/combinat/designs/covering_design.py index f204dddd09e..41d1fe32754 100644 --- a/src/sage/combinat/designs/covering_design.py +++ b/src/sage/combinat/designs/covering_design.py @@ -46,7 +46,7 @@ # **************************************************************************** from __future__ import print_function -from six.moves.urllib.request import urlopen +from urllib.request import urlopen from sage.misc.sage_eval import sage_eval from sage.structure.sage_object import SageObject diff --git a/src/sage/combinat/designs/database.py b/src/sage/combinat/designs/database.py index 91e2f54fc70..1866fdc6b3c 100644 --- a/src/sage/combinat/designs/database.py +++ b/src/sage/combinat/designs/database.py @@ -47,8 +47,6 @@ --------- """ from __future__ import print_function, absolute_import -from six import iteritems -from six.moves import range, zip from sage.combinat.designs.orthogonal_arrays import (OA_from_quasi_difference_matrix, OA_from_Vmt, @@ -1685,7 +1683,7 @@ def OA_10_469(): blocks[len(B)].append(B) # Product of each symmetric design with the OA - for b_size,symmetric_design in iteritems(blocks): + for b_size,symmetric_design in blocks.items(): matrix = _reorder_matrix(symmetric_design) OA.extend([[B[xx] for xx in R] for R in incomplete_orthogonal_array(9,b_size,[1]*b_size) @@ -2695,7 +2693,7 @@ def QDM_57_9_1_1_8(): (12,413) : ((0,1,436,546,977,467,242,3695,682,483,3026,461,1334), _ref_Abel_v_12_t), } # Translate all V(m,t) into (mt+1,m+2;1,0;t)-QDM constructors -for (m,t),(vec,source) in iteritems(Vmt_vectors): +for (m,t),(vec,source) in Vmt_vectors.items(): n,k,lmbda,mu,u = (m*t+1,m+2,1,0,t) if not (n+u,lmbda) in QDM: QDM[n+u,lmbda] = {} diff --git a/src/sage/combinat/designs/difference_family.py b/src/sage/combinat/designs/difference_family.py index 6f7acf972b3..4d58fb67b1f 100644 --- a/src/sage/combinat/designs/difference_family.py +++ b/src/sage/combinat/designs/difference_family.py @@ -50,9 +50,6 @@ # python3 from __future__ import division, print_function, absolute_import -from builtins import zip -from six.moves import range - from sage.misc.cachefunc import cached_function from sage.categories.sets_cat import EmptySetError diff --git a/src/sage/combinat/designs/ext_rep.py b/src/sage/combinat/designs/ext_rep.py index f9662b13cac..57f3b7eb636 100644 --- a/src/sage/combinat/designs/ext_rep.py +++ b/src/sage/combinat/designs/ext_rep.py @@ -39,12 +39,11 @@ import os.path import gzip import bz2 + +from urllib.request import urlopen + from sage.misc.all import tmp_filename -# import compatible with py2 and py3 -import six -from six.moves.urllib.request import urlopen -from six import string_types, PY2 XML_NAMESPACE = 'http://designtheory.org/xml-namespace' DTRS_PROTOCOL = '2.0' @@ -662,7 +661,7 @@ def __init__(self, node): """ - if isinstance(node, string_types): + if isinstance(node, str): node = (node, {}, []) name, attributes, children = node self.xt_node = node @@ -870,7 +869,7 @@ def _start_element(self, name, attrs): elif name == 'designs': pass # self.outf.write(' <%s>\n' % name) if self.in_item: - for k, v in six.iteritems(attrs): + for k, v in attrs.items(): attrs[k] = _encode_attribute(v) new_node = (name, attrs, []) self.node_stack.append(new_node) @@ -990,10 +989,8 @@ def parse(self, xml_source): p.StartElementHandler = self._start_element p.EndElementHandler = self._end_element p.CharacterDataHandler = self._char_data - if PY2: - p.returns_unicode = 0 - if isinstance(xml_source, string_types+(bytes,)): + if isinstance(xml_source, (str, bytes)): p.Parse(xml_source) else: p.ParseFile(xml_source) diff --git a/src/sage/combinat/designs/group_divisible_designs.py b/src/sage/combinat/designs/group_divisible_designs.py index c68ae3c398f..ff7bf291603 100644 --- a/src/sage/combinat/designs/group_divisible_designs.py +++ b/src/sage/combinat/designs/group_divisible_designs.py @@ -31,7 +31,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.arith.all import is_prime_power from sage.misc.unknown import Unknown diff --git a/src/sage/combinat/designs/incidence_structures.py b/src/sage/combinat/designs/incidence_structures.py index 1a0c7b95fc3..12eb87c6c31 100644 --- a/src/sage/combinat/designs/incidence_structures.py +++ b/src/sage/combinat/designs/incidence_structures.py @@ -40,9 +40,6 @@ # ************************************************************************** from __future__ import print_function -import six -from six.moves import range - from sage.rings.integer import Integer from sage.misc.latex import latex from sage.sets.set import Set @@ -481,8 +478,8 @@ def is_isomorphic(self, other, certificate=False): if A == B: if certificate: - B_canon_rev = {y:x for x,y in six.iteritems(B_canon)} - return {x:B_canon_rev[xint] for x,xint in six.iteritems(A_canon)} + B_canon_rev = {y:x for x,y in B_canon.items()} + return {x:B_canon_rev[xint] for x,xint in A_canon.items()} else: return True else: @@ -889,7 +886,7 @@ def degrees(self, size=None): for s in combinations(b,size): d[s]+=1 if self._point_to_index: - return {tuple([self._points[x] for x in s]):v for s,v in six.iteritems(d)} + return {tuple([self._points[x] for x in s]):v for s,v in d.items()} else: return d @@ -1438,7 +1435,7 @@ def packing(self, solver=None, verbose=0): p.solve(log=verbose) return [[self._points[x] for x in self._blocks[i]] - for i, v in six.iteritems(p.get_values(b)) if v] + for i, v in p.get_values(b).items() if v] def is_t_design(self, t=None, v=None, k=None, l=None, return_parameters=False): r""" @@ -1961,7 +1958,7 @@ def is_resolvable(self, certificate=False, solver=None, verbose=0, check=True): else: # each class is stored as the list of indices of its blocks self._classes = [[] for _ in range(n_classes)] - for (t, i), v in six.iteritems(p.get_values(b)): + for (t, i), v in p.get_values(b).items(): if v: self._classes[t].append(self._blocks[i]) @@ -2073,7 +2070,7 @@ def coloring(self, k=None, solver=None, verbose=0): col = [[] for i in range(k)] - for (x,i),v in six.iteritems(p.get_values(b)): + for (x,i),v in p.get_values(b).items(): if v: col[i].append(self._points[x]) diff --git a/src/sage/combinat/designs/latin_squares.py b/src/sage/combinat/designs/latin_squares.py index 0926824cbf1..aced411b060 100644 --- a/src/sage/combinat/designs/latin_squares.py +++ b/src/sage/combinat/designs/latin_squares.py @@ -123,8 +123,6 @@ --------- """ from __future__ import print_function, absolute_import -from six import iteritems -from six.moves import zip from sage.rings.integer import Integer from sage.categories.sets_cat import EmptySetError @@ -449,7 +447,7 @@ def latin_square_product(M, N, *others): for jj in range(n)} L = lambda i_j: i_j[0] * n + i_j[1] - D = {(L(c[0]), L(c[1])): L(v) for c, v in iteritems(D)} + D = {(L(c[0]), L(c[1])): L(v) for c, v in D.items()} P = Matrix(D) if others: diff --git a/src/sage/combinat/designs/orthogonal_arrays.py b/src/sage/combinat/designs/orthogonal_arrays.py index 726296a53aa..7e47fd5402a 100644 --- a/src/sage/combinat/designs/orthogonal_arrays.py +++ b/src/sage/combinat/designs/orthogonal_arrays.py @@ -53,10 +53,6 @@ """ from __future__ import print_function, absolute_import -from builtins import zip -from six import iteritems -from six.moves import range - from sage.categories.sets_cat import EmptySetError from sage.misc.unknown import Unknown from .designs_pyx import is_orthogonal_array @@ -1362,8 +1358,8 @@ def incomplete_orthogonal_array(k,n,holes,resolvable=False, existence=False): # From a quasi-difference matrix elif (number_of_holes == 1 and any(uu == sum_of_holes and mu <= 1 and lmbda == 1 and k <= kk + 1 - for (nn,lmbda,mu,uu),(kk,_) in iteritems(QDM.get((n,1),{})))): - for (nn,lmbda,mu,uu),(kk,f) in iteritems(QDM[n,1]): + for (nn,lmbda,mu,uu),(kk,_) in QDM.get((n,1),{}).items())): + for (nn,lmbda,mu,uu),(kk,f) in QDM[n,1].items(): if uu == sum_of_holes and mu <= 1 and lmbda == 1 and k <= kk + 1: break G,M = f() @@ -1781,8 +1777,8 @@ def OA_from_quasi_difference_matrix(M,G,add_col=True,fill_hole=True): # A cache for addition in G G_sum = [[0] * Gn for _ in range(Gn)] - for x, i in iteritems(G_to_int): - for xx, ii in iteritems(G_to_int): + for x, i in G_to_int.items(): + for xx, ii in G_to_int.items(): G_sum[i][ii] = G_to_int[x + xx] # Convert M to integers diff --git a/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py b/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py index b1a6aa41310..f1e19383806 100644 --- a/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py +++ b/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py @@ -31,8 +31,6 @@ --------- """ from __future__ import print_function, absolute_import -from six.moves import range -from builtins import zip from .orthogonal_arrays import orthogonal_array, wilson_construction, is_orthogonal_array diff --git a/src/sage/combinat/designs/resolvable_bibd.py b/src/sage/combinat/designs/resolvable_bibd.py index 7b9836f0423..e942ec51631 100644 --- a/src/sage/combinat/designs/resolvable_bibd.py +++ b/src/sage/combinat/designs/resolvable_bibd.py @@ -48,7 +48,6 @@ --------- """ from __future__ import print_function, absolute_import, division -from six.moves import range from sage.arith.all import is_prime_power from sage.combinat.designs.bibd import BalancedIncompleteBlockDesign diff --git a/src/sage/combinat/designs/steiner_quadruple_systems.py b/src/sage/combinat/designs/steiner_quadruple_systems.py index 4a7092da2d6..a08266faca7 100644 --- a/src/sage/combinat/designs/steiner_quadruple_systems.py +++ b/src/sage/combinat/designs/steiner_quadruple_systems.py @@ -60,7 +60,6 @@ --------- """ from __future__ import print_function -from six.moves import range from sage.misc.cachefunc import cached_function from sage.combinat.designs.incidence_structures import IncidenceStructure diff --git a/src/sage/combinat/designs/twographs.py b/src/sage/combinat/designs/twographs.py index 2de7c09fb80..ecf0460fc89 100644 --- a/src/sage/combinat/designs/twographs.py +++ b/src/sage/combinat/designs/twographs.py @@ -247,7 +247,6 @@ def has_triple(x_y_z): return bool(v_to_blocks[x] & v_to_blocks[y] & v_to_blocks[z]) # Check that every quadruple contains an even number of triples - from six.moves.builtins import sum for quad in combinations(range(T.num_points()),4): if sum(map(has_triple,combinations(quad,3))) % 2 == 1: return False diff --git a/src/sage/combinat/diagram_algebras.py b/src/sage/combinat/diagram_algebras.py index 5037c6062fa..9e1591fb61a 100644 --- a/src/sage/combinat/diagram_algebras.py +++ b/src/sage/combinat/diagram_algebras.py @@ -23,7 +23,6 @@ # *************************************************************************** # python3 from __future__ import division -from six.moves import range from sage.categories.associative_algebras import AssociativeAlgebras from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets diff --git a/src/sage/combinat/dyck_word.py b/src/sage/combinat/dyck_word.py index 33ecc328190..a87cc7b2001 100644 --- a/src/sage/combinat/dyck_word.py +++ b/src/sage/combinat/dyck_word.py @@ -82,7 +82,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import range from .combinat import CombinatorialElement, catalan_number from sage.combinat.combinatorial_map import combinatorial_map diff --git a/src/sage/combinat/e_one_star.py b/src/sage/combinat/e_one_star.py index a32cc13ddac..0bc319e6399 100644 --- a/src/sage/combinat/e_one_star.py +++ b/src/sage/combinat/e_one_star.py @@ -208,7 +208,6 @@ # the License, or (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.misc.functional import det from sage.structure.sage_object import SageObject diff --git a/src/sage/combinat/finite_state_machine.py b/src/sage/combinat/finite_state_machine.py index 2e5c8d98847..a5d5421b070 100644 --- a/src/sage/combinat/finite_state_machine.py +++ b/src/sage/combinat/finite_state_machine.py @@ -931,9 +931,6 @@ # **************************************************************************** from __future__ import print_function -import six -from six.moves import range, zip_longest, zip - from IPython.lib.pretty import pretty import collections import itertools @@ -2105,7 +2102,7 @@ def _epsilon_successors_(self, fsm=None): _epsilon_successors_dict_[self].remove([]) # delete starting state if not _epsilon_successors_dict_[self]: del _epsilon_successors_dict_[self] - for s, outputs in six.iteritems(_epsilon_successors_dict_): + for s, outputs in _epsilon_successors_dict_.items(): _epsilon_successors_dict_[s] = [t for t, _ in itertools.groupby(sorted(outputs))] return _epsilon_successors_dict_ @@ -3220,10 +3217,10 @@ def __init__(self, elif hasattr(data, 'items'): # data is a dict (or something similar), # format: key = from_state, value = iterator of transitions - for (sf, iter_transitions) in six.iteritems(data): + for (sf, iter_transitions) in data.items(): self.add_state(sf) if hasattr(iter_transitions, 'items'): - for (st, transition) in six.iteritems(iter_transitions): + for (st, transition) in iter_transitions.items(): self.add_state(st) if is_FSMTransition(transition): self.add_transition(transition) @@ -5017,7 +5014,7 @@ def key_function(s): key=key_function )) - for ((source, target), transitions) in six.iteritems(adjacent): + for ((source, target), transitions) in adjacent.items(): if len(transitions) > 0: labels = [] for transition in transitions: @@ -6638,14 +6635,14 @@ def _iter_process_simple_(self, iterator): "'simple' iterator cannot be used " "here." % (len(current),)) - pos, states = next(six.iteritems(current)) + pos, states = next(iter(current.items())) if len(states) > 1: raise RuntimeError("Process has branched " "(visiting %s states in branch). The " "'simple' iterator cannot be used " "here." % (len(states),)) - state, branch = next(six.iteritems(states)) + state, branch = next(iter(states.items())) if len(branch.outputs) > 1: raise RuntimeError("Process has branched. " "(%s different outputs in branch). The " @@ -9816,7 +9813,6 @@ def construct_final_word_out(self, letters, allow_non_final=True): sage: F.state(0).final_word_out [] """ - from itertools import cycle if not isinstance(letters, list): letters = [letters] @@ -9875,14 +9871,14 @@ def find_final_word_out(state): assert(not in_progress) # trailing_letters is an infinite iterator additionally # marking positions - trailing_letters = cycle(enumerate(letters)) + trailing_letters = itertools.cycle(enumerate(letters)) find_final_word_out(state) # actual modifications can only be carried out after all final words # have been computed as it may not be permissible to stop at a # formerly non-final state unless a cycle has been completed. - for (state, position), final_word_out in six.iteritems(cache): + for (state, position), final_word_out in cache.items(): if position == 0 and final_word_out is not None: state.is_final = True state.final_word_out = final_word_out @@ -11802,7 +11798,7 @@ def is_equivalent(self, other): B = other.minimization().relabeled() labels = {B.process(path)[1].label(): state.label() - for (state, path) in six.iteritems(address)} + for (state, path) in address.items()} try: return A == B.relabeled(labels=labels) except KeyError: @@ -12233,8 +12229,8 @@ def shannon_parry_markov_chain(self): P.state(s.label()).color = 1/(w[states[s]] * ff) P.state(s.label()).initial_probability = w[states[s]] * u[states[s]] return P - - + + def with_output(self, word_out_function=None): r""" Construct a transducer out of this automaton. @@ -12805,14 +12801,14 @@ def cartesian_product(self, other, only_accessible_components=True): def function(*transitions): if equal(t.word_in for t in transitions): return (transitions[0].word_in, - list(zip_longest( + list(itertools.zip_longest( *(t.word_out for t in transitions) ))) else: raise LookupError def final_function(*states): - return list(zip_longest(*(s.final_word_out + return list(itertools.zip_longest(*(s.final_word_out for s in states))) return self.product_FiniteStateMachine( @@ -14106,7 +14102,7 @@ def tupleofwords_to_wordoftuples(tupleofwords): ....: ([1, 2], [3, 4, 5, 6], [7])) [(1, 3, 7), (2, 4, None), (None, 5, None), (None, 6, None)] """ - return list(zip_longest(*tupleofwords, fillvalue=None)) + return list(itertools.zip_longest(*tupleofwords, fillvalue=None)) def wordoftuples_to_tupleofwords(wordoftuples): @@ -14439,8 +14435,8 @@ def __repr__(self): """ data = sorted( (state, pos, tape_cache, outputs) - for pos, states in six.iteritems(self) - for state, (tape_cache, outputs) in six.iteritems(states)) + for pos, states in self.items() + for state, (tape_cache, outputs) in states.items()) branch = "branch" if len(data) == 1 else "branches" result = "process (%s %s)" % (len(data), branch) for s, sdata in itertools.groupby(data, lambda x: x[0]): @@ -14716,7 +14712,7 @@ def _push_branches_(self, state, tape_cache, outputs): 'but output is written.' % (state,)) for eps_state, eps_outputs in \ - six.iteritems(state._epsilon_successors_(self.fsm)): + state._epsilon_successors_(self.fsm).items(): if eps_state == state: continue # "eps_state == state" means epsilon cycle @@ -14909,7 +14905,7 @@ def step(current_state, input_tape, outputs): return states_dict = self._current_.pop(heapq.heappop(self._current_positions_)) - for state, branch in six.iteritems(states_dict): + for state, branch in states_dict.items(): step(state, branch.tape_cache, branch.outputs) return self._current_ diff --git a/src/sage/combinat/free_dendriform_algebra.py b/src/sage/combinat/free_dendriform_algebra.py index 176aa6cf759..32709cfaf7c 100644 --- a/src/sage/combinat/free_dendriform_algebra.py +++ b/src/sage/combinat/free_dendriform_algebra.py @@ -14,7 +14,6 @@ # the License, or (at your option) any later version. # http://www.gnu.org/licenses/ # **************************************************************************** -from six import iteritems from sage.categories.hopf_algebras import HopfAlgebras from sage.combinat.free_module import CombinatorialFreeModule @@ -166,7 +165,7 @@ def __init__(self, R, names=None): self._alphabet = names # Here one would need LabelledBinaryTrees(names) # so that one can restrict the labels to some fixed set - + cat = HopfAlgebras(R).WithBasis().Graded().Connected() CombinatorialFreeModule.__init__(self, R, Trees, latex_prefix="", @@ -252,7 +251,7 @@ def algebra_generators(self): """ Trees = self.basis().keys() return Family(self._alphabet, lambda a: self.monomial(Trees([], a))) - + def change_ring(self, R): """ Return the free dendriform algebra in the same variables over `R`. @@ -824,7 +823,8 @@ def _apply_functor_to_morphism(self, f): def action(x): return codom._from_dict({a: f(b) - for a, b in iteritems(x.monomial_coefficients())}) + for a, b in + x.monomial_coefficients().items()}) return dom.module_morphism(function=action, codomain=codom) def __eq__(self, other): diff --git a/src/sage/combinat/free_module.py b/src/sage/combinat/free_module.py index 60a8cdef42a..a7b316aeb3b 100644 --- a/src/sage/combinat/free_module.py +++ b/src/sage/combinat/free_module.py @@ -11,7 +11,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six.moves import range from sage.structure.unique_representation import UniqueRepresentation from sage.structure.parent import Parent @@ -33,8 +32,6 @@ from sage.typeset.unicode_art import UnicodeArt, unicode_art from sage.misc.superseded import deprecation -import six - class CombinatorialFreeModule(UniqueRepresentation, Module, IndexedGenerators): r""" @@ -338,7 +335,7 @@ def element_class(self): EXAMPLES:: sage: A = Algebras(QQ).WithBasis().example(); A - An example of an algebra with basis: + An example of an algebra with basis: the free algebra on the generators ('a', 'b', 'c') over Rational Field sage: A.element_class.mro() @@ -974,7 +971,7 @@ def from_vector(self, vector): True """ cc = self.get_order() - return self._from_dict({cc[index]: coeff for (index,coeff) in six.iteritems(vector)}) + return self._from_dict({cc[index]: coeff for (index,coeff) in vector.items()}) def sum(self, iter_of_elements): """ @@ -1186,9 +1183,9 @@ def _from_dict(self, d, coerce=False, remove_zeros=True): assert isinstance(d, dict) if coerce: R = self.base_ring() - d = {key: R(coeff) for key, coeff in six.iteritems(d)} + d = {key: R(coeff) for key, coeff in d.items()} if remove_zeros: - d = {key: coeff for key, coeff in six.iteritems(d) if coeff} + d = {key: coeff for key, coeff in d.items() if coeff} return self.element_class(self, d) diff --git a/src/sage/combinat/free_prelie_algebra.py b/src/sage/combinat/free_prelie_algebra.py index ce6abd8f63d..3ca4bd3adbe 100644 --- a/src/sage/combinat/free_prelie_algebra.py +++ b/src/sage/combinat/free_prelie_algebra.py @@ -15,7 +15,6 @@ # the License, or (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six import string_types from sage.categories.magmatic_algebras import MagmaticAlgebras from sage.categories.lie_algebras import LieAlgebras @@ -177,7 +176,7 @@ def __classcall_private__(cls, R, names=None): True """ if names is not None: - if isinstance(names, string_types) and ',' in names: + if isinstance(names, str) and ',' in names: names = [u for u in names if u != ','] names = Alphabet(names) diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py index 3f609ba6194..3323a1de19b 100644 --- a/src/sage/combinat/fully_packed_loop.py +++ b/src/sage/combinat/fully_packed_loop.py @@ -25,7 +25,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import division, print_function -from six import add_metaclass from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass from sage.structure.unique_representation import UniqueRepresentation @@ -96,8 +95,8 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False): return colors -@add_metaclass(InheritComparisonClasscallMetaclass) -class FullyPackedLoop(Element): + +class FullyPackedLoop(Element, metaclass=InheritComparisonClasscallMetaclass): r""" A class for fully packed loops. diff --git a/src/sage/combinat/gelfand_tsetlin_patterns.py b/src/sage/combinat/gelfand_tsetlin_patterns.py index 52d39ddb8c2..dd8b1d07e3f 100644 --- a/src/sage/combinat/gelfand_tsetlin_patterns.py +++ b/src/sage/combinat/gelfand_tsetlin_patterns.py @@ -37,8 +37,6 @@ # https://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range -from six import add_metaclass from sage.structure.parent import Parent from sage.structure.list_clone import ClonableArray @@ -55,8 +53,8 @@ from sage.misc.all import prod -@add_metaclass(InheritComparisonClasscallMetaclass) -class GelfandTsetlinPattern(ClonableArray): +class GelfandTsetlinPattern(ClonableArray, + metaclass=InheritComparisonClasscallMetaclass): r""" A Gelfand-Tsetlin (sometimes written as Gelfand-Zetlin or Gelfand-Cetlin) pattern. They were originally defined in [GC50]_. diff --git a/src/sage/combinat/gray_codes.py b/src/sage/combinat/gray_codes.py index d30f24d6847..d9c6da78127 100644 --- a/src/sage/combinat/gray_codes.py +++ b/src/sage/combinat/gray_codes.py @@ -13,7 +13,6 @@ --------- """ from __future__ import print_function -from six.moves import range def product(m): diff --git a/src/sage/combinat/growth.py b/src/sage/combinat/growth.py index 141fe345d4b..d26bf37e0b5 100644 --- a/src/sage/combinat/growth.py +++ b/src/sage/combinat/growth.py @@ -471,7 +471,9 @@ # https://www.gnu.org/licenses/ # *************************************************************************** -from six.moves import zip_longest +from copy import copy +from itertools import zip_longest + from sage.structure.sage_object import SageObject from sage.structure.unique_representation import UniqueRepresentation from sage.combinat.posets.posets import Poset @@ -485,7 +487,6 @@ from sage.combinat.core import Core, Cores from sage.combinat.k_tableau import WeakTableau, StrongTableau from sage.combinat.shifted_primed_tableau import ShiftedPrimedTableau -from copy import copy from sage.graphs.digraph import DiGraph def _make_partition(l): diff --git a/src/sage/combinat/integer_list_old.py b/src/sage/combinat/integer_list_old.py index 885ae4126b6..2912a2d6e0c 100644 --- a/src/sage/combinat/integer_list_old.py +++ b/src/sage/combinat/integer_list_old.py @@ -31,7 +31,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import builtins from sage.arith.all import binomial from sage.rings.integer_ring import ZZ @@ -417,7 +416,7 @@ def iterator(n, min_length, max_length, floor, ceiling, min_slope, max_slope): succ = lambda x: next(x, min_length, max_length, floor, ceiling, min_slope, max_slope) # Handle the case where n is a list of integers - if isinstance(n, builtins.list): + if isinstance(n, list): for i in range(n[0], min(n[1]+1, upper_bound(min_length, max_length, floor, ceiling, min_slope, max_slope))): for el in iterator(i, min_length, max_length, floor, ceiling, min_slope, max_slope): yield el @@ -912,7 +911,7 @@ def __init__(self, # Is ``floor`` an iterable? # Not ``floor[:]`` because we want ``self.floor_list`` # mutable, and applying [:] to a tuple gives a tuple. - self.floor_list = builtins.list(floor) + self.floor_list = list(floor) # Make sure the floor list will make the list satisfy the constraints if min_slope != float('-inf'): for i in range(1, len(self.floor_list)): @@ -931,7 +930,7 @@ def __init__(self, else: try: # Is ``ceiling`` an iterable? - self.ceiling_list = builtins.list(ceiling) + self.ceiling_list = list(ceiling) # Make sure the ceiling list will make the list satisfy the constraints if max_slope != float('+inf'): for i in range(1, len(self.ceiling_list)): @@ -1211,6 +1210,6 @@ def __contains__(self, v): sage: all(v in C for v in C) True """ - if isinstance(v, self.element_class) or isinstance(v, builtins.list): + if isinstance(v, self.element_class) or isinstance(v, list): return is_a(v, *(self.build_args())) and sum(v) in self.n_range return False diff --git a/src/sage/combinat/integer_lists/lists.py b/src/sage/combinat/integer_lists/lists.py index 924cd0647dd..8795add6e56 100644 --- a/src/sage/combinat/integer_lists/lists.py +++ b/src/sage/combinat/integer_lists/lists.py @@ -25,7 +25,6 @@ from sage.structure.list_clone import ClonableArray from sage.structure.parent import Parent from sage.combinat.integer_lists.base import IntegerListsBackend -from six import get_method_function class IntegerList(ClonableArray): @@ -174,9 +173,9 @@ def __eq__(self, other): a = self._element_constructor_ b = other._element_constructor_ if ismethod(a): - a = get_method_function(a) + a = a.__func__ if ismethod(b): - b = get_method_function(b) + b = b.__func__ return a == b def __ne__(self, other): @@ -208,7 +207,7 @@ def __hash__(self): """ a = self._element_constructor_ if ismethod(a): - a = get_method_function(a) + a = a.__func__ return hash((self.__class__, a)) def __iter__(self): diff --git a/src/sage/combinat/integer_vector.py b/src/sage/combinat/integer_vector.py index 3a1c08cfdec..415ef8d43b0 100644 --- a/src/sage/combinat/integer_vector.py +++ b/src/sage/combinat/integer_vector.py @@ -28,8 +28,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import, division -from six.moves import range -from six import add_metaclass from sage.combinat.integer_lists import IntegerListsLex from itertools import product @@ -449,8 +447,7 @@ def check(self): raise ValueError("all entries must be non-negative") -@add_metaclass(ClasscallMetaclass) -class IntegerVectors(Parent): +class IntegerVectors(Parent, metaclass=ClasscallMetaclass): """ The class of (non-negative) integer vectors. @@ -572,7 +569,7 @@ class IntegerVectors(Parent): [[4], [3, 1], [2, 2], [1, 3], [0, 4]] .. SEEALSO:: - + :class: `sage.combinat.integer_lists.invlex.IntegerListsLex`. """ @staticmethod diff --git a/src/sage/combinat/interval_posets.py b/src/sage/combinat/interval_posets.py index de37d92a461..2335bc71276 100644 --- a/src/sage/combinat/interval_posets.py +++ b/src/sage/combinat/interval_posets.py @@ -31,8 +31,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six.moves import range -from six import add_metaclass from sage.categories.enumerated_sets import EnumeratedSets from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets @@ -61,8 +59,8 @@ from sage.graphs.digraph import DiGraph -@add_metaclass(InheritComparisonClasscallMetaclass) -class TamariIntervalPoset(Element): +class TamariIntervalPoset(Element, + metaclass=InheritComparisonClasscallMetaclass): r""" The class of Tamari interval-posets. diff --git a/src/sage/combinat/k_tableau.py b/src/sage/combinat/k_tableau.py index 8770fb9c464..f6f892ba2d7 100644 --- a/src/sage/combinat/k_tableau.py +++ b/src/sage/combinat/k_tableau.py @@ -30,7 +30,6 @@ # http://www.gnu.org/licenses/ #**************************************************************************** from __future__ import print_function, absolute_import -from six import add_metaclass, iteritems from sage.structure.unique_representation import UniqueRepresentation from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets @@ -259,8 +258,8 @@ def WeakTableaux(k, shape , weight, representation = "core"): raise NotImplementedError("The representation option needs to be 'core', 'bounded', or 'factorized_permutation'") #Abstract class for the elements of weak tableau -@add_metaclass(InheritComparisonClasscallMetaclass) -class WeakTableau_abstract(ClonableList): +class WeakTableau_abstract(ClonableList, + metaclass=InheritComparisonClasscallMetaclass): r""" Abstract class for the various element classes of WeakTableau. """ @@ -1020,7 +1019,7 @@ def list_of_standard_cells(self): r = self[0].count(1) - i - 1 for v in range(1,mu[i]): D = self.dictionary_of_coordinates_at_residues(v+1) - new_D = {a: b for (a, b) in iteritems(D) + new_D = {a: b for (a, b) in D.items() if all(x not in already_used for x in b)} r = (r - min([self.k+1 - (x-r)%(self.k+1) for x in new_D]))%(self.k+1) standard_cells.append(new_D[r][-1]) @@ -2206,8 +2205,7 @@ def __iter__(self): ######## END weak tableaux BEGIN strong tableaux -@add_metaclass(InheritComparisonClasscallMetaclass) -class StrongTableau(ClonableList): +class StrongTableau(ClonableList, metaclass=InheritComparisonClasscallMetaclass): r""" A (standard) strong `k`-tableau is a (saturated) chain in Bruhat order. diff --git a/src/sage/combinat/lr_tableau.py b/src/sage/combinat/lr_tableau.py index ce9691c56d1..6d14d998066 100644 --- a/src/sage/combinat/lr_tableau.py +++ b/src/sage/combinat/lr_tableau.py @@ -27,6 +27,8 @@ # http://www.gnu.org/licenses/ #**************************************************************************** +from itertools import zip_longest + from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets from sage.combinat.tableau import SemistandardTableau, SemistandardTableaux from sage.combinat.partition import Partition, Partitions @@ -300,6 +302,5 @@ def _tableau_join(t1, t2, shift=0): sage: _tableau_join([[1,2]],[[None,None,2],[3]],shift=5) [[1, 2, 7], [8]] """ - from six.moves import zip_longest return [[e1 for e1 in row1] + [e2+shift for e2 in row2 if e2 is not None] for (row1, row2) in zip_longest(t1, t2, fillvalue=[])] diff --git a/src/sage/combinat/matrices/hadamard_matrix.py b/src/sage/combinat/matrices/hadamard_matrix.py index 75aac8a4155..45fb4cee9d9 100644 --- a/src/sage/combinat/matrices/hadamard_matrix.py +++ b/src/sage/combinat/matrices/hadamard_matrix.py @@ -55,8 +55,7 @@ #***************************************************************************** from __future__ import print_function -from six.moves import range -from six.moves.urllib.request import urlopen +from urllib.request import urlopen from sage.rings.integer_ring import ZZ from sage.matrix.constructor import matrix, block_matrix, block_diagonal_matrix, diagonal_matrix diff --git a/src/sage/combinat/matrices/latin.py b/src/sage/combinat/matrices/latin.py index 97dcce10ae4..5d85d559ac4 100644 --- a/src/sage/combinat/matrices/latin.py +++ b/src/sage/combinat/matrices/latin.py @@ -128,7 +128,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range from sage.matrix.all import matrix from sage.rings.all import ZZ diff --git a/src/sage/combinat/misc.py b/src/sage/combinat/misc.py index 666b7df513b..6e95cc23d14 100644 --- a/src/sage/combinat/misc.py +++ b/src/sage/combinat/misc.py @@ -17,7 +17,6 @@ #***************************************************************************** from __future__ import print_function -from six.moves import range from sage.misc.all import prod class DoublyLinkedList(): diff --git a/src/sage/combinat/multiset_partition_into_sets_ordered.py b/src/sage/combinat/multiset_partition_into_sets_ordered.py index 792e884c62b..2b15f9cb899 100755 --- a/src/sage/combinat/multiset_partition_into_sets_ordered.py +++ b/src/sage/combinat/multiset_partition_into_sets_ordered.py @@ -62,8 +62,6 @@ # **************************************************************************** from __future__ import absolute_import, division -from six.moves import range -from six import add_metaclass, iteritems from functools import reduce from itertools import chain @@ -96,8 +94,9 @@ from sage.combinat.crystals.letters import CrystalOfLetters as Letters from sage.combinat.root_system.cartan_type import CartanType -@add_metaclass(InheritComparisonClasscallMetaclass) -class OrderedMultisetPartitionIntoSets(ClonableArray): + +class OrderedMultisetPartitionIntoSets(ClonableArray, + metaclass=InheritComparisonClasscallMetaclass): r""" Ordered Multiset Partition into sets @@ -1403,7 +1402,7 @@ def __classcall_private__(self, *args, **constraints): # Should be a 'dictionary' of letter-frequencies, but accept a weak composition w = constraints["weight"] if not isinstance(w, dict): - # make sure we didn't receive ``iteritems(some_dict)`` + # make sure we didn't receive ``some_dict.items()`` if len(w) > 0 and isinstance(w[0], (list, tuple)): w = dict(w) else: @@ -1411,7 +1410,7 @@ def __classcall_private__(self, *args, **constraints): if not all((a in ZZ and a > 0) for a in w.values()): raise ValueError("%s must be a dictionary of letter-frequencies or a weak composition"%w) else: - constraints["weight"] = tuple(iteritems(w)) + constraints["weight"] = tuple(w.items()) if "alphabet" in constraints: A = constraints["alphabet"] @@ -1454,7 +1453,7 @@ def __classcall_private__(self, *args, **constraints): suff = "" offenses = str(over_determined.pop()) raise ValueError("cannot pass multiset as first argument and %s as keyword argument%s" % (offenses, suff)) - X_items = tuple(iteritems(X)) + X_items = tuple(X.items()) if constraints == {}: return OrderedMultisetPartitionsIntoSets_X(X_items) else: @@ -1560,7 +1559,7 @@ def __init__(self, is_finite=None, **constraints): # pop keys with empty values, with the exception of 'size' or 'order' self.constraints = {} - for (key,val) in iteritems(constraints): + for (key,val) in constraints.items(): if val: self.constraints[key] = val elif key in ("size", "order", "length") and val is not None: @@ -1622,7 +1621,7 @@ def _constraint_repr_(self, cdict=None): A = sorted(cdict["alphabet"]) cdict["alphabet"] = "{" + repr(A)[1:-1] + "}" constr = "" - ss = ['%s=%s' % item for item in iteritems(cdict)] + ss = ['%s=%s' % item for item in cdict.items()] ss = sorted(ss) if len(ss) > 1: constr = " with constraints: " + ", ".join(ss) @@ -1723,7 +1722,7 @@ def _satisfies_constraints(self, x): False """ X = _concatenate(x) - P = OrderedMultisetPartitionsIntoSets_X(tuple(iteritems(_get_weight(X)))) + P = OrderedMultisetPartitionsIntoSets_X(tuple(_get_weight(X).items())) x = P.element_class(P, [frozenset(block) for block in x]) constr = self.full_constraints tsts = [] @@ -1952,8 +1951,7 @@ def subset(self, size): # slice by 'order' if "alphabet" in fc: - no_alpha = {k: v for (k, v) in iteritems(self.constraints) - if k != "alphabet"} + no_alpha = {k: v for (k, v) in self.constraints.items() if k != "alphabet"} return OrderedMultisetPartitionsIntoSets(fc["alphabet"], size, **no_alpha) # slice by 'size' diff --git a/src/sage/combinat/ncsym/dual.py b/src/sage/combinat/ncsym/dual.py index 20db5249f31..dbf3c95830f 100644 --- a/src/sage/combinat/ncsym/dual.py +++ b/src/sage/combinat/ncsym/dual.py @@ -11,7 +11,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.misc.lazy_attribute import lazy_attribute from sage.misc.misc_c import prod diff --git a/src/sage/combinat/ncsym/ncsym.py b/src/sage/combinat/ncsym/ncsym.py index da15d99f0ea..2c4a1ca714f 100644 --- a/src/sage/combinat/ncsym/ncsym.py +++ b/src/sage/combinat/ncsym/ncsym.py @@ -11,7 +11,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # https://www.gnu.org/licenses/ # **************************************************************************** -from six.moves import range from sage.misc.cachefunc import cached_method from sage.misc.misc_c import prod diff --git a/src/sage/combinat/necklace.py b/src/sage/combinat/necklace.py index 5a4b6b63ccb..69345c662f6 100644 --- a/src/sage/combinat/necklace.py +++ b/src/sage/combinat/necklace.py @@ -21,7 +21,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.combinat.composition import Composition from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets diff --git a/src/sage/combinat/ordered_tree.py b/src/sage/combinat/ordered_tree.py index 95873af80dc..4322f309c9a 100644 --- a/src/sage/combinat/ordered_tree.py +++ b/src/sage/combinat/ordered_tree.py @@ -19,8 +19,6 @@ #python 3 support from __future__ import division, absolute_import, print_function, unicode_literals -from six import add_metaclass - import itertools from sage.structure.list_clone import ClonableArray, ClonableList @@ -41,8 +39,8 @@ from sage.rings.infinity import Infinity -@add_metaclass(InheritComparisonClasscallMetaclass) -class OrderedTree(AbstractClonableTree, ClonableList): +class OrderedTree(AbstractClonableTree, ClonableList, + metaclass=InheritComparisonClasscallMetaclass): """ The class of (ordered rooted) trees. @@ -356,7 +354,7 @@ def to_parallelogram_polyomino(self, bijection=None): INPUT: - - ``bijection`` -- (default:``'Boussicault-Socci'``) is the name of the + - ``bijection`` -- (default:``'Boussicault-Socci'``) is the name of the bijection to use. Possible values are ``'Boussicault-Socci'``, ``'via dyck and Delest-Viennot'``. @@ -386,7 +384,7 @@ def to_parallelogram_polyomino(self, bijection=None): def _to_parallelogram_polyomino_Boussicault_Socci(self): r""" - Return the polyomino parallelogram using the Boussicault-Socci + Return the polyomino parallelogram using the Boussicault-Socci bijection. EXAMPLES:: diff --git a/src/sage/combinat/output.py b/src/sage/combinat/output.py index 93d9f3b7971..f7980607df6 100644 --- a/src/sage/combinat/output.py +++ b/src/sage/combinat/output.py @@ -13,8 +13,6 @@ from __future__ import absolute_import, print_function -from six.moves import range - from string import Template from sage.combinat.tableau import Tableaux diff --git a/src/sage/combinat/parallelogram_polyomino.py b/src/sage/combinat/parallelogram_polyomino.py index 24a0d00081c..4dc32a7c066 100644 --- a/src/sage/combinat/parallelogram_polyomino.py +++ b/src/sage/combinat/parallelogram_polyomino.py @@ -20,8 +20,6 @@ division, absolute_import, print_function, unicode_literals ) -from six.moves import range -from six import add_metaclass from sage.structure.list_clone import ClonableList from sage.structure.unique_representation import UniqueRepresentation @@ -877,8 +875,8 @@ def draw_point(self, p1, color=None, size=None): ) -@add_metaclass(InheritComparisonClasscallMetaclass) -class ParallelogramPolyomino(ClonableList): +class ParallelogramPolyomino(ClonableList, + metaclass=InheritComparisonClasscallMetaclass): r""" Parallelogram Polyominoes. diff --git a/src/sage/combinat/parking_functions.py b/src/sage/combinat/parking_functions.py index b79c49ca9e6..80e508022ae 100644 --- a/src/sage/combinat/parking_functions.py +++ b/src/sage/combinat/parking_functions.py @@ -62,7 +62,6 @@ # the License, or (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.rings.integer import Integer from sage.rings.all import QQ diff --git a/src/sage/combinat/partition.py b/src/sage/combinat/partition.py index e046474e857..9727c06b6ef 100644 --- a/src/sage/combinat/partition.py +++ b/src/sage/combinat/partition.py @@ -282,8 +282,6 @@ from __future__ import print_function, absolute_import from copy import copy -import six -from six.moves import range, zip from sage.libs.all import pari from sage.libs.flint.arith import number_of_partitions as flint_number_of_partitions @@ -3671,7 +3669,7 @@ def centralizer_size(self, t=0, q=0): 48 """ size = prod(i ** mi * factorial(mi) - for i, mi in six.iteritems(self.to_exp_dict())) + for i, mi in self.to_exp_dict().items()) if t or q: size *= prod((ZZ.one() - q ** j) / (ZZ.one() - t ** j) for j in self) diff --git a/src/sage/combinat/partition_algebra.py b/src/sage/combinat/partition_algebra.py index 6556b03ba8e..ce8a2288429 100644 --- a/src/sage/combinat/partition_algebra.py +++ b/src/sage/combinat/partition_algebra.py @@ -16,7 +16,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six.moves import range from .combinat import catalan_number from .combinatorial_algebra import CombinatorialAlgebra, CombinatorialAlgebraElement diff --git a/src/sage/combinat/partition_tuple.py b/src/sage/combinat/partition_tuple.py index a78798746a1..f3b6c05e403 100644 --- a/src/sage/combinat/partition_tuple.py +++ b/src/sage/combinat/partition_tuple.py @@ -255,8 +255,6 @@ class of modules for the algebras, which are generalisations of the Specht #***************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range - import itertools from .combinat import CombinatorialElement diff --git a/src/sage/combinat/perfect_matching.py b/src/sage/combinat/perfect_matching.py index 16924dca039..8e65e9c9cc5 100644 --- a/src/sage/combinat/perfect_matching.py +++ b/src/sage/combinat/perfect_matching.py @@ -54,7 +54,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import division, print_function -from six.moves import range from sage.misc.cachefunc import cached_method from sage.rings.integer import Integer diff --git a/src/sage/combinat/permutation.py b/src/sage/combinat/permutation.py index a68d6734f81..8e6899275bf 100644 --- a/src/sage/combinat/permutation.py +++ b/src/sage/combinat/permutation.py @@ -233,9 +233,6 @@ #***************************************************************************** from __future__ import print_function, absolute_import -from builtins import zip -from six.moves import range - from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets diff --git a/src/sage/combinat/plane_partition.py b/src/sage/combinat/plane_partition.py index 24815ac122b..c61717fd833 100644 --- a/src/sage/combinat/plane_partition.py +++ b/src/sage/combinat/plane_partition.py @@ -23,8 +23,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range -from six import add_metaclass from sage.structure.list_clone import ClonableArray from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass @@ -37,8 +35,8 @@ from sage.combinat.tableau import Tableau -@add_metaclass(InheritComparisonClasscallMetaclass) -class PlanePartition(ClonableArray): +class PlanePartition(ClonableArray, + metaclass=InheritComparisonClasscallMetaclass): r""" A plane partition. diff --git a/src/sage/combinat/posets/hasse_diagram.py b/src/sage/combinat/posets/hasse_diagram.py index 334a1a0985d..de9c28a785a 100644 --- a/src/sage/combinat/posets/hasse_diagram.py +++ b/src/sage/combinat/posets/hasse_diagram.py @@ -17,8 +17,6 @@ # **************************************************************************** from __future__ import print_function -from six.moves import range - from sage.graphs.digraph import DiGraph from sage.matrix.constructor import matrix from sage.rings.integer_ring import ZZ diff --git a/src/sage/combinat/posets/lattices.py b/src/sage/combinat/posets/lattices.py index 66d08b4f3e7..11718697a2b 100644 --- a/src/sage/combinat/posets/lattices.py +++ b/src/sage/combinat/posets/lattices.py @@ -146,8 +146,6 @@ # # https://www.gnu.org/licenses/ # ***************************************************************************** -from six.moves import range -from six import iteritems from sage.categories.finite_lattice_posets import FiniteLatticePosets from sage.combinat.posets.posets import Poset, FinitePoset @@ -1830,7 +1828,7 @@ def is_relatively_complemented(self, certificate=False): for e1 in range(n - 1): C = Counter(flatten([H.neighbors_out(e2) for e2 in H.neighbors_out(e1)])) - for e3, c in iteritems(C): + for e3, c in C.items(): if c == 1 and len(H.closed_interval(e1, e3)) == 3: if not certificate: return False diff --git a/src/sage/combinat/posets/linear_extensions.py b/src/sage/combinat/posets/linear_extensions.py index b466e0a8c36..cb3064004a8 100644 --- a/src/sage/combinat/posets/linear_extensions.py +++ b/src/sage/combinat/posets/linear_extensions.py @@ -25,8 +25,6 @@ # http://www.gnu.org/licenses/ #**************************************************************************** from __future__ import print_function -from six.moves import range -from six import add_metaclass from sage.rings.rational_field import QQ from sage.structure.unique_representation import UniqueRepresentation @@ -38,8 +36,8 @@ from sage.structure.list_clone import ClonableArray -@add_metaclass(InheritComparisonClasscallMetaclass) -class LinearExtensionOfPoset(ClonableArray): +class LinearExtensionOfPoset(ClonableArray, + metaclass=InheritComparisonClasscallMetaclass): r""" A linear extension of a finite poset `P` of size `n` is a total ordering `\pi := \pi_0 \pi_1 \ldots \pi_{n-1}` of its elements diff --git a/src/sage/combinat/posets/poset_examples.py b/src/sage/combinat/posets/poset_examples.py index 21f513686ef..afc7af37029 100644 --- a/src/sage/combinat/posets/poset_examples.py +++ b/src/sage/combinat/posets/poset_examples.py @@ -81,7 +81,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six import add_metaclass, string_types from sage.misc.classcall_metaclass import ClasscallMetaclass import sage.categories.posets @@ -95,8 +94,7 @@ from sage.rings.integer import Integer -@add_metaclass(ClasscallMetaclass) -class Posets(object): +class Posets(metaclass=ClasscallMetaclass): r""" A collection of posets and lattices. @@ -849,7 +847,7 @@ def RandomLattice(n, p, properties=None): D.relabel([i-1 for i in Permutations(n).random_element()]) return LatticePoset(D, cover_relations=True) - if isinstance(properties, string_types): + if isinstance(properties, str): properties = set([properties]) else: properties = set(properties) diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py index deac1eff88b..2795700652b 100644 --- a/src/sage/combinat/posets/posets.py +++ b/src/sage/combinat/posets/posets.py @@ -273,9 +273,6 @@ # **************************************************************************** from __future__ import division, print_function, absolute_import -from six.moves import range, builtins -from six import iteritems - from copy import copy, deepcopy from sage.misc.cachefunc import cached_method from sage.misc.lazy_attribute import lazy_attribute @@ -3148,7 +3145,7 @@ def init_LP(k,cycles,inc_P): # We create the digraphs of all color classes linear_extensions = [hasse_diagram.copy() for i in range(k)] - for ((u,v),i),x in iteritems(p.get_values(b)): + for ((u,v),i),x in p.get_values(b).items(): if x == 1: linear_extensions[i].add_edge(u,v) @@ -4132,7 +4129,7 @@ def isomorphic_subposets(self, other): return [self.subposet([self._list[i] for i in x]) for x in sorted(set(frozenset(y) for y in L))] # Caveat: list is overridden by the method list above!!! - def antichains(self, element_constructor=builtins.list): + def antichains(self, element_constructor=type([])): """ Return the antichains of the poset. @@ -4338,7 +4335,7 @@ def dilworth_decomposition(self): chains.append(chain) return chains - def chains(self, element_constructor=builtins.list, exclude=None): + def chains(self, element_constructor=type([]), exclude=None): """ Return the chains of the poset. @@ -5682,7 +5679,7 @@ def canonical_label(self, algorithm=None): """ canonical_label = self._hasse_diagram.canonical_label(certificate=True, algorithm=algorithm)[1] - canonical_label = {self._elements[v]:i for v,i in iteritems(canonical_label)} + canonical_label = {self._elements[v]:i for v,i in canonical_label.items()} return self.relabel(canonical_label) def with_linear_extension(self, linear_extension): @@ -7308,7 +7305,7 @@ def is_slender(self, certificate=False): for y in self.upper_covers(x): for c in self.upper_covers(y): d[c] = d.get(c, 0) + 1 - for c, y in iteritems(d): + for c, y in d.items(): if y >= 3: if certificate: return (False, (x, c)) diff --git a/src/sage/combinat/ranker.py b/src/sage/combinat/ranker.py index e3db5328a0e..4017b340522 100644 --- a/src/sage/combinat/ranker.py +++ b/src/sage/combinat/ranker.py @@ -17,7 +17,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from collections import Iterable, Sequence from sage.misc.cachefunc import cached_function diff --git a/src/sage/combinat/rigged_configurations/kleber_tree.py b/src/sage/combinat/rigged_configurations/kleber_tree.py index 2bae940a517..0011a1d36c3 100644 --- a/src/sage/combinat/rigged_configurations/kleber_tree.py +++ b/src/sage/combinat/rigged_configurations/kleber_tree.py @@ -65,7 +65,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from six.moves import range import itertools from sage.misc.lazy_attribute import lazy_attribute diff --git a/src/sage/combinat/rigged_configurations/tensor_product_kr_tableaux_element.py b/src/sage/combinat/rigged_configurations/tensor_product_kr_tableaux_element.py index f1009a0fc6f..99af798bfb3 100644 --- a/src/sage/combinat/rigged_configurations/tensor_product_kr_tableaux_element.py +++ b/src/sage/combinat/rigged_configurations/tensor_product_kr_tableaux_element.py @@ -25,8 +25,6 @@ #***************************************************************************** from __future__ import print_function -from six.moves import range - from sage.combinat.crystals.tensor_product import TensorProductOfRegularCrystalsElement class TensorProductOfKirillovReshetikhinTableauxElement(TensorProductOfRegularCrystalsElement): @@ -219,7 +217,7 @@ def classical_weight(self): EXAMPLES:: sage: KRT = crystals.TensorProductOfKirillovReshetikhinTableaux(['D',4,1], [[2,2]]) - sage: elt = KRT(pathlist=[[3,2,-1,1]]); elt + sage: elt = KRT(pathlist=[[3,2,-1,1]]); elt [[2, 1], [3, -1]] sage: elt.classical_weight() (0, 1, 1, 0) diff --git a/src/sage/combinat/root_system/ambient_space.py b/src/sage/combinat/root_system/ambient_space.py index 1ccd5c9c13c..3950cef7edc 100644 --- a/src/sage/combinat/root_system/ambient_space.py +++ b/src/sage/combinat/root_system/ambient_space.py @@ -15,8 +15,6 @@ from sage.rings.all import ZZ, QQ from sage.categories.homset import End -import six - class AmbientSpace(CombinatorialFreeModule): r""" @@ -384,7 +382,7 @@ def inner_product(self, lambdacheck): lambdacheck_mc = lambdacheck._monomial_coefficients result = self.parent().base_ring().zero() - for t,c in six.iteritems(lambdacheck_mc): + for t,c in lambdacheck_mc.items(): if t not in self_mc: continue result += c*self_mc[t] diff --git a/src/sage/combinat/root_system/cartan_matrix.py b/src/sage/combinat/root_system/cartan_matrix.py index ad04d337884..0a02a262f7c 100644 --- a/src/sage/combinat/root_system/cartan_matrix.py +++ b/src/sage/combinat/root_system/cartan_matrix.py @@ -25,8 +25,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range -from six import add_metaclass from sage.misc.cachefunc import cached_method from sage.matrix.constructor import matrix @@ -43,8 +41,8 @@ from sage.graphs.digraph import DiGraph -@add_metaclass(InheritComparisonClasscallMetaclass) -class CartanMatrix(Matrix_integer_sparse, CartanType_abstract): +class CartanMatrix(Matrix_integer_sparse, CartanType_abstract, + metaclass=InheritComparisonClasscallMetaclass): r""" A (generalized) Cartan matrix. diff --git a/src/sage/combinat/root_system/cartan_type.py b/src/sage/combinat/root_system/cartan_type.py index 3cac952462f..934c081781b 100644 --- a/src/sage/combinat/root_system/cartan_type.py +++ b/src/sage/combinat/root_system/cartan_type.py @@ -477,10 +477,6 @@ #***************************************************************************** from __future__ import print_function, absolute_import, division -from six.moves import range -from six.moves.builtins import sorted -from six import class_types, string_types - from sage.misc.cachefunc import cached_method from sage.misc.abstract_method import abstract_method from sage.misc.lazy_import import LazyImport @@ -554,7 +550,7 @@ def __call__(self, *args): sage: CT.cartan_matrix() [ 2 -1] [-1 2] - sage: CT = CartanType(['A2']) + sage: CT = CartanType(['A2']) sage: CT.is_irreducible() True sage: CartanType('A2') @@ -600,7 +596,7 @@ def __call__(self, *args): return t from sage.rings.semirings.non_negative_integer_semiring import NN - if isinstance(t, string_types): + if isinstance(t, str): if "x" in t: from . import type_reducible return type_reducible.CartanType([CartanType(u) for u in t.split("x")]) @@ -617,7 +613,7 @@ def __call__(self, *args): return CartanType([t[0], eval(t[1:])]) t = list(t) - if isinstance(t[0], string_types) and t[1] in [Infinity, ZZ, NN]: + if isinstance(t[0], str) and t[1] in [Infinity, ZZ, NN]: letter, n = t[0], t[1] if letter == 'A': from . import type_A_infinity @@ -626,7 +622,7 @@ def __call__(self, *args): else: return type_A_infinity.CartanType(ZZ) - if isinstance(t[0], string_types) and t[1] in ZZ and t[1] >= 0: + if isinstance(t[0], str) and t[1] in ZZ and t[1] >= 0: letter, n = t[0], t[1] if len(t) == 2: if letter == "A": @@ -726,7 +722,7 @@ def __call__(self, *args): return CartanType(["F", 4, 1]).dual() raise ValueError("%s is not a valid Cartan type" % t) - if isinstance(t[0], string_types) and isinstance(t[1], (list, tuple)): + if isinstance(t[0], str) and isinstance(t[1], (list, tuple)): letter, n = t[0], t[1] if len(t) == 2 and len(n) == 2: from . import type_super_A @@ -952,10 +948,10 @@ class options(GlobalOptions): alias=dict(BC="Stembridge", tilde="Stembridge", twisted="Kac")) dual_str = dict(default="*", description='The string used for dual Cartan types when printing', - checker=lambda char: isinstance(char, string_types)) + checker=lambda char: isinstance(char, str)) dual_latex = dict(default="\\vee", description='The latex used for dual CartanTypes when latexing', - checker=lambda char: isinstance(char, string_types)) + checker=lambda char: isinstance(char, str)) mark_special_node = dict(default="none", description="Make the special nodes", values=dict(none="no markup", latex="only in latex", @@ -963,10 +959,10 @@ class options(GlobalOptions): case_sensitive=False) special_node_str = dict(default="@", description="The string used to indicate which node is special when printing", - checker=lambda char: isinstance(char, string_types)) + checker=lambda char: isinstance(char, str)) marked_node_str = dict(default="X", description="The string used to indicate a marked node when printing", - checker=lambda char: isinstance(char, string_types)) + checker=lambda char: isinstance(char, str)) latex_relabel = dict(default=True, description="Indicate in the latex output if a Cartan type has been relabelled", checker=lambda x: isinstance(x, bool)) @@ -1036,7 +1032,7 @@ def _add_abstract_superclass(self, classes): .. TODO:: Generalize to :class:`SageObject`? """ from sage.structure.dynamic_class import dynamic_class - assert isinstance(classes, (tuple, class_types)) + assert isinstance(classes, (tuple, type)) if not isinstance(classes, tuple): classes = (classes,) bases = (self.__class__,) + classes diff --git a/src/sage/combinat/root_system/coxeter_matrix.py b/src/sage/combinat/root_system/coxeter_matrix.py index cfc4daa41c0..2595166bf57 100644 --- a/src/sage/combinat/root_system/coxeter_matrix.py +++ b/src/sage/combinat/root_system/coxeter_matrix.py @@ -17,7 +17,6 @@ # # https://www.gnu.org/licenses/ # **************************************************************************** -from six import add_metaclass from sage.misc.cachefunc import cached_method from sage.matrix.constructor import matrix @@ -31,8 +30,7 @@ from sage.combinat.root_system.coxeter_type import CoxeterType -@add_metaclass(ClasscallMetaclass) -class CoxeterMatrix(CoxeterType): +class CoxeterMatrix(CoxeterType, metaclass=ClasscallMetaclass): r""" A Coxeter matrix. diff --git a/src/sage/combinat/root_system/coxeter_type.py b/src/sage/combinat/root_system/coxeter_type.py index 00d235fe69e..7f6b48482f9 100644 --- a/src/sage/combinat/root_system/coxeter_type.py +++ b/src/sage/combinat/root_system/coxeter_type.py @@ -16,7 +16,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six import add_metaclass from sage.misc.abstract_method import abstract_method from sage.misc.cachefunc import cached_method @@ -30,8 +29,7 @@ from sage.rings.number_field.number_field import is_QuadraticField -@add_metaclass(ClasscallMetaclass) -class CoxeterType(SageObject): +class CoxeterType(SageObject, metaclass=ClasscallMetaclass): """ Abstract class for Coxeter types. """ diff --git a/src/sage/combinat/root_system/pieri_factors.py b/src/sage/combinat/root_system/pieri_factors.py index 9f3056ef73e..0e66a15aaab 100644 --- a/src/sage/combinat/root_system/pieri_factors.py +++ b/src/sage/combinat/root_system/pieri_factors.py @@ -7,9 +7,8 @@ # Nicolas M. Thiery # # Distributed under the terms of the GNU General Public License (GPL) -# https://www.gnu.org/licenses/ -# ***************************************************************************** -from six.moves import range +# http://www.gnu.org/licenses/ +#****************************************************************************** from sage.misc.cachefunc import cached_method from sage.misc.constant_function import ConstantFunction diff --git a/src/sage/combinat/root_system/plot.py b/src/sage/combinat/root_system/plot.py index 627f7875b50..5d1cfe9bd96 100644 --- a/src/sage/combinat/root_system/plot.py +++ b/src/sage/combinat/root_system/plot.py @@ -805,7 +805,6 @@ # **************************************************************************** from __future__ import print_function -import six from sage.misc.cachefunc import cached_method, cached_function from sage.misc.latex import latex from sage.misc.lazy_import import lazy_import @@ -988,13 +987,13 @@ def text(self, label, position, rgbcolor=(0,0,0)): """ if self.labels: if self.dimension <= 2: - if not isinstance(label, six.string_types): + if not isinstance(label, str): label = "$"+str(latex(label))+"$" from sage.plot.text import text return text(label, position, fontsize=15, rgbcolor=rgbcolor) elif self.dimension == 3: # LaTeX labels not yet supported in 3D - if isinstance(label, six.string_types): + if isinstance(label, str): label = label.replace("{","").replace("}","").replace("$","").replace("_","") else: label = str(label) diff --git a/src/sage/combinat/root_system/reflection_group_complex.py b/src/sage/combinat/root_system/reflection_group_complex.py index 0567f8bf304..ce474eca551 100644 --- a/src/sage/combinat/root_system/reflection_group_complex.py +++ b/src/sage/combinat/root_system/reflection_group_complex.py @@ -196,8 +196,6 @@ #***************************************************************************** from __future__ import print_function -#from six.moves import range - from sage.misc.cachefunc import cached_method, cached_function from sage.misc.misc_c import prod from sage.categories.category import Category diff --git a/src/sage/combinat/root_system/reflection_group_real.py b/src/sage/combinat/root_system/reflection_group_real.py index 96cbbcd9431..339278dc360 100644 --- a/src/sage/combinat/root_system/reflection_group_real.py +++ b/src/sage/combinat/root_system/reflection_group_real.py @@ -45,8 +45,6 @@ # **************************************************************************** from __future__ import print_function -from six.moves import range - from sage.misc.cachefunc import cached_function, cached_method, cached_in_parent_method from sage.combinat.root_system.cartan_type import CartanType, CartanType_abstract from sage.rings.all import ZZ @@ -407,7 +405,7 @@ def cartan_type(self): sage: W = ReflectionGroup(['A',3], ['B',3]) # optional - gap3 sage: W.cartan_type() # optional - gap3 - A3xB3 relabelled by {1: 3, 2: 2, 3: 1} + A3xB3 relabelled by {1: 3, 2: 2, 3: 1} """ if len(self._type) == 1: ct = self._type[0] diff --git a/src/sage/combinat/root_system/root_lattice_realization_algebras.py b/src/sage/combinat/root_system/root_lattice_realization_algebras.py index 9368d309291..e391955783d 100644 --- a/src/sage/combinat/root_system/root_lattice_realization_algebras.py +++ b/src/sage/combinat/root_system/root_lattice_realization_algebras.py @@ -21,8 +21,6 @@ from sage.modules.free_module_element import vector from sage.combinat.root_system.hecke_algebra_representation import HeckeAlgebraRepresentation -import six - class Algebras(AlgebrasCategory): """ @@ -119,7 +117,8 @@ def from_polynomial(self, p): .. TODO:: make this work for Laurent polynomials too """ L = self.basis().keys() - return self.sum_of_terms((L.from_vector(vector(t)), c) for (t,c) in six.iteritems(p.dict())) + return self.sum_of_terms((L.from_vector(vector(t)), c) + for (t,c) in p.dict().items()) @cached_method def divided_difference_on_basis(self, weight, i): diff --git a/src/sage/combinat/root_system/root_lattice_realizations.py b/src/sage/combinat/root_system/root_lattice_realizations.py index 0c4db0d7bb4..76e5773d09f 100644 --- a/src/sage/combinat/root_system/root_lattice_realizations.py +++ b/src/sage/combinat/root_system/root_lattice_realizations.py @@ -12,7 +12,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range from sage.misc.abstract_method import abstract_method, AbstractMethod from sage.misc.misc import attrcall @@ -1098,7 +1097,7 @@ def nonnesting_partition_lattice(self, facade=False): REFERENCES: .. [Reiner97] Victor Reiner. *Non-crossing partitions for - classical reflection groups*. Discrete Mathematics 177 (1997) + classical reflection groups*. Discrete Mathematics 177 (1997) .. [Arm06] Drew Armstrong. *Generalized Noncrossing Partitions and Combinatorics of Coxeter Groups*. :arxiv:`math/0611106` """ diff --git a/src/sage/combinat/root_system/type_E.py b/src/sage/combinat/root_system/type_E.py index 206e01b4c0b..7d6cd905ff6 100644 --- a/src/sage/combinat/root_system/type_E.py +++ b/src/sage/combinat/root_system/type_E.py @@ -12,8 +12,6 @@ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range - from . import ambient_space from sage.rings.all import ZZ from sage.combinat.family import Family diff --git a/src/sage/combinat/root_system/type_F.py b/src/sage/combinat/root_system/type_F.py index be62ee359ec..61cdd485740 100644 --- a/src/sage/combinat/root_system/type_F.py +++ b/src/sage/combinat/root_system/type_F.py @@ -12,8 +12,6 @@ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range - from . import ambient_space from sage.rings.all import ZZ from sage.combinat.family import Family diff --git a/src/sage/combinat/root_system/type_folded.py b/src/sage/combinat/root_system/type_folded.py index a894281c331..93891fc941a 100644 --- a/src/sage/combinat/root_system/type_folded.py +++ b/src/sage/combinat/root_system/type_folded.py @@ -19,8 +19,6 @@ from sage.sets.family import Family from sage.combinat.root_system.cartan_type import CartanType -import six - class CartanTypeFolded(UniqueRepresentation, SageObject): r""" @@ -181,7 +179,7 @@ def __classcall_private__(cls, cartan_type, virtual, orbit): if isinstance(orbit, dict): i_set = cartan_type.index_set() orb = [None]*len(i_set) - for k,v in six.iteritems(orbit): + for k,v in orbit.items(): orb[i_set.index(k)] = tuple(v) orbit = tuple(orb) else: diff --git a/src/sage/combinat/root_system/type_relabel.py b/src/sage/combinat/root_system/type_relabel.py index a00b415e50f..01a50856343 100644 --- a/src/sage/combinat/root_system/type_relabel.py +++ b/src/sage/combinat/root_system/type_relabel.py @@ -8,7 +8,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range from sage.misc.cachefunc import cached_method from sage.misc.lazy_attribute import lazy_attribute diff --git a/src/sage/combinat/root_system/type_super_A.py b/src/sage/combinat/root_system/type_super_A.py index 0905f8e2051..cdfc23855a4 100644 --- a/src/sage/combinat/root_system/type_super_A.py +++ b/src/sage/combinat/root_system/type_super_A.py @@ -11,8 +11,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range -from six import iteritems from sage.rings.all import ZZ from sage.misc.cachefunc import cached_method @@ -326,7 +324,7 @@ def inner_product(self, lambdacheck): lambdacheck_mc = lambdacheck._monomial_coefficients result = self.parent().base_ring().zero() - for t,c in iteritems(lambdacheck_mc): + for t,c in lambdacheck_mc.items(): if t not in self_mc: continue if t > 0: @@ -375,7 +373,7 @@ def associated_coroot(self): dep = V.linear_dependence([self._vector_()] + [al[i]._vector_() for i in P.index_set()])[0] I = P.index_set() - return P.sum((-c/dep[0]) * h[I[i]] for i,c in dep[1:].iteritems()) + return P.sum((-c/dep[0]) * h[I[i]] for i,c in dep[1:].items()) def has_descent(self, i, positive=False): """ diff --git a/src/sage/combinat/rooted_tree.py b/src/sage/combinat/rooted_tree.py index d842394de99..f12c6c1dbc2 100644 --- a/src/sage/combinat/rooted_tree.py +++ b/src/sage/combinat/rooted_tree.py @@ -5,7 +5,6 @@ - Florent Hivert (2011): initial version """ -from six import add_metaclass from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets from sage.categories.sets_cat import Sets @@ -56,8 +55,8 @@ def number_of_rooted_trees(n): for k in ZZ.range(1, n)) // (n - 1) -@add_metaclass(InheritComparisonClasscallMetaclass) -class RootedTree(AbstractClonableTree, NormalizedClonableList): +class RootedTree(AbstractClonableTree, NormalizedClonableList, + metaclass=InheritComparisonClasscallMetaclass): r""" The class for unordered rooted trees. diff --git a/src/sage/combinat/set_partition.py b/src/sage/combinat/set_partition.py index ef78e8b4e2e..fecf9055cd3 100644 --- a/src/sage/combinat/set_partition.py +++ b/src/sage/combinat/set_partition.py @@ -31,8 +31,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function, absolute_import, division -from six.moves import range -from six import add_metaclass from sage.sets.set import Set, Set_generic @@ -58,8 +56,8 @@ from sage.sets.disjoint_set import DisjointSet from sage.combinat.posets.hasse_diagram import HasseDiagram -@add_metaclass(InheritComparisonClasscallMetaclass) -class AbstractSetPartition(ClonableArray): +class AbstractSetPartition(ClonableArray, + metaclass=InheritComparisonClasscallMetaclass): r""" Methods of set partitions which are independent of the base set """ @@ -478,8 +476,8 @@ def max_block_size(self): return max(len(block) for block in self) -@add_metaclass(InheritComparisonClasscallMetaclass) -class SetPartition(AbstractSetPartition): +class SetPartition(AbstractSetPartition, + metaclass=InheritComparisonClasscallMetaclass): r""" A partition of a set. diff --git a/src/sage/combinat/set_partition_ordered.py b/src/sage/combinat/set_partition_ordered.py index 70408ad52f1..aaeedf7b11d 100644 --- a/src/sage/combinat/set_partition_ordered.py +++ b/src/sage/combinat/set_partition_ordered.py @@ -24,7 +24,6 @@ # # https://www.gnu.org/licenses/ #***************************************************************************** -from six import add_metaclass from sage.arith.all import factorial from sage.sets.set import Set, Set_generic @@ -50,8 +49,8 @@ from sage.categories.cartesian_product import cartesian_product -@add_metaclass(InheritComparisonClasscallMetaclass) -class OrderedSetPartition(ClonableArray): +class OrderedSetPartition(ClonableArray, + metaclass=InheritComparisonClasscallMetaclass): r""" An ordered partition of a set. diff --git a/src/sage/combinat/sf/k_dual.py b/src/sage/combinat/sf/k_dual.py index 160eeadfbcc..65f27bf7be0 100644 --- a/src/sage/combinat/sf/k_dual.py +++ b/src/sage/combinat/sf/k_dual.py @@ -28,7 +28,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six import iteritems from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation @@ -1125,7 +1124,7 @@ def _m_to_kHLP_on_basis(self, la): else: HLP = self._kBoundedRing._quotient_basis m = self._kBoundedRing._sym.m() - elt = dict(x for x in iteritems(dict(HLP(m(la)))) + elt = dict(x for x in dict(HLP(m(la))).items() if x[0] in self._kbounded_partitions) return self._from_dict(elt) diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index d193157aa3e..b945e6e2991 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -17,7 +17,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import zip from . import classical import sage.libs.lrcalc.lrcalc as lrcalc diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 35838d1cd01..df738714bb5 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -300,8 +300,6 @@ def is_SymmetricFunction(x): from sage.categories.realizations import Category_realization_of_parent -import six - class SymmetricFunctionsBases(Category_realization_of_parent): r""" @@ -1634,7 +1632,7 @@ def _change_by_proportionality(self, x, function): """ BR = self.base_ring() z_elt = {} - for m, c in six.iteritems(x._monomial_coefficients): + for m, c in x._monomial_coefficients.items(): coeff = function(m) z_elt[m] = BR( c*coeff ) return self._from_dict(z_elt) @@ -1719,7 +1717,7 @@ def _apply_multi_module_morphism(self, x, y, f, orthogonal=False): if orthogonal: # could check which of x and y has less terms # for mx, cx in x: - for mx, cx in six.iteritems(x._monomial_coefficients): + for mx, cx in x._monomial_coefficients.items(): if mx not in y._monomial_coefficients: continue else: @@ -1729,8 +1727,8 @@ def _apply_multi_module_morphism(self, x, y, f, orthogonal=False): res += cx*cy*f(mx, mx) return res else: - for mx, cx in six.iteritems(x._monomial_coefficients): - for my, cy in six.iteritems(y._monomial_coefficients): + for mx, cx in x._monomial_coefficients.items(): + for my, cy in y._monomial_coefficients.items(): res += cx*cy*f(mx,my) return res @@ -1814,13 +1812,13 @@ def _from_cache(self, element, cache_function, cache_dict, **subs_dict): BR = self.base_ring() zero = BR.zero() z_elt = {} - for part, c in six.iteritems(element.monomial_coefficients()): + for part, c in element.monomial_coefficients().items(): if sum(part) not in cache_dict: cache_function(sum(part)) # Make sure it is a partition (for #13605), this is # needed for the old kschur functions - TCS part = _Partitions(part) - for part2, c2 in six.iteritems(cache_dict[sum(part)][part]): + for part2, c2 in cache_dict[sum(part)][part].items(): if hasattr(c2,'subs'): # c3 may be in the base ring c3 = c*BR(c2.subs(**subs_dict)) else: @@ -3094,8 +3092,8 @@ def inner_plethysm(self, x): p = parent.realization_of().power() cache = {} ip_pnu_g = parent._inner_plethysm_pnu_g - return parent.sum( c*ip_pnu_g(p(x), cache, nu) - for (nu, c) in six.iteritems(p(self).monomial_coefficients()) ) + return parent.sum(c*ip_pnu_g(p(x), cache, nu) + for (nu, c) in p(self).monomial_coefficients().items()) def omega(self): diff --git a/src/sage/combinat/shifted_primed_tableau.py b/src/sage/combinat/shifted_primed_tableau.py index 4d7c3167c6c..5c23ae2d335 100644 --- a/src/sage/combinat/shifted_primed_tableau.py +++ b/src/sage/combinat/shifted_primed_tableau.py @@ -18,7 +18,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import, division -from six import add_metaclass from sage.combinat.partition import Partition, Partitions, _Partitions, OrderedPartitions from sage.combinat.partitions import ZS1_iterator @@ -45,8 +44,8 @@ from sage.combinat.combination import Combinations -@add_metaclass(InheritComparisonClasscallMetaclass) -class ShiftedPrimedTableau(ClonableArray): +class ShiftedPrimedTableau(ClonableArray, + metaclass=InheritComparisonClasscallMetaclass): r""" A shifted primed tableau. diff --git a/src/sage/combinat/similarity_class_type.py b/src/sage/combinat/similarity_class_type.py index c52ea6e3944..ec3676a710c 100644 --- a/src/sage/combinat/similarity_class_type.py +++ b/src/sage/combinat/similarity_class_type.py @@ -175,8 +175,6 @@ class type, it is also possible to compute the number of classes of that type # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six.moves import range -from six import add_metaclass from operator import mul from itertools import chain, product @@ -340,8 +338,8 @@ def centralizer_group_cardinality(la, q = None): return q**centralizer_algebra_dim(la)*prod([fq(m, q = q) for m in la.to_exp()]) -@add_metaclass(InheritComparisonClasscallMetaclass) -class PrimarySimilarityClassType(Element): +class PrimarySimilarityClassType(Element, + metaclass=InheritComparisonClasscallMetaclass): r""" A primary similarity class type is a pair consisting of a partition and a positive integer. diff --git a/src/sage/combinat/skew_partition.py b/src/sage/combinat/skew_partition.py index 34c7f62b482..c2825d8de23 100644 --- a/src/sage/combinat/skew_partition.py +++ b/src/sage/combinat/skew_partition.py @@ -143,8 +143,6 @@ #***************************************************************************** from __future__ import print_function -from six.moves import range - from sage.structure.global_options import GlobalOptions from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation @@ -696,7 +694,7 @@ def is_ribbon(self): l_out = len(lam) l_in = len(mu) mu += [0]*(l_out-l_in) - + if l_out == 0: return True else: @@ -710,7 +708,7 @@ def is_ribbon(self): else: u += 1 - # Find the least v strictly greater than u for which + # Find the least v strictly greater than u for which # lam[v] != mu[v-1]+1 v = u + 1 v_test = True diff --git a/src/sage/combinat/skew_tableau.py b/src/sage/combinat/skew_tableau.py index e35c782d13a..cd9182ab58b 100644 --- a/src/sage/combinat/skew_tableau.py +++ b/src/sage/combinat/skew_tableau.py @@ -24,8 +24,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function, absolute_import -from six import add_metaclass -from six.moves import range, zip from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass from sage.structure.parent import Parent @@ -48,8 +46,8 @@ from sage.combinat.words.words import Words -@add_metaclass(InheritComparisonClasscallMetaclass) -class SkewTableau(ClonableList): +class SkewTableau(ClonableList, + metaclass=InheritComparisonClasscallMetaclass): r""" A skew tableau. diff --git a/src/sage/combinat/sloane_functions.py b/src/sage/combinat/sloane_functions.py index a0ebd69bef5..91edfc0f723 100644 --- a/src/sage/combinat/sloane_functions.py +++ b/src/sage/combinat/sloane_functions.py @@ -124,8 +124,6 @@ # just used for handy .load, .save, etc. from __future__ import print_function, absolute_import -from six.moves import range -from six import integer_types import inspect from sage.structure.sage_object import SageObject @@ -227,7 +225,7 @@ def __call__(self, n): ... ValueError: input n (=0) must be a positive integer """ - if not isinstance(n, integer_types + (Integer_class,)): + if not isinstance(n, (int, Integer_class)): raise TypeError("input must be an int or Integer") m = ZZ(n) if m < self.offset: diff --git a/src/sage/combinat/species/characteristic_species.py b/src/sage/combinat/species/characteristic_species.py index be0f2bb0ff6..4e1dfe4605b 100644 --- a/src/sage/combinat/species/characteristic_species.py +++ b/src/sage/combinat/species/characteristic_species.py @@ -16,7 +16,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from .species import GenericCombinatorialSpecies from .generating_series import factorial_stream diff --git a/src/sage/combinat/species/permutation_species.py b/src/sage/combinat/species/permutation_species.py index d9962fb460e..c640324d9cf 100644 --- a/src/sage/combinat/species/permutation_species.py +++ b/src/sage/combinat/species/permutation_species.py @@ -16,7 +16,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from .species import GenericCombinatorialSpecies from .structure import GenericSpeciesStructure diff --git a/src/sage/combinat/species/series.py b/src/sage/combinat/species/series.py index c847580abb2..1163aebcda4 100644 --- a/src/sage/combinat/species/series.py +++ b/src/sage/combinat/species/series.py @@ -30,6 +30,8 @@ # **************************************************************************** from __future__ import absolute_import +import builtins + from .stream import Stream, Stream_class from .series_order import bounded_decrement, increment, inf, unk from sage.rings.all import Integer @@ -1743,7 +1745,6 @@ def restricted(self, min=None, max=None): sage: a.restricted(min=2, max=6).coefficients(10) [0, 0, 1, 1, 1, 1, 0, 0, 0, 0] """ - from six.moves import builtins if ((min is None and max is None) or (max is None and self.get_aorder() >= min)): diff --git a/src/sage/combinat/species/set_species.py b/src/sage/combinat/species/set_species.py index 991de91227e..1f8d6e3f6de 100644 --- a/src/sage/combinat/species/set_species.py +++ b/src/sage/combinat/species/set_species.py @@ -16,7 +16,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from .species import GenericCombinatorialSpecies from .generating_series import factorial_stream, _integers_from diff --git a/src/sage/combinat/species/subset_species.py b/src/sage/combinat/species/subset_species.py index 86a8cea8703..dc2539807c5 100644 --- a/src/sage/combinat/species/subset_species.py +++ b/src/sage/combinat/species/subset_species.py @@ -16,7 +16,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from .species import GenericCombinatorialSpecies from .set_species import SetSpecies diff --git a/src/sage/combinat/subset.py b/src/sage/combinat/subset.py index dbb2b7333a8..a81e7cffd11 100644 --- a/src/sage/combinat/subset.py +++ b/src/sage/combinat/subset.py @@ -28,7 +28,6 @@ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range import sage.misc.prandom as rnd import itertools diff --git a/src/sage/combinat/subword.py b/src/sage/combinat/subword.py index 0d503c1c722..90aa323d986 100644 --- a/src/sage/combinat/subword.py +++ b/src/sage/combinat/subword.py @@ -56,7 +56,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range import itertools diff --git a/src/sage/combinat/subword_complex.py b/src/sage/combinat/subword_complex.py index bafd060a272..58929e6022e 100644 --- a/src/sage/combinat/subword_complex.py +++ b/src/sage/combinat/subword_complex.py @@ -113,7 +113,6 @@ # **************************************************************************** # python3 from __future__ import division, print_function -from six.moves import range from copy import copy from sage.misc.cachefunc import cached_method diff --git a/src/sage/combinat/superpartition.py b/src/sage/combinat/superpartition.py index 3c65b5f8373..4d58f25a722 100644 --- a/src/sage/combinat/superpartition.py +++ b/src/sage/combinat/superpartition.py @@ -74,7 +74,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function, absolute_import, division -from six import add_metaclass from functools import reduce @@ -92,8 +91,8 @@ @richcmp_method -@add_metaclass(InheritComparisonClasscallMetaclass) -class SuperPartition(ClonableArray): +class SuperPartition(ClonableArray, + metaclass=InheritComparisonClasscallMetaclass): r""" A super partition. diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py index ff4b003c9bc..131f7eabe6a 100644 --- a/src/sage/combinat/symmetric_group_algebra.py +++ b/src/sage/combinat/symmetric_group_algebra.py @@ -9,8 +9,6 @@ # **************************************************************************** from __future__ import print_function, absolute_import import itertools -import six -from six.moves import range from sage.misc.cachefunc import cached_method from sage.misc.lazy_attribute import lazy_attribute @@ -820,7 +818,7 @@ def retract_plain(self, f, m): I = RSm.group() pairs = [] P = Permutations(self.n) - for (p, coeff) in six.iteritems(f.monomial_coefficients()): + for (p, coeff) in f.monomial_coefficients().items(): p_ret = P(p).retract_plain(m) if p_ret is not None: pairs.append((I(p_ret), coeff)) @@ -886,7 +884,7 @@ def retract_direct_product(self, f, m): I = RSm.group() dct = {} P = Permutations(self.n) - for (p, coeff) in six.iteritems(f.monomial_coefficients()): + for (p, coeff) in f.monomial_coefficients().items(): p_ret = P(p).retract_direct_product(m) if p_ret is not None: p_ret = I(p_ret) @@ -949,7 +947,7 @@ def retract_okounkov_vershik(self, f, m): I = RSm.group() dct = {} P = Permutations(self.n) - for (p, coeff) in six.iteritems(f.monomial_coefficients()): + for (p, coeff) in f.monomial_coefficients().items(): p_ret = I(P(p).retract_okounkov_vershik(m)) if not p_ret in dct: dct[p_ret] = coeff @@ -1966,7 +1964,7 @@ def epsilon_ik(self, itab, ktab, star=0, mult='l2r'): I = self._indices z_elts = {} epik = epsilon_ik(it, kt, star=star) - for m, c in six.iteritems(epik._monomial_coefficients): + for m, c in epik._monomial_coefficients.items(): z_elts[I(m)] = BR(c) z = self._from_dict(z_elts) diff --git a/src/sage/combinat/symmetric_group_representations.py b/src/sage/combinat/symmetric_group_representations.py index d3c2495e446..554b161bf30 100644 --- a/src/sage/combinat/symmetric_group_representations.py +++ b/src/sage/combinat/symmetric_group_representations.py @@ -28,8 +28,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -import six -from six.moves import range from sage.symbolic.ring import SR from sage.functions.all import sqrt @@ -570,7 +568,7 @@ def _word_dict(self): (2, 0, 1, -1, 0): (2, 4, 1, 3, 5)} """ word_dict = {} - for (v,t) in six.iteritems(self._tableau_dict): + for (v,t) in self._tableau_dict.items(): word_dict[v] = sum(reversed(t), ()) return word_dict diff --git a/src/sage/combinat/tableau.py b/src/sage/combinat/tableau.py index a8418234a62..da464af7648 100644 --- a/src/sage/combinat/tableau.py +++ b/src/sage/combinat/tableau.py @@ -85,8 +85,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range, zip, map -from six import add_metaclass, text_type from sage.sets.disjoint_union_enumerated_sets import DisjointUnionEnumeratedSets from sage.sets.family import Family @@ -117,8 +115,7 @@ from sage.combinat.posets.posets import Poset @richcmp_method -@add_metaclass(InheritComparisonClasscallMetaclass) -class Tableau(ClonableList): +class Tableau(ClonableList, metaclass=InheritComparisonClasscallMetaclass): """ A class to model a tableau. @@ -605,7 +602,7 @@ def _ascii_art_table(self, use_unicode=False): if use_unicode: # Special handling of overline not adding to printed length def get_len(e): - return len(e) - list(text_type(e)).count(u"\u0304") + return len(e) - list(str(e)).count(u"\u0304") else: get_len = len for row in str_tab: diff --git a/src/sage/combinat/tableau_residues.py b/src/sage/combinat/tableau_residues.py index 67d6e13a413..b3e87317645 100644 --- a/src/sage/combinat/tableau_residues.py +++ b/src/sage/combinat/tableau_residues.py @@ -119,7 +119,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import, print_function -from six import add_metaclass from sage.categories.sets_cat import Sets from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass @@ -140,8 +139,8 @@ # ------------------------------------------------- # needed for __classcall_private__ -@add_metaclass(InheritComparisonClasscallMetaclass) -class ResidueSequence(ClonableArray): +class ResidueSequence(ClonableArray, + metaclass=InheritComparisonClasscallMetaclass): r""" A residue sequence. diff --git a/src/sage/combinat/tableau_tuple.py b/src/sage/combinat/tableau_tuple.py index b9fe5fba35c..49dec045a86 100644 --- a/src/sage/combinat/tableau_tuple.py +++ b/src/sage/combinat/tableau_tuple.py @@ -211,8 +211,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range -from six import add_metaclass from sage.combinat.combinat import CombinatorialElement from sage.combinat.words.word import Word @@ -1386,8 +1384,7 @@ def residue(self, k, e, multicharge): #-------------------------------------------------- # Row standard tableau tuple - element class #-------------------------------------------------- -@add_metaclass(ClasscallMetaclass) -class RowStandardTableauTuple(TableauTuple): +class RowStandardTableauTuple(TableauTuple, metaclass=ClasscallMetaclass): r""" A class for row standard tableau tuples of shape a partition tuple. diff --git a/src/sage/combinat/tiling.py b/src/sage/combinat/tiling.py index acc46406754..54827a3c913 100644 --- a/src/sage/combinat/tiling.py +++ b/src/sage/combinat/tiling.py @@ -277,10 +277,6 @@ # **************************************************************************** from __future__ import division -from builtins import zip -from six import iteritems -from six.moves import range - import itertools from sage.structure.sage_object import SageObject from sage.modules.free_module_element import vector @@ -1056,9 +1052,9 @@ def isometric_copies(self, box, orientation_preserving=True, raise ValueError("Dimension of input box must match the " "dimension of the polyomino") box_min_coords, box_max_coords = box.bounding_box() - if mod_box_isometries and len(set(b-a for (a,b) in zip(box_min_coords, + if mod_box_isometries and len(set(b-a for (a,b) in zip(box_min_coords, box_max_coords))) < box._dimension: - raise NotImplementedError("The code below assumes that the" + raise NotImplementedError("The code below assumes that the" " sizes of the box (={}) are all distinct when" " argument `mod_box_isometries` is True.".format(box)) all_distinct_cano = self.canonical_isometric_copies(orientation_preserving, @@ -1172,10 +1168,10 @@ def boundary(self): vertical[(x+1, y)] -= 1 edges = [] h = 0.5 - for (x, y), coeff in iteritems(horizontal): + for (x, y), coeff in horizontal.items(): if coeff: edges.append(((x-h, y-h), (x+h, y-h))) - for (x, y), coeff in iteritems(vertical): + for (x, y), coeff in vertical.items(): if coeff: edges.append(((x-h, y-h), (x-h, y+h))) return edges diff --git a/src/sage/combinat/words/abstract_word.py b/src/sage/combinat/words/abstract_word.py index 0c35589693e..6168f6cb854 100644 --- a/src/sage/combinat/words/abstract_word.py +++ b/src/sage/combinat/words/abstract_word.py @@ -31,9 +31,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range - -from builtins import zip from sage.structure.sage_object import SageObject from sage.combinat.words.word_options import word_options diff --git a/src/sage/combinat/words/alphabet.py b/src/sage/combinat/words/alphabet.py index 70f0a3528bf..0219633ed9a 100644 --- a/src/sage/combinat/words/alphabet.py +++ b/src/sage/combinat/words/alphabet.py @@ -32,8 +32,6 @@ # http://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six.moves import range -from six import integer_types from sage.categories.sets_cat import Sets @@ -217,12 +215,12 @@ def build_alphabet(data=None, names=None, name=None): raise ValueError("name cannot be specified with any other argument") # Swap arguments if we need to try and make sure we have "good" user input - if isinstance(names, integer_types + (Integer,)) or names == Infinity \ + if isinstance(names, (int, Integer)) or names == Infinity \ or (data is None and names is not None): data, names = names, data # data is an integer - if isinstance(data, integer_types + (Integer,)): + if isinstance(data, (int, Integer)): if names is None: from sage.sets.integer_range import IntegerRange return IntegerRange(Integer(data)) diff --git a/src/sage/combinat/words/finite_word.py b/src/sage/combinat/words/finite_word.py index a3bdb3d4339..9406087ff8e 100644 --- a/src/sage/combinat/words/finite_word.py +++ b/src/sage/combinat/words/finite_word.py @@ -216,10 +216,6 @@ #***************************************************************************** from __future__ import print_function, absolute_import -from builtins import zip - -from six import iteritems -from six.moves import range from collections import defaultdict from itertools import islice, cycle from sage.combinat.words.abstract_word import Word_class @@ -3551,7 +3547,7 @@ def critical_exponent(self): current_exp = QQ((current_pos+1, current_pos+1-m)) if current_exp > best_exp: best_exp = current_exp - for ((i,j),u) in iteritems(st._transition_function[v]): + for ((i,j),u) in st._transition_function[v].items(): if j is None: j = self.length() queue.append((u, i, j, l+j-i+1)) @@ -4868,7 +4864,7 @@ def evaluation_sparse(self): sage: sorted(Word("abcaccab").evaluation_sparse()) [('a', 3), ('b', 2), ('c', 3)] """ - return list(iteritems(self.evaluation_dict())) + return list(self.evaluation_dict().items()) def evaluation_partition(self): r""" diff --git a/src/sage/combinat/words/lyndon_word.py b/src/sage/combinat/words/lyndon_word.py index 26c9f32268c..aaa16322e7a 100644 --- a/src/sage/combinat/words/lyndon_word.py +++ b/src/sage/combinat/words/lyndon_word.py @@ -12,7 +12,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import builtins from sage.structure.unique_representation import UniqueRepresentation from sage.structure.parent import Parent @@ -287,7 +286,7 @@ def cardinality(self): True """ evaluation = self._e - le = builtins.list(evaluation) + le = list(evaluation) if len(evaluation) == 0: return 0 diff --git a/src/sage/combinat/words/morphism.py b/src/sage/combinat/words/morphism.py index e9185d24973..7c5128f9f7f 100644 --- a/src/sage/combinat/words/morphism.py +++ b/src/sage/combinat/words/morphism.py @@ -90,8 +90,7 @@ # **************************************************************************** from __future__ import print_function -from six.moves import range -import itertools +from itertools import chain from sage.misc.callable_dict import CallableDict from sage.structure.sage_object import SageObject @@ -1793,7 +1792,7 @@ def _fixed_point_iterator(self, letter): yield a else: next_w = next(w) - w = itertools.chain([next_w], w, self.image(next_w)) + w = chain([next_w], w, self.image(next_w)) except StopIteration: return diff --git a/src/sage/combinat/words/suffix_trees.py b/src/sage/combinat/words/suffix_trees.py index 325c33220f6..daaa592cb73 100644 --- a/src/sage/combinat/words/suffix_trees.py +++ b/src/sage/combinat/words/suffix_trees.py @@ -10,8 +10,6 @@ # (at your option) any later version. # https://www.gnu.org/licenses/ # **************************************************************************** -from six.moves import range -from six import iteritems from itertools import chain from sage.structure.sage_object import SageObject @@ -208,7 +206,7 @@ def node_to_word(self, state=0): if state == 0: return Words(self._alphabet)() # We first invert the transition function - tf_inv = {b: a for a, b in iteritems(self._transition_function)} + tf_inv = {b: a for a, b in self._transition_function.items()} # Starting from the active state, # read labels along the unique path to the root. @@ -451,7 +449,7 @@ def to_digraph(self): [0 0 0 0 0 0] """ dag = {} - for ((u, letter), v) in iteritems(self._transition_function): + for ((u, letter), v) in self._transition_function.items(): dag.setdefault(u, {})[v] = letter return DiGraph(dag) @@ -756,7 +754,7 @@ def _find_transition(self, state, letter): return ((0, 0), 0) else: if state in self._transition_function: - for ((k,p),s) in iteritems(self._transition_function[state]): + for ((k,p),s) in self._transition_function[state].items(): if self._letters[k-1] == letter: return ((k,p), s) return None @@ -840,7 +838,7 @@ def to_digraph(self, word_labels=False): return DiGraph(d) d = self.transition_function_dictionary() for u in d: - for (v, (i, j)) in iteritems(d[u]): + for (v, (i, j)) in d[u].items(): if word_labels: d[u][v] = self._word[i:j] elif j is None: @@ -1124,7 +1122,7 @@ def edge_iterator(self): queue = [0] while queue: v = queue.pop() - for ((i,j),u) in iteritems(self._transition_function[v]): + for ((i,j),u) in self._transition_function[v].items(): yield (v,u,(i-1,j)) queue.append(u) @@ -1204,7 +1202,7 @@ def number_of_factors(self,n=None): num_factors += 1 if l < n: if self._transition_function[v] != {}: - for ((i,j),u) in iteritems(self._transition_function[v]): + for ((i,j),u) in self._transition_function[v].items(): if j is None: j = self.word().length() if j - i >= n - l: @@ -1260,7 +1258,7 @@ def factor_iterator(self,n=None): (v,i,j,l) = queue.pop() for k in range(i,j+1): yield w[j-l:k] - for ((i,j),u) in iteritems(self._transition_function[v]): + for ((i,j),u) in self._transition_function[v].items(): if j is None: j = wlen queue.append((u,i,j, l+j-i+1)) @@ -1271,7 +1269,7 @@ def factor_iterator(self,n=None): if l == n: yield w[j-l:j] if l < n: - for ((i,j),u) in iteritems(self._transition_function[v]): + for ((i,j),u) in self._transition_function[v].items(): if j is None: j = wlen if j - i >= n - l: @@ -1547,8 +1545,8 @@ def trie_type_dict(self): """ d = {} new_node = len(self._transition_function) - for (u, dd) in iteritems(self._transition_function): - for (sl, v) in iteritems(dd): + for (u, dd) in self._transition_function.items(): + for (sl, v) in dd.items(): w = self._word[sl[0]-1:sl[1]] if w.length() == 1: d[u,w] = v diff --git a/src/sage/combinat/words/word_generators.py b/src/sage/combinat/words/word_generators.py index 9e16021c9f1..6161961bda1 100644 --- a/src/sage/combinat/words/word_generators.py +++ b/src/sage/combinat/words/word_generators.py @@ -55,8 +55,6 @@ # **************************************************************************** from __future__ import print_function -from six.moves import range - from itertools import cycle, count from random import randint from sage.misc.cachefunc import cached_method diff --git a/src/sage/combinat/words/word_infinite_datatypes.py b/src/sage/combinat/words/word_infinite_datatypes.py index 25eaab9b686..078f00644d6 100644 --- a/src/sage/combinat/words/word_infinite_datatypes.py +++ b/src/sage/combinat/words/word_infinite_datatypes.py @@ -11,7 +11,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.combinat.words.word_datatypes import WordDatatype from sage.rings.all import Infinity diff --git a/src/sage/combinat/yang_baxter_graph.py b/src/sage/combinat/yang_baxter_graph.py index f24ac2f9923..b3e56f7eead 100644 --- a/src/sage/combinat/yang_baxter_graph.py +++ b/src/sage/combinat/yang_baxter_graph.py @@ -15,7 +15,6 @@ # # https://www.gnu.org/licenses/ # **************************************************************************** -from six.moves import range from sage.graphs.digraph import DiGraph from sage.structure.sage_object import SageObject diff --git a/src/sage/cpython/string.pxd b/src/sage/cpython/string.pxd index d1eb6b502b9..0ac92862092 100644 --- a/src/sage/cpython/string.pxd +++ b/src/sage/cpython/string.pxd @@ -38,13 +38,9 @@ cpdef inline str bytes_to_str(b, encoding=None, errors=None): EXAMPLES:: - sage: import six sage: from sage.cpython.string import bytes_to_str sage: s = bytes_to_str(b'\xcf\x80') - sage: if six.PY2: - ....: s == b'\xcf\x80' - ....: else: - ....: s == u'π' + sage: s == u'π' True sage: bytes_to_str([]) Traceback (most recent call last): @@ -75,12 +71,8 @@ cpdef inline bytes str_to_bytes(s, encoding=None, errors=None): EXAMPLES:: - sage: import six sage: from sage.cpython.string import str_to_bytes - sage: if six.PY2: - ....: bs = [str_to_bytes('\xcf\x80'), str_to_bytes(u'π')] - ....: else: - ....: bs = [str_to_bytes(u'π')] + sage: bs = [str_to_bytes(u'π')] sage: all(b == b'\xcf\x80' for b in bs) True sage: str_to_bytes([]) diff --git a/src/sage/crypto/block_cipher/des.py b/src/sage/crypto/block_cipher/des.py index 44f8b510b8c..0e6ecb06e22 100644 --- a/src/sage/crypto/block_cipher/des.py +++ b/src/sage/crypto/block_cipher/des.py @@ -78,7 +78,6 @@ from sage.modules.free_module_element import vector from sage.rings.finite_rings.finite_field_constructor import GF from sage.modules.vector_mod2_dense import Vector_mod2_dense -from six import integer_types from sage.rings.integer import Integer from sage.crypto.sboxes import DES_S1_1, DES_S1_2, DES_S1_3, DES_S1_4 from sage.crypto.sboxes import DES_S2_1, DES_S2_2, DES_S2_3, DES_S2_4 @@ -514,7 +513,7 @@ def encrypt(self, plaintext, key): """ if isinstance(plaintext, (list, tuple, Vector_mod2_dense)): inputType = 'vector' - elif isinstance(plaintext, integer_types + (Integer,)): + elif isinstance(plaintext, (Integer, int)): inputType = 'integer' state = convert_to_vector(plaintext, self._blocksize) key = convert_to_vector(key, self._keySize) @@ -571,7 +570,7 @@ def decrypt(self, ciphertext, key): """ if isinstance(ciphertext, (list, tuple, Vector_mod2_dense)): inputType = 'vector' - elif isinstance(ciphertext, integer_types + (Integer,)): + elif isinstance(ciphertext, (Integer, int)): inputType = 'integer' state = convert_to_vector(ciphertext, 64) key = convert_to_vector(key, self._keySize) @@ -871,7 +870,7 @@ def __call__(self, key): """ if isinstance(key, (list, tuple, Vector_mod2_dense)): inputType = 'vector' - elif isinstance(key, integer_types + (Integer,)): + elif isinstance(key, (Integer, int)): inputType = 'integer' key = convert_to_vector(key, self._keySize) roundKeys = [] diff --git a/src/sage/crypto/block_cipher/miniaes.py b/src/sage/crypto/block_cipher/miniaes.py index 003bca78b20..4dff1a9ea00 100644 --- a/src/sage/crypto/block_cipher/miniaes.py +++ b/src/sage/crypto/block_cipher/miniaes.py @@ -25,7 +25,6 @@ # # http://www.gnu.org/licenses/ ########################################################################### -from six.moves import range from sage.matrix.matrix_dense import Matrix_dense from sage.matrix.matrix_space import MatrixSpace diff --git a/src/sage/crypto/block_cipher/present.py b/src/sage/crypto/block_cipher/present.py index 4584945375a..fe72cb6c983 100644 --- a/src/sage/crypto/block_cipher/present.py +++ b/src/sage/crypto/block_cipher/present.py @@ -65,7 +65,6 @@ from sage.rings.finite_rings.finite_field_constructor import GF from sage.crypto.sboxes import PRESENT as PRESENTSBOX from sage.modules.vector_mod2_dense import Vector_mod2_dense -from six import integer_types def _smallscale_present_linearlayer(nsboxes=16): @@ -420,7 +419,7 @@ def encrypt(self, plaintext, key): """ if isinstance(plaintext, (list, tuple, Vector_mod2_dense)): inputType = 'vector' - elif isinstance(plaintext, integer_types + (Integer,)): + elif isinstance(plaintext, (Integer, int)): inputType = 'integer' state = convert_to_vector(plaintext, 64) key = convert_to_vector(key, self._keysize) @@ -476,7 +475,7 @@ def decrypt(self, ciphertext, key): """ if isinstance(ciphertext, (list, tuple, Vector_mod2_dense)): inputType = 'vector' - elif isinstance(ciphertext, integer_types + (Integer,)): + elif isinstance(ciphertext, (Integer, int)): inputType = 'integer' state = convert_to_vector(ciphertext, 64) key = convert_to_vector(key, self._keysize) @@ -776,7 +775,7 @@ def __call__(self, K): """ if isinstance(K, (list, tuple, Vector_mod2_dense)): inputType = 'vector' - elif isinstance(K, integer_types + (Integer,)): + elif isinstance(K, (Integer, int)): inputType = 'integer' K = convert_to_vector(K, self._keysize) roundKeys = [] diff --git a/src/sage/crypto/block_cipher/sdes.py b/src/sage/crypto/block_cipher/sdes.py index 3c6e240dd84..02a7a14772c 100644 --- a/src/sage/crypto/block_cipher/sdes.py +++ b/src/sage/crypto/block_cipher/sdes.py @@ -26,7 +26,6 @@ # # http://www.gnu.org/licenses/ ########################################################################### -from six.moves import range from sage.monoids.string_monoid import BinaryStrings from sage.structure.sage_object import SageObject diff --git a/src/sage/crypto/classical.py b/src/sage/crypto/classical.py index a6850ffa9a1..99aeca320c3 100644 --- a/src/sage/crypto/classical.py +++ b/src/sage/crypto/classical.py @@ -42,7 +42,6 @@ #***************************************************************************** from __future__ import print_function from __future__ import absolute_import -from six.moves import range # TODO: check off this todo list: # - methods to cryptanalyze the Hill, substitution, transposition, and diff --git a/src/sage/crypto/classical_cipher.py b/src/sage/crypto/classical_cipher.py index fb55dd9b2d0..6969d33a287 100644 --- a/src/sage/crypto/classical_cipher.py +++ b/src/sage/crypto/classical_cipher.py @@ -10,7 +10,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from .cipher import SymmetricKeyCipher from sage.monoids.string_monoid_element import StringMonoidElement diff --git a/src/sage/crypto/lwe.py b/src/sage/crypto/lwe.py index 8a27529053b..73ab9bd491e 100644 --- a/src/sage/crypto/lwe.py +++ b/src/sage/crypto/lwe.py @@ -86,7 +86,6 @@ - [CGW2013]_ """ -from six.moves import range from sage.functions.log import log from sage.functions.other import sqrt, floor, ceil diff --git a/src/sage/crypto/mq/rijndael_gf.py b/src/sage/crypto/mq/rijndael_gf.py index 6721caad767..90b207a2f67 100644 --- a/src/sage/crypto/mq/rijndael_gf.py +++ b/src/sage/crypto/mq/rijndael_gf.py @@ -422,7 +422,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, division -from six import string_types from sage.matrix.constructor import matrix from sage.matrix.constructor import column_matrix @@ -488,10 +487,10 @@ def __init__(self, Nb, Nk, state_chr='a', key_chr='k'): if Nk not in range(4, 9): msg = "Key length Nk must be in the range 4 - 8, not {0}" raise ValueError(msg.format(Nk)) - if not isinstance(state_chr, string_types): + if not isinstance(state_chr, str): msg = "state_chr must be a string, not {0}" raise TypeError(msg.format(state_chr)) - if not isinstance(key_chr, string_types): + if not isinstance(key_chr, str): msg = "key_chr must be a string, not {0}" raise TypeError(msg.format(key_chr)) @@ -708,7 +707,7 @@ def _hex_to_GF(self, H, matrix=True): sage: rgf._hex_to_GF('1a2b0f', matrix=False) [x^4 + x^3 + x, x^5 + x^3 + x + 1, x^3 + x^2 + x + 1] """ - if not isinstance(H, string_types) or \ + if not isinstance(H, str) or \ any(c not in '0123456789abcdefABCDEF' for c in H): raise TypeError("keyword 'H' must be a hex string") @@ -836,7 +835,7 @@ def _bin_to_GF(self, B, matrix=True): x^7 + x^6 + x^4 + x^2 + x + 1, x^5 + x^4 + x^2 + 1] """ - if not isinstance(B, string_types) or any(c not in '01' for c in B): + if not isinstance(B, str) or any(c not in '01' for c in B): raise TypeError("keyword 'B' must be a binary string") def bn_to_gf(b): @@ -954,13 +953,13 @@ def encrypt(self, plain, key, format='hex'): True """ if format == 'hex': - if not isinstance(plain, string_types) or \ + if not isinstance(plain, str) or \ any(c not in '0123456789abcdefABCDEF' for c in plain): raise TypeError("'plain' keyword must be a hex string") if len(plain) != 8 * self._Nb: msg = "'plain' keyword\'s length must be {0}, not{1}" raise ValueError(msg.format(8 * self._Nb, len(plain))) - if not isinstance(key, string_types) or \ + if not isinstance(key, str) or \ any(c not in '0123456789abcdefABCDEF' for c in key): raise TypeError("'key' keyword must be a hex string") if len(key) != 8 * self._Nk: @@ -970,13 +969,13 @@ def encrypt(self, plain, key, format='hex'): key_state = self._hex_to_GF(key) roundKeys = self.expand_key(key_state) elif format == 'binary': - if not isinstance(plain, string_types) or \ + if not isinstance(plain, str) or \ any(c not in '01' for c in plain): raise TypeError("'plain' keyword must be a binary string") if len(plain) != 32 * self._Nb: msg = "'plain' keyword's length must be {0}, not {1}" raise ValueError(msg.format(32 * self._Nb, len(plain))) - if not isinstance(key, string_types) or \ + if not isinstance(key, str) or \ any(c not in '01' for c in key): raise TypeError("'key' keyword must be a binary string") if len(key) != 32 * self._Nk: @@ -1044,13 +1043,13 @@ def decrypt(self, ciphertext, key, format='hex'): True """ if format == 'hex': - if not isinstance(ciphertext, string_types) or \ + if not isinstance(ciphertext, str) or \ any(c not in '0123456789abcdefABCDEF' for c in ciphertext): raise TypeError("'ciphertext' keyword must be a hex string") if len(ciphertext) != 8 * self._Nb: msg = "'ciphertext' keyword's length must be {0}, not{1}" raise ValueError(msg.format(8 * self._Nb, len(ciphertext))) - if not isinstance(key, string_types) or \ + if not isinstance(key, str) or \ any(c not in '0123456789abcdefABCDEF' for c in key): raise TypeError("'key' keyword must be a hex string") if len(key) != 8 * self._Nk: @@ -1060,14 +1059,14 @@ def decrypt(self, ciphertext, key, format='hex'): key_state = self._hex_to_GF(key) roundKeys = self.expand_key(key_state) elif format == 'binary': - if not isinstance(ciphertext, string_types) or \ + if not isinstance(ciphertext, str) or \ any(c not in '01' for c in ciphertext): raise TypeError(("'ciphertext' keyword must be a binary " "string")) if len(ciphertext) != 32 * self._Nb: msg = "'ciphertext' keyword's length must be {0}, not {1}" raise ValueError(msg.format(32 * self._Nb, len(ciphertext))) - if not isinstance(key, string_types) or \ + if not isinstance(key, str) or \ any(c not in '01' for c in key): raise TypeError("'key' keyword must be a binary string") if len(key) != 32 * self._Nk: diff --git a/src/sage/crypto/mq/sr.py b/src/sage/crypto/mq/sr.py index 0124f776d0f..736dd315ab8 100644 --- a/src/sage/crypto/mq/sr.py +++ b/src/sage/crypto/mq/sr.py @@ -306,8 +306,6 @@ """ # python3 from __future__ import division, print_function, absolute_import -from six.moves import range -from six import integer_types from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF from sage.rings.integer_ring import ZZ @@ -2110,7 +2108,7 @@ def polynomial_system(self, P=None, K=None, C=None): if d is None: data.append( None ) elif isinstance(d, (tuple, list)): - if isinstance(d[0], integer_types): + if isinstance(d[0], int): d = [GF(2)(_) for _ in d] if len(d) == r*c*e and (d[0].parent() is R or d[0].parent() == R): data.append( Matrix(R,r*c*e,1,d) ) diff --git a/src/sage/crypto/public_key/blum_goldwasser.py b/src/sage/crypto/public_key/blum_goldwasser.py index 954b6565531..d841e69699a 100644 --- a/src/sage/crypto/public_key/blum_goldwasser.py +++ b/src/sage/crypto/public_key/blum_goldwasser.py @@ -27,7 +27,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from operator import xor diff --git a/src/sage/crypto/sbox.py b/src/sage/crypto/sbox.py index e722c2ef647..71c615f7f21 100644 --- a/src/sage/crypto/sbox.py +++ b/src/sage/crypto/sbox.py @@ -2,8 +2,6 @@ S-Boxes and Their Algebraic Representations """ from __future__ import print_function, division -from six.moves import range -from six import integer_types from sage.combinat.integer_vector import IntegerVectors from sage.crypto.boolean_function import BooleanFunction @@ -356,7 +354,7 @@ def __call__(self, X): sage: S([0,0,0]) [1, 1] """ - if isinstance(X, integer_types + (Integer,)): + if isinstance(X, (Integer, int)): return self._S[ZZ(X)] try: diff --git a/src/sage/crypto/stream.py b/src/sage/crypto/stream.py index b25b73d5581..a973634d4e5 100644 --- a/src/sage/crypto/stream.py +++ b/src/sage/crypto/stream.py @@ -12,7 +12,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from .cryptosystem import SymmetricKeyCryptosystem from .stream_cipher import LFSRCipher, ShrinkingGeneratorCipher diff --git a/src/sage/crypto/util.py b/src/sage/crypto/util.py index daf427bfc61..7541dd65b51 100644 --- a/src/sage/crypto/util.py +++ b/src/sage/crypto/util.py @@ -20,7 +20,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range from sage.monoids.string_monoid import BinaryStrings from sage.arith.all import is_prime, lcm, primes, random_prime diff --git a/src/sage/databases/conway.py b/src/sage/databases/conway.py index a5a96f64059..6d3e585973d 100644 --- a/src/sage/databases/conway.py +++ b/src/sage/databases/conway.py @@ -19,11 +19,9 @@ # http://www.gnu.org/licenses/ #***************************************************************************** -from six import iteritems -from six.moves import cPickle as pickle - import collections import os +import pickle from sage.env import CONWAY_POLYNOMIALS_DATA_DIR @@ -182,7 +180,7 @@ def __iter__(self): sage: next(itr) # random (65537, 4) """ - for a, b in iteritems(self._store): + for a, b in self._store.items(): for c in b: yield a, c diff --git a/src/sage/databases/findstat.py b/src/sage/databases/findstat.py index a2c596085f6..fad0b17117f 100644 --- a/src/sage/databases/findstat.py +++ b/src/sage/databases/findstat.py @@ -172,8 +172,6 @@ def increasing_tree_shape(elt, compare=min): # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range -from six import iteritems, add_metaclass, string_types from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass from sage.structure.element import Element @@ -198,10 +196,9 @@ def increasing_tree_shape(elt, compare=min): import json import cgi -# import compatible with py2 and py3 -from six.moves.urllib.parse import urlencode -from six.moves.urllib.request import Request, urlopen -from six.moves.urllib.error import HTTPError +from urllib.parse import urlencode +from urllib.request import Request, urlopen +from urllib.error import HTTPError # Combinatorial collections from sage.combinat.alternating_sign_matrix import AlternatingSignMatrix, AlternatingSignMatrices @@ -534,7 +531,7 @@ def query_by_dict(query, collection=None): we expect a dictionary from objects or strings to integers """ - l = iteritems(query) + l = query.items() (key, value) = next(l) (collection, to_str) = get_collection(collection, key) @@ -1000,12 +997,12 @@ def _find_by_id(self): gf = self._raw[FINDSTAT_STATISTIC_GENERATING_FUNCTION] self._generating_functions_dict = { literal_eval(key): { literal_eval(inner_key): inner_value - for inner_key, inner_value in iteritems(value) } - for key, value in iteritems(gf) } + for inner_key, inner_value in value.items() } + for key, value in gf.items() } from_str = self._collection.from_string() # we want to keep FindStat's ordering here! - self._first_terms = [(from_str(obj), Integer(val)) for (obj, val) in iteritems(self._raw[FINDSTAT_STATISTIC_DATA])] + self._first_terms = [(from_str(obj), Integer(val)) for (obj, val) in self._raw[FINDSTAT_STATISTIC_DATA].items()] return self ###################################################################### @@ -1465,8 +1462,8 @@ def generating_functions(self, style="polynomial"): P = PolynomialRing(ZZ,"q") q = P.gen() return { level : sum( coefficient * q**exponent - for exponent,coefficient in iteritems(gen_dict) ) - for level, gen_dict in iteritems(gfs)} + for exponent,coefficient in gen_dict.items() ) + for level, gen_dict in gfs.items()} else: raise ValueError("The argument 'style' (='%s') must be 'dictionary', 'polynomial', or 'list'." % style) @@ -1860,7 +1857,7 @@ def submit(self, max_values=FINDSTAT_MAX_SUBMISSION_VALUES): f.write(FINDSTAT_NEWSTATISTIC_FORM_HEADER %FINDSTAT_URL_NEW) else: f.write(FINDSTAT_NEWSTATISTIC_FORM_HEADER %(FINDSTAT_URL_EDIT+self.id_str())) - for key, value in iteritems(args): + for key, value in args.items(): verbose("writing argument %s" % key, caller_name='FindStat') value_encoded = cgi.escape(str(value), quote=True) verbose("%s" % value_encoded, caller_name='FindStat') @@ -1908,8 +1905,7 @@ def _finite_irreducible_cartan_types_by_rank(n): return cartan_types -@add_metaclass(InheritComparisonClasscallMetaclass) -class FindStatCollection(Element): +class FindStatCollection(Element, metaclass=InheritComparisonClasscallMetaclass): r""" A FindStat collection. @@ -2517,7 +2513,7 @@ def __init__(self): c[1] = j[FINDSTAT_COLLECTION_NAME_PLURAL] c[2] = j[FINDSTAT_COLLECTION_NAME_WIKI] c[5] = {literal_eval(key):value for key,value in - iteritems(j[FINDSTAT_COLLECTION_LEVELS])} + j[FINDSTAT_COLLECTION_LEVELS].items()} Parent.__init__(self, category=Sets()) @@ -2574,7 +2570,7 @@ def _element_constructor_(self, entry): if isinstance(entry, FindStatCollection): return entry - if isinstance(entry, string_types): + if isinstance(entry, str): # find by name in _findstat_collections for id, c in self._findstat_collections.items(): if entry.upper() in (c[0].upper(), c[1].upper(), c[2].upper()): @@ -2651,8 +2647,7 @@ def __iter__(self): Element = FindStatCollection -@add_metaclass(InheritComparisonClasscallMetaclass) -class FindStatMap(Element): +class FindStatMap(Element, metaclass=InheritComparisonClasscallMetaclass): r""" A FindStat map. @@ -3003,7 +2998,7 @@ def _element_constructor_(self, entry): elif entry in self._findstat_maps: return self.element_class(self, entry) - elif isinstance(entry, string_types): + elif isinstance(entry, str): # find by name in _findstat_maps for c in self._findstat_maps: if entry.upper() == c[FINDSTAT_MAP_NAME].upper(): diff --git a/src/sage/databases/oeis.py b/src/sage/databases/oeis.py index d774de7c0be..b8fa05dfb12 100644 --- a/src/sage/databases/oeis.py +++ b/src/sage/databases/oeis.py @@ -158,8 +158,8 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six.moves.urllib.request import urlopen -from six.moves.urllib.parse import urlencode +from urllib.request import urlopen +from urllib.parse import urlencode from sage.structure.sage_object import SageObject from sage.structure.unique_representation import UniqueRepresentation diff --git a/src/sage/databases/sloane.py b/src/sage/databases/sloane.py index 6235e51ca72..356ed162519 100644 --- a/src/sage/databases/sloane.py +++ b/src/sage/databases/sloane.py @@ -86,8 +86,7 @@ import os import re -# import compatible with py2 and py3 -from six.moves.urllib.request import urlretrieve +from urllib.request import urlretrieve from sage.misc.all import verbose from sage.env import SAGE_SHARE diff --git a/src/sage/databases/stein_watkins.py b/src/sage/databases/stein_watkins.py index eeb2bcb5981..45a45c8472d 100644 --- a/src/sage/databases/stein_watkins.py +++ b/src/sage/databases/stein_watkins.py @@ -134,7 +134,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range import bz2 import os diff --git a/src/sage/docs/conf.py b/src/sage/docs/conf.py index a1212f5839d..a5c8d96acdf 100644 --- a/src/sage/docs/conf.py +++ b/src/sage/docs/conf.py @@ -3,7 +3,6 @@ import sage.version from sage.misc.sagedoc import extlinks import dateutil.parser -from six import iteritems from docutils import nodes from docutils.transforms import Transform from sphinx.ext.doctest import blankline_re @@ -556,7 +555,7 @@ def check_nested_class_picklability(app, what, name, obj, skip, options): # Check picklability of nested classes. Adapted from # sage.misc.nested_class.modify_for_nested_pickle. module = sys.modules[obj.__module__] - for (nm, v) in iteritems(obj.__dict__): + for (nm, v) in obj.__dict__.items(): if (isinstance(v, type) and v.__name__ == nm and v.__module__ == module.__name__ and @@ -620,7 +619,6 @@ def process_dollars(app, what, name, obj, options, docstringlines): See sage.misc.sagedoc.process_dollars for more information. """ if len(docstringlines) and name.find("process_dollars") == -1: - from six.moves import range from sage.misc.sagedoc import process_dollars as sagedoc_dollars s = sagedoc_dollars("\n".join(docstringlines)) lines = s.split("\n") diff --git a/src/sage/docs/instancedoc.pyx b/src/sage/docs/instancedoc.pyx index 0cf1176ae2b..13fc059b06c 100644 --- a/src/sage/docs/instancedoc.pyx +++ b/src/sage/docs/instancedoc.pyx @@ -74,12 +74,11 @@ docstring:: ....: "Metaclass doc" ....: def _instancedoc_(self): ....: return "Docstring for {}".format(self) - sage: from six import with_metaclass - sage: class T(with_metaclass(Meta, object)): + sage: class T(metaclass=Meta): ....: pass sage: print(T.__doc__) Docstring for - sage: class U(with_metaclass(Meta, object)): + sage: class U(metaclass=Meta): ....: "Special doc for U" sage: print(U.__doc__) Special doc for U diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py index 57e1d3f2c16..8073a2373fe 100644 --- a/src/sage/doctest/control.py +++ b/src/sage/doctest/control.py @@ -23,7 +23,6 @@ from __future__ import absolute_import, division, print_function import random, os, sys, time, json, re, types -import six import sage.misc.flatten from sage.structure.sage_object import SageObject from sage.env import DOT_SAGE, SAGE_LIB, SAGE_SRC, SAGE_LOCAL, SAGE_EXTCODE @@ -41,7 +40,7 @@ optionaltag_regex = re.compile(r'^\w+$') # Optional tags which are always automatically added -auto_optional_tags = set(['py2' if six.PY2 else 'py3']) +auto_optional_tags = set(['py3']) class DocTestDefaults(SageObject): @@ -341,7 +340,7 @@ def __init__(self, options, args): if options.verbose: options.show_skipped = True - if isinstance(options.optional, six.string_types): + if isinstance(options.optional, str): s = options.optional.lower() options.optional = set(s.split(',')) if "all" in options.optional: @@ -730,7 +729,7 @@ def all_files(): filename.endswith(".rst"))): self.files.append(os.path.relpath(opj(SAGE_ROOT,filename))) if self.options.sagenb: - if six.PY3 or not PythonModule('sagenb').is_present(): + if not PythonModule('sagenb').is_present(): if not self.options.all: self.log("Skipping doctesting of the Sage notebook: " "not installed on Python 3") @@ -1275,7 +1274,7 @@ def stringify(x): return [base] else: return [os.path.join(base, file) + ext] - elif isinstance(x, six.string_types): + elif isinstance(x, str): return [os.path.abspath(x)] F = stringify(module) if options is None: diff --git a/src/sage/doctest/external.py b/src/sage/doctest/external.py index e19c9891b9c..b0db07b47a2 100644 --- a/src/sage/doctest/external.py +++ b/src/sage/doctest/external.py @@ -27,6 +27,9 @@ from multiprocessing import Array +import urllib.error +from urllib.request import Request, urlopen + # Functions in this module whose name is of the form 'has_xxx' tests if the # software xxx is available to Sage. prefix = 'has_' @@ -44,8 +47,6 @@ def has_internet(): sage: has_internet() # random, optional -- internet True """ - from six.moves import urllib - from six.moves.urllib.request import Request, urlopen req = Request("http://www.sagemath.org",headers={"User-Agent":"sage-doctest"}) try: urlopen(req,timeout=1) @@ -67,10 +68,10 @@ def has_latex(): from sage.misc.temporary_file import tmp_filename try: f = tmp_filename(ext='.tex') - O = open(f, 'w') + O = open(f, 'w') O.write(_latex_file_('2+3')) - O.close() - _run_latex_(f) + O.close() + _run_latex_(f) return True except Exception: return False @@ -301,7 +302,7 @@ def external_software(): def _lookup(software): """ Test if the software is available on the system. - + EXAMPLES:: sage: sage.doctest.external._lookup('internet') # random, optional - internet @@ -353,8 +354,8 @@ def __init__(self): sage: S.seen() # random [] """ - # For multiprocessing of doctests, the data self._seen should be - # shared among subprocesses. Thus we use Array class from the + # For multiprocessing of doctests, the data self._seen should be + # shared among subprocesses. Thus we use Array class from the # multiprocessing module. self._seen = Array('i', len(external_software)) # initialized to zeroes @@ -402,7 +403,7 @@ def issuperset(self, other): def seen(self): """ Return the list of detected external software. - + EXAMPLES:: sage: from sage.doctest.external import available_software diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py index c91a49c06be..c93d1f2d995 100644 --- a/src/sage/doctest/forker.py +++ b/src/sage/doctest/forker.py @@ -49,8 +49,8 @@ import traceback import tempfile from dis import findlinestarts +from queue import Empty import gc -import six import sage.misc.randstate as randstate from .util import Timer, RecordingDict, count_noun @@ -68,24 +68,23 @@ MANDATORY_COMPILE_FLAGS = __future__.print_function.compiler_flag -if not six.PY2: - # These lists are used on Python 3+ only for backwards compatibility with - # Python 2 in traceback parsing - # These exceptions in Python 2 have been rolled into OSError on Python 3; - # see https://docs.python.org/3/library/exceptions.html#OSError - _OSError_ALIASES = [ - 'IOError', 'EnvironmentError', 'socket.error', 'select.error', - 'mmap.error' - ] - # This list is sort of the opposite case: these are new built-in exceptions - # in Python 3 that are subclasses of OSError; see - # https://docs.python.org/3/library/exceptions.html#os-exceptions - import builtins - _OSError_SUBCLASSES = [ - exc.__name__ for exc in vars(builtins).values() - if isinstance(exc, type) and issubclass(exc, OSError) and - exc is not OSError - ] +# These lists are used on Python 3+ only for backwards compatibility with +# Python 2 in traceback parsing +# These exceptions in Python 2 have been rolled into OSError on Python 3; +# see https://docs.python.org/3/library/exceptions.html#OSError +_OSError_ALIASES = [ + 'IOError', 'EnvironmentError', 'socket.error', 'select.error', + 'mmap.error' +] +# This list is sort of the opposite case: these are new built-in exceptions +# in Python 3 that are subclasses of OSError; see +# https://docs.python.org/3/library/exceptions.html#os-exceptions +import builtins +_OSError_SUBCLASSES = [ + exc.__name__ for exc in vars(builtins).values() + if isinstance(exc, type) and issubclass(exc, OSError) and + exc is not OSError +] @@ -698,7 +697,7 @@ def compiler(example): self.debugger.set_continue() # ==== Example Finished ==== got = self._fakeout.getvalue() - if not isinstance(got, six.text_type): + if not isinstance(got, str): # On Python 3 got should already be unicode text, but on Python # 2 it is not. For comparison's sake we want the unicode text # decoded from UTF-8. If there was some error such that the @@ -721,7 +720,7 @@ def compiler(example): else: exc_msg = traceback.format_exception_only(*exception[:2])[-1] - if six.PY3 and example.exc_msg is not None: + if example.exc_msg is not None: # On Python 3 the exception repr often includes the # exception's full module name (for non-builtin # exceptions), whereas on Python 2 does not, so we @@ -755,25 +754,7 @@ def compiler(example): break if not quiet: - exc_tb = doctest._exception_traceback(exception) - if not isinstance(exc_tb, six.text_type): - # On Python 2, if the traceback contains non-ASCII - # text we can get a UnicodeDecodeError here if we - # don't explicitly decode it first; first try utf-8 - # and then fall back on latin-1. - try: - exc_tb = exc_tb.decode('utf-8') - except UnicodeDecodeError: - exc_tb = exc_tb.decode('latin-1') - - got += exc_tb - - if not isinstance(exc_msg, six.text_type): - # Same here as above - try: - exc_msg = exc_msg.decode('utf-8') - except UnicodeDecodeError: - exc_msg = exc_msg.decode('latin-1') + got += doctest._exception_traceback(exception) # If `example.exc_msg` is None, then we weren't expecting # an exception. @@ -1991,10 +1972,7 @@ def sel_exit(): # Hack to ensure multiprocessing leaves these processes # alone (in particular, it doesn't wait for them when we # exit). - if six.PY2: - p = multiprocessing.current_process() - else: - p = multiprocessing.process + p = multiprocessing.process assert hasattr(p, '_children') p._children = set() @@ -2277,7 +2255,6 @@ def save_result_output(self): This method is called from the parent process, not from the subprocess. """ - from six.moves.queue import Empty try: self.result = self.result_queue.get(block=False) except Empty: @@ -2405,10 +2382,7 @@ class DocTestTask(object): ['cputime', 'err', 'failures', 'optionals', 'tests', 'walltime', 'walltime_skips'] """ - if six.PY2: - extra_globals = {} - else: - extra_globals = {'long': int} + extra_globals = {'long': int} """ Extra objects to place in the global namespace in which tests are run. Normally this should be empty but there are special cases where it may diff --git a/src/sage/doctest/parsing.py b/src/sage/doctest/parsing.py index ebf7555106e..876661f5257 100644 --- a/src/sage/doctest/parsing.py +++ b/src/sage/doctest/parsing.py @@ -23,9 +23,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from sage.misc.six import u -import six -from six import text_type import re import doctest @@ -119,7 +116,7 @@ def remove_unicode_u(string): sage: print(remu(euro)) '€' """ - stripped, replacements = cython_strip_string_literals(u(string), + stripped, replacements = cython_strip_string_literals(string, "__remove_unicode_u") string = stripped.replace('u"', '"').replace("u'", "'") for magic, literal in replacements.items(): @@ -257,25 +254,19 @@ def subst(m): # application. # For example, on Python 3 we strip all u prefixes from unicode strings in the # expected output, because we never expect to see those on Python 3. -if six.PY2: - _repr_fixups = [ - (lambda g, w: ' keep symbolic return None - + class Func_chebyshev_T(ChebyshevFunction): """ Chebyshev polynomials of the first kind. @@ -2007,7 +2006,7 @@ def __init__(self): class Func_laguerre(OrthogonalFunction): """ REFERENCE: - + - [AS1964]_ 22.5.16, page 778 and page 789. """ def __init__(self): diff --git a/src/sage/functions/other.py b/src/sage/functions/other.py index 07669864d61..e39e424c31f 100644 --- a/src/sage/functions/other.py +++ b/src/sage/functions/other.py @@ -13,8 +13,6 @@ beta(x, x) """ from __future__ import print_function -from six.moves import range -from six import integer_types from sage.misc.lazy_import import lazy_import lazy_import('sage.functions.gamma', @@ -186,7 +184,7 @@ def _eval_floor_ceil(self, x, method, bits=0, **kwds): else: return m() - if isinstance(x, integer_types): + if isinstance(x, int): return Integer(x) if isinstance(x, (float, complex)): m = getattr(math, method) @@ -447,7 +445,7 @@ def _eval_(self, x): try: return x.ceil() except AttributeError: - if isinstance(x, integer_types): + if isinstance(x, int): return Integer(x) elif isinstance(x, (float, complex)): return Integer(math.ceil(x)) @@ -611,7 +609,7 @@ def _eval_(self, x): try: return x.floor() except AttributeError: - if isinstance(x, integer_types): + if isinstance(x, int): return Integer(x) elif isinstance(x, (float, complex)): return Integer(math.floor(x)) @@ -741,7 +739,7 @@ def _eval_(self, x): try: return x - x.floor() except AttributeError: - if isinstance(x, integer_types): + if isinstance(x, int): return Integer(0) elif isinstance(x, (float, complex)): return x - Integer(math.floor(x)) diff --git a/src/sage/functions/piecewise.py b/src/sage/functions/piecewise.py index e8743b8fe2f..790b3f0878c 100644 --- a/src/sage/functions/piecewise.py +++ b/src/sage/functions/piecewise.py @@ -77,8 +77,6 @@ from sage.symbolic.ring import SR from sage.rings.infinity import minus_infinity, infinity -from six import get_function_code - class PiecewiseFunction(BuiltinFunction): def __init__(self): @@ -149,7 +147,7 @@ def __call__(self, function_pieces, **kwds): if isinstance(function, FunctionType): if var is None: var = SR.var('x') - if get_function_code(function).co_argcount == 0: + if function.__code__.co_argcount == 0: function = function() else: function = function(var) diff --git a/src/sage/games/sudoku.py b/src/sage/games/sudoku.py index f767e52e4e5..fd3ea3e018a 100644 --- a/src/sage/games/sudoku.py +++ b/src/sage/games/sudoku.py @@ -21,8 +21,6 @@ # http://www.gnu.org/licenses/ ###################################################################### from __future__ import print_function, absolute_import -from six.moves import range -from six import string_types from sage.structure.sage_object import SageObject @@ -183,7 +181,7 @@ def __init__(self, puzzle, verify_input = True): if verify_input and not(puzzle.is_square()): raise ValueError('Sudoku puzzle must be a square matrix') self.puzzle = tuple([int(x) for x in puzzle.list()]) - elif isinstance(puzzle, string_types): + elif isinstance(puzzle, str): puzzle_size = int(round(sqrt(len(puzzle)))) puzzle_numeric = [] for char in puzzle: diff --git a/src/sage/geometry/cone.py b/src/sage/geometry/cone.py index 866167b3a84..42911093c1b 100644 --- a/src/sage/geometry/cone.py +++ b/src/sage/geometry/cone.py @@ -192,7 +192,6 @@ # Use python-3.x versions of print() and range(). from __future__ import print_function -from six.moves import range import collections import copy diff --git a/src/sage/geometry/lattice_polytope.py b/src/sage/geometry/lattice_polytope.py index 35d2195c45e..0793432652b 100644 --- a/src/sage/geometry/lattice_polytope.py +++ b/src/sage/geometry/lattice_polytope.py @@ -102,10 +102,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range -from six import StringIO -from six.moves import copyreg -import six from sage.arith.all import gcd from sage.combinat.posets.posets import FinitePoset @@ -135,14 +131,12 @@ from copy import copy import collections +import copyreg import os import subprocess import warnings from functools import reduce -from io import IOBase - -if not six.PY2: - file = IOBase +from io import IOBase, StringIO class SetOfAllLatticePolytopesClass(Set_generic): @@ -300,7 +294,7 @@ def LatticePolytope(data, compute_vertices=True, n=0, lattice=None): skip_palp_matrix(f, n) data = read_palp_point_collection(data) f.close() - if isinstance(data, (file, IOBase, StringIO)): + if isinstance(data, (IOBase, StringIO)): data = read_palp_point_collection(data) if not is_PointCollection(data) and not isinstance(data, (list, tuple)): try: diff --git a/src/sage/geometry/linear_expression.py b/src/sage/geometry/linear_expression.py index cc49fd19b70..142f7a0321e 100644 --- a/src/sage/geometry/linear_expression.py +++ b/src/sage/geometry/linear_expression.py @@ -36,7 +36,6 @@ sage: m-m 0*x + 0*y + 0*z + 0 """ -from six.moves import zip from sage.structure.parent import Parent from sage.structure.richcmp import richcmp diff --git a/src/sage/geometry/point_collection.pyx b/src/sage/geometry/point_collection.pyx index f04fe59d042..102929a15bb 100644 --- a/src/sage/geometry/point_collection.pyx +++ b/src/sage/geometry/point_collection.pyx @@ -912,7 +912,7 @@ cdef class PointCollection(SageObject): EXAMPLES:: sage: o = lattice_polytope.cross_polytope(3) - sage: from six import StringIO + sage: from io import StringIO sage: f = StringIO() sage: o.vertices().write_for_palp(f) sage: print(f.getvalue()) @@ -975,7 +975,7 @@ def read_palp_point_collection(f, lattice=None, permutation=False): 2 3 transposed 1 2 3 4 5 6 - sage: from six import StringIO + sage: from io import StringIO sage: f = StringIO(data) sage: from sage.geometry.point_collection \ ....: import read_palp_point_collection diff --git a/src/sage/geometry/polyhedron/backend_cdd.py b/src/sage/geometry/polyhedron/backend_cdd.py index 0b9d007df7e..064a8653d61 100644 --- a/src/sage/geometry/polyhedron/backend_cdd.py +++ b/src/sage/geometry/polyhedron/backend_cdd.py @@ -15,7 +15,6 @@ # **************************************************************************** from __future__ import print_function, absolute_import -from six import PY2 from subprocess import Popen, PIPE from sage.rings.all import ZZ @@ -147,13 +146,9 @@ def _run_cdd(self, cdd_input_string, cmdline_arg, verbose=False): print('---- CDD input -----') print(cdd_input_string) - if PY2: - enc_kwargs = {} - else: - enc_kwargs = {'encoding': 'latin-1'} - cdd_proc = Popen([self._cdd_executable, cmdline_arg], - stdin=PIPE, stdout=PIPE, stderr=PIPE, **enc_kwargs) + stdin=PIPE, stdout=PIPE, stderr=PIPE, + encoding='latin-1') ans, err = cdd_proc.communicate(input=cdd_input_string) if verbose: diff --git a/src/sage/geometry/polyhedron/backend_normaliz.py b/src/sage/geometry/polyhedron/backend_normaliz.py index 1570a9a6c0c..c293783e14e 100644 --- a/src/sage/geometry/polyhedron/backend_normaliz.py +++ b/src/sage/geometry/polyhedron/backend_normaliz.py @@ -393,8 +393,7 @@ def _cone_from_normaliz_data(self, data, verbose=False): [[-1L, 2L, 0L], [0L, 0L, 1L], [2L, -1L, 0L]] """ if verbose: - import six - if isinstance(verbose, six.string_types): + if isinstance(verbose, str): print("# Wrote equivalent Normaliz input file to {}".format(verbose)) self._normaliz_format(data, file_output=verbose) else: diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 01989bbd80e..1c9bee5874d 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -18,7 +18,6 @@ from __future__ import division, print_function, absolute_import import itertools -import six from sage.structure.element import Element, coerce_binop, is_Vector, is_Matrix from sage.structure.richcmp import rich_to_bool, op_NE from sage.cpython.string import bytes_to_str @@ -943,7 +942,7 @@ def merge_options(*opts): continue elif opt is False: return False - elif isinstance(opt, (six.string_types, list, tuple)): + elif isinstance(opt, (str, list, tuple)): merged['color'] = opt else: merged.update(opt) diff --git a/src/sage/geometry/polyhedron/palp_database.py b/src/sage/geometry/polyhedron/palp_database.py index 9f91adc4f17..4e4d18532a1 100644 --- a/src/sage/geometry/polyhedron/palp_database.py +++ b/src/sage/geometry/polyhedron/palp_database.py @@ -33,8 +33,6 @@ from subprocess import Popen, PIPE -import six - from sage.structure.sage_object import SageObject from sage.rings.all import ZZ @@ -136,16 +134,8 @@ def _palp_Popen(self): """ - if six.PY2: - encoding_kwargs = {} - else: - encoding_kwargs = { - 'encoding': 'utf-8', - 'errors': 'surrogateescape' - } - return Popen(["class.x", "-b2a", "-di", self._data_basename], - stdout=PIPE, **encoding_kwargs) + stdout=PIPE, encoding='utf-8', errors='surrogateescape') def _read_vertices(self, stdout, rows, cols): r""" @@ -470,15 +460,8 @@ def _palp_Popen(self): sage: polygons._palp_Popen() # optional - polytopes_db_4d """ - if six.PY2: - encoding_kwargs = {} - else: - encoding_kwargs = { - 'encoding': 'utf-8', - 'errors': 'surrogateescape' - } return Popen(['class-4d.x', '-He', 'H{}:{}L100000000'.format(self._h21, self._h11), '-di', self._data_basename], stdout=PIPE, - **encoding_kwargs) + encoding='utf-8', errors='surrogateescape') diff --git a/src/sage/geometry/toric_plotter.py b/src/sage/geometry/toric_plotter.py index 5ba73413734..ffe59cc81db 100644 --- a/src/sage/geometry/toric_plotter.py +++ b/src/sage/geometry/toric_plotter.py @@ -46,7 +46,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six import iteritems from copy import copy from math import pi @@ -203,12 +202,12 @@ def __init__(self, all_options, dimension, generators=None): extra_options = dict() self.extra_options = extra_options toric_options = options() - for option, value in iteritems(all_options): + for option, value in all_options.items(): if option in toric_options: sd[option] = value else: extra_options[option] = value - for option, value in iteritems(toric_options): + for option, value in toric_options.items(): if option not in sd: sd[option] = value if dimension not in [1, 2, 3]: @@ -607,7 +606,7 @@ def plot_walls(self, walls): sage: tp = ToricPlotter(dict(), 2, quadrant.rays()) sage: tp.plot_walls([quadrant]) Graphics object consisting of 2 graphics primitives - + Let's also check that the truncating polyhedron is functioning correctly:: diff --git a/src/sage/geometry/triangulation/element.py b/src/sage/geometry/triangulation/element.py index ba053e7139c..fe7a6560946 100644 --- a/src/sage/geometry/triangulation/element.py +++ b/src/sage/geometry/triangulation/element.py @@ -39,8 +39,6 @@ # https://www.gnu.org/licenses/ #***************************************************************************** -from six import iteritems - from sage.structure.richcmp import richcmp from sage.structure.element import Element from sage.rings.all import QQ, ZZ @@ -673,7 +671,7 @@ def boundary(self): frozenset({(0, 1, 7), (0, 2, 7), (0, 3, 7), (0, 4, 7), (0, 5, 7), (1, 5, 7)}) """ return frozenset(facet for facet, bounded_simplices - in iteritems(self._boundary_simplex_dictionary()) + in self._boundary_simplex_dictionary().items() if len(bounded_simplices) == 1) @cached_method @@ -709,7 +707,7 @@ def interior_facets(self): frozenset({(0, 1, 7), (0, 2, 7), (0, 3, 7), (0, 4, 7), (0, 5, 7), (1, 5, 7)}) """ return frozenset(facet for facet, bounded_simplices - in iteritems(self._boundary_simplex_dictionary()) + in self._boundary_simplex_dictionary().items() if len(bounded_simplices) == 2) @cached_method diff --git a/src/sage/graphs/bipartite_graph.py b/src/sage/graphs/bipartite_graph.py index 744a6399231..28cf2877462 100644 --- a/src/sage/graphs/bipartite_graph.py +++ b/src/sage/graphs/bipartite_graph.py @@ -38,9 +38,6 @@ # **************************************************************************** from __future__ import print_function, absolute_import -from six import iteritems -from six.moves import range - from collections import defaultdict from .generic_graph import GenericGraph @@ -464,7 +461,7 @@ def _upgrade_from_graph(self): if not ans: raise ValueError("input graph is not bipartite") cols = defaultdict(set) - for k, v in iteritems(certif): + for k, v in certif.items(): cols[v].add(k) self.left = cols[1] self.right = cols[0] @@ -1591,7 +1588,7 @@ def matching(self, value_only=False, algorithm=None, m = networkx.bipartite.hopcroft_karp_matching(h) else: m = networkx.bipartite.eppstein_matching(h) - d.extend((u, v, g.edge_label(u,v)) for u,v in iteritems(m) if v2int[u] < v2int[v]) + d.extend((u, v, g.edge_label(u,v)) for u,v in m.items() if v2int[u] < v2int[v]) if value_only: return Integer(len(d)) diff --git a/src/sage/graphs/digraph_generators.py b/src/sage/graphs/digraph_generators.py index 89492161f5b..d00fea61a0a 100644 --- a/src/sage/graphs/digraph_generators.py +++ b/src/sage/graphs/digraph_generators.py @@ -62,8 +62,6 @@ # http://www.gnu.org/licenses/ ################################################################################ from __future__ import print_function, division -from six.moves import range -from six import PY2 from sage.cpython.string import bytes_to_str from sage.env import SAGE_NAUTY_BINS_PREFIX as nautyprefix @@ -636,11 +634,6 @@ def nauty_directg(self, graphs, options="", debug=False): if '-q' not in options: options += ' -q' - if PY2: - enc_kwargs = {} - else: - enc_kwargs = {'encoding': 'latin-1'} - # Build directg input (graphs6 format) input = ''.join(g.graph6_string()+'\n' for g in graphs) sub = subprocess.Popen(nautyprefix+'directg {0}'.format(options), @@ -648,7 +641,7 @@ def nauty_directg(self, graphs, options="", debug=False): stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT, - **enc_kwargs) + encoding='latin-1') out, err = sub.communicate(input=input) if debug: diff --git a/src/sage/graphs/generators/basic.py b/src/sage/graphs/generators/basic.py index 5d42dd851af..759481057fa 100644 --- a/src/sage/graphs/generators/basic.py +++ b/src/sage/graphs/generators/basic.py @@ -15,7 +15,6 @@ # http://www.gnu.org/licenses/ ########################################################################### from __future__ import print_function -from six.moves import range # import from Sage library from sage.graphs.graph import Graph diff --git a/src/sage/graphs/generators/chessboard.py b/src/sage/graphs/generators/chessboard.py index 7660327078f..432c98b3f48 100644 --- a/src/sage/graphs/generators/chessboard.py +++ b/src/sage/graphs/generators/chessboard.py @@ -22,7 +22,6 @@ # http://www.gnu.org/licenses/ ################################################################################ from __future__ import print_function -from six.moves import range def ChessboardGraphGenerator(dim_list, rook = True, rook_radius = None, diff --git a/src/sage/graphs/generators/classical_geometries.py b/src/sage/graphs/generators/classical_geometries.py index 031b57282b9..1293210dd66 100644 --- a/src/sage/graphs/generators/classical_geometries.py +++ b/src/sage/graphs/generators/classical_geometries.py @@ -16,7 +16,6 @@ # https://www.gnu.org/licenses/ ########################################################################### from __future__ import absolute_import, division -from six.moves import range from sage.graphs.graph import Graph from sage.arith.all import is_prime_power @@ -865,7 +864,6 @@ def TaylorTwographDescendantSRG(q, clique_partition=None): raise ValueError('q must be an odd prime power') from sage.schemes.projective.projective_space import ProjectiveSpace from sage.rings.finite_rings.integer_mod import mod - from six.moves.builtins import sum Fq = FiniteField(q**2, 'a') PG = map(tuple,ProjectiveSpace(2, Fq)) diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py index 142e7768e67..dc164e0d22d 100644 --- a/src/sage/graphs/generators/families.py +++ b/src/sage/graphs/generators/families.py @@ -18,8 +18,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, division -import six -from six.moves import range from copy import copy from math import sin, cos, pi @@ -1206,7 +1204,7 @@ def CubeGraph(n): for i in range(n): ci = float(cos(i*theta)) si = float(sin(i*theta)) - for v,e in six.iteritems(d): + for v,e in d.items(): v0 = v+'0' v1 = v+'1' l0 = [v1] @@ -1225,7 +1223,7 @@ def CubeGraph(n): # construct the graph r = Graph(name="%d-Cube"%n) r.add_vertices(d.keys()) - for u,L in six.iteritems(d): + for u,L in d.items(): for v in L: r.add_edge(u,v) r.set_pos(p) diff --git a/src/sage/graphs/generators/intersection.py b/src/sage/graphs/generators/intersection.py index 28aca244f1e..1e787376072 100644 --- a/src/sage/graphs/generators/intersection.py +++ b/src/sage/graphs/generators/intersection.py @@ -17,8 +17,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import, print_function -from six.moves import range - # import from Sage library from sage.graphs.graph import Graph diff --git a/src/sage/graphs/generators/random.py b/src/sage/graphs/generators/random.py index 3b128c7ae1f..ed9524f337e 100644 --- a/src/sage/graphs/generators/random.py +++ b/src/sage/graphs/generators/random.py @@ -14,7 +14,7 @@ # http://www.gnu.org/licenses/ ########################################################################### from __future__ import print_function, division -from six.moves import range + import sys # import from Sage library from sage.graphs.graph import Graph diff --git a/src/sage/graphs/generators/smallgraphs.py b/src/sage/graphs/generators/smallgraphs.py index 4f8a6732288..891aea2a2da 100644 --- a/src/sage/graphs/generators/smallgraphs.py +++ b/src/sage/graphs/generators/smallgraphs.py @@ -15,8 +15,6 @@ # https://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function, absolute_import, division -import six -from six.moves import range # import from Sage library from sage.graphs.graph import Graph @@ -154,12 +152,12 @@ def HarriesGraph(embedding=1): 20: 14, 22: 56, 62: 42} # Position for the vertices from the first copy - for v, i in six.iteritems(g_to_p): + for v, i in g_to_p.items(): gpos[v] = ppos[i] # Position for the vertices in the second copy. Moves the first, too. offset = 3.5 - for v, i in six.iteritems(g_to_g): + for v, i in g_to_g.items(): x, y = gpos[i] gpos[v] = (x + offset*0.5, y) gpos[i] = (x - offset*0.5, y) @@ -3480,7 +3478,7 @@ def LjubljanaGraph(embedding=1): # The vertices of each 8-set are plotted on a circle, and the # circles are slowly shifted to obtain a symmetric drawing. - for i, (u, vertices) in enumerate(six.iteritems(d)): + for i, (u, vertices) in enumerate(d.items()): g._circle_embedding(vertices, center=dh[u], radius=.1, shift=8.*i/14) @@ -3789,10 +3787,10 @@ def MoserSpindle(): True """ edge_dict = { - 0: [1, 4, 6], - 1: [2, 5], - 2: [3, 5], - 3: [4, 5, 6], + 0: [1, 4, 6], + 1: [2, 5], + 2: [3, 5], + 3: [4, 5, 6], 4: [6]} pos_dict = { 0: [QQ('1/2'), 0], @@ -4832,7 +4830,7 @@ def JankoKharaghaniGraph(v): for R in W] D = (D+matrix.block(D2))/2 - return Graph([e for e,v in six.iteritems(D.dict()) if v == 1], + return Graph([e for e,v in D.dict().items() if v == 1], multiedges=False, name="Janko-Kharaghani") @@ -5013,7 +5011,7 @@ def IoninKharaghani765Graph(): for i in range(4): L[i,phi[i](p)].add(p) - L = {k:frozenset(v) for k,v in six.iteritems(L)} + L = {k:frozenset(v) for k,v in L.items()} # Defining pi pi = {L[i,j]:L[i,(j+1)%3] for (i,j) in L} diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py index e00570bc2cc..4c9e6927511 100644 --- a/src/sage/graphs/generic_graph.py +++ b/src/sage/graphs/generic_graph.py @@ -424,8 +424,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import, division -from six.moves import range, zip -from six import iteritems, integer_types from copy import copy @@ -488,7 +486,7 @@ def __setstate__(self,state): Also converts old NetworkX backends into a more recent one. """ - for k,v in iteritems(state): + for k,v in state.items(): self.__dict__[k] = v def __add__(self, other): @@ -734,7 +732,7 @@ def __mul__(self, n): sage: H = G * 1; H Cycle graph: Graph on 3 vertices """ - if isinstance(n, integer_types + (Integer,)): + if isinstance(n, (int, Integer)): if n < 1: raise TypeError('multiplication of a graph and a nonpositive integer is not defined') if n == 1: @@ -1211,7 +1209,7 @@ def copy(self, weighted=None, data_structure=None, sparse=None, immutable=None): copy_attr = {} old_attr = getattr(self, attr) if isinstance(old_attr, dict): - for v, value in iteritems(old_attr): + for v, value in old_attr.items(): try: copy_attr[v] = value.copy() except AttributeError: @@ -2442,10 +2440,10 @@ def kirchhoff_matrix(self, weighted=None, indegree=True, normalized=False, signl if M.is_sparse(): row_sums = {} if indegree: - for (i,j), entry in iteritems(M.dict()): + for (i,j), entry in M.dict().items(): row_sums[j] = row_sums.get(j, 0) + entry else: - for (i,j), entry in iteritems(M.dict()): + for (i,j), entry in M.dict().items(): row_sums[i] = row_sums.get(i, 0) + entry @@ -9248,7 +9246,7 @@ def _ford_fulkerson(self, s, t, use_edge_labels=False, integer=False, value_only # Building and returning the flow graph g = DiGraph() - g.add_edges((x, y, l) for (x, y), l in iteritems(flow) if l > 0) + g.add_edges((x, y, l) for (x, y), l in flow.items() if l > 0) g.set_pos(self.get_pos()) return flow_intensity, g @@ -9422,7 +9420,7 @@ def multicommodity_flow(self, terminals, integer=True, use_edge_labels=False, ve flow = p.get_values(flow) # building clean flow digraphs - flow_graphs = [g._build_flow_graph({e: f for (ii,e),f in iteritems(flow) if ii == i}, integer=integer) + flow_graphs = [g._build_flow_graph({e: f for (ii,e),f in flow.items() if ii == i}, integer=integer) for i in range(len(terminals))] # which could be .. graphs ! @@ -9482,7 +9480,7 @@ def _build_flow_graph(self, flow, integer): g = DiGraph() # add significant edges - for (u,v),l in iteritems(flow): + for (u,v),l in flow.items(): if l > 0 and not (integer and l < .5): g.add_edge(u, v, l) @@ -14233,7 +14231,7 @@ def cluster_triangles(self, nbunch=None, implementation=None): if nbunch is None: return triangles_count(self) - return {v: c for v, c in iteritems(triangles_count(self)) if v in nbunch} + return {v: c for v, c in triangles_count(self).items() if v in nbunch} def clustering_average(self, implementation=None): r""" @@ -14442,11 +14440,11 @@ def coeff_from_triangle_count(v, count): elif implementation == 'sparse_copy': from sage.graphs.base.static_sparse_graph import triangles_count return {v: coeff_from_triangle_count(v, count) - for v, count in iteritems(triangles_count(self))} + for v, count in triangles_count(self).items()} elif implementation =="dense_copy": from sage.graphs.base.static_dense_graph import triangles_count return {v: coeff_from_triangle_count(v, count) - for v, count in iteritems(triangles_count(self))} + for v, count in triangles_count(self).items()} def cluster_transitivity(self): r""" @@ -15951,7 +15949,7 @@ def centrality_closeness(self, vert=None, by_weight=False, algorithm=None, degree = self.out_degree if self.is_directed() else self.degree if vert is None: closeness = networkx.closeness_centrality(G, vert, distance='weight' if by_weight else None) - return {v: c for v, c in iteritems(closeness) if degree(v)} + return {v: c for v, c in closeness.items() if degree(v)} closeness = {} for x in v_iter: if degree(x): @@ -17276,9 +17274,9 @@ def weight_function(e): weight_function=weight_function) dist[u] = {v: self._path_length(p, by_weight=by_weight, weight_function=weight_function) - for v, p in iteritems(paths)} + for v, p in paths.items()} pred[u] = {v: None if len(p) <= 1 else p[1] - for v, p in iteritems(paths)} + for v, p in paths.items()} return dist, pred elif algorithm != "Floyd-Warshall-Python": @@ -17970,7 +17968,6 @@ def add_clique(self, vertices, loops=False): Using different kinds of iterable container of vertices, :trac:`22906`:: - sage: from six.moves import range sage: G = Graph(4) sage: G.add_clique(G) sage: G.is_clique() @@ -19626,7 +19623,7 @@ def slide(v, dx): stick.append(t) if tree_orientation in ['right', 'left']: - return {p: (py, px) for p, (px, py) in iteritems(pos)} + return {p: (py, px) for p, (px, py) in pos.items()} return pos @@ -19719,7 +19716,7 @@ def layout_graphviz(self, dim=2, prog='dot', **options): import dot2tex positions = dot2tex.dot2tex(self.graphviz_string(**options), format="positions", prog=prog) - return {key_to_vertex[key]: pos for key, pos in iteritems(positions)} + return {key_to_vertex[key]: pos for key, pos in positions.items()} def _layout_bounding_box(self, pos): """ @@ -21941,7 +21938,7 @@ def relabel(self, perm=None, inplace=True, return_map=False, check_input=True, c for attr in attributes_to_update: if hasattr(self, attr) and getattr(self, attr) is not None: new_attr = {} - for v, value in iteritems(getattr(self, attr)): + for v, value in getattr(self, attr).items(): if attr != '_embedding': new_attr[perm[v]] = value else: @@ -22500,7 +22497,7 @@ def automorphism_group(self, partition=None, verbosity=0, # We relabel the cycles using the vertices' names instead of integers n = self.order() - int_to_vertex = {((i + 1) if i != n else 1): v for v, i in iteritems(b)} + int_to_vertex = {((i + 1) if i != n else 1): v for v, i in b.items()} gens = [[tuple(int_to_vertex[i] for i in cycle) for cycle in gen] for gen in gens] output.append(PermutationGroup(gens=gens, domain=int_to_vertex.values())) else: diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py index cda883c7030..e33997149b2 100644 --- a/src/sage/graphs/graph.py +++ b/src/sage/graphs/graph.py @@ -82,7 +82,7 @@ - Amanda Francis, Caitlin Lienkaemper, Kate Collins, Rajat Mittal (2019-03-10): methods for computing effective resistance - + - Amanda Francis, Caitlin Lienkaemper, Kate Collins, Rajat Mittal (2019-03-19): most_common_neighbors and common_neighbors_matrix added. @@ -411,8 +411,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -import six -from six.moves import range import itertools from copy import copy @@ -3859,7 +3857,7 @@ def bipartite_sets(self): left = set() right = set() - for u,s in six.iteritems(color): + for u,s in color.items(): if s: left.add(u) else: @@ -4819,7 +4817,7 @@ def maximum_average_degree(self, value_only=True, solver=None, verbose=0): # should be safe :-) m = 1/(10 *Integer(g.order())) d_val = p.get_values(d) - g_mad = g.subgraph(v for v,l in six.iteritems(d_val) if l > m) + g_mad = g.subgraph(v for v,l in d_val.items() if l > m) if value_only: return g_mad.average_degree() @@ -8258,7 +8256,7 @@ def effective_resistance(self, i, j): if i not in self: raise ValueError("vertex ({0}) is not a vertex of the graph".format(repr(i))) elif j not in self: - raise ValueError("vertex ({0}) is not a vertex of the graph".format(repr(j))) + raise ValueError("vertex ({0}) is not a vertex of the graph".format(repr(j))) if i == j : return 0 @@ -8366,7 +8364,7 @@ def effective_resistance_matrix(self, vertices=None, nonedgesonly=True): multiedges. Perhaps this method can be updated to handle them, but in the meantime if you want to use it please disallow multiedges using allow_multiple_edges(). - + sage: graphs.CompleteGraph(4).effective_resistance_matrix(nonedgesonly=False) [ 0 1/2 1/2 1/2] [1/2 0 1/2 1/2] @@ -8491,10 +8489,10 @@ def least_effective_resistance(self, nonedgesonly=True): edges = self.complement().edges(labels=False) else: edges = [(verts[i], verts[j]) for i in range(n) for j in range(i + 1, n)] - + rmin = min(S[(verttoidx[e[0]], verttoidx[e[1]])] for e in edges) return [e for e in edges if S[(verttoidx[e[0]], verttoidx[e[1]])] == rmin] - + @doc_index("Leftovers") def common_neighbors_matrix(self, vertices=None, nonedgesonly=True): r""" @@ -8562,9 +8560,9 @@ def common_neighbors_matrix(self, vertices=None, nonedgesonly=True): sage: G.common_neighbors_matrix() Traceback (most recent call last): ... - ValueError: This method is not known to work on graphs with loops. - Perhaps this method can be updated to handle them, but in the - meantime if you want to use it please disallow loops using + ValueError: This method is not known to work on graphs with loops. + Perhaps this method can be updated to handle them, but in the + meantime if you want to use it please disallow loops using allow_loops(). .. SEEALSO:: @@ -8608,7 +8606,7 @@ def most_common_neighbors(self, nonedgesonly=True): Return vertex pairs with maximal number of common neighbors. This method is only valid for simple (no loops, no multiple edges) - graphs with order `\geq 2` + graphs with order `\geq 2` INPUT: diff --git a/src/sage/graphs/graph_coloring.pyx b/src/sage/graphs/graph_coloring.pyx index f2200f5712c..7f82c457121 100644 --- a/src/sage/graphs/graph_coloring.pyx +++ b/src/sage/graphs/graph_coloring.pyx @@ -53,6 +53,7 @@ Methods # Distributed under the terms of the GNU General Public License (GPL) # https://www.gnu.org/licenses/ # **************************************************************************** + from copy import copy from sage.combinat.matrices.dlxcpp import DLXCPP from sage.plot.colors import rainbow @@ -1674,7 +1675,7 @@ cdef class Test: def random(self, tests=1000): r""" - Call ``self.random_all_graph_colorings()``. + Call ``self.random_all_graph_colorings()``. In the future, if other methods are added, it should call them, too. diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py index a0c9973abcf..283d9f5fc4a 100644 --- a/src/sage/graphs/graph_generators.py +++ b/src/sage/graphs/graph_generators.py @@ -16,8 +16,6 @@ build by typing ``graphs.`` in Sage and then hitting tab. """ from __future__ import print_function, absolute_import, division -from six.moves import range -from six import PY2 from sage.env import SAGE_NAUTY_BINS_PREFIX as nautyprefix import subprocess @@ -920,15 +918,11 @@ def nauty_geng(self, options="", debug=False): sage: list(graphs.nauty_geng("-c 3", debug=True)) ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices] """ - if PY2: - enc_kwargs = {} - else: - enc_kwargs = {'encoding': 'latin-1'} sp = subprocess.Popen(nautyprefix+"geng {0}".format(options), shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True, - **enc_kwargs) + encoding='latin-1') msg = sp.stderr.readline() if debug: yield msg @@ -1096,7 +1090,7 @@ def _read_planar_code(self, code_input): The following example creates a small planar code file in memory and reads it using the ``_read_planar_code`` method:: - sage: from six import StringIO + sage: from io import StringIO sage: code_input = StringIO('>>planar_code<<') sage: _ = code_input.write('>>planar_code<<') sage: for c in [4,2,3,4,0,1,4,3,0,1,2,4,0,1,3,2,0]: @@ -1262,18 +1256,12 @@ def fullerenes(self, order, ipr=False): command = 'buckygen -'+('I' if ipr else '')+'d {0}d'.format(order) - if PY2: - enc_kwargs = {} - else: - enc_kwargs = {'encoding': 'latin-1'} - sp = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True, - **enc_kwargs) + encoding='latin-1') - if not PY2: - sp.stdout.reconfigure(newline='') + sp.stdout.reconfigure(newline='') for G in graphs._read_planar_code(sp.stdout): yield(G) @@ -1355,18 +1343,12 @@ def fusenes(self, hexagon_count, benzenoids=False): command = 'benzene '+('b' if benzenoids else '')+' {0} p'.format(hexagon_count) - if PY2: - enc_kwargs = {} - else: - enc_kwargs = {'encoding': 'latin-1'} - sp = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True, - **enc_kwargs) + encoding='latin-1') - if not PY2: - sp.stdout.reconfigure(newline='') + sp.stdout.reconfigure(newline='') for G in graphs._read_planar_code(sp.stdout): yield(G) @@ -1553,18 +1535,12 @@ def planar_graphs(self, order, minimum_degree=None, 'd' if dual else '', order) - if PY2: - enc_kwargs = {} - else: - enc_kwargs = {'encoding': 'latin-1'} - sp = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True, - **enc_kwargs) + encoding='latin-1') - if not PY2: - sp.stdout.reconfigure(newline='') + sp.stdout.reconfigure(newline='') for G in graphs._read_planar_code(sp.stdout): yield(G) @@ -1744,18 +1720,12 @@ def triangulations(self, order, minimum_degree=None, minimum_connectivity=None, 'd' if dual else '', order) - if PY2: - enc_kwargs = {} - else: - enc_kwargs = {'encoding': 'latin-1'} - sp = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True, - **enc_kwargs) + encoding='latin-1') - if not PY2: - sp.stdout.reconfigure(newline='') + sp.stdout.reconfigure(newline='') for G in graphs._read_planar_code(sp.stdout): yield(G) @@ -1894,18 +1864,12 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None 'd' if dual else '', order) - if PY2: - enc_kwargs = {} - else: - enc_kwargs = {'encoding': 'latin-1'} - sp = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True, - **enc_kwargs) + encoding='latin-1') - if not PY2: - sp.stdout.reconfigure(newline='') + sp.stdout.reconfigure(newline='') for G in graphs._read_planar_code(sp.stdout): yield(G) diff --git a/src/sage/graphs/graph_input.py b/src/sage/graphs/graph_input.py index 972742d6195..f8f126c9d1e 100644 --- a/src/sage/graphs/graph_input.py +++ b/src/sage/graphs/graph_input.py @@ -19,8 +19,6 @@ """ from __future__ import absolute_import, division -from six import iteritems -from six.moves import range from sage.cpython.string import bytes_to_str @@ -459,9 +457,9 @@ def from_dict_of_dicts(G, M, loops=False, multiedges=False, weighted=False, conv raise ValueError("input dict must be a consistent format") if not loops: - if any(u in neighb for u,neighb in iteritems(M)): + if any(u in neighb for u,neighb in M.items()): if loops is False: - u = next(u for u,neighb in iteritems(M) if u in neighb) + u = next(u for u,neighb in M.items() if u in neighb) raise ValueError("the graph was built with loops=False but input M has a loop at {}".format(u)) loops = True if loops is None: @@ -526,9 +524,9 @@ def from_dict_of_lists(G, D, loops=False, multiedges=False, weighted=False): """ verts = set().union(D.keys(), *D.values()) if not loops: - if any(u in neighb for u, neighb in iteritems(D)): + if any(u in neighb for u, neighb in D.items()): if loops is False: - u = next(u for u, neighb in iteritems(D) if u in neighb) + u = next(u for u, neighb in D.items() if u in neighb) raise ValueError("the graph was built with loops=False but input D has a loop at {}".format(u)) loops = True if loops is None: diff --git a/src/sage/graphs/graph_plot.py b/src/sage/graphs/graph_plot.py index 8bb7708370f..4f65bedaef1 100644 --- a/src/sage/graphs/graph_plot.py +++ b/src/sage/graphs/graph_plot.py @@ -11,7 +11,7 @@ sage: P.show() # long time .. PLOT:: - + sphinx_plot(graphs.WheelGraph(15)) If you create a graph in Sage using the ``Graph`` command, then plot that graph, @@ -24,7 +24,7 @@ sage: petersen_spring.show() # long time .. PLOT:: - + petersen_spring = Graph(':I`ES@obGkqegW~') sphinx_plot(petersen_spring) @@ -34,7 +34,7 @@ sage: petersen_database.show() # long time .. PLOT:: - + petersen_database = graphs.PetersenGraph() sphinx_plot(petersen_database) @@ -157,10 +157,9 @@ 'graph_border': 'Whether or not to draw a frame around the graph.', 'edge_labels_background' : 'The color of the background of the edge labels'}) -from six import iteritems _PLOT_OPTIONS_TABLE = "" -for key, value in iteritems(graphplot_options): +for key, value in graphplot_options.items(): _PLOT_OPTIONS_TABLE += " ``"+str(key)+"`` | "+str(value)+"\n" __doc__ = __doc__.format(PLOT_OPTIONS_TABLE=_PLOT_OPTIONS_TABLE) @@ -183,7 +182,6 @@ from sage.structure.sage_object import SageObject from sage.plot.all import Graphics, scatter_plot, bezier_path, line, arrow, text, circle from math import sqrt, cos, sin, atan, pi -from six import text_type as str DEFAULT_SHOW_OPTIONS = { "figsize" : [4,4] @@ -248,7 +246,7 @@ def __init__(self, graph, options): """ # Setting the default values if needed - for k, value in iteritems(DEFAULT_PLOT_OPTIONS): + for k, value in DEFAULT_PLOT_OPTIONS.items(): if k not in options: options[k] = value self._plot_components = {} @@ -307,7 +305,7 @@ def set_pos(self): Graphics object consisting of 14 graphics primitives .. PLOT:: - + g = Graph({0:[1,2], 2:[3], 4:[0,1]}) g.graphplot(save_pos=True, layout='circular') # indirect doctest T = list(graphs.trees(7)) @@ -339,7 +337,7 @@ def set_pos(self): self._pos = self._graph.layout(**self._options) # make sure the positions are floats (trac #10124) self._pos = {k: (float(v[0]), float(v[1])) - for k, v in iteritems(self._pos)} + for k, v in self._pos.items()} def set_vertices(self, **vertex_options): """ @@ -368,7 +366,7 @@ def set_vertices(self, **vertex_options): g = Graph({}, loops=True, multiedges=True, sparse=True) g.add_edges([(0,0,'a'),(0,0,'b'),(0,1,'c'),(0,1,'d'),(0,1,'e'),(0,1,'f'), (0,1,'f'),(2,1,'g'),(2,2,'h')]) - GP = g.graphplot(vertex_size=100, edge_labels=True, color_by_label=True, + GP = g.graphplot(vertex_size=100, edge_labels=True, color_by_label=True, edge_style='dashed') GP.set_vertices(talk=True) sphinx_plot(GP) @@ -887,7 +885,7 @@ def show(self, **kwds): """ # Setting the default values if needed - for k, value in iteritems(DEFAULT_SHOW_OPTIONS): + for k, value in DEFAULT_SHOW_OPTIONS.items(): if k not in kwds: kwds[k] = value @@ -939,12 +937,12 @@ def plot(self, **kwds): x = float(cos(pi/2 + ((2*pi)/5)*i)) y = float(sin(pi/2 + ((2*pi)/5)*i)) pos_dict[i] = [x,y] - + for i in range(5,10): x = float(0.5*cos(pi/2 + ((2*pi)/5)*i)) y = float(0.5*sin(pi/2 + ((2*pi)/5)*i)) pos_dict[i] = [x,y] - + pl = P.graphplot(pos=pos_dict, vertex_colors=d) sphinx_plot(pl) diff --git a/src/sage/graphs/isgci.py b/src/sage/graphs/isgci.py index 6db80b2bd39..ce6211aa104 100644 --- a/src/sage/graphs/isgci.py +++ b/src/sage/graphs/isgci.py @@ -397,7 +397,10 @@ class is defined by the exclusion of subgraphs, one can write a generic from sage.structure.unique_representation import CachedRepresentation, UniqueRepresentation from sage.misc.unknown import Unknown from sage.env import GRAPHS_DATA_DIR -import six + +import os +import zipfile +from urllib.request import urlopen #***************************************************************************** # Copyright (C) 2011 Nathann Cohen @@ -824,16 +827,11 @@ def _download_db(self): sage: graph_classes._download_db() # Not tested -- requires internet """ - # import compatible with py2 and py3 - from six.moves.urllib.request import urlopen - from sage.misc.misc import SAGE_TMP - import os.path u = urlopen('http://www.graphclasses.org/data.zip') localFile = open(os.path.join(SAGE_TMP, 'isgci.zip'), 'w') localFile.write(u.read()) localFile.close() - import os, zipfile z = zipfile.ZipFile(os.path.join(SAGE_TMP, 'isgci.zip')) # Save a systemwide updated copy whenever possible @@ -1003,7 +1001,7 @@ def sort_key(x): MAX[key] = len(max((str(x.get(key, "")) for x in classes_list), key=len)) # At most MAX characters per field - for key, length in six.iteritems(MAX): + for key, length in MAX.items(): MAX[key] = min(length, MAX_LEN) # Head of the table diff --git a/src/sage/graphs/line_graph.pyx b/src/sage/graphs/line_graph.pyx index 714e2531272..77e1b252be3 100644 --- a/src/sage/graphs/line_graph.pyx +++ b/src/sage/graphs/line_graph.pyx @@ -127,6 +127,7 @@ Functions --------- """ + def is_line_graph(g, certificate=False): r""" Tests wether the graph is a line graph. diff --git a/src/sage/graphs/tutte_polynomial.py b/src/sage/graphs/tutte_polynomial.py index 27860001cd9..377d6b253b8 100644 --- a/src/sage/graphs/tutte_polynomial.py +++ b/src/sage/graphs/tutte_polynomial.py @@ -31,6 +31,7 @@ Functions --------- """ + from contextlib import contextmanager from sage.misc.lazy_attribute import lazy_attribute from sage.misc.misc_c import prod diff --git a/src/sage/groups/abelian_gps/abelian_group.py b/src/sage/groups/abelian_gps/abelian_group.py index e8671002697..e89982d0596 100644 --- a/src/sage/groups/abelian_gps/abelian_group.py +++ b/src/sage/groups/abelian_gps/abelian_group.py @@ -203,8 +203,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range -import six from sage.rings.integer import Integer from sage.rings.integer_ring import ZZ @@ -540,7 +538,7 @@ def __init__(self, generator_orders, names): sage: A.category() Category of infinite commutative groups """ - assert isinstance(names, (six.string_types, tuple)) + assert isinstance(names, (str, tuple)) assert isinstance(generator_orders, tuple) assert all(isinstance(order,Integer) for order in generator_orders) self._gens_orders = generator_orders @@ -1147,7 +1145,7 @@ def permutation_group(self): TypeError: Abelian group must be finite """ # GAP does not support infinite permutation groups - if not self.is_finite(): + if not self.is_finite(): raise TypeError('Abelian group must be finite') from sage.groups.perm_gps.permgroup import PermutationGroup s = 'Image(IsomorphismPermGroup(%s))'%self._gap_init_() diff --git a/src/sage/groups/additive_abelian/additive_abelian_group.py b/src/sage/groups/additive_abelian/additive_abelian_group.py index 498ec739a32..3dcedeb7e36 100644 --- a/src/sage/groups/additive_abelian/additive_abelian_group.py +++ b/src/sage/groups/additive_abelian/additive_abelian_group.py @@ -136,7 +136,6 @@ def cover_and_relations_from_invariants(invs): [0 2 0] [0 0 3]) """ - from six.moves import range n = len(invs) A = ZZ**n B = A.span([A.gen(i) * invs[i] for i in range(n)]) @@ -166,7 +165,6 @@ def _hermite_lift(self): sage: v._hermite_lift() (1, 0) """ - from six.moves import range y = self.lift() H = self.parent().W().basis_matrix() pivot_rows = H.pivot_rows() @@ -466,7 +464,7 @@ def permutation_group(self): TypeError: Additive Abelian group must be finite """ # GAP does not support infinite permutation groups - if not self.is_finite(): + if not self.is_finite(): raise TypeError('Additive Abelian group must be finite') from sage.groups.perm_gps.permgroup import PermutationGroup s = 'Image(IsomorphismPermGroup(AbelianGroup(%s)))'%(list(self.invariants()),) diff --git a/src/sage/groups/additive_abelian/additive_abelian_wrapper.py b/src/sage/groups/additive_abelian/additive_abelian_wrapper.py index 1112deb130e..95729a7ef80 100644 --- a/src/sage/groups/additive_abelian/additive_abelian_wrapper.py +++ b/src/sage/groups/additive_abelian/additive_abelian_wrapper.py @@ -223,7 +223,6 @@ def _discrete_exp(self, v): sage: v.parent() is QQbar True """ - from six.moves import range v = self.V()(v) verbose("Calling discrete exp on %s" % v) # DUMB IMPLEMENTATION! diff --git a/src/sage/groups/artin.py b/src/sage/groups/artin.py index f7d1ff086af..68465b38213 100644 --- a/src/sage/groups/artin.py +++ b/src/sage/groups/artin.py @@ -22,7 +22,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import division, absolute_import, print_function -import six from sage.misc.cachefunc import cached_method from sage.groups.free_group import FreeGroup @@ -403,7 +402,7 @@ def __classcall_private__(cls, coxeter_data, names=None): coxeter_data = CoxeterMatrix(coxeter_data) if names is None: names = 's' - if isinstance(names, six.string_types): + if isinstance(names, str): if ',' in names: names = [x.strip() for x in names.split(',')] else: diff --git a/src/sage/groups/braid.py b/src/sage/groups/braid.py index c7a87c68cd4..5e020504800 100644 --- a/src/sage/groups/braid.py +++ b/src/sage/groups/braid.py @@ -65,7 +65,6 @@ # https://www.gnu.org/licenses/ ############################################################################## -import six from sage.rings.integer import Integer from sage.rings.integer_ring import IntegerRing from sage.misc.lazy_attribute import lazy_attribute @@ -2246,7 +2245,7 @@ def BraidGroup(n=None, names='s'): n = None # derive n from counting names if n is None: - if isinstance(names, six.string_types): + if isinstance(names, str): n = len(names.split(',')) else: names = list(names) diff --git a/src/sage/groups/free_group.py b/src/sage/groups/free_group.py index a056ad4c455..d046f201b9a 100644 --- a/src/sage/groups/free_group.py +++ b/src/sage/groups/free_group.py @@ -60,7 +60,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -import six from sage.categories.groups import Groups from sage.groups.group import Group from sage.groups.libgap_wrapper import ParentLibGAP, ElementLibGAP @@ -669,7 +668,7 @@ def FreeGroup(n=None, names='x', index_set=None, abelian=False, **kwds): n = None # derive n from counting names if n is None: - if isinstance(names, six.string_types): + if isinstance(names, str): n = len(names.split(',')) else: names = list(names) diff --git a/src/sage/groups/generic.py b/src/sage/groups/generic.py index feb3c7b935a..45c4d0222f1 100644 --- a/src/sage/groups/generic.py +++ b/src/sage/groups/generic.py @@ -589,7 +589,6 @@ def discrete_log_rho(a, base, ord=None, operation='*', hash_function=hash): - Yann Laigle-Chapuy (2009-09-05) """ - from six.moves import range from sage.rings.integer import Integer from sage.rings.finite_rings.integer_mod_ring import IntegerModRing from operator import mul, add, pow @@ -892,7 +891,6 @@ def discrete_log_lambda(a, base, bounds, operation='*', hash_function=hash): -- Yann Laigle-Chapuy (2009-01-25) """ - from six.moves import range from sage.rings.integer import Integer from operator import mul, add, pow diff --git a/src/sage/groups/indexed_free_group.py b/src/sage/groups/indexed_free_group.py index c15c2e104fc..91982ce4457 100644 --- a/src/sage/groups/indexed_free_group.py +++ b/src/sage/groups/indexed_free_group.py @@ -18,7 +18,6 @@ # # https://www.gnu.org/licenses/ ############################################################################## -from six import integer_types from sage.categories.groups import Groups from sage.categories.poor_man_map import PoorManMap @@ -30,7 +29,7 @@ from sage.rings.integer import Integer from sage.rings.infinity import infinity from sage.sets.family import Family -from six import iteritems + class IndexedGroup(IndexedMonoid): """ @@ -371,7 +370,7 @@ def _element_constructor_(self, x=None): d[k] = v x = d if isinstance(x, dict): - x = {k: v for k, v in iteritems(x) if v != 0} + x = {k: v for k, v in x.items() if v != 0} return IndexedGroup._element_constructor_(self, x) @cached_method @@ -478,11 +477,11 @@ def __pow__(self, n): sage: x^-3 F[0]^-3*F[1]^-6*F[3]^-3*F[4]^3 """ - if not isinstance(n, integer_types + (Integer,)): + if not isinstance(n, (int, Integer)): raise TypeError("Argument n (= {}) must be an integer".format(n)) if n == 1: return self if n == 0: return self.parent().one() - return self.__class__(self.parent(), {k:v*n for k,v in iteritems(self._monomial)}) + return self.__class__(self.parent(), {k:v*n for k,v in self._monomial.items()}) diff --git a/src/sage/groups/matrix_gps/coxeter_group.py b/src/sage/groups/matrix_gps/coxeter_group.py index ddb102db427..ec8db50992e 100644 --- a/src/sage/groups/matrix_gps/coxeter_group.py +++ b/src/sage/groups/matrix_gps/coxeter_group.py @@ -18,7 +18,6 @@ # # http://www.gnu.org/licenses/ ############################################################################## -from six.moves import range from sage.structure.unique_representation import UniqueRepresentation from sage.categories.coxeter_groups import CoxeterGroups diff --git a/src/sage/groups/perm_gps/cubegroup.py b/src/sage/groups/perm_gps/cubegroup.py index 78602206c24..72c2c484c4d 100644 --- a/src/sage/groups/perm_gps/cubegroup.py +++ b/src/sage/groups/perm_gps/cubegroup.py @@ -92,7 +92,6 @@ # https://www.gnu.org/licenses/ # ***************************************************************************** from __future__ import print_function -from six.moves import range from sage.groups.perm_gps.permgroup import PermutationGroup_generic import random diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py index bc77f05afdf..334d90ac328 100644 --- a/src/sage/groups/perm_gps/permgroup.py +++ b/src/sage/groups/perm_gps/permgroup.py @@ -136,8 +136,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import range -from six import integer_types from functools import wraps @@ -450,7 +448,7 @@ def __init__(self, gens=None, gap_group=None, canonicalize=True, #Here we need to check if all of the points are integers #to make the domain contain all integers up to the max. #This is needed for backward compatibility - if all(isinstance(p, (Integer,) + integer_types) for p in domain): + if all(isinstance(p, (int, Integer)) for p in domain): domain = list(range(min([1] + domain), max([1] + domain)+1)) if domain not in FiniteEnumeratedSets(): @@ -787,7 +785,7 @@ def _element_constructor_(self, x, check=True): ....: if elt in G2: ....: assert G1(G2(elt)) == elt """ - if isinstance(x, integer_types + (Integer,)) and x == 1: + if isinstance(x, (int, Integer)) and x == 1: return self.identity() if isinstance(x, PermutationGroupElement): diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py index aa8a6a1502b..d72de7fc060 100644 --- a/src/sage/groups/perm_gps/permgroup_named.py +++ b/src/sage/groups/perm_gps/permgroup_named.py @@ -86,7 +86,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range import os diff --git a/src/sage/groups/perm_gps/symgp_conjugacy_class.py b/src/sage/groups/perm_gps/symgp_conjugacy_class.py index 8ff2e4bacec..918e80ab905 100644 --- a/src/sage/groups/perm_gps/symgp_conjugacy_class.py +++ b/src/sage/groups/perm_gps/symgp_conjugacy_class.py @@ -6,7 +6,6 @@ - Vincent Delecroix, Travis Scrimshaw (2014-11-23) """ from __future__ import print_function -from six.moves import range from sage.groups.conjugacy_classes import ConjugacyClass, ConjugacyClassGAP from sage.groups.perm_gps.permgroup_element import PermutationGroupElement @@ -295,7 +294,7 @@ def conjugacy_class_iterator(part, S=None): r""" Return an iterator over the conjugacy class associated to the partition ``part``. - + The elements are given as a list of tuples, each tuple being a cycle. INPUT: diff --git a/src/sage/groups/raag.py b/src/sage/groups/raag.py index 2ace1206e38..4cfe5bee2f4 100644 --- a/src/sage/groups/raag.py +++ b/src/sage/groups/raag.py @@ -24,7 +24,6 @@ #***************************************************************************** from __future__ import division, absolute_import, print_function -import six from sage.libs.gap.element import GapElement @@ -161,7 +160,7 @@ def __classcall_private__(cls, G, names=None): raise ValueError("the graph must not be empty") if names is None: names = 'v' - if isinstance(names, six.string_types): + if isinstance(names, str): if ',' in names: names = [x.strip() for x in names.split(',')] else: diff --git a/src/sage/homology/algebraic_topological_model.py b/src/sage/homology/algebraic_topological_model.py index 97452fabc12..d635daaa82e 100644 --- a/src/sage/homology/algebraic_topological_model.py +++ b/src/sage/homology/algebraic_topological_model.py @@ -23,7 +23,6 @@ # # http://www.gnu.org/licenses/ ######################################################################## -from six import iteritems # TODO: cythonize this. @@ -221,7 +220,7 @@ def algebraic_topological_model(K, base_ring=None): c_bar = c_vec bdry_c = diff * c_vec # Apply phi to bdry_c and subtract from c_bar. - for (idx, coord) in iteritems(bdry_c): + for (idx, coord) in bdry_c.items(): try: c_bar -= coord * phi_dict[dim-1][idx] except KeyError: @@ -232,7 +231,7 @@ def algebraic_topological_model(K, base_ring=None): # Evaluate pi(bdry(c_bar)). pi_bdry_c_bar = zero - for (idx, coeff) in iteritems(bdry_c_bar): + for (idx, coeff) in bdry_c_bar.items(): try: pi_bdry_c_bar += coeff * pi_dict[dim-1][idx] except KeyError: @@ -312,7 +311,7 @@ def algebraic_topological_model(K, base_ring=None): # First pi: if idx in pi_dict[n]: column = vector(base_ring, M_rows) - for (entry, coeff) in iteritems(pi_dict[n][idx]): + for (entry, coeff) in pi_dict[n][idx].items(): # Translate from cells in n_cells to cells in gens[n]. column[gens[n].index(n_cells[entry])] = coeff else: @@ -524,7 +523,7 @@ def conditionally_sparse(m): # Take any u in gens so that lambda_i = != 0. # u_idx will be the index of the corresponding cell. (u_idx, lambda_i) = pi_bdry_c_bar.leading_item() - for (u_idx, lambda_i) in iteritems(pi_bdry_c_bar): + for (u_idx, lambda_i) in pi_bdry_c_bar.items(): if u_idx not in to_be_deleted: break # This element/column needs to be deleted from gens and diff --git a/src/sage/homology/cell_complex.py b/src/sage/homology/cell_complex.py index bd582b87498..7c00e37435b 100644 --- a/src/sage/homology/cell_complex.py +++ b/src/sage/homology/cell_complex.py @@ -44,7 +44,6 @@ # http://www.gnu.org/licenses/ ######################################################################## from __future__ import absolute_import -from six.moves import range from sage.structure.sage_object import SageObject from sage.rings.integer_ring import ZZ diff --git a/src/sage/homology/chain_complex.py b/src/sage/homology/chain_complex.py index 51c379fe6f0..efc2ee6d809 100644 --- a/src/sage/homology/chain_complex.py +++ b/src/sage/homology/chain_complex.py @@ -47,7 +47,6 @@ # # http://www.gnu.org/licenses/ ######################################################################## -from six import iteritems from copy import copy @@ -394,7 +393,7 @@ def _repr_(self): return 'Trivial chain' if n == 1: - deg, vec = next(iteritems(self._vec)) + deg, vec = next(iter(self._vec.items())) return 'Chain({0}:{1})'.format(deg, vec) return 'Chain with {0} nonzero terms over {1}'.format( @@ -510,7 +509,7 @@ def is_cycle(self): True """ chain_complex = self.parent() - for d, v in iteritems(self._vec): + for d, v in self._vec.items(): dv = chain_complex.differential(d) * v if not dv.is_zero(): return False @@ -540,7 +539,7 @@ def is_boundary(self): True """ chain_complex = self.parent() - for d, v in iteritems(self._vec): + for d, v in self._vec.items(): d = chain_complex.differential(d - chain_complex.degree_of_differential()).transpose() if v not in d.image(): return False @@ -584,7 +583,7 @@ def _lmul_(self, scalar): True """ vectors = dict() - for d, v in iteritems(self._vec): + for d, v in self._vec.items(): v = scalar * v if not v.is_zero(): v.set_immutable() @@ -673,10 +672,10 @@ def __init__(self, grading_group, degree_of_differential, base_ring, differentia raise ValueError('grading_group must be either ZZ or multiplicative') # all differentials (excluding the 0x0 ones) must be specified to the constructor if any(dim+degree_of_differential not in differentials and d.nrows() != 0 - for dim, d in iteritems(differentials)): + for dim, d in differentials.items()): raise ValueError('invalid differentials') if any(dim-degree_of_differential not in differentials and d.ncols() != 0 - for dim, d in iteritems(differentials)): + for dim, d in differentials.items()): raise ValueError('invalid differentials') self._grading_group = grading_group self._degree_of_differential = degree_of_differential @@ -708,7 +707,7 @@ def _element_constructor_(self, vectors, check=True): if isinstance(vectors, Chain_class): vectors = vectors._vec data = dict() - for degree, vec in iteritems(vectors): + for degree, vec in vectors.items(): if not is_Vector(vec): vec = vector(self.base_ring(), vec) vec.set_immutable() @@ -823,7 +822,7 @@ def nonzero_degrees(self): sage: D.nonzero_degrees() (0, 1, 2, 3, 6, 7) """ - return tuple(sorted(n for n, d in iteritems(self._diff) + return tuple(sorted(n for n, d in self._diff.items() if d.ncols())) @cached_method @@ -1083,13 +1082,13 @@ def __eq__(self, other): return False R = self.base_ring() equal = True - for d, mat in iteritems(self.differential()): + for d, mat in self.differential().items(): if d not in other.differential(): equal = equal and mat.ncols() == 0 and mat.nrows() == 0 else: equal = (equal and other.differential()[d].change_ring(R) == mat.change_ring(R)) - for d, mat in iteritems(other.differential()): + for d, mat in other.differential().items(): if d not in self.differential(): equal = equal and mat.ncols() == 0 and mat.nrows() == 0 return equal @@ -1467,7 +1466,7 @@ def betti(self, deg=None, base_ring=None): H = self.homology(deg, base_ring=base_ring) if isinstance(H, dict): return {deg: homology_group.dimension() - for deg, homology_group in iteritems(H)} + for deg, homology_group in H.items()} else: return H.dimension() diff --git a/src/sage/homology/cubical_complex.py b/src/sage/homology/cubical_complex.py index 6c8e0aa1e0e..6871c9a086a 100644 --- a/src/sage/homology/cubical_complex.py +++ b/src/sage/homology/cubical_complex.py @@ -66,7 +66,6 @@ page instead. """ from __future__ import print_function, absolute_import -from six.moves import zip from copy import copy from sage.homology.cell_complex import GenericCellComplex diff --git a/src/sage/homology/delta_complex.py b/src/sage/homology/delta_complex.py index c0ad86af2c1..3889450c9ec 100644 --- a/src/sage/homology/delta_complex.py +++ b/src/sage/homology/delta_complex.py @@ -49,8 +49,6 @@ page instead. """ from __future__ import absolute_import -from six.moves import range -from six import integer_types from copy import copy from sage.homology.cell_complex import GenericCellComplex @@ -297,7 +295,7 @@ def store_bdry(simplex, faces): new_data[dim] = s dim += 1 elif isinstance(data, dict): - if all(isinstance(a, (Integer,) + integer_types) for a in data): + if all(isinstance(a, (int, Integer)) for a in data): # a dictionary indexed by integers new_data = data if -1 not in new_data: diff --git a/src/sage/homology/examples.py b/src/sage/homology/examples.py index 4242b7b05a5..fb466af33dc 100644 --- a/src/sage/homology/examples.py +++ b/src/sage/homology/examples.py @@ -62,7 +62,6 @@ sage: simplicial_complexes.MatchingComplex(6).homology() {0: 0, 1: Z^16, 2: 0} """ -from six import iteritems from sage.homology.simplicial_complex import SimplicialComplex from sage.structure.unique_representation import UniqueRepresentation @@ -1409,7 +1408,7 @@ def RandomTwoSphere(n): graph = RandomTriangulation(n) graph = graph.relabel(inplace=False) - triangles = [(u, v, w) for u, L in iteritems(graph._embedding) + triangles = [(u, v, w) for u, L in graph._embedding.items() for v, w in zip(L, L[1:] + [L[0]]) if u < v and u < w] return SimplicialComplex(triangles, maximality_check=False) diff --git a/src/sage/homology/homology_group.py b/src/sage/homology/homology_group.py index 2b6ac8036fc..adfac7717a0 100644 --- a/src/sage/homology/homology_group.py +++ b/src/sage/homology/homology_group.py @@ -16,7 +16,6 @@ # # http://www.gnu.org/licenses/ ######################################################################## -from six.moves import range from sage.modules.free_module import VectorSpace from sage.groups.additive_abelian.additive_abelian_group import AdditiveAbelianGroup_fixed_gens @@ -142,7 +141,7 @@ def HomologyGroup(n, base_ring, invfac=None): fixed degree. INPUT: - + - ``n`` -- integer; the number of generators - ``base_ring`` -- ring; the base ring over which the homology is computed diff --git a/src/sage/homology/koszul_complex.py b/src/sage/homology/koszul_complex.py index a52b1251ff0..83cbe9dd243 100644 --- a/src/sage/homology/koszul_complex.py +++ b/src/sage/homology/koszul_complex.py @@ -11,7 +11,6 @@ # # http://www.gnu.org/licenses/ ######################################################################## -from six.moves import range from sage.structure.unique_representation import UniqueRepresentation from sage.structure.parent import Parent diff --git a/src/sage/homology/matrix_utils.py b/src/sage/homology/matrix_utils.py index 222634e64c8..341cefb55eb 100644 --- a/src/sage/homology/matrix_utils.py +++ b/src/sage/homology/matrix_utils.py @@ -16,7 +16,6 @@ # http://www.gnu.org/licenses/ ######################################################################## from __future__ import print_function -from six.moves import range # TODO: this module is a clear candidate for cythonizing. Need to # evaluate speed benefits. diff --git a/src/sage/homology/simplicial_complex.py b/src/sage/homology/simplicial_complex.py index bd29635767a..322db093bdc 100644 --- a/src/sage/homology/simplicial_complex.py +++ b/src/sage/homology/simplicial_complex.py @@ -149,8 +149,6 @@ True """ from __future__ import print_function, absolute_import -from six.moves import range -from six import integer_types from operator import index as PyNumber_Index # possible future directions for SimplicialComplex: @@ -4286,7 +4284,7 @@ def _is_numeric(self): sage: s._is_numeric() False """ - return all(isinstance(v, integer_types + (Integer,)) + return all(isinstance(v, (int, Integer)) for v in self.vertices()) # @cached_method when we switch to immutable SimplicialComplex diff --git a/src/sage/homology/simplicial_set.py b/src/sage/homology/simplicial_set.py index 69654587aa1..fc94b055cba 100644 --- a/src/sage/homology/simplicial_set.py +++ b/src/sage/homology/simplicial_set.py @@ -251,7 +251,6 @@ # http://www.gnu.org/licenses/ # #***************************************************************************** -from six.moves import range import copy diff --git a/src/sage/homology/simplicial_set_morphism.py b/src/sage/homology/simplicial_set_morphism.py index a851222294e..bbac4531136 100644 --- a/src/sage/homology/simplicial_set_morphism.py +++ b/src/sage/homology/simplicial_set_morphism.py @@ -29,7 +29,6 @@ # http://www.gnu.org/licenses/ # #***************************************************************************** -from six.moves import range import itertools diff --git a/src/sage/interacts/debugger.py b/src/sage/interacts/debugger.py index dd9bd706918..e8aa9f6788c 100644 --- a/src/sage/interacts/debugger.py +++ b/src/sage/interacts/debugger.py @@ -9,7 +9,6 @@ - William Stein (2012) """ from __future__ import print_function -from six.moves import range from sage.misc.superseded import deprecation deprecation(27531, "sage.interacts.debugger is deprecated because it is meant for the deprecated Sage Notebook") diff --git a/src/sage/interfaces/ecm.py b/src/sage/interfaces/ecm.py index 220a9449aae..ee5236f2a2d 100644 --- a/src/sage/interfaces/ecm.py +++ b/src/sage/interfaces/ecm.py @@ -50,10 +50,8 @@ ############################################################################### from __future__ import print_function -from six import iteritems, PY2 - -import subprocess import re +import subprocess from sage.structure.sage_object import SageObject from sage.rings.integer_ring import ZZ @@ -187,7 +185,7 @@ def __init__(self, B1=10, B2=None, **kwds): def _make_cmd(self, B1, B2, kwds): ecm = ['ecm'] options = [] - for x, v in iteritems(kwds): + for x, v in kwds.items(): if v is False: continue options.append('-{0}'.format(x)) @@ -221,16 +219,11 @@ def _run_ecm(self, cmd, n): """ from subprocess import Popen, PIPE - if PY2: - enc_kwds = {} - else: - # Under normal usage this program only returns ASCII; anything - # else mixed is garbage and an error - # So just accept latin-1 without encoding errors, and let the - # output parser deal with the rest - enc_kwds = {'encoding': 'latin-1'} - - p = Popen(cmd, stdout=PIPE, stdin=PIPE, stderr=PIPE, **enc_kwds) + # Under normal usage this program only returns ASCII; anything + # else mixed is garbage and an error + # So just accept latin-1 without encoding errors, and let the + # output parser deal with the rest + p = Popen(cmd, stdout=PIPE, stdin=PIPE, stderr=PIPE, encoding='latin-1') out, err = p.communicate(input=str(n)) if err != '': raise ValueError(err) diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py index 571c6c2807e..cce13898753 100644 --- a/src/sage/interfaces/expect.py +++ b/src/sage/interfaces/expect.py @@ -39,8 +39,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six import string_types -from six import reraise as raise_ import io import os @@ -171,7 +169,7 @@ def __init__(self, name, prompt, command=None, env={}, server=None, self.__init_code = init_code #Handle the log file - if isinstance(logfile, string_types): + if isinstance(logfile, str): self.__logfile = None self.__logfilename = logfile else: @@ -976,11 +974,11 @@ def _eval_line(self, line, allow_use_file=True, wait_for_prompt=True, restart_if except (TypeError, RuntimeError): pass return self._eval_line(line,allow_use_file=allow_use_file, wait_for_prompt=wait_for_prompt, restart_if_needed=False) - raise_(RuntimeError, RuntimeError("%s\nError evaluating %s in %s" % (msg, line, self)), sys.exc_info()[2]) + raise RuntimeError("%s\nError evaluating %s in %s" % (msg, line, self)) if line: try: - if isinstance(wait_for_prompt, string_types): + if isinstance(wait_for_prompt, str): E.expect(str_to_bytes(wait_for_prompt)) else: E.expect(self._prompt) @@ -1369,7 +1367,7 @@ def eval(self, code, strip=True, synchronize=False, locals=None, allow_use_file= except AttributeError: pass - if not isinstance(code, string_types): + if not isinstance(code, str): raise TypeError('input code must be a string.') #Remove extra whitespace @@ -1460,7 +1458,7 @@ def __init__(self, parent, value, is_name=False, name=None): # idea: Joe Wetherell -- try to find out if the output # is too long and if so get it using file, otherwise # don't. - if isinstance(value, string_types) and parent._eval_using_file_cutoff and \ + if isinstance(value, str) and parent._eval_using_file_cutoff and \ parent._eval_using_file_cutoff < len(value): self._get_using_file = True @@ -1473,7 +1471,7 @@ def __init__(self, parent, value, is_name=False, name=None): # coercion to work properly. except (RuntimeError, ValueError) as x: self._session_number = -1 - raise_(TypeError, TypeError(*x.args), sys.exc_info()[2]) + raise TypeError(*x.args) except BaseException: self._session_number = -1 raise diff --git a/src/sage/interfaces/four_ti_2.py b/src/sage/interfaces/four_ti_2.py index a336d54b197..067535f2d40 100644 --- a/src/sage/interfaces/four_ti_2.py +++ b/src/sage/interfaces/four_ti_2.py @@ -34,7 +34,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six import iteritems from sage.rings.integer_ring import ZZ import os @@ -254,7 +253,7 @@ def _process_input(self, kwds): if project is None: project = self.temp_project() - for ext, value in iteritems(kwds): + for ext, value in kwds.items(): if value is None: continue if ext == "project" or ext == "self": diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py index 2b1cb8aef46..5f24b102da6 100644 --- a/src/sage/interfaces/gap.py +++ b/src/sage/interfaces/gap.py @@ -176,8 +176,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import, print_function -import six -from six import string_types from .expect import Expect, ExpectElement, FunctionElement, ExpectFunction from .gap_workspace import gap_workspace_file, prepare_workspace_dir @@ -624,10 +622,7 @@ def _execute_line(self, line, wait_for_prompt=True, expect_eof=False): current_outputs.append(b'@') elif x == 2: #special char c = ord(E.after[1:2]) - ord(b'A') + 1 - if six.PY2: - s = chr(c) - else: - s = bytes([c]) + s = bytes([c]) current_outputs.append(s) elif x == 3: # garbage collection info, ignore pass @@ -769,7 +764,7 @@ def _eval_line(self, line, allow_use_file=True, wait_for_prompt=True, restart_if if not len(normal): return '' - if isinstance(wait_for_prompt, string_types) and normal.ends_with(wait_for_prompt): + if isinstance(wait_for_prompt, str) and normal.ends_with(wait_for_prompt): n = len(wait_for_prompt) elif normal.endswith(bytes_to_str(self._prompt)): n = len(self._prompt) diff --git a/src/sage/interfaces/gfan.py b/src/sage/interfaces/gfan.py index 226f2cad576..3b4c8b33f29 100644 --- a/src/sage/interfaces/gfan.py +++ b/src/sage/interfaces/gfan.py @@ -41,8 +41,6 @@ #***************************************************************************** from __future__ import print_function -import six - from subprocess import Popen, PIPE @@ -63,13 +61,8 @@ def __call__(self, I, cmd='', verbose=False, format=True): print("gfan command:\n%s" % cmd) print("gfan input:\n%s" % I) - if six.PY2: - enc_kwargs = {} - else: - enc_kwargs = {'encoding': 'latin-1'} - gfan_processes = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, - **enc_kwargs) + encoding='latin-1') ans, err = gfan_processes.communicate(input=I) # sometimes, gfan outputs stuff to stderr even though everything is fine diff --git a/src/sage/interfaces/interface.py b/src/sage/interfaces/interface.py index 1ab71831b94..616c13d94cf 100644 --- a/src/sage/interfaces/interface.py +++ b/src/sage/interfaces/interface.py @@ -38,7 +38,6 @@ # https://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six import iteritems, integer_types, string_types import operator @@ -293,7 +292,7 @@ def __call__(self, x, name=None): except (NotImplementedError, TypeError): pass - if isinstance(x, string_types): + if isinstance(x, str): return cls(self, x, name=name) try: # Special methods do not and should not have an option to @@ -336,7 +335,7 @@ def _coerce_from_special_method(self, x): def _coerce_impl(self, x, use_special=True): if isinstance(x, bool): return self(self._true_symbol() if x else self._false_symbol()) - elif isinstance(x, integer_types): + elif isinstance(x, int): import sage.rings.all return self(sage.rings.all.Integer(x)) elif isinstance(x, float): @@ -556,7 +555,7 @@ def _convert_args_kwds(self, args=None, kwds=None): for i, arg in enumerate(args): if not isinstance(arg, InterfaceElement) or arg.parent() is not self: args[i] = self(arg) - for key, value in iteritems(kwds): + for key, value in kwds.items(): if not isinstance(value, InterfaceElement) or value.parent() is not self: kwds[key] = self(value) @@ -1131,7 +1130,7 @@ def __repr__(self): except ValueError as msg: return '(invalid {} object -- {})'.format(self.parent() or type(self), msg) cr = getattr(self, '_cached_repr', None) - if isinstance(cr, string_types): + if isinstance(cr, str): s = cr else: s = self._repr_() @@ -1400,7 +1399,7 @@ def name(self, new_name=None): 's5' """ if new_name is not None: - if not isinstance(new_name, string_types): + if not isinstance(new_name, str): raise TypeError("new_name must be a string") p = self.parent() p.set(new_name, self._name) diff --git a/src/sage/interfaces/latte.py b/src/sage/interfaces/latte.py index b358d433df9..59d1b02e40b 100644 --- a/src/sage/interfaces/latte.py +++ b/src/sage/interfaces/latte.py @@ -12,7 +12,7 @@ #***************************************************************************** from __future__ import print_function, absolute_import -import six + from sage.cpython.string import str_to_bytes, bytes_to_str from subprocess import Popen, PIPE @@ -344,7 +344,7 @@ def integrate(arg, polynomial=None, algorithm='triangulate', raw_output=False, v args.append('--{}={}'.format(key, value)) if got_polynomial: - if not isinstance(polynomial, six.string_types): + if not isinstance(polynomial, str): # transform polynomial to LattE description monomials_list = to_latte_polynomial(polynomial) else: diff --git a/src/sage/interfaces/macaulay2.py b/src/sage/interfaces/macaulay2.py index 5d8566d1a8e..f6f7df8dc7f 100644 --- a/src/sage/interfaces/macaulay2.py +++ b/src/sage/interfaces/macaulay2.py @@ -117,7 +117,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six import string_types import os import re @@ -1020,7 +1019,7 @@ def name(self, new_name=None): """ if new_name is None: return self._name - if not isinstance(new_name, string_types): + if not isinstance(new_name, str): raise TypeError("new_name must be a string") P = self.parent() diff --git a/src/sage/interfaces/magma.py b/src/sage/interfaces/magma.py index a527c157780..58da2ba4b53 100644 --- a/src/sage/interfaces/magma.py +++ b/src/sage/interfaces/magma.py @@ -213,7 +213,6 @@ #***************************************************************************** from __future__ import print_function from __future__ import absolute_import -from six import string_types import re import sys @@ -459,7 +458,7 @@ def _post_process_from_file(self, s): sage: magma._post_process_from_file("Hello") '' """ - if not isinstance(s, string_types): + if not isinstance(s, str): raise RuntimeError("Error evaluating object in %s:\n%s" % (self, s)) # Chop off the annoying "Loading ... " message that Magma # always outputs no matter what. diff --git a/src/sage/interfaces/magma_free.py b/src/sage/interfaces/magma_free.py index 3b83007688c..b82b9c4699d 100644 --- a/src/sage/interfaces/magma_free.py +++ b/src/sage/interfaces/magma_free.py @@ -34,9 +34,8 @@ def magma_free_eval(code, strip=True, columns=0): sage: magma_free("Factorization(9290348092384)") # optional - internet [ <2, 5>, <290323377887, 1> ] """ - # import compatible with py2 and py3 - from six.moves.urllib.parse import urlencode - from six.moves import http_client as httplib + from urllib.parse import urlencode + from http import client as httplib from xml.dom.minidom import parseString server = "magma.maths.usyd.edu.au" diff --git a/src/sage/interfaces/maxima.py b/src/sage/interfaces/maxima.py index d6d37fe3305..9ab456ed36f 100644 --- a/src/sage/interfaces/maxima.py +++ b/src/sage/interfaces/maxima.py @@ -464,7 +464,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function, absolute_import -from six import string_types import os import re @@ -994,7 +993,7 @@ def set(self, var, value): sage: maxima.get('xxxxx') '2' """ - if not isinstance(value, string_types): + if not isinstance(value, str): raise TypeError cmd = '%s : %s$'%(var, value.rstrip(';')) if len(cmd) > self.__eval_using_file_cutoff: diff --git a/src/sage/interfaces/maxima_abstract.py b/src/sage/interfaces/maxima_abstract.py index bb23d7dbebd..86fbe7519bd 100644 --- a/src/sage/interfaces/maxima_abstract.py +++ b/src/sage/interfaces/maxima_abstract.py @@ -50,7 +50,6 @@ #***************************************************************************** from __future__ import print_function from __future__ import absolute_import -from six import string_types import os import re @@ -646,11 +645,11 @@ def function(self, args, defn, rep=None, latex=None): name = self._next_var_name() if isinstance(defn, MaximaAbstractElement): defn = defn.str() - elif not isinstance(defn, string_types): + elif not isinstance(defn, str): defn = str(defn) if isinstance(args, MaximaAbstractElement): args = args.str() - elif not isinstance(args, string_types): + elif not isinstance(args, str): args = str(args) cmd = '%s(%s) := %s' % (name, args, defn) self._eval_line(cmd) @@ -856,7 +855,7 @@ def de_solve(self, de, vars, ics=None): sage: maxima.de_solve('diff(y,x) + 3*x = y', ['x','y'],[1,1]) y=-%e^-1*(5*%e^x-3*%e*x-3*%e) """ - if not isinstance(vars, string_types): + if not isinstance(vars, str): str_vars = '%s, %s'%(vars[1], vars[0]) else: str_vars = vars diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py index 7053f351680..75826f679f8 100644 --- a/src/sage/interfaces/maxima_lib.py +++ b/src/sage/interfaces/maxima_lib.py @@ -82,10 +82,10 @@ # # The full text of the GPL is available at: # -# https://www.gnu.org/licenses/ -# **************************************************************************** -from __future__ import print_function, absolute_import -from six import string_types +# http://www.gnu.org/licenses/ +#***************************************************************************** +from __future__ import print_function +from __future__ import absolute_import from sage.symbolic.ring import SR @@ -452,7 +452,7 @@ def _eval_line(self, line, locals=None, reformat=True, **kwds): statement = line[:ind_semi] line = line[ind_semi+1:] if statement: - result = ((result + '\n') if result else '') + max_to_string(maxima_eval("#$%s$"%statement)) + result = ((result + '\n') if result else '') + max_to_string(maxima_eval("#$%s$"%statement)) else: statement = line[:ind_dollar] line = line[ind_dollar+1:] @@ -508,7 +508,7 @@ def set(self, var, value): sage: maxima_lib.get('xxxxx') '2' """ - if not isinstance(value, string_types): + if not isinstance(value, str): raise TypeError cmd = '%s : %s$'%(var, value.rstrip(';')) self.eval(cmd) @@ -1011,7 +1011,7 @@ def _missing_assumption(self,errstr): """ Helper function for unified handling of failed computation because an assumption was missing. - + EXAMPLES:: sage: from sage.interfaces.maxima_lib import maxima_lib @@ -1027,7 +1027,7 @@ def _missing_assumption(self,errstr): if errstr[3] == ' ': jj = 3 k = errstr.find(' ',jj+1) - + outstr = "Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume("\ + errstr[jj+1:k] +">0)', see `assume?` for more details)\n" + errstr outstr = outstr.replace('_SAGE_VAR_','') diff --git a/src/sage/interfaces/polymake.py b/src/sage/interfaces/polymake.py index 8a969a0b5db..0bc1fcb99ba 100644 --- a/src/sage/interfaces/polymake.py +++ b/src/sage/interfaces/polymake.py @@ -25,9 +25,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -import six -from six.moves import range -from six import reraise as raise_ import os import re @@ -590,7 +587,7 @@ def set(self, var, value): 9 36 84 126 126 84 36 9 """ - if isinstance(value, six.string_types): + if isinstance(value, str): value = value.strip().rstrip(';').strip() cmd = "@{}{}({});".format(var, self._assign_symbol(), value) self.eval(cmd) @@ -2138,7 +2135,7 @@ def _eval_line(self, line, allow_use_file=True, wait_for_prompt=True, restart_if except (TypeError, RuntimeError): pass return self._eval_line(line, allow_use_file=allow_use_file, wait_for_prompt=wait_for_prompt, restart_if_needed=False, **kwds) - raise_(RuntimeError, "{}\nError evaluating {} in {}".format(msg, line, self), sys.exc_info()[2]) + raise RuntimeError("{}\nError evaluating {} in {}".format(msg, line, self)) p_warnings = [] p_errors = [] @@ -2149,7 +2146,7 @@ def _eval_line(self, line, allow_use_file=True, wait_for_prompt=True, restart_if first = True while True: try: - if isinstance(wait_for_prompt, six.string_types): + if isinstance(wait_for_prompt, str): pat = E.expect(wait_for_prompt, **kwds) else: pat = E.expect_list(self._prompt, **kwds) diff --git a/src/sage/interfaces/povray.py b/src/sage/interfaces/povray.py index 7dcf963d84d..880c5fecbcd 100644 --- a/src/sage/interfaces/povray.py +++ b/src/sage/interfaces/povray.py @@ -1,7 +1,6 @@ r""" POV-Ray, The Persistence of Vision Ray Tracer """ -from six import iteritems from sage.misc.pager import pager import os @@ -42,7 +41,7 @@ def __call__(self, pov_file, outfile='sage.ppm', block=True, **kwargs): return "You must specify a width and height." cmd = "povray -D +FP +I%s +O%s " % (pov_file, outfile) - for k, v in iteritems(kwargs): + for k, v in kwargs.items(): cmd += "+%s%s " % (k, v) if not block: diff --git a/src/sage/interfaces/qepcad.py b/src/sage/interfaces/qepcad.py index 508d1ef3f99..c21b226353c 100644 --- a/src/sage/interfaces/qepcad.py +++ b/src/sage/interfaces/qepcad.py @@ -605,7 +605,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function, absolute_import -from six import string_types from sage.env import SAGE_LOCAL import pexpect @@ -839,12 +838,12 @@ def __init__(self, formula, varlist = None if vars is not None: - if isinstance(vars, string_types): + if isinstance(vars, str): varlist = vars.strip('()').split(',') else: varlist = [str(v) for v in vars] - if isinstance(formula, string_types): + if isinstance(formula, str): if varlist is None: raise ValueError("vars must be specified if formula is a string") @@ -920,7 +919,7 @@ def assume(self, assume): sage: qe.finish() # optional - qepcad 4 a c - b^2 <= 0 """ - if not isinstance(assume, string_types): + if not isinstance(assume, str): assume = qepcad_formula.formula(assume) if len(assume.qvars): raise ValueError("assumptions cannot be quantified") diff --git a/src/sage/interfaces/qsieve.py b/src/sage/interfaces/qsieve.py index 2006e6fbb8f..5b098130255 100644 --- a/src/sage/interfaces/qsieve.py +++ b/src/sage/interfaces/qsieve.py @@ -7,8 +7,6 @@ import os import subprocess as sp -import six - import sage.rings.integer from sage.cpython.string import bytes_to_str @@ -83,15 +81,10 @@ def qsieve_block(n, time, verbose=False): if time: cmd = ['time'] + cmd - if six.PY2: - enc_kwds = {} - else: - enc_kwds = {'encoding': 'latin1'} - env = os.environ.copy() env['TMPDIR'] = tmp_dir('qsieve') p = sp.Popen(cmd, env=env, stdout=sp.PIPE, stderr=sp.STDOUT, - stdin=sp.PIPE, **enc_kwds) + stdin=sp.PIPE, encoding='latin1') out, err = p.communicate(str(n)) z = data_to_list(out, n, time=time) if verbose: diff --git a/src/sage/interfaces/r.py b/src/sage/interfaces/r.py index 2939d46644b..720bf5c71ad 100644 --- a/src/sage/interfaces/r.py +++ b/src/sage/interfaces/r.py @@ -11,7 +11,7 @@ The %R and %%R interface creating an R line or an R cell in the Jupyter notebook are briefly decribed at the end of this page. This documentation will be expanded and placed in the Jupyter notebook -manual when this manual exists. +manual when this manual exists. The following examples try to follow "An Introduction to R" which can be found at http://cran.r-project.org/doc/manuals/R-intro.html . @@ -238,7 +238,7 @@ - R graphics are (beautifully) displayed in output cells, but are not directly importable. You have to save them as .png, .pdf or .svg - files and import them in Sage for further use. + files and import them in Sage for further use. In its current incarnation, this interface is mostly useful to statisticians needing Sage for a few symbolic computations but mostly @@ -265,8 +265,6 @@ # ########################################################################## from __future__ import print_function, absolute_import -from six.moves import range -import six from .interface import Interface, InterfaceElement, InterfaceFunction, InterfaceFunctionElement from sage.env import DOT_SAGE @@ -1584,7 +1582,7 @@ def __getitem__(self, n): [1] 1 3 """ P = self._check_valid() - if isinstance(n, six.string_types): + if isinstance(n, str): n = n.replace('self', self._name) return P.new('%s[%s]'%(self._name, n)) elif parent(n) is P: # the key is RElement itself @@ -1872,7 +1870,7 @@ def _instancedoc_(self): title ----- - Length of an Object + Length of an Object name ---- @@ -1969,7 +1967,7 @@ def _instancedoc_(self): title ----- - Length of an Object + Length of an Object name ---- diff --git a/src/sage/interfaces/sage0.py b/src/sage/interfaces/sage0.py index 9ccfb0be4d4..7d0aa68a6b3 100644 --- a/src/sage/interfaces/sage0.py +++ b/src/sage/interfaces/sage0.py @@ -15,10 +15,9 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six import iteritems, string_types -from six.moves import cPickle import os +import pickle import re import textwrap @@ -148,7 +147,7 @@ def __init__(self, if init_code is None: init_code = [] - elif isinstance(init_code, string_types): + elif isinstance(init_code, str): init_code = init_code.splitlines() else: try: @@ -175,11 +174,11 @@ def __init__(self, ]) prompt = re.compile(b'sage: ') - init_code.append('from six.moves import cPickle') + init_code.append('import pickle') init_code.append(textwrap.dedent(""" def _sage0_load_local(filename): with open(filename, 'rb') as f: - return cPickle.load(f) + return pickle.load(f) """)) init_code.append(textwrap.dedent(""" def _sage0_load_remote(filename): @@ -254,12 +253,12 @@ def __call__(self, x): else: return self(x.sage()) - if isinstance(x, string_types): + if isinstance(x, str): return SageElement(self, x) if self.is_local(): with open(self._local_tmpfile(), 'wb') as fobj: - fobj.write(cPickle.dumps(x, 2)) + fobj.write(pickle.dumps(x, 2)) code = '_sage0_load_local({!r})'.format(self._local_tmpfile()) return SageElement(self, code) else: @@ -538,7 +537,7 @@ def __call__(self, *args, **kwds): # get cleared from the interpreter before we complete the function # call. args = [P(x) for x in args] - kwds = [(k, P(v)) for k, v in iteritems(kwds)] + kwds = [(k, P(v)) for k, v in kwds.items()] arg_str = ','.join(x.name() for x in args) kwd_str = ','.join('%s=%s' % (k, v.name()) for k, v in kwds) diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py index 78e65d0c93a..f01b80476bc 100644 --- a/src/sage/interfaces/singular.py +++ b/src/sage/interfaces/singular.py @@ -318,9 +318,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range -from six import integer_types, string_types -from six import reraise as raise_ import io import os @@ -815,7 +812,7 @@ def _coerce_map_from_(self, S): if hasattr(S, 'an_element'): if hasattr(S.an_element(), '_singular_'): return True - elif S in integer_types: + elif S is int: return True return None @@ -901,7 +898,7 @@ def ideal(self, *gens): x0*x1-x0*x2-x1*x2, x0^2*x2-x0*x2^2-x1*x2^2 """ - if isinstance(gens, string_types): + if isinstance(gens, str): gens = self(gens) if isinstance(gens, SingularElement): @@ -1049,7 +1046,7 @@ def ring(self, char=0, vars='(x)', order='lp', check=True): for x in vars[1:-1].split(',')]) self.eval(s) - if check and isinstance(char, integer_types + (sage.rings.integer.Integer,)): + if check and isinstance(char, (int, sage.rings.integer.Integer)): if char != 0: n = sage.rings.integer.Integer(char) if not n.is_prime(): @@ -1280,7 +1277,7 @@ def __init__(self, parent, type, value, is_name=False): # coercion to work properly. except SingularError as x: self._session_number = -1 - raise_(TypeError, TypeError(x), sys.exc_info()[2]) + raise TypeError(x) except BaseException: self._session_number = -1 raise diff --git a/src/sage/knots/knot.py b/src/sage/knots/knot.py index cde79e43973..f9b7ec532d7 100644 --- a/src/sage/knots/knot.py +++ b/src/sage/knots/knot.py @@ -18,8 +18,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from six import add_metaclass - from sage.knots.link import Link from sage.knots.knot_table import small_knots_table from sage.knots.gauss_code import (recover_orientations, dowker_to_gauss, @@ -32,8 +30,7 @@ from sage.categories.monoids import Monoids # We need Link to be first in the MRO in order to use its equality, hash, etc. -@add_metaclass(InheritComparisonClasscallMetaclass) -class Knot(Link, Element): +class Knot(Link, Element, metaclass=InheritComparisonClasscallMetaclass): r""" A knot. diff --git a/src/sage/knots/link.py b/src/sage/knots/link.py index eda927fb177..8d98039a30a 100644 --- a/src/sage/knots/link.py +++ b/src/sage/knots/link.py @@ -48,8 +48,6 @@ # **************************************************************************** from __future__ import division -from six.moves import range - from sage.matrix.constructor import matrix from sage.rings.integer_ring import ZZ from sage.graphs.digraph import DiGraph diff --git a/src/sage/libs/coxeter3/coxeter_group.py b/src/sage/libs/coxeter3/coxeter_group.py index a480e1243f2..329f7ee2298 100644 --- a/src/sage/libs/coxeter3/coxeter_group.py +++ b/src/sage/libs/coxeter3/coxeter_group.py @@ -8,7 +8,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #***************************************************************************** -from six import iteritems from sage.libs.coxeter3.coxeter import get_CoxGroup, CoxGroupElement from sage.misc.cachefunc import cached_method @@ -673,7 +672,7 @@ def action_on_rational_function(self, f): exponent = self.action(exponent) monomial = 1 - for s, c in iteritems(exponent.monomial_coefficients()): + for s, c in exponent.monomial_coefficients().items(): monomial *= Q_gens[basis_to_order[s]]**int(c) result += monomial diff --git a/src/sage/libs/gap/assigned_names.py b/src/sage/libs/gap/assigned_names.py index 46ea8542bd2..e8d1f1707cc 100644 --- a/src/sage/libs/gap/assigned_names.py +++ b/src/sage/libs/gap/assigned_names.py @@ -21,7 +21,8 @@ # http://www.gnu.org/licenses/ ############################################################################### -from six.moves import cPickle +import pickle + from sage.libs.gap.libgap import libgap from sage.libs.gap.saved_workspace import workspace @@ -60,12 +61,12 @@ def load_or_compute(name, function): filename, up_to_date = workspace(name=name) if up_to_date: with open(filename, 'rb') as f: - return cPickle.load(f) + return pickle.load(f) else: value = function() from sage.misc.temporary_file import atomic_write with atomic_write(filename, binary=True) as f: - cPickle.dump(value, f) + pickle.dump(value, f) return value diff --git a/src/sage/libs/symmetrica/symmetrica.pxi b/src/sage/libs/symmetrica/symmetrica.pxi index 263ad7c35b4..5497d26b56e 100644 --- a/src/sage/libs/symmetrica/symmetrica.pxi +++ b/src/sage/libs/symmetrica/symmetrica.pxi @@ -448,7 +448,7 @@ cdef void late_import(): import sage.combinat.sf.sf SymmetricFunctions = sage.combinat.sf.sf.SymmetricFunctions - from six.moves import builtins + import builtins builtinlist = builtins.list import sage.rings.polynomial.multi_polynomial_ring diff --git a/src/sage/manifolds/differentiable/metric.py b/src/sage/manifolds/differentiable/metric.py index f38e480a5a3..51290da04b8 100644 --- a/src/sage/manifolds/differentiable/metric.py +++ b/src/sage/manifolds/differentiable/metric.py @@ -39,7 +39,6 @@ # the License, or (at your option) any later version. # https://www.gnu.org/licenses/ # ***************************************************************************** -from six.moves import range from sage.rings.integer import Integer from sage.manifolds.differentiable.tensorfield import TensorField diff --git a/src/sage/manifolds/differentiable/tensorfield.py b/src/sage/manifolds/differentiable/tensorfield.py index 6f9658853d6..e16f67819e0 100644 --- a/src/sage/manifolds/differentiable/tensorfield.py +++ b/src/sage/manifolds/differentiable/tensorfield.py @@ -52,7 +52,6 @@ # https://www.gnu.org/licenses/ # ***************************************************************************** from __future__ import print_function -from six import string_types from sage.rings.integer import Integer from sage.rings.integer_ring import ZZ @@ -753,7 +752,7 @@ def _init_components(self, *comp, **kwargs): # frame is actually a pair (frame, chart): frame, chart = frame self.add_comp(frame)[:, chart] = components - elif isinstance(comp0, string_types): + elif isinstance(comp0, str): # For compatibility with previous use of tensor_field(): self.set_name(comp0) else: diff --git a/src/sage/manifolds/scalarfield.py b/src/sage/manifolds/scalarfield.py index 05e814377a6..6cf8a987cd6 100644 --- a/src/sage/manifolds/scalarfield.py +++ b/src/sage/manifolds/scalarfield.py @@ -39,6 +39,7 @@ # the License, or (at your option) any later version. # https://www.gnu.org/licenses/ # ***************************************************************************** + from sage.structure.element import CommutativeAlgebraElement from sage.symbolic.expression import Expression from sage.manifolds.chart_func import ChartFunction diff --git a/src/sage/matrix/constructor.pyx b/src/sage/matrix/constructor.pyx index 080581b9008..4d7ff0fae18 100644 --- a/src/sage/matrix/constructor.pyx +++ b/src/sage/matrix/constructor.pyx @@ -608,7 +608,6 @@ def matrix(*args, **kwds): Some calls using an iterator:: - sage: from six.moves import range sage: matrix(QQ, 3, 6, range(18), sparse=true) [ 0 1 2 3 4 5] [ 6 7 8 9 10 11] diff --git a/src/sage/matrix/matrix_integer_dense_hnf.py b/src/sage/matrix/matrix_integer_dense_hnf.py index 8badc088e69..51fd5f3ecf7 100644 --- a/src/sage/matrix/matrix_integer_dense_hnf.py +++ b/src/sage/matrix/matrix_integer_dense_hnf.py @@ -6,7 +6,6 @@ - Clement Pernet and William Stein (2008-02-07): initial version """ from __future__ import print_function -from six.moves import range from copy import copy diff --git a/src/sage/matrix/matrix_integer_dense_saturation.py b/src/sage/matrix/matrix_integer_dense_saturation.py index 425d4fce302..6a8c55df233 100644 --- a/src/sage/matrix/matrix_integer_dense_saturation.py +++ b/src/sage/matrix/matrix_integer_dense_saturation.py @@ -2,7 +2,6 @@ Saturation over ZZ """ from __future__ import absolute_import -from six.moves import range from sage.rings.integer_ring import ZZ from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF diff --git a/src/sage/matrix/matrix_misc.py b/src/sage/matrix/matrix_misc.py index 575500ab1af..72986685c1f 100644 --- a/src/sage/matrix/matrix_misc.py +++ b/src/sage/matrix/matrix_misc.py @@ -15,10 +15,8 @@ # # The full text of the GPL is available at: # -# https://www.gnu.org/licenses/ -# **************************************************************************** -from six.moves import range -from six import iteritems +# http://www.gnu.org/licenses/ +#***************************************************************************** from sage.categories.fields import Fields from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing @@ -59,10 +57,10 @@ def prm_mul(p1, p2, mask_free, prec): p = {} if not p2: return p - for exp1, v1 in iteritems(p1): + for exp1, v1 in p1.items(): if v1.is_zero(): continue - for exp2, v2 in iteritems(p2): + for exp2, v2 in p2.items(): if exp1 & exp2: continue v = v1 * v2 diff --git a/src/sage/matrix/matrix_space.py b/src/sage/matrix/matrix_space.py index acb2d53f210..335e424b506 100644 --- a/src/sage/matrix/matrix_space.py +++ b/src/sage/matrix/matrix_space.py @@ -32,8 +32,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range -from six import iteritems, integer_types # System imports import sys @@ -1497,7 +1495,7 @@ def __getitem__(self, x): ... AttributeError: 'MatrixSpace_with_category' object has no attribute 'list' """ - if isinstance(x, integer_types + (integer.Integer,)): + if isinstance(x, (integer.Integer, int)): return self.list()[x] return super(MatrixSpace, self).__getitem__(x) @@ -2225,7 +2223,7 @@ def dict_to_list(entries, nrows, ncols): [1, 0, 0, 0, 2, 0] """ v = [0] * (nrows * ncols) - for ij, y in iteritems(entries): + for ij, y in entries.items(): i, j = ij v[i * ncols + j] = y return v diff --git a/src/sage/matrix/operation_table.py b/src/sage/matrix/operation_table.py index 4690ddf97e7..99e2f5cf009 100644 --- a/src/sage/matrix/operation_table.py +++ b/src/sage/matrix/operation_table.py @@ -16,7 +16,6 @@ from __future__ import absolute_import -import six from sage.structure.sage_object import SageObject class OperationTable(SageObject): @@ -542,12 +541,12 @@ def _name_maker(self, names): if len(names) != self._n: raise ValueError('list of element names must be the same size as the set, %s != %s'%(len(names), self._n)) width = 0 - for str in names: - if not isinstance(str, six.string_types): - raise ValueError('list of element names must only contain strings, not %s'%str) - if len(str) > width: - width = len(str) - name_list.append(str) + for name in names: + if not isinstance(name, str): + raise ValueError('list of element names must only contain strings, not %s' % name) + if len(name) > width: + width = len(name) + name_list.append(name) else: raise ValueError("element names must be a list, or one of the keywords: 'letters', 'digits', 'elements'") name_dict = {} @@ -717,9 +716,9 @@ def set_print_symbols(self, ascii, latex): ... ValueError: ASCII symbol should be a single character, not 5 """ - if not isinstance(ascii, six.string_types) or not len(ascii)==1: + if not isinstance(ascii, str) or not len(ascii)==1: raise ValueError('ASCII symbol should be a single character, not %s' % ascii) - if not isinstance(latex, six.string_types): + if not isinstance(latex, str): raise ValueError('LaTeX symbol must be a string, not %s' % latex) self._ascii_symbol = ascii self._latex_symbol = latex diff --git a/src/sage/matrix/special.py b/src/sage/matrix/special.py index 21bd4a620ff..f27497a437c 100644 --- a/src/sage/matrix/special.py +++ b/src/sage/matrix/special.py @@ -63,8 +63,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import, division -from six.moves import range -from six import integer_types from sage.rings.ring import is_Ring import sage.matrix.matrix_space as matrix_space @@ -802,7 +800,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True): # Size of matrix specified? # Formats 2, 4 nrows = None - if isinstance(arg0, integer_types + (Integer,)): + if isinstance(arg0, (Integer, int)): nrows = arg0 arg0 = arg1 # Object holding entries @@ -877,7 +875,7 @@ def identity_matrix(ring, n=0, sparse=False): sage: M.is_mutable() True """ - if isinstance(ring, integer_types + (Integer,)): + if isinstance(ring, (Integer, int)): n = ring ring = ZZ return matrix_space.MatrixSpace(ring, n, n, sparse)(1) @@ -903,7 +901,7 @@ def lehmer(ring, n=0): """ from sage.sets.integer_range import IntegerRange - if isinstance(ring, integer_types + (Integer,)): + if isinstance(ring, (Integer, int)): n = ring ring = QQ return matrix_space.MatrixSpace(ring, n, n).matrix([[min(i, j)/max(i, j) for i in IntegerRange(1, n+1)] for j in IntegerRange(1, n+1)]) @@ -946,7 +944,7 @@ def zero_matrix(ring, nrows=None, ncols=None, sparse=False): [0 0 0 0 0] """ - if isinstance(ring, integer_types + (Integer,)): + if isinstance(ring, (Integer, int)): nrows, ncols = (ring, nrows) ring = ZZ return matrix_space.MatrixSpace(ring, nrows, ncols, sparse)(0) @@ -1031,7 +1029,7 @@ def ones_matrix(ring, nrows=None, ncols=None, sparse=False): ... ValueError: constructing an all ones matrix requires at least one dimension """ - if isinstance(ring, integer_types + (Integer,)): + if isinstance(ring, (Integer, int)): nrows, ncols = (ring, nrows) ring = ZZ if nrows is None: diff --git a/src/sage/matroids/catalog.py b/src/sage/matroids/catalog.py index 8a42138784b..845dd72e8e0 100644 --- a/src/sage/matroids/catalog.py +++ b/src/sage/matroids/catalog.py @@ -32,9 +32,8 @@ # 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. -# https://www.gnu.org/licenses/ -# **************************************************************************** -from six.moves import range +# http://www.gnu.org/licenses/ +#***************************************************************************** from sage.matrix.constructor import Matrix from sage.graphs.all import graphs diff --git a/src/sage/matroids/utilities.py b/src/sage/matroids/utilities.py index 735705d3e87..5d156936ac3 100644 --- a/src/sage/matroids/utilities.py +++ b/src/sage/matroids/utilities.py @@ -24,7 +24,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six import iteritems from sage.matrix.constructor import Matrix from sage.rings.all import ZZ, QQ, GF @@ -127,7 +126,7 @@ def setprint_s(X, toplevel=False): return '{' + ', '.join(sorted(setprint_s(x) for x in X)) + '}' elif isinstance(X, dict): return '{' + ', '.join(sorted(setprint_s(key) + ': ' + setprint_s(val) - for key, val in iteritems(X))) + '}' + for key, val in X.items())) + '}' elif isinstance(X, str): if toplevel: return X @@ -558,7 +557,7 @@ def lift_cross_ratios(A, lift_map=None): True """ - for s, t in iteritems(lift_map): + for s, t in lift_map.items(): source_ring = s.parent() target_ring = t.parent() break @@ -629,13 +628,13 @@ def lift_cross_ratios(A, lift_map=None): div = True for entry2 in entries: if div: - for cr, degree in iteritems(F[entry2]): + for cr, degree in F[entry2].items(): if cr in monomial: monomial[cr] = monomial[cr] + degree else: monomial[cr] = degree else: - for cr, degree in iteritems(F[entry2]): + for cr, degree in F[entry2].items(): if cr in monomial: monomial[cr] = monomial[cr] - degree else: @@ -647,9 +646,9 @@ def lift_cross_ratios(A, lift_map=None): # compute each entry of Z as the product of lifted cross ratios Z = Matrix(target_ring, A.nrows(), A.ncols()) - for entry, monomial in iteritems(F): + for entry, monomial in F.items(): Z[entry] = plus_one2 - for cr, degree in iteritems(monomial): + for cr, degree in monomial.items(): if cr == minus_one1: Z[entry] = Z[entry] * (minus_one2**degree) else: diff --git a/src/sage/media/wav.py b/src/sage/media/wav.py index 3b68644f791..79ed045eb49 100644 --- a/src/sage/media/wav.py +++ b/src/sage/media/wav.py @@ -25,7 +25,6 @@ - Bobby Moretti (2007-07-03): add doctests """ from __future__ import print_function, absolute_import -from six.moves import range import math import os diff --git a/src/sage/misc/bindable_class.py b/src/sage/misc/bindable_class.py index 5157de20b80..a3b29ee120c 100644 --- a/src/sage/misc/bindable_class.py +++ b/src/sage/misc/bindable_class.py @@ -15,11 +15,10 @@ from __future__ import absolute_import, print_function import functools -from sage.misc import six from sage.misc.nested_class import NestedClassMetaclass from sage.misc.classcall_metaclass import ClasscallMetaclass -class BindableClass(six.with_metaclass(ClasscallMetaclass)): +class BindableClass(metaclass=ClasscallMetaclass): """ Bindable classes @@ -259,7 +258,7 @@ class Inner2(BindableClass): """ # We need NestedClassMetaclass to work around a Python pickling bug -class Outer(six.with_metaclass(NestedClassMetaclass)): +class Outer(metaclass=NestedClassMetaclass): """ A class with a bindable nested class, for testing purposes """ diff --git a/src/sage/misc/classcall_metaclass.pyx b/src/sage/misc/classcall_metaclass.pyx index 47e71349345..eb8f75a5094 100644 --- a/src/sage/misc/classcall_metaclass.pyx +++ b/src/sage/misc/classcall_metaclass.pyx @@ -87,10 +87,8 @@ cdef class ClasscallMetaclass(NestedClassMetaclass): If a class is put in this metaclass it automatically becomes a new-style class:: - sage: from six import add_metaclass sage: from sage.misc.classcall_metaclass import ClasscallMetaclass - sage: @add_metaclass(ClasscallMetaclass) - ....: class Foo: pass + sage: class Foo(metaclass=ClasscallMetaclass): pass sage: x = Foo(); x <__main__.Foo object at 0x...> sage: issubclass(Foo, object) @@ -103,10 +101,8 @@ cdef class ClasscallMetaclass(NestedClassMetaclass): r""" TESTS:: - sage: from six import add_metaclass sage: from sage.misc.classcall_metaclass import ClasscallMetaclass - sage: @add_metaclass(ClasscallMetaclass) - ....: class FOO(object): pass + sage: class FOO(metaclass=ClasscallMetaclass): pass sage: isinstance(FOO, ClasscallMetaclass) # indirect doctest True """ @@ -126,10 +122,8 @@ cdef class ClasscallMetaclass(NestedClassMetaclass): EXAMPLES:: - sage: from six import add_metaclass sage: from sage.misc.classcall_metaclass import ClasscallMetaclass - sage: @add_metaclass(ClasscallMetaclass) - ....: class FOO(object): pass + sage: class FOO(metaclass=ClasscallMetaclass): pass sage: FOO() <__main__.FOO object at ...> @@ -194,10 +188,8 @@ cdef class ClasscallMetaclass(NestedClassMetaclass): EXAMPLES:: - sage: from six import add_metaclass sage: from sage.misc.classcall_metaclass import ClasscallMetaclass - sage: @add_metaclass(ClasscallMetaclass) - ....: class Foo(object): + sage: class Foo(metaclass=ClasscallMetaclass): ....: @staticmethod ....: def __classcall__(cls): ....: print("calling classcall") @@ -224,8 +216,7 @@ cdef class ClasscallMetaclass(NestedClassMetaclass): We now show the usage of ``__classcall_private__``:: - sage: @add_metaclass(ClasscallMetaclass) - ....: class FooNoInherits(object): + sage: class FooNoInherits(object, metaclass=ClasscallMetaclass): ....: __metaclass__ = ClasscallMetaclass ....: @staticmethod ....: def __classcall_private__(cls): @@ -244,8 +235,7 @@ cdef class ClasscallMetaclass(NestedClassMetaclass): We now show the usage of both:: - sage: @add_metaclass(ClasscallMetaclass) - ....: class Foo2(object): + sage: class Foo2(object, metaclass=ClasscallMetaclass): ....: @staticmethod ....: def __classcall_private__(cls): ....: print("calling private classcall") @@ -312,16 +302,14 @@ cdef class ClasscallMetaclass(NestedClassMetaclass): We check for memory leaks:: - sage: @add_metaclass(ClasscallMetaclass) - ....: class NOCALL(object): + sage: class NOCALL(object, metaclass=ClasscallMetaclass): ....: pass sage: sys.getrefcount(NOCALL()) 1 We check that exceptions are correctly handled:: - sage: @add_metaclass(ClasscallMetaclass) - ....: class Exc(object): + sage: class Exc(object, metaclass=ClasscallMetaclass): ....: @staticmethod ....: def __classcall__(cls): ....: raise ValueError("Calling classcall") @@ -367,13 +355,10 @@ cdef class ClasscallMetaclass(NestedClassMetaclass): ``obj.Inner(...)`` is equivalent to ``Outer.Inner(obj, ...)``:: sage: import functools - sage: from six import add_metaclass sage: from sage.misc.nested_class import NestedClassMetaclass sage: from sage.misc.classcall_metaclass import ClasscallMetaclass - sage: @add_metaclass(NestedClassMetaclass) - ....: class Outer: - ....: @add_metaclass(ClasscallMetaclass) - ....: class Inner(object): + sage: class Outer(metaclass=NestedClassMetaclass): + ....: class Inner(metaclass=ClasscallMetaclass): ....: @staticmethod ....: def __classget__(cls, instance, owner): ....: print("calling __classget__(%s, %s, %s)" % ( @@ -439,10 +424,8 @@ cdef class ClasscallMetaclass(NestedClassMetaclass): We construct a class which implements membership testing, and which contains ``1`` and no other x:: - sage: from six import add_metaclass sage: from sage.misc.classcall_metaclass import ClasscallMetaclass - sage: @add_metaclass(ClasscallMetaclass) - ....: class Foo(object): + sage: class Foo(metaclass=ClasscallMetaclass): ....: @staticmethod ....: def __classcontains__(cls, x): ....: return x == 1 @@ -454,10 +437,8 @@ cdef class ClasscallMetaclass(NestedClassMetaclass): We now check that for a class without ``__classcontains__`` method, we emulate the usual error message:: - sage: from six import add_metaclass sage: from sage.misc.classcall_metaclass import ClasscallMetaclass - sage: @add_metaclass(ClasscallMetaclass) - ....: class Bar(object): pass + sage: class Bar(metaclass=ClasscallMetaclass): pass sage: 1 in Bar Traceback (most recent call last): ... @@ -557,7 +538,6 @@ def timeCall(T, int n, *args): EXAMPLES:: - sage: from six import add_metaclass sage: from sage.misc.classcall_metaclass import ( ....: ClasscallMetaclass, CRef, C2, C3, C2C, timeCall) sage: timeCall(object, 1000) @@ -576,8 +556,7 @@ def timeCall(T, int n, *args): overhead in using :class:`ClasscallMetaclass` if there is no classcall defined:: - sage: @add_metaclass(ClasscallMetaclass) - ....: class P(object): + sage: class P(metaclass=ClasscallMetaclass): ....: def __init__(self, i): ....: self.i = i+i1 @@ -596,8 +575,7 @@ def timeCall(T, int n, *args): Let's now compare when there is a classcall defined:: - sage: @add_metaclass(ClasscallMetaclass) - ....: class PC(object): + sage: class PC(object, metaclass=ClasscallMetaclass): ....: @staticmethod ....: def __classcall__(cls, i): ....: return i+i1 diff --git a/src/sage/misc/converting_dict.py b/src/sage/misc/converting_dict.py index f9bdb17bba3..c3433ade6ce 100644 --- a/src/sage/misc/converting_dict.py +++ b/src/sage/misc/converting_dict.py @@ -45,7 +45,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six import iteritems import collections @@ -294,5 +293,5 @@ def update(self, *args, **kwds): seq = ((f(k), v) for k, v in arg) u(seq) if kwds: - seq = ((f(k), v) for k, v in iteritems(kwds)) + seq = ((f(k), v) for k, v in kwds.items()) u(seq) diff --git a/src/sage/misc/cython.py b/src/sage/misc/cython.py index 0bb586e5fc9..af5f99d03eb 100644 --- a/src/sage/misc/cython.py +++ b/src/sage/misc/cython.py @@ -18,9 +18,8 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import builtins -from six import iteritems, PY2 +import builtins import os import sys import shutil @@ -522,7 +521,7 @@ def cython_import_all(filename, globals, **kwds): code """ m = cython_import(filename, **kwds) - for k, x in iteritems(m.__dict__): + for k, x in m.__dict__.items(): if k[0] != '_': globals[k] = x @@ -659,9 +658,6 @@ def _strhash(s): l = len(s) for c in s: - if PY2: - c = ord(c) - h += c + (c << 17) h ^= h >> 2 diff --git a/src/sage/misc/decorators.py b/src/sage/misc/decorators.py index 4c8e6f6b575..0136c4281f4 100644 --- a/src/sage/misc/decorators.py +++ b/src/sage/misc/decorators.py @@ -29,7 +29,6 @@ from functools import (partial, update_wrapper, WRAPPER_ASSIGNMENTS, WRAPPER_UPDATES) -from six import iteritems from copy import copy from sage.misc.sageinspect import (sage_getsource, sage_getsourcelines, @@ -402,7 +401,7 @@ def wrapper(*args, **kwds): # Collect all the relevant keywords in kwds # and put them in suboptions - for key, value in list(iteritems(kwds)): + for key, value in list(kwds.items()): if key.startswith(self.name): suboptions[key[len(self.name):]] = value del kwds[key] diff --git a/src/sage/misc/dev_tools.py b/src/sage/misc/dev_tools.py index 0a13f56c016..3b991f48efb 100644 --- a/src/sage/misc/dev_tools.py +++ b/src/sage/misc/dev_tools.py @@ -21,8 +21,6 @@ from collections import defaultdict -from six import iteritems, string_types - def runsnake(command): """ @@ -249,7 +247,7 @@ def find_objects_from_name(name, module_name=None): """ obj = [] - for smodule_name, smodule in iteritems(sys.modules): + for smodule_name, smodule in sys.modules.items(): if module_name and not smodule_name.startswith(module_name): continue if hasattr(smodule, '__dict__') and name in smodule.__dict__: @@ -304,7 +302,7 @@ def find_object_modules(obj): # otherwise, we parse all (already loaded) modules and hope to find # something module_to_obj = {} - for module_name, module in iteritems(sys.modules): + for module_name, module in sys.modules.items(): if module_name != '__main__' and hasattr(module, '__dict__'): d = module.__dict__ names = [key for key in d if d[key] is obj] @@ -315,7 +313,7 @@ def find_object_modules(obj): if sageinspect.isclassinstance(obj): dec_pattern = re.compile(r"^(\w[\w0-9\_]*)\s*=", re.MULTILINE) module_to_obj2 = {} - for module_name, obj_names in iteritems(module_to_obj): + for module_name, obj_names in module_to_obj.items(): module_to_obj2[module_name] = [] src = sageinspect.sage_getsource(sys.modules[module_name]) m = dec_pattern.search(src) @@ -522,7 +520,7 @@ def import_statements(*objects, **kwds): name = None # the name of the object # 1. if obj is a string, we look for an object that has that name - if isinstance(obj, string_types): + if isinstance(obj, str): from sage.all import sage_globals G = sage_globals() name = obj diff --git a/src/sage/misc/explain_pickle.py b/src/sage/misc/explain_pickle.py index 19a7ccea3bb..d4f64f1cf68 100644 --- a/src/sage/misc/explain_pickle.py +++ b/src/sage/misc/explain_pickle.py @@ -166,8 +166,6 @@ from pickletools import genops -from six import iteritems - import sage.all from sage.misc.sage_input import SageInputBuilder, SageInputExpression from sage.misc.sage_eval import sage_eval @@ -1210,7 +1208,7 @@ def EXT1(self, n): r""" TESTS:: - sage: from six.moves.copyreg import * + sage: from copyreg import * sage: from sage.misc.explain_pickle import * sage: add_extension('sage.misc.explain_pickle', 'EmptyNewstyleClass', 42) sage: test_pickle(EmptyNewstyleClass()) # py2 @@ -1237,7 +1235,7 @@ def EXT2(self, n): r""" TESTS:: - sage: from six.moves.copyreg import * + sage: from copyreg import * sage: from sage.misc.explain_pickle import * sage: add_extension('sage.misc.explain_pickle', 'EmptyNewstyleClass', 31415) sage: test_pickle(EmptyNewstyleClass()) # py2 @@ -1264,7 +1262,7 @@ def EXT4(self, n): r""" TESTS:: - sage: from six.moves.copyreg import * + sage: from copyreg import * sage: from sage.misc.explain_pickle import * sage: add_extension('sage.misc.explain_pickle', 'EmptyNewstyleClass', 27182818) sage: test_pickle(EmptyNewstyleClass()) # py2 @@ -2466,12 +2464,12 @@ def unpickle_build(obj, state): if state is not None: assert(isinstance(state, dict)) d = obj.__dict__ - for k, v in iteritems(state): + for k, v in state.items(): d[k] = v if slots is not None: assert(isinstance(slots, dict)) - for k, v in iteritems(slots): + for k, v in slots.items(): setattr(obj, k, v) @@ -2518,13 +2516,13 @@ def unpickle_extension(code): EXAMPLES:: - sage: from six.moves.copyreg import * + sage: from copyreg import * sage: add_extension('sage.misc.explain_pickle', 'EmptyNewstyleClass', 42) sage: unpickle_extension(42) sage: remove_extension('sage.misc.explain_pickle', 'EmptyNewstyleClass', 42) """ - from six.moves.copyreg import _inverted_registry, _extension_cache + from copyreg import _inverted_registry, _extension_cache # copied from .get_extension() in pickle.py nil = [] obj = _extension_cache.get(code, nil) diff --git a/src/sage/misc/fpickle.pyx b/src/sage/misc/fpickle.pyx index 93f18854397..0305532e902 100644 --- a/src/sage/misc/fpickle.pyx +++ b/src/sage/misc/fpickle.pyx @@ -6,10 +6,9 @@ Function pickling REFERENCE: The python cookbook. """ +import copyreg +import pickle import types -import six -from six.moves import copyreg -from six.moves import cPickle def code_ctor(*args): @@ -38,12 +37,8 @@ def reduce_code(co): if co.co_freevars or co.co_cellvars: raise ValueError("Cannot pickle code objects from closures") - if six.PY2: - co_args = (co.co_argcount,) - else: - co_args = (co.co_argcount, co.co_kwonlyargcount) - - co_args += (co.co_nlocals, co.co_stacksize, co.co_flags, co.co_code, + co_args = (co.co_argcount, co.co_kwonlyargcount, co.co_nlocals, + co.co_stacksize, co.co_flags, co.co_code, co.co_consts, co.co_names, co.co_varnames, co.co_filename, co.co_name, co.co_firstlineno, co.co_lnotab) @@ -79,7 +74,7 @@ def pickle_function(func): sage: h(10) 11 """ - return cPickle.dumps(func.__code__) + return pickle.dumps(func.__code__) def unpickle_function(pickled): """ @@ -92,7 +87,7 @@ def unpickle_function(pickled): sage: unpickle_function(pickle_function(f))(3,5) 15 """ - recovered = cPickle.loads(pickled) + recovered = pickle.loads(pickled) return types.FunctionType(recovered, globals()) diff --git a/src/sage/misc/functional.py b/src/sage/misc/functional.py index f27976bdd0d..cd190ab53fd 100644 --- a/src/sage/misc/functional.py +++ b/src/sage/misc/functional.py @@ -21,8 +21,7 @@ # https://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six.moves import range, builtins -from six import integer_types +import builtins from sage.rings.complex_double import CDF from sage.rings.real_double import RDF, RealDoubleElement @@ -247,7 +246,7 @@ def denominator(x): sage: denominator(r) x - 1 """ - if isinstance(x, integer_types): + if isinstance(x, int): return 1 return x.denominator() @@ -1213,7 +1212,7 @@ def numerator(x): sage: numerator(17/11111) 17 """ - if isinstance(x, integer_types): + if isinstance(x, int): return x return x.numerator() @@ -1548,10 +1547,9 @@ def round(x, ndigits=0): .. NOTE:: - This is currently slower than the builtin round function, since - it does more work - i.e., allocating an RDF element and - initializing it. To access the builtin version do - ``from six.moves import builtins; builtins.round``. + This is currently slower than the builtin round function, since it does + more work - i.e., allocating an RDF element and initializing it. To + access the builtin version do ``import builtins; builtins.round``. """ try: if ndigits: diff --git a/src/sage/misc/gperftools.py b/src/sage/misc/gperftools.py index bd802daee72..55ee572b8c4 100644 --- a/src/sage/misc/gperftools.py +++ b/src/sage/misc/gperftools.py @@ -207,12 +207,11 @@ def _pprof(self): EXAMPLES:: - sage: import six sage: from sage.misc.gperftools import Profiler sage: prof = Profiler() sage: try: ....: pp = prof._pprof() - ....: assert isinstance(pp, six.string_types) + ....: assert isinstance(pp, str) ....: except OSError: ....: pass # not installed """ diff --git a/src/sage/misc/inline_fortran.py b/src/sage/misc/inline_fortran.py index 9cba50d041f..1625feeade4 100644 --- a/src/sage/misc/inline_fortran.py +++ b/src/sage/misc/inline_fortran.py @@ -3,15 +3,12 @@ """ from __future__ import absolute_import +import importlib import os import shutil import subprocess import sys -import six - -from six import iteritems - from sage.misc.temporary_file import tmp_dir @@ -50,36 +47,19 @@ def _import_module_from_path(name, path=None): return _import_module_from_path_impl(name, path) -if six.PY2: - import imp - - def _import_module_from_path_impl(name, path): - """Implement ``_import_module_from_path for Python 2.""" - - # Note: Raises an ImportError if not found - fileobj, pathname, description = imp.find_module(name, path) - try: - # Executes the module in fileobj using the appropriate loader and - # returns the module - return imp.load_module(name, fileobj, pathname, description) - finally: - fileobj.close() -else: - import importlib - - def _import_module_from_path_impl(name, path): - """Implement ``_import_module_from_path for Python 3.4+.""" +def _import_module_from_path_impl(name, path): + """Implement ``_import_module_from_path for Python 3.4+.""" - # This is remarkably tricky to do right, considering that the new - # importlib is supposed to make direct interaction with the import - # system easier. I blame the ModuleSpec stuff... - finder = importlib.machinery.PathFinder() - spec = finder.find_spec(name, path=path) - if spec is None: - raise ImportError('No module named {}'.format(name)) - mod = importlib.util.module_from_spec(spec) - spec.loader.exec_module(mod) - return mod + # This is remarkably tricky to do right, considering that the new + # importlib is supposed to make direct interaction with the import + # system easier. I blame the ModuleSpec stuff... + finder = importlib.machinery.PathFinder() + spec = finder.find_spec(name, path=path) + if spec is None: + raise ImportError('No module named {}'.format(name)) + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod class InlineFortran: @@ -221,7 +201,7 @@ def eval(self, x, globals=None, locals=None): # This can fail for example over NFS pass - for k, x in iteritems(mod.__dict__): + for k, x in mod.__dict__.items(): if k[0] != '_': globals[k] = x diff --git a/src/sage/misc/latex.py b/src/sage/misc/latex.py index 295f40c0b9b..b4ee01c09a7 100644 --- a/src/sage/misc/latex.py +++ b/src/sage/misc/latex.py @@ -26,8 +26,6 @@ import shutil import subprocess -from six import integer_types - from sage.misc import sage_eval from sage.misc.cachefunc import cached_function, cached_method from sage.misc.sage_ostools import have_program @@ -400,18 +398,18 @@ def float_function(x): return latex(RDF(x)) -latex_table = {type(None): None_function, - bool: bool_function, - dict: dict_function, - float: float_function, - list: list_function, - str: str_function, - tuple: tuple_function, - type(NotImplemented): builtin_constant_function, - type(Ellipsis): builtin_constant_function} - -for t in integer_types: - latex_table[t] = str +latex_table = { + type(None): None_function, + bool: bool_function, + dict: dict_function, + float: float_function, + int: str, + list: list_function, + str: str_function, + tuple: tuple_function, + type(NotImplemented): builtin_constant_function, + type(Ellipsis): builtin_constant_function +} class LatexExpr(str): @@ -2341,7 +2339,7 @@ def coeff_repr(c): return c._latex_coeff_repr() except AttributeError: pass - if isinstance(c, integer_types + (float,)): + if isinstance(c, (int, float)): return str(c) s = latex(c) if s.find("+") != -1 or s.find("-") != -1: diff --git a/src/sage/misc/lazy_import.pyx b/src/sage/misc/lazy_import.pyx index 0fb97f04858..16f04bfe8d1 100644 --- a/src/sage/misc/lazy_import.pyx +++ b/src/sage/misc/lazy_import.pyx @@ -63,7 +63,7 @@ cdef extern from *: int likely(int) nogil # Defined by Cython import os -from six.moves import cPickle as pickle +import pickle import inspect from . import sageinspect @@ -380,9 +380,8 @@ cdef class LazyImport(object): """ TESTS:: - sage: import six sage: lazy_import('sage.all', 'ZZ'); lazy_ZZ = ZZ - sage: six.text_type(lazy_ZZ) + sage: str(lazy_ZZ) u'Integer Ring' """ return unicode(self.get_object()) diff --git a/src/sage/misc/lazy_list.pyx b/src/sage/misc/lazy_list.pyx index 539c2bd7135..b1698ddd4bc 100644 --- a/src/sage/misc/lazy_list.pyx +++ b/src/sage/misc/lazy_list.pyx @@ -763,7 +763,6 @@ cdef class lazy_list_generic(object): We check commutation:: - sage: from six.moves import range sage: l = lazy_list(iter(range(10000))) sage: l1 = l[::2][:3001] sage: l2 = l[:6002][::2] diff --git a/src/sage/misc/mathml.py b/src/sage/misc/mathml.py index d584a481900..e2d959bfe55 100644 --- a/src/sage/misc/mathml.py +++ b/src/sage/misc/mathml.py @@ -23,7 +23,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six import iteritems, integer_types def list_function(x): @@ -44,13 +43,15 @@ def str_function(x): # One can add to the latex_table in order to install latexing # functionality for other types. -mathml_table = {list: list_function, - tuple:tuple_function, - bool:bool_function, - str: str_function, - float:str} -for x in integer_types: - mathml_table[x] = str +mathml_table = { + list: list_function, + tuple: tuple_function, + bool: bool_function, + str: str_function, + float: str, + int: str +} + class MathML(str): def __repr__(self): @@ -64,7 +65,7 @@ def mathml(x): try: return MathML(x._mathml_()) except (AttributeError, TypeError): - for k, f in iteritems(mathml_table): + for k, f in mathml_table.items(): if isinstance(x, k): return MathML(f(x)) diff --git a/src/sage/misc/messaging.py b/src/sage/misc/messaging.py index 05600b9f0a1..1664070efce 100644 --- a/src/sage/misc/messaging.py +++ b/src/sage/misc/messaging.py @@ -12,6 +12,10 @@ - Martin Albrecht (2012) - initial implementation """ from __future__ import absolute_import + +import http.client as httplib +from urllib.parse import urlencode + pushover_defaults = {"token": "Eql67F14ohOZJ0AtEBJJU7FiLAk8wK"} @@ -69,10 +73,6 @@ def pushover(message, **kwds): You may want to populate ``sage.misc.messaging.pushover_defaults`` with default values such as the default user in ``$HOME/.sage/init.sage``. """ - # import compatible with py2 and py3 - from six.moves import http_client as httplib - from six.moves.urllib.parse import urlencode - request = {"message": message} request.update(pushover_defaults) request.update(kwds) diff --git a/src/sage/misc/misc.py b/src/sage/misc/misc.py index c0100a2d1af..b3c538d7c88 100644 --- a/src/sage/misc/misc.py +++ b/src/sage/misc/misc.py @@ -38,8 +38,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range -from six import integer_types import os import sys @@ -778,7 +776,7 @@ def coeff_repr(c, is_latex=False): return c._coeff_repr() except AttributeError: pass - if isinstance(c, integer_types + (float,)): + if isinstance(c, (int, float)): return str(c) if is_latex and hasattr(c, '_latex_'): s = c._latex_() diff --git a/src/sage/misc/mrange.py b/src/sage/misc/mrange.py index fd513ff09cd..84500d961a1 100644 --- a/src/sage/misc/mrange.py +++ b/src/sage/misc/mrange.py @@ -64,7 +64,6 @@ def _is_finite(L, fallback=True): True sage: _is_finite([]) True - sage: from six.moves import range sage: _is_finite(range(10^8)) True sage: from itertools import product @@ -208,8 +207,7 @@ def mrange_iter(iter_list, typ=list): sage: mrange_iter([range(5),range(3),range(0)]) [] - sage: from six.moves import range - sage: mrange_iter([range(5),range(3),range(-2)]) + sage: mrange_iter([range(5), range(3), range(-2)]) [] This example is not empty, and should not be. See :trac:`6561`. diff --git a/src/sage/misc/nested_class.pyx b/src/sage/misc/nested_class.pyx index b164a049108..3054461a9c7 100644 --- a/src/sage/misc/nested_class.pyx +++ b/src/sage/misc/nested_class.pyx @@ -103,7 +103,6 @@ The name for ``"A1.A2"`` could potentially be set to ``"B1.A2"``. But that will import sys cdef dict sys_modules = sys.modules -from six import class_types __all__ = ['modify_for_nested_pickle', 'nested_pickle', 'NestedClassMetaclass', 'MainClass' @@ -214,7 +213,7 @@ cpdef modify_for_nested_pickle(cls, str name_prefix, module, first_run=True): setattr(module, dotted_name, v) modify_for_nested_pickle(v, name_prefix, module, False) v.__name__ = dotted_name - elif isinstance(v, class_types): + elif isinstance(v, type): v_name = v.__name__ if v_name == name and v.__module__ == mod_name and getattr(module, v_name, None) is not v: # OK, probably this is a nested class. @@ -224,7 +223,7 @@ cpdef modify_for_nested_pickle(cls, str name_prefix, module, first_run=True): v.__name__ = dotted_name else: for (name, v) in cls.__dict__.items(): - if isinstance(v, class_types): + if isinstance(v, type): v_name = v.__name__ if v_name == cls_name + name and v.__module__ == mod_name: # OK, probably this is a nested class. diff --git a/src/sage/misc/nested_class_test.py b/src/sage/misc/nested_class_test.py index 9c714f13889..27273ad5c69 100644 --- a/src/sage/misc/nested_class_test.py +++ b/src/sage/misc/nested_class_test.py @@ -45,7 +45,6 @@ # http://www.gnu.org/licenses/ #****************************************************************************** from __future__ import print_function, absolute_import -from six import add_metaclass __all__ = [] # Don't document any parents @@ -71,8 +70,7 @@ class Element(ElementWrapper): pass -@add_metaclass(NestedClassMetaclass) -class TestParent2(Parent): +class TestParent2(Parent, metaclass=NestedClassMetaclass): def __init__(self): """ EXAMPLES:: @@ -105,8 +103,7 @@ class Element(ElementWrapper): pass -@add_metaclass(ClasscallMetaclass) -class TestParent4(Parent): +class TestParent4(Parent, metaclass=ClasscallMetaclass): def __init__(self): """ EXAMPLES:: @@ -193,8 +190,7 @@ class C(object): C = ALB.C -@add_metaclass(NestedClassMetaclass) -class ABBMeta(object): +class ABBMeta(metaclass=NestedClassMetaclass): class B(object): """ B interne @@ -202,13 +198,11 @@ class B(object): pass -@add_metaclass(NestedClassMetaclass) -class ABLMeta(object): +class ABLMeta(metaclass=NestedClassMetaclass): B = B -@add_metaclass(NestedClassMetaclass) -class ALBMeta(object): +class ALBMeta(metaclass=NestedClassMetaclass): """ There is a nested class just below which is properly sphinxed. """ diff --git a/src/sage/misc/persist.pyx b/src/sage/misc/persist.pyx index 828f15bafaf..71e209c383b 100644 --- a/src/sage/misc/persist.pyx +++ b/src/sage/misc/persist.pyx @@ -29,6 +29,7 @@ save member functions and commands. import io import os +import pickle import sys from textwrap import dedent @@ -38,8 +39,6 @@ from textwrap import dedent import zlib; comp = zlib import bz2; comp_other = bz2 -from six.moves import cPickle as pickle - from .misc import SAGE_DB from .sage_unittest import TestSuite diff --git a/src/sage/misc/prandom.py b/src/sage/misc/prandom.py index 9812cf82a32..b473d79aa3a 100644 --- a/src/sage/misc/prandom.py +++ b/src/sage/misc/prandom.py @@ -173,7 +173,6 @@ def sample(population, k): sage: sample(["Here", "I", "come", "to", "save", "the", "day"], 3) ['Here', 'to', 'day'] - sage: from six.moves import range sage: sample(range(2^30), 7) [357009070, 558990255, 196187132, 752551188, 85926697, 954621491, 624802848] """ diff --git a/src/sage/misc/random_testing.py b/src/sage/misc/random_testing.py index f8c26317a3b..9126d93edc8 100644 --- a/src/sage/misc/random_testing.py +++ b/src/sage/misc/random_testing.py @@ -9,7 +9,6 @@ decorator to help write random testers that meet these goals. """ from __future__ import print_function, absolute_import -from six.moves import range from functools import wraps diff --git a/src/sage/misc/remote_file.py b/src/sage/misc/remote_file.py index ef2d6e91725..5d99a2e8670 100644 --- a/src/sage/misc/remote_file.py +++ b/src/sage/misc/remote_file.py @@ -3,6 +3,8 @@ from __future__ import absolute_import import os +import sys +from urllib.request import Request, urlopen def get_remote_file(filename, verbose=True): @@ -38,8 +40,7 @@ def get_remote_file(filename, verbose=True): # so do not import it in the module scope. # import compatible with py2 and py3 - from six.moves.urllib.request import Request, urlopen - req = Request(filename, headers={"User-Agent": "sage-doctest"}) + req = Request(filename, headers={"User-Agent":"sage-doctest"}) if verbose: print("Loading started") diff --git a/src/sage/misc/rest_index_of_methods.py b/src/sage/misc/rest_index_of_methods.py index fbac3d0161d..4547316eb1f 100644 --- a/src/sage/misc/rest_index_of_methods.py +++ b/src/sage/misc/rest_index_of_methods.py @@ -11,8 +11,6 @@ import inspect -from six import PY2 - from sage.misc.sageinspect import _extract_embedded_position @@ -175,7 +173,7 @@ def gen_rest_table_index(obj, names=None, sort=True, only_local_functions=True): link = ":meth:`~{module}.{cls}.{func}`".format( module=e.im_class.__module__, cls=e.im_class.__name__, func=fname(e)) - elif not PY2 and inspect.isfunction(e) and inspect.isclass(obj): + elif inspect.isfunction(e) and inspect.isclass(obj): link = ":meth:`~{module}.{cls}.{func}`".format( module=obj.__module__, cls=obj.__name__, func=fname(e)) elif inspect.isfunction(e): diff --git a/src/sage/misc/sage_eval.py b/src/sage/misc/sage_eval.py index 14020fc56e0..63fa92b3f58 100644 --- a/src/sage/misc/sage_eval.py +++ b/src/sage/misc/sage_eval.py @@ -11,7 +11,6 @@ #***************************************************************************** from __future__ import absolute_import, division -import six from copy import copy import sage.repl.preparse as preparser @@ -181,7 +180,7 @@ def sage_eval(source, locals=None, cmds='', preparse=True): locals = copy(source[2]) source = source[1] - if not isinstance(source, six.string_types): + if not isinstance(source, str): raise TypeError("source must be a string.") if locals is None: diff --git a/src/sage/misc/sage_input.py b/src/sage/misc/sage_input.py index b12d3cc9d24..80ddd888269 100644 --- a/src/sage/misc/sage_input.py +++ b/src/sage/misc/sage_input.py @@ -174,9 +174,6 @@ from __future__ import print_function, absolute_import -from six import iteritems, integer_types, string_types - - def sage_input(x, preparse=True, verify=False, allow_locals=False): r""" Return a sequence of commands that can be used to rebuild the object ``x``. @@ -481,8 +478,7 @@ def __call__(self, x, coerced=False): if isinstance(x, bool): return SIE_literal_stringrep(self, str(x)) - if (isinstance(x, int) or - (isinstance(x, integer_types) and not isinstance(int(x), int))): + if isinstance(x, int): # For longs that don't fit in an int, we just use the int # code; it will get extended to long automatically. if self._preparse is True: @@ -492,28 +488,11 @@ def __call__(self, x, coerced=False): return SIE_literal_stringrep(self, str(x) + 'r') elif self._preparse is False: return self.int(x) - else: - tyname = 'int' if isinstance(x, int) else 'long' - if x < 0: - return -self.name(tyname)(self.int(-x)) - else: - return self.name(tyname)(self.int(x)) - - if isinstance(x, integer_types): - # This must be a long that does fit in an int, so we need either - # long(x) or an 'L' suffix. - # With the current preparser, 1Lr does not work. - # 1rL does work; but that's just ugly, so I don't use it. - if self._preparse is False: - if x < 0: - return -SIE_literal_stringrep(self, str(-x) + 'L') - else: - return SIE_literal_stringrep(self, str(x) + 'L') else: if x < 0: - return -self.name('long')(self.int(-x)) + return -self.name('int')(self.int(-x)) else: - return self.name('long')(self.int(x)) + return self.name('int')(self.int(x)) if isinstance(x, float): # floats could often have prettier output, @@ -536,7 +515,7 @@ def __call__(self, x, coerced=False): return self.name('float')(self.int(ZZ(rrx))) return self.name('float')(RR(x)) - if isinstance(x, string_types): + if isinstance(x, str): return SIE_literal_stringrep(self, repr(x)) if isinstance(x, tuple): @@ -1912,7 +1891,7 @@ def __repr__(self): func = repr(self._sie_func) args = [repr(arg) for arg in self._sie_args] kwargs = sorted(k + '=' + repr(v) - for k, v in iteritems(self._sie_kwargs)) + for k, v in self._sie_kwargs.items()) all_args = ', '.join(args + kwargs) return "{call: %s(%s)}" % (func, all_args) @@ -1953,7 +1932,7 @@ def _sie_format(self, sif): func = sif.format(self._sie_func, _prec_attribute) args = [sif.format(arg, 0) for arg in self._sie_args] kwargs = sorted(k + '=' + sif.format(v, 0) - for k, v in iteritems(self._sie_kwargs)) + for k, v in self._sie_kwargs.items()) all_args = ', '.join(args + kwargs) return ('%s(%s)' % (func, all_args), _prec_funcall) @@ -3637,5 +3616,5 @@ def __repr__(self): locals = self[2] locals_text = ''.join(' %s: %r\n' % (k, v) - for k, v in iteritems(locals)) + for k, v in locals.items()) return 'LOCALS:\n' + locals_text + self[0] + self[1] diff --git a/src/sage/misc/sage_ostools.pyx b/src/sage/misc/sage_ostools.pyx index d9b6a50a16b..75b0d7a8a0d 100644 --- a/src/sage/misc/sage_ostools.pyx +++ b/src/sage/misc/sage_ostools.pyx @@ -183,12 +183,8 @@ cdef class redirection: TESTS:: - sage: from six.moves import cStringIO as StringIO - sage: redirection(sys.stdout, StringIO()) # py2 - Traceback (most recent call last): - ... - TypeError: <...> must be a Python file or an integer - sage: redirection(sys.stdout, StringIO()) # py3 + sage: import io + sage: redirection(sys.stdout, io.StringIO()) Traceback (most recent call last): ... io.UnsupportedOperation: fileno diff --git a/src/sage/misc/sage_timeit.py b/src/sage/misc/sage_timeit.py index 9ff405e3127..13035cc5134 100644 --- a/src/sage/misc/sage_timeit.py +++ b/src/sage/misc/sage_timeit.py @@ -17,8 +17,6 @@ -- William Stein, based on code by Fernando Perez included in IPython """ -import six - class SageTimeitResult(object): r""" @@ -228,12 +226,8 @@ def sage_timeit(stmt, globals_dict=None, preparse=None, number=0, repeat=3, prec # but is there a better way to achieve that the code stmt has access # to the shell namespace? - if six.PY2: - src = timeit_.template % {'stmt': timeit_.reindent(stmt, 8), - 'setup': "pass", 'init': ''} - else: - src = timeit_.template.format(stmt=timeit_.reindent(stmt, 8), - setup="pass", init='') + src = timeit_.template.format(stmt=timeit_.reindent(stmt, 8), + setup="pass", init='') code = compile(src, "", "exec") ns = {} if not globals_dict: diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py index 85ee7644fac..61d7a4c812d 100644 --- a/src/sage/misc/sagedoc.py +++ b/src/sage/misc/sagedoc.py @@ -40,8 +40,8 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -from __future__ import print_function, absolute_import -from six import string_types, text_type +from __future__ import print_function +from __future__ import absolute_import import os import re @@ -682,7 +682,7 @@ def format(s, embedded=False): sage: format(r'inline code ``\\\\.``') 'inline code "\\\\\\\\."\n' """ - if not isinstance(s, string_types): + if not isinstance(s, str): raise TypeError("s must be a string") # Leading empty lines must be removed, since we search for directives @@ -766,7 +766,7 @@ def format_src(s): sage: format_src('<<>>')[5:15] 'Sq(*nums):' """ - if not isinstance(s, string_types): + if not isinstance(s, str): raise TypeError("s must be a string") docs = set([]) import sage.all @@ -953,7 +953,7 @@ def _search_src_or_doc(what, string, extra1='', extra2='', extra3='', else: # Pass through the IPython pager in a mime bundle from IPython.core.page import page - if not isinstance(text_results, text_type): + if not isinstance(text_results, str): text_results = text_results.decode('utf-8', 'replace') page({ diff --git a/src/sage/misc/sageinspect.py b/src/sage/misc/sageinspect.py index 15e3ceecb56..6251ec5742c 100644 --- a/src/sage/misc/sageinspect.py +++ b/src/sage/misc/sageinspect.py @@ -114,10 +114,6 @@ def foo(unsigned int x=1, a=')"', b={not (2+1==3):'bar'}, *args, **kwds): return """ from __future__ import print_function, absolute_import -import six -from six import iteritems, string_types, class_types -from six.moves import range - import ast import inspect import functools @@ -146,14 +142,8 @@ def loadable_module_extension(): sage: sage.structure.sage_object.__file__.endswith(loadable_module_extension()) True """ - if six.PY2: - if sys.platform == 'cygwin': - return os.path.extsep + 'dll' - else: - return os.path.extsep + 'so' - else: - # Return the full platform-specific extension module suffix - return import_machinery.EXTENSION_SUFFIXES[0] + # Return the full platform-specific extension module suffix + return import_machinery.EXTENSION_SUFFIXES[0] def isclassinstance(obj): @@ -377,12 +367,8 @@ def _getblock(lines): """ blockfinder = BlockFinder() iter_lines = iter(lines) - if six.PY2: - tokenizer = tokenize.generate_tokens - readline = lambda: next(iter_lines) - else: - tokenizer = tokenize.tokenize - readline = lambda: next(iter_lines).encode('utf-8') + tokenizer = tokenize.tokenize + readline = lambda: next(iter_lines).encode('utf-8') try: for tok in tokenizer(readline): blockfinder.tokeneater(*tok) @@ -413,7 +399,7 @@ def _extract_source(lines, lineno): raise ValueError("Line numbering starts at 1! (tried to extract line {})".format(lineno)) lineno -= 1 - if isinstance(lines, string_types): + if isinstance(lines, str): lines = lines.splitlines(True) # true keeps the '\n' if len(lines): # Fixes an issue with getblock @@ -475,73 +461,64 @@ def visit_Name(self, node): sage: [type(vis(n)) for n in ['foo', 'bar']] # py3 [, ] """ - if six.PY2: - what = node.id - if what == 'None': - return None - elif what == 'True': - return True - elif what == 'False': - return False return node.id - if six.PY3: - def visit_NameConstant(self, node): - """ - Visit a Python AST :class:`ast.NameConstant` node. + def visit_NameConstant(self, node): + """ + Visit a Python AST :class:`ast.NameConstant` node. - This is an optimization added in Python 3.4 for the special cases - of True, False, and None. + This is an optimization added in Python 3.4 for the special cases + of True, False, and None. - INPUT: + INPUT: - - ``node`` - the node instance to visit + - ``node`` - the node instance to visit - OUTPUT: + OUTPUT: - - None, True, False. + - None, True, False. - EXAMPLES:: + EXAMPLES:: - sage: import ast, sage.misc.sageinspect as sms # py3 - sage: visitor = sms.SageArgSpecVisitor() # py3 - sage: vis = lambda x: visitor.visit_NameConstant(ast.parse(x).body[0].value) # py3 - sage: [vis(n) for n in ['True', 'False', 'None']] # py3 - [True, False, None] - sage: [type(vis(n)) for n in ['True', 'False', 'None']] # py3 - [, , ] - """ + sage: import ast, sage.misc.sageinspect as sms # py3 + sage: visitor = sms.SageArgSpecVisitor() # py3 + sage: vis = lambda x: visitor.visit_NameConstant(ast.parse(x).body[0].value) # py3 + sage: [vis(n) for n in ['True', 'False', 'None']] # py3 + [True, False, None] + sage: [type(vis(n)) for n in ['True', 'False', 'None']] # py3 + [, , ] + """ - return node.value + return node.value - def visit_arg(self, node): - r""" - Visit a Python AST :class:`ast.arg` node. + def visit_arg(self, node): + r""" + Visit a Python AST :class:`ast.arg` node. - This node type is only on Python 3, where function arguments are - more complex than just an identifier (e.g. they may also include - annotations). + This node type is only on Python 3, where function arguments are + more complex than just an identifier (e.g. they may also include + annotations). - For now we simply return the argument identifier as a string. + For now we simply return the argument identifier as a string. - INPUT: + INPUT: - - ``node`` -- the node instance to visit + - ``node`` -- the node instance to visit - OUTPUT: + OUTPUT: - the argument name + the argument name - EXAMPLES:: + EXAMPLES:: - sage: import ast, sage.misc.sageinspect as sms # py3 - sage: s = "def f(a, b=2, c={'a': [4, 5.5, False]}, d=(None, True)):\n return" # py3 - sage: visitor = sms.SageArgSpecVisitor() # py3 - sage: args = ast.parse(s).body[0].args.args # py3 - sage: [visitor.visit_arg(n) for n in args] # py3 - ['a', 'b', 'c', 'd'] - """ - return node.arg + sage: import ast, sage.misc.sageinspect as sms # py3 + sage: s = "def f(a, b=2, c={'a': [4, 5.5, False]}, d=(None, True)):\n return" # py3 + sage: visitor = sms.SageArgSpecVisitor() # py3 + sage: args = ast.parse(s).body[0].args.args # py3 + sage: [visitor.visit_arg(n) for n in args] # py3 + ['a', 'b', 'c', 'd'] + """ + return node.arg def visit_Num(self, node): """ @@ -1104,13 +1081,9 @@ def _sage_getargspec_from_ast(source): args = [visitor.visit(a) for a in ast_args.args] defaults = [visitor.visit(d) for d in ast_args.defaults] - if six.PY2: - vararg = ast_args.vararg - kwarg = ast_args.kwarg - else: - # vararg and kwarg may be None - vararg = getattr(ast_args.vararg, 'arg', None) - kwarg = getattr(ast_args.kwarg, 'arg', None) + # vararg and kwarg may be None + vararg = getattr(ast_args.vararg, 'arg', None) + kwarg = getattr(ast_args.kwarg, 'arg', None) return inspect.ArgSpec(args, vararg, kwarg, tuple(defaults) if defaults else None) @@ -1921,7 +1894,7 @@ def _sage_getdoc_unformatted(obj): # Check if the __doc__ attribute was actually a string, and # not a 'getset_descriptor' or similar. - if isinstance(r, string_types): + if isinstance(r, str): return r else: # Not a string of any kind @@ -1998,7 +1971,7 @@ def sage_getdoc_original(obj): """ # typ is the type corresponding to obj, which is obj itself if # that was a type or old-style class - if isinstance(obj, class_types): + if isinstance(obj, type): typ = obj else: typ = type(obj) @@ -2510,7 +2483,7 @@ def sage_getvariablename(self, omit_underscore_names=True): """ result = [] for frame in inspect.stack(): - for name, obj in iteritems(frame[0].f_globals): + for name, obj in frame[0].f_globals.items(): if obj is self: result.append(name) if len(result) == 1: diff --git a/src/sage/misc/session.pyx b/src/sage/misc/session.pyx index 9e600373a49..2036e7f3db5 100644 --- a/src/sage/misc/session.pyx +++ b/src/sage/misc/session.pyx @@ -59,11 +59,11 @@ AUTHOR: ############################################################################# # Standard python imports +import builtins import os import types # We want the caller's locals, but locals() is emulated in Cython -from six.moves import builtins cdef caller_locals = builtins.locals # Sage imports diff --git a/src/sage/misc/six.py b/src/sage/misc/six.py deleted file mode 100644 index 30c34ef9074..00000000000 --- a/src/sage/misc/six.py +++ /dev/null @@ -1,100 +0,0 @@ -# -*- encoding: utf-8 -*- -""" -Python 2 and 3 Compatibility - -TESTS: - -Test the functionality of ``six.with_metaclass`` and various issues -which came up with it. Sage used to have a custom version of -``with_metaclass``, but this is now fixed upstream. :: - - sage: from six import with_metaclass - sage: class Meta(type): pass - sage: class X(with_metaclass(Meta)): pass - sage: type(X) is Meta - True - sage: issubclass(X, object) - True - sage: class Base(object): pass - sage: class X(with_metaclass(Meta, Base)): pass - sage: type(X) is Meta - True - sage: issubclass(X, Base) - True - sage: class Base2(object): pass - sage: class X(with_metaclass(Meta, Base, Base2)): pass - sage: type(X) is Meta - True - sage: issubclass(X, Base) - True - sage: issubclass(X, Base2) - True - sage: X.__mro__ == (X, Base, Base2, object) or X.__mro__ - True - -Check that :trac:`18503` is fixed, i.e. that with_metaclass -works with cdef'ed metaclasses:: - - sage: from sage.misc.classcall_metaclass import ClasscallMetaclass - sage: class X(with_metaclass(ClasscallMetaclass)): pass - sage: type(X) is ClasscallMetaclass - True - sage: X.__mro__ == (X, object) or X.__mro__ - True - -Check a fix for :trac:`16074`:: - - sage: from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass - sage: from sage.modules.with_basis.morphism import ModuleMorphismByLinearity - sage: from sage.structure.unique_representation import UniqueRepresentation - sage: class ExteriorAlgebraDifferential(with_metaclass( - ....: InheritComparisonClasscallMetaclass, - ....: ModuleMorphismByLinearity, UniqueRepresentation - ....: )): - ....: pass -""" - -#***************************************************************************** -# Copyright (C) 2017 Jeroen Demeyer -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License 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/ -#***************************************************************************** - -from __future__ import absolute_import - -from six import * - - -def u(x): - r""" - Convert `x` to unicode, assuming UTF-8 encoding. - - Python2 behaviour: - - If input is unicode, returns the input. - - If input is str (assumed to be utf-8 encoded), convert to unicode. - - Python3 behaviour: - - If input is str, returns the input. - - If input is bytes (assumed to be utf-8 encoded), convert to unicode. - - EXAMPLES:: - - sage: from sage.misc.six import u - sage: u("500 €") - u'500 \u20ac' - sage: u(u"500 \u20ac") - u'500 \u20ac' - """ - if isinstance(x, text_type): # py2 unicode and py3 str - return x - if isinstance(x, bytes): - return x.decode("utf-8") - raise TypeError('input has no conversion to unicode') diff --git a/src/sage/misc/sphinxify.py b/src/sage/misc/sphinxify.py index b9e630f4d95..ab0de0a7b66 100644 --- a/src/sage/misc/sphinxify.py +++ b/src/sage/misc/sphinxify.py @@ -22,9 +22,11 @@ # **************************************************************************** from __future__ import absolute_import, print_function +import builtins import os import re import shutil +import sys from tempfile import mkdtemp from sphinx.application import Sphinx @@ -114,7 +116,6 @@ def sphinxify(docstring, format='html'): doctreedir = os.path.join(srcdir, 'doctrees') confoverrides = {'html_context': {}, 'master_doc': 'docstring'} - import sys old_sys_path = list(sys.path) # Sphinx modifies sys.path # Sphinx constructor: Sphinx(srcdir, confdir, outdir, doctreedir, # buildername, confoverrides, status, warning, freshenv). @@ -124,7 +125,6 @@ def sphinxify(docstring, format='html'): sys.path = old_sys_path # We need to remove "_" from __builtin__ that the gettext module installs - from six.moves import builtins builtins.__dict__.pop('_', None) if os.path.exists(output_name): diff --git a/src/sage/misc/superseded.py b/src/sage/misc/superseded.py index 2242de9b530..238c2013b24 100644 --- a/src/sage/misc/superseded.py +++ b/src/sage/misc/superseded.py @@ -23,7 +23,6 @@ # https://www.gnu.org/licenses/ ######################################################################## from __future__ import print_function, absolute_import -from six import iteritems from warnings import warn import inspect @@ -379,7 +378,7 @@ def __name__(self): """ # first look through variables in stack frames for frame in inspect.stack(): - for name, obj in iteritems(frame[0].f_globals): + for name, obj in frame[0].f_globals.items(): if obj is self: return name # then search object that contains self as method @@ -395,7 +394,7 @@ def is_class(gc_ref): for ref in gc.get_referrers(search_for): if is_class(ref) and ref is not self.__dict__: ref_copy = copy.copy(ref) - for key, val in iteritems(ref_copy): + for key, val in ref_copy.items(): if val is search_for: return key raise AttributeError("The name of this deprecated function can not be determined") diff --git a/src/sage/misc/table.py b/src/sage/misc/table.py index 18fdc1c1be7..cdb7d23f865 100644 --- a/src/sage/misc/table.py +++ b/src/sage/misc/table.py @@ -10,8 +10,8 @@ - John H. Palmieri (2012-11) """ from __future__ import absolute_import -from six.moves import cStringIO as StringIO -from six.moves import range, zip + +from io import StringIO from sage.structure.sage_object import SageObject from sage.misc.cachefunc import cached_method @@ -774,7 +774,7 @@ def _html_table_row(self, file, row, header=False): EXAMPLES:: sage: T = table([['a', 'bb', 'ccccc'], [10, -12, 0], [1, 2, 3]]) - sage: from six import StringIO + sage: from io import StringIO sage: s = StringIO() sage: T._html_table_row(s, ['a', 2, '$x$']) sage: print(s.getvalue()) diff --git a/src/sage/misc/temporary_file.py b/src/sage/misc/temporary_file.py index f4e5b721ec0..91bd88642b5 100644 --- a/src/sage/misc/temporary_file.py +++ b/src/sage/misc/temporary_file.py @@ -25,7 +25,6 @@ import os import tempfile import atexit -import six def delete_tmpfiles(): @@ -343,7 +342,7 @@ def __init__(self, target_filename, append=False, mode=0o666, # 'binary' mode is the default on Python 2, whereas 'text' mode is the # default on Python 3--this reflects consistent handling of the default # str type on the two platforms - self.binary = six.PY2 if binary is None else binary + self.binary = False if binary is None else binary self.kwargs = kwargs def __enter__(self): diff --git a/src/sage/misc/test_class_pickling.py b/src/sage/misc/test_class_pickling.py index ba9c1e625cc..e03c911c054 100644 --- a/src/sage/misc/test_class_pickling.py +++ b/src/sage/misc/test_class_pickling.py @@ -1,5 +1,6 @@ from __future__ import absolute_import -from six.moves import copyreg + +import copyreg class bar: @@ -49,10 +50,10 @@ class Metaclass(type): sage: from sage.misc.test_class_pickling import metaclass, bar sage: c = metaclass("foo", (bar, object)) constructing class - sage: from six.moves import cPickle - sage: s = cPickle.dumps(c) + sage: import pickle + sage: s = pickle.dumps(c) reducing a class - sage: c2 = cPickle.loads(s) + sage: c2 = pickle.loads(s) constructing class sage: c == c2 calling __eq__ defined in Metaclass diff --git a/src/sage/modular/abvar/constructor.py b/src/sage/modular/abvar/constructor.py index 4255061b6c0..df2518d34dc 100644 --- a/src/sage/modular/abvar/constructor.py +++ b/src/sage/modular/abvar/constructor.py @@ -11,7 +11,6 @@ # http://www.gnu.org/licenses/ # ########################################################################### from __future__ import absolute_import -from six import integer_types import weakref @@ -172,7 +171,7 @@ def AbelianVariety(X): ... TypeError: X must be an integer, string, newform, modsym space, congruence subgroup or tuple of congruence subgroups """ - if isinstance(X, integer_types + (Integer,)): + if isinstance(X, (int, Integer)): X = Gamma0(X) if is_CongruenceSubgroup(X): X = X.modular_symbols().cuspidal_submodule() diff --git a/src/sage/modular/arithgroup/arithgroup_generic.py b/src/sage/modular/arithgroup/arithgroup_generic.py index f2d9d51d396..7b075efb54b 100644 --- a/src/sage/modular/arithgroup/arithgroup_generic.py +++ b/src/sage/modular/arithgroup/arithgroup_generic.py @@ -13,7 +13,6 @@ # ################################################################################ from __future__ import absolute_import -from six.moves import range from sage.groups.old import Group from sage.categories.groups import Groups diff --git a/src/sage/modular/arithgroup/arithgroup_perm.py b/src/sage/modular/arithgroup/arithgroup_perm.py index 65593272951..4620c7b3c0e 100644 --- a/src/sage/modular/arithgroup/arithgroup_perm.py +++ b/src/sage/modular/arithgroup/arithgroup_perm.py @@ -98,7 +98,6 @@ # ################################################################################ from __future__ import print_function, absolute_import -from six.moves import range from .all import SL2Z from .arithgroup_generic import ArithmeticSubgroup diff --git a/src/sage/modular/arithgroup/congroup_gamma.py b/src/sage/modular/arithgroup/congroup_gamma.py index 232005ebf2a..bc7a13c2f65 100644 --- a/src/sage/modular/arithgroup/congroup_gamma.py +++ b/src/sage/modular/arithgroup/congroup_gamma.py @@ -10,7 +10,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from .congroup_generic import CongruenceSubgroup from sage.misc.all import prod diff --git a/src/sage/modular/arithgroup/congroup_gamma0.py b/src/sage/modular/arithgroup/congroup_gamma0.py index ebd881bc556..2c50834fe20 100644 --- a/src/sage/modular/arithgroup/congroup_gamma0.py +++ b/src/sage/modular/arithgroup/congroup_gamma0.py @@ -8,9 +8,8 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# https://www.gnu.org/licenses/ -# **************************************************************************** -from six.moves import range +# http://www.gnu.org/licenses/ +#***************************************************************************** from .congroup_gammaH import GammaH_class from .congroup_gamma1 import is_Gamma1 diff --git a/src/sage/modular/arithgroup/congroup_gammaH.py b/src/sage/modular/arithgroup/congroup_gammaH.py index aa91f91db92..f989b8e5b95 100644 --- a/src/sage/modular/arithgroup/congroup_gammaH.py +++ b/src/sage/modular/arithgroup/congroup_gammaH.py @@ -20,7 +20,6 @@ # http://www.gnu.org/licenses/ # ################################################################################ -from six.moves import range from sage.arith.all import euler_phi, lcm, gcd, divisors, get_inverse_mod, get_gcd, factor, xgcd from sage.modular.modsym.p1list import lift_to_sl2z diff --git a/src/sage/modular/arithgroup/tests.py b/src/sage/modular/arithgroup/tests.py index 8321a6f3b00..51c94f86df9 100644 --- a/src/sage/modular/arithgroup/tests.py +++ b/src/sage/modular/arithgroup/tests.py @@ -13,7 +13,6 @@ # ################################################################################ from __future__ import print_function, absolute_import -from six.moves import range from .arithgroup_perm import ArithmeticSubgroup_Permutation, EvenArithmeticSubgroup_Permutation, OddArithmeticSubgroup_Permutation from sage.modular.arithgroup.all import Gamma, Gamma0, Gamma1, GammaH diff --git a/src/sage/modular/btquotients/pautomorphicform.py b/src/sage/modular/btquotients/pautomorphicform.py index cbaca6a0114..95c797282e8 100644 --- a/src/sage/modular/btquotients/pautomorphicform.py +++ b/src/sage/modular/btquotients/pautomorphicform.py @@ -41,8 +41,6 @@ """ from __future__ import print_function, division -from six.moves import zip - from sage.modular.btquotients.btquotient import DoubleCosetReduction from sage.structure.unique_representation import UniqueRepresentation from sage.structure.richcmp import op_EQ, op_NE diff --git a/src/sage/modular/cusps.py b/src/sage/modular/cusps.py index 47c3f8286d8..9727adf6d7b 100644 --- a/src/sage/modular/cusps.py +++ b/src/sage/modular/cusps.py @@ -28,7 +28,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six import integer_types from sage.rings.all import Rational, Integer, ZZ, QQ from sage.rings.infinity import Infinity, InfinityRing @@ -169,7 +168,7 @@ def __init__(self, a, b=None, parent=None, check=True): elif isinstance(a, Cusp): self.__a = a.__a self.__b = a.__b - elif isinstance(a, integer_types): + elif isinstance(a, int): self.__a = ZZ(a) self.__b = ZZ.one() elif isinstance(a, (tuple, list)): @@ -220,7 +219,7 @@ def __init__(self, a, b=None, parent=None, check=True): self.__a = ZZ.one() self.__b = ZZ.zero() return - elif isinstance(a, integer_types): + elif isinstance(a, int): r = ZZ(a) / b elif isinstance(a, (tuple, list)): if len(a) != 2: diff --git a/src/sage/modular/cusps_nf.py b/src/sage/modular/cusps_nf.py index da0cb670cc0..cad947a62ec 100644 --- a/src/sage/modular/cusps_nf.py +++ b/src/sage/modular/cusps_nf.py @@ -70,7 +70,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # https://www.gnu.org/licenses/ # **************************************************************************** -from six import integer_types from sage.structure.parent import Parent from sage.structure.element import Element, is_InfinityElement @@ -454,7 +453,7 @@ def __init__(self, number_field, a, b=None, parent=None, lreps=None): elif is_InfinityElement(a): self.__a = R.one() self.__b = R.zero() - elif isinstance(a, integer_types): + elif isinstance(a, int): self.__a = R(a) self.__b = R.one() elif isinstance(a, (tuple, list)): @@ -510,7 +509,7 @@ def __init__(self, number_field, a, b=None, parent=None, lreps=None): self.__a = R.zero() self.__b = R.one() return - if (b in R or isinstance(b, integer_types)) and (a in R or isinstance(a, integer_types)): + if (b in R or isinstance(b, int)) and (a in R or isinstance(a, int)): self.__a = R(a) self.__b = R(b) else: @@ -526,7 +525,7 @@ def __init__(self, number_field, a, b=None, parent=None, lreps=None): self.__b = R.zero() return r = a.__a / (a.__b * b) - elif isinstance(a, integer_types): + elif isinstance(a, int): r = R(a) / b elif isinstance(a, (tuple, list)): if len(a) != 2: diff --git a/src/sage/modular/dims.py b/src/sage/modular/dims.py index 59369ba02f1..6b6bc675f96 100644 --- a/src/sage/modular/dims.py +++ b/src/sage/modular/dims.py @@ -45,7 +45,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six import integer_types from sage.arith.all import factor, is_prime, valuation @@ -315,7 +314,7 @@ def dimension_new_cusp_forms(X, k=2, p=0): # Gamma1(N) for N<=2 just returns Gamma0(N), which has no # eps parameter. See trac #12640. return Gamma1(N).dimension_new_cusp_forms(k, eps=X, p=p) - elif isinstance(X, integer_types + (Integer,)): + elif isinstance(X, (int, Integer)): return Gamma0(X).dimension_new_cusp_forms(k, p=p) else: raise TypeError("X (=%s) must be an integer, a Dirichlet character or a congruence subgroup of type Gamma0, Gamma1 or GammaH" % X) @@ -426,7 +425,7 @@ def dimension_cusp_forms(X, k=2): return Gamma1(N).dimension_cusp_forms(k, X) elif is_ArithmeticSubgroup(X): return X.dimension_cusp_forms(k) - elif isinstance(X, (Integer,) + integer_types): + elif isinstance(X, (int, Integer)): return Gamma0(X).dimension_cusp_forms(k) else: raise TypeError("argument 1 must be a Dirichlet character, an integer " @@ -509,7 +508,7 @@ def dimension_eis(X, k=2): return X.dimension_eis(k) elif isinstance(X, dirichlet.DirichletCharacter): return Gamma1(X.modulus()).dimension_eis(k, X) - elif isinstance(X, integer_types + (Integer,)): + elif isinstance(X, (int, Integer)): return Gamma0(X).dimension_eis(k) else: raise TypeError("argument in dimension_eis must be an integer, a Dirichlet character, or a finite index subgroup of SL2Z (got %s)" % X) @@ -551,7 +550,7 @@ def dimension_modular_forms(X, k=2): sage: dimension_modular_forms(11,2) 2 """ - if isinstance(X, integer_types + (Integer,)): + if isinstance(X, (int, Integer)): return Gamma0(X).dimension_modular_forms(k) elif is_ArithmeticSubgroup(X): return X.dimension_modular_forms(k) @@ -597,5 +596,5 @@ def sturm_bound(level, weight=2): else: raise ValueError("no Sturm bound defined for noncongruence " "subgroups") - if isinstance(level, integer_types + (Integer,)): + if isinstance(level, (int, Integer)): return Gamma0(level).sturm_bound(weight) diff --git a/src/sage/modular/dirichlet.py b/src/sage/modular/dirichlet.py index dd5332c879c..1204e393221 100644 --- a/src/sage/modular/dirichlet.py +++ b/src/sage/modular/dirichlet.py @@ -57,7 +57,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six.moves import range, zip import sage.categories.all as cat from sage.misc.all import prod diff --git a/src/sage/modular/etaproducts.py b/src/sage/modular/etaproducts.py index 3f8dd838bae..2184fcd3c39 100644 --- a/src/sage/modular/etaproducts.py +++ b/src/sage/modular/etaproducts.py @@ -230,7 +230,6 @@ def basis(self, reduce=True): pass it to the reduce_basis() function which performs LLL-reduction to give a more manageable basis. """ - from six.moves import range N = self.level() divs = divisors(N)[:-1] s = len(divs) @@ -298,7 +297,6 @@ def reduce_basis(self, long_etas): [Eta product of level 4 : (eta_1)^8 (eta_4)^-8, Eta product of level 4 : (eta_1)^-8 (eta_2)^24 (eta_4)^-16] """ - from six.moves import range N = self.level() cusps = AllCusps(N) r = matrix(ZZ, [[et.order_at_cusp(c) for c in cusps] for et in long_etas]) @@ -712,7 +710,6 @@ def AllCusps(N): ... ValueError: N must be positive """ - from six.moves import range N = ZZ(N) if N <= 0: raise ValueError("N must be positive") @@ -1037,7 +1034,6 @@ def _eta_relations_helper(eta1, eta2, degree, qexp_terms, labels, verbose): sage: _eta_relations_helper(EtaProduct(26, {2:2,13:2,26:-2,1:-2}),EtaProduct(26, {2:4,13:2,26:-4,1:-2}),3,12,['a','b'],False) # not enough terms, will return rubbish [1] """ - from six.moves import range indices = [(i,j) for j in range(degree) for i in range(degree)] inf = CuspFamily(eta1.level(), 1) diff --git a/src/sage/modular/hecke/algebra.py b/src/sage/modular/hecke/algebra.py index 13a4b4750eb..3a586bed1d9 100644 --- a/src/sage/modular/hecke/algebra.py +++ b/src/sage/modular/hecke/algebra.py @@ -26,7 +26,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six.moves import range import sage.arith.all as arith import sage.rings.infinity diff --git a/src/sage/modular/hecke/hecke_operator.py b/src/sage/modular/hecke/hecke_operator.py index d32b5b96cb1..060a92d7435 100644 --- a/src/sage/modular/hecke/hecke_operator.py +++ b/src/sage/modular/hecke/hecke_operator.py @@ -17,7 +17,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six import integer_types from sage.structure.element import AlgebraElement @@ -607,7 +606,7 @@ def __init__(self, parent, n): Hecke operator T_10604499373 on Modular Symbols space of dimension 5 for Gamma_0(21) of weight 2 with sign 0 over Rational Field """ HeckeAlgebraElement.__init__(self, parent) - if not isinstance(n, integer_types + (Integer,)): + if not isinstance(n, (int, Integer)): raise TypeError("n must be an int") self.__n = int(n) diff --git a/src/sage/modular/local_comp/smoothchar.py b/src/sage/modular/local_comp/smoothchar.py index fff3cdd0fc3..6dedb26e7ee 100644 --- a/src/sage/modular/local_comp/smoothchar.py +++ b/src/sage/modular/local_comp/smoothchar.py @@ -40,7 +40,6 @@ sage: chi.multiplicative_order() +Infinity """ -from six.moves import range import operator from sage.structure.element import MultiplicativeGroupElement, parent diff --git a/src/sage/modular/local_comp/type_space.py b/src/sage/modular/local_comp/type_space.py index 5497d529c38..a256113b3d4 100644 --- a/src/sage/modular/local_comp/type_space.py +++ b/src/sage/modular/local_comp/type_space.py @@ -14,7 +14,6 @@ """ from __future__ import absolute_import -from six.moves import range import operator from sage.modular.arithgroup.all import GammaH diff --git a/src/sage/modular/modform/cuspidal_submodule.py b/src/sage/modular/modform/cuspidal_submodule.py index f3a62ca63b1..45a88f683a3 100644 --- a/src/sage/modular/modform/cuspidal_submodule.py +++ b/src/sage/modular/modform/cuspidal_submodule.py @@ -38,7 +38,6 @@ # # http://www.gnu.org/licenses/ ######################################################################### -from six.moves import range from sage.rings.all import QQ, Integer from sage.misc.all import verbose, cached_method from sage.matrix.all import Matrix, identity_matrix diff --git a/src/sage/modular/modform/eis_series.py b/src/sage/modular/modform/eis_series.py index 9765adf420a..a3cb6497040 100644 --- a/src/sage/modular/modform/eis_series.py +++ b/src/sage/modular/modform/eis_series.py @@ -12,7 +12,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six import integer_types from sage.misc.all import verbose, cputime import sage.modular.dirichlet as dirichlet @@ -485,7 +484,7 @@ def compute_eisenstein_params(character, k): sage: len(sage.modular.modform.eis_series.compute_eisenstein_params(GammaH(15, [4]), 3)) 8 """ - if isinstance(character, integer_types + (Integer,)): + if isinstance(character, (int, Integer)): return __find_eisen_chars_gamma1(character, k) elif isinstance(character, GammaH_class): return __find_eisen_chars_gammaH(character.level(), character._generators_for_H(), k) diff --git a/src/sage/modular/modform/eisenstein_submodule.py b/src/sage/modular/modform/eisenstein_submodule.py index 1ef3c6ff4c8..1508eaf3dd0 100644 --- a/src/sage/modular/modform/eisenstein_submodule.py +++ b/src/sage/modular/modform/eisenstein_submodule.py @@ -3,7 +3,6 @@ The Eisenstein Subspace """ from __future__ import absolute_import -from six.moves import range from sage.structure.all import Sequence from sage.misc.all import verbose, cached_method diff --git a/src/sage/modular/modform/element.py b/src/sage/modular/modform/element.py index 65e6034d7b1..f122dec0f4d 100644 --- a/src/sage/modular/modform/element.py +++ b/src/sage/modular/modform/element.py @@ -25,7 +25,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import, division -from six.moves import range import sage.modular.hecke.element as element diff --git a/src/sage/modular/modform/find_generators.py b/src/sage/modular/modform/find_generators.py index b55f73e3adf..c593213bc04 100644 --- a/src/sage/modular/modform/find_generators.py +++ b/src/sage/modular/modform/find_generators.py @@ -18,8 +18,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six.moves import range -from six import integer_types from sage.structure.richcmp import richcmp_method, richcmp from sage.rings.all import Integer, QQ, ZZ @@ -218,7 +216,7 @@ def __init__(self, group, base_ring=QQ): ... ValueError: Base ring (=Univariate Polynomial Ring in x over Integer Ring) should be QQ, ZZ or a finite prime field """ - if isinstance(group, integer_types + (Integer,)): + if isinstance(group, (int, Integer)): group = Gamma0(group) elif not is_CongruenceSubgroup(group): raise ValueError("Group (=%s) should be a congruence subgroup" % group) diff --git a/src/sage/modular/modform/numerical.py b/src/sage/modular/modform/numerical.py index fac22c1b80b..d795b4bd622 100644 --- a/src/sage/modular/modform/numerical.py +++ b/src/sage/modular/modform/numerical.py @@ -11,7 +11,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six import integer_types from sage.arith.all import prime_range from sage.matrix.constructor import matrix @@ -101,7 +100,7 @@ def __init__(self, group, weight=2, eps=1e-20, sage: numerical_eigenforms(61) # indirect doctest Numerical Hecke eigenvalues for Congruence Subgroup Gamma0(61) of weight 2 """ - if isinstance(group, integer_types + (Integer,)): + if isinstance(group, (int, Integer)): group = Gamma0(Integer(group)) self._group = group self._weight = Integer(weight) diff --git a/src/sage/modular/modform/theta.py b/src/sage/modular/modform/theta.py index 203f4f8b448..e41532e2da2 100644 --- a/src/sage/modular/modform/theta.py +++ b/src/sage/modular/modform/theta.py @@ -5,7 +5,6 @@ William Stein """ -from six.moves import range from sage.rings.all import Integer, ZZ, PowerSeriesRing from math import sqrt diff --git a/src/sage/modular/modform/vm_basis.py b/src/sage/modular/modform/vm_basis.py index ca9e07da858..47417e59516 100644 --- a/src/sage/modular/modform/vm_basis.py +++ b/src/sage/modular/modform/vm_basis.py @@ -27,7 +27,6 @@ # the License, or (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range import math from sage.rings.all import QQ, ZZ, Integer, \ diff --git a/src/sage/modular/modform_hecketriangle/graded_ring_element.py b/src/sage/modular/modform_hecketriangle/graded_ring_element.py index 4b6ac52bfb1..edc715fafb3 100644 --- a/src/sage/modular/modform_hecketriangle/graded_ring_element.py +++ b/src/sage/modular/modform_hecketriangle/graded_ring_element.py @@ -17,7 +17,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** -from sage.misc import six from sage.rings.all import ZZ, infinity, LaurentSeries, O from sage.functions.all import exp from sage.rings.number_field.number_field import QuadraticField @@ -42,10 +41,8 @@ # corresponding operations (e.g. __pow__) even though the category # (and class) of the parent is in some cases not # CommutativeAlgebras but Modules -class FormsRingElement(six.with_metaclass( - InheritComparisonClasscallMetaclass, - CommutativeAlgebraElement, UniqueRepresentation - )): +class FormsRingElement(CommutativeAlgebraElement, UniqueRepresentation, + metaclass=InheritComparisonClasscallMetaclass): r""" Element of a FormsRing. """ diff --git a/src/sage/modular/modsym/ambient.py b/src/sage/modular/modsym/ambient.py index 8476db2c9a9..ef0db033ab6 100644 --- a/src/sage/modular/modsym/ambient.py +++ b/src/sage/modular/modsym/ambient.py @@ -72,7 +72,6 @@ class ``ModularSymbolsAmbient``, derived from # # http://www.gnu.org/licenses/ ################################################################################ -from six.moves import range # Sage packages import sage.misc.latex as latex import sage.misc.misc as misc diff --git a/src/sage/modular/modsym/boundary.py b/src/sage/modular/modsym/boundary.py index 55f3b46a823..ca0f9b6c6eb 100644 --- a/src/sage/modular/modsym/boundary.py +++ b/src/sage/modular/modsym/boundary.py @@ -89,7 +89,6 @@ # **************************************************************************** from __future__ import absolute_import -from six.moves import range from sage.misc.misc import repr_lincomb from sage.structure.richcmp import richcmp_method, richcmp diff --git a/src/sage/modular/modsym/g1list.py b/src/sage/modular/modsym/g1list.py index 67649e0300e..1515f7bf935 100644 --- a/src/sage/modular/modsym/g1list.py +++ b/src/sage/modular/modsym/g1list.py @@ -18,7 +18,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.arith.all import GCD from sage.structure.richcmp import richcmp_method, richcmp from sage.structure.sage_object import SageObject diff --git a/src/sage/modular/modsym/manin_symbol_list.py b/src/sage/modular/modsym/manin_symbol_list.py index 154c09d6ed0..c6d948e8e56 100644 --- a/src/sage/modular/modsym/manin_symbol_list.py +++ b/src/sage/modular/modsym/manin_symbol_list.py @@ -33,7 +33,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six.moves import range import sage.modular.modsym.p1list as p1list import sage.modular.modsym.g1list as g1list diff --git a/src/sage/modular/modsym/modular_symbols.py b/src/sage/modular/modsym/modular_symbols.py index bc4dcd662a3..7b0f75daf23 100644 --- a/src/sage/modular/modsym/modular_symbols.py +++ b/src/sage/modular/modsym/modular_symbols.py @@ -31,7 +31,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range import sage.modular.cusps as cusps from sage.modular.modsym.apply import apply_to_monomial from sage.modular.modsym.manin_symbol import ManinSymbol diff --git a/src/sage/modular/modsym/relation_matrix.py b/src/sage/modular/modsym/relation_matrix.py index 150f65fad36..88a20af5092 100644 --- a/src/sage/modular/modsym/relation_matrix.py +++ b/src/sage/modular/modsym/relation_matrix.py @@ -22,7 +22,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import range import sage.matrix.matrix_space as matrix_space from sage.rings.all import Ring diff --git a/src/sage/modular/modsym/space.py b/src/sage/modular/modsym/space.py index 220eac9eba4..912c1ceb5a7 100644 --- a/src/sage/modular/modsym/space.py +++ b/src/sage/modular/modsym/space.py @@ -23,7 +23,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range import sage.modules.free_module as free_module import sage.matrix.matrix_space as matrix_space from sage.modules.free_module_element import is_FreeModuleElement diff --git a/src/sage/modular/modsym/tests.py b/src/sage/modular/modsym/tests.py index 325b9ef632e..c4d0ff1ad7d 100644 --- a/src/sage/modular/modsym/tests.py +++ b/src/sage/modular/modsym/tests.py @@ -25,7 +25,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range import random diff --git a/src/sage/modular/overconvergent/genus0.py b/src/sage/modular/overconvergent/genus0.py index 4a34ad3de77..1396e1b114e 100644 --- a/src/sage/modular/overconvergent/genus0.py +++ b/src/sage/modular/overconvergent/genus0.py @@ -172,8 +172,6 @@ # https://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range -from six import integer_types from sage.matrix.all import matrix, MatrixSpace, diagonal_matrix from sage.misc.misc import verbose @@ -732,7 +730,7 @@ def _element_constructor_(self, input): sage: M10(M(f)) 3-adic overconvergent modular form of weight-character 0 with q-expansion 27*q + 324*q^2 + 2430*q^3 + 13716*q^4 + O(q^5) """ - if isinstance(input, integer_types): + if isinstance(input, int): input = ZZ(input) if isinstance(input, OverconvergentModularFormElement): diff --git a/src/sage/modular/overconvergent/hecke_series.py b/src/sage/modular/overconvergent/hecke_series.py index 164fd07a1e2..e7ec26a78f8 100644 --- a/src/sage/modular/overconvergent/hecke_series.py +++ b/src/sage/modular/overconvergent/hecke_series.py @@ -66,9 +66,9 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# https://www.gnu.org/licenses/ -# **************************************************************************** -from six.moves import range +# http://www.gnu.org/licenses/ +#***************************************************************************** + from sage.functions.all import floor, ceil from sage.arith.all import valuation from sage.rings.all import ZZ, Zmod, Infinity, Integer diff --git a/src/sage/modular/overconvergent/weightspace.py b/src/sage/modular/overconvergent/weightspace.py index 9ff96b6b9f2..21702b725bd 100644 --- a/src/sage/modular/overconvergent/weightspace.py +++ b/src/sage/modular/overconvergent/weightspace.py @@ -61,9 +61,8 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# https://www.gnu.org/licenses/ -# **************************************************************************** -from six.moves import range +# http://www.gnu.org/licenses/ +#***************************************************************************** from sage.structure.parent_base import ParentWithBase from sage.structure.element import Element diff --git a/src/sage/modular/pollack_stevens/distributions.py b/src/sage/modular/pollack_stevens/distributions.py index 97a015d10bf..a4aab63a1c3 100644 --- a/src/sage/modular/pollack_stevens/distributions.py +++ b/src/sage/modular/pollack_stevens/distributions.py @@ -41,7 +41,6 @@ #***************************************************************************** from __future__ import print_function from __future__ import absolute_import -from six.moves import range from sage.modules.module import Module from sage.structure.parent import Parent diff --git a/src/sage/modular/pollack_stevens/fund_domain.py b/src/sage/modular/pollack_stevens/fund_domain.py index eb75ded7468..545dc60b174 100644 --- a/src/sage/modular/pollack_stevens/fund_domain.py +++ b/src/sage/modular/pollack_stevens/fund_domain.py @@ -23,7 +23,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function, absolute_import -from six import iteritems from sage.matrix.matrix_space import MatrixSpace from sage.modular.modsym.all import P1List @@ -1540,7 +1539,7 @@ def prep_hecke_on_gen_list(self, l, gen, modulus=None): 4 """ ans = [] - for h, vh in iteritems(self.prep_hecke_on_gen(l, gen, modulus=modulus)): + for h, vh in self.prep_hecke_on_gen(l, gen, modulus=modulus).items(): ans.extend([(h, v) for v in vh]) return ans diff --git a/src/sage/modular/pollack_stevens/manin_map.py b/src/sage/modular/pollack_stevens/manin_map.py index e5118e89d7a..668d115d100 100644 --- a/src/sage/modular/pollack_stevens/manin_map.py +++ b/src/sage/modular/pollack_stevens/manin_map.py @@ -43,8 +43,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function, absolute_import -from six import iteritems -from six.moves import range from sage.rings.continued_fraction import convergents from .sigma0 import Sigma0 @@ -405,7 +403,7 @@ def __add__(self, right): D = {} sd = self._dict rd = right._dict - for ky, val in iteritems(sd): + for ky, val in sd.items(): if ky in rd: D[ky] = val + rd[ky] return self.__class__(self._codomain, self._manin, D, check=False) @@ -442,7 +440,7 @@ def __sub__(self, right): D = {} sd = self._dict rd = right._dict - for ky, val in iteritems(sd): + for ky, val in sd.items(): if ky in rd: D[ky] = val - rd[ky] return self.__class__(self._codomain, self._manin, D, check=False) @@ -480,7 +478,7 @@ def __mul__(self, right): return self._right_action(right) D = {} - for ky, val in iteritems(self._dict): + for ky, val in self._dict.items(): D[ky] = val * right return self.__class__(self._codomain, self._manin, D, check=False) @@ -614,7 +612,7 @@ def apply(self, f, codomain=None, to_moments=False): sd = self._dict if codomain is None: codomain = self._codomain - for ky, val in iteritems(sd): + for ky, val in sd.items(): if to_moments: D[ky] = codomain([f(val.moment(a)) for a in range(val.precision_absolute())]) @@ -738,7 +736,7 @@ def reduce_precision(self, M): 1 + O(11^2) """ D = {} - for ky, val in iteritems(self._dict): + for ky, val in self._dict.items(): D[ky] = val.reduce_precision(M) return self.__class__(self._codomain, self._manin, D, check=False) @@ -760,7 +758,7 @@ def specialize(self, *args): Sym^0 Z_11^2 """ D = {} - for ky, val in iteritems(self._dict): + for ky, val in self._dict.items(): D[ky] = val.specialize(*args) return self.__class__(self._codomain.specialize(*args), self._manin, D, check=False) diff --git a/src/sage/modules/filtered_vector_space.py b/src/sage/modules/filtered_vector_space.py index b9ca38ddb6f..221694c3fd7 100644 --- a/src/sage/modules/filtered_vector_space.py +++ b/src/sage/modules/filtered_vector_space.py @@ -107,8 +107,6 @@ # the License, or (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six import iteritems -from six.moves import range from sage.rings.all import QQ, ZZ, RDF, RR, Integer from sage.rings.infinity import InfinityRing, infinity, minus_infinity @@ -317,7 +315,7 @@ def normalize_gen(v): # normalize filtration data normalized = dict() - for deg, gens_deg in iteritems(filtration): + for deg, gens_deg in filtration.items(): indices = [generators.index(normalize_gen(v)) for v in gens_deg] normalized[deg] = tuple(indices) return construct_from_generators_indices(generators, normalized, base_ring, check) @@ -376,7 +374,7 @@ def construct_from_generators_indices(generators, filtration, base_ring, check): # normalize filtration data normalized = dict() - for deg, gens in iteritems(filtration): + for deg, gens in filtration.items(): deg = normalize_degree(deg) gens = [ZZ(i) for i in gens] if any(i < 0 or i >= len(generators) for i in gens): @@ -448,7 +446,7 @@ def __init__(self, base_ring, dim, generators, filtration, check=True): if check: assert matrix(generators).rank() == self.dimension() assert isinstance(filtration, dict) - for degree, indices in iteritems(filtration): + for degree, indices in filtration.items(): assert isinstance(degree, Integer) or degree == infinity assert isinstance(indices, tuple) assert all(isinstance(r, Integer) for r in indices) @@ -1228,7 +1226,7 @@ def shift(self, deg): """ generators, filtration = self.presentation() shifted = dict() - for d, indices in iteritems(filtration): + for d, indices in filtration.items(): shifted[d + deg] = indices return FilteredVectorSpace(generators, shifted, base_ring=self.base_ring()) diff --git a/src/sage/modules/free_module.py b/src/sage/modules/free_module.py index 10ba91f559a..f77c41fc3b5 100644 --- a/src/sage/modules/free_module.py +++ b/src/sage/modules/free_module.py @@ -162,7 +162,6 @@ # http://www.gnu.org/licenses/ ########################################################################### from __future__ import print_function, absolute_import -from six import integer_types from itertools import islice from . import free_module_element @@ -1012,7 +1011,7 @@ def _element_constructor_(self, x, coerce=True, copy=True, check=True): sage: N((0,0,0,1), check=False) in N True """ - if (isinstance(x, integer_types + (sage.rings.integer.Integer,)) and + if (isinstance(x, (int, sage.rings.integer.Integer)) and x == 0): return self.zero_vector() elif isinstance(x, free_module_element.FreeModuleElement): diff --git a/src/sage/modules/multi_filtered_vector_space.py b/src/sage/modules/multi_filtered_vector_space.py index e7777d1b92a..05973ccf7ed 100644 --- a/src/sage/modules/multi_filtered_vector_space.py +++ b/src/sage/modules/multi_filtered_vector_space.py @@ -38,7 +38,6 @@ # the License, or (at your option) any later version. # https://www.gnu.org/licenses/ # **************************************************************************** -from six import iteritems from sage.rings.all import QQ, ZZ, Integer from sage.rings.infinity import infinity, minus_infinity @@ -190,7 +189,7 @@ def change_ring(self, base_ring): return MultiFilteredVectorSpace(self.dimension(), base_ring=base_ring) filtrations = {} - for key, F in iteritems(self._filt): + for key, F in self._filt.items(): filtrations[key] = F.change_ring(base_ring) return MultiFilteredVectorSpace(filtrations, base_ring=base_ring) diff --git a/src/sage/modules/tensor_operations.py b/src/sage/modules/tensor_operations.py index 2840567f4b2..16eb8717e36 100644 --- a/src/sage/modules/tensor_operations.py +++ b/src/sage/modules/tensor_operations.py @@ -60,7 +60,6 @@ # the License, or (at your option) any later version. # https://www.gnu.org/licenses/ # **************************************************************************** -from six.moves import range from collections import defaultdict diff --git a/src/sage/modules/with_basis/morphism.py b/src/sage/modules/with_basis/morphism.py index bbbd07cddf5..2978bf1f564 100644 --- a/src/sage/modules/with_basis/morphism.py +++ b/src/sage/modules/with_basis/morphism.py @@ -104,7 +104,6 @@ # http://www.gnu.org/licenses/ #****************************************************************************** from __future__ import print_function -from six import iteritems from sage.categories.fields import Fields from sage.categories.modules import Modules @@ -395,9 +394,12 @@ def __call__(self, *args): mc = x.monomial_coefficients(copy=False) if self._is_module_with_basis_over_same_base_ring: - return self.codomain().linear_combination( (self._on_basis(*(before+(index,)+after)), coeff ) for (index, coeff) in iteritems(mc) ) + return self.codomain().linear_combination( + (self._on_basis(*(before+(index,)+after)), coeff ) + for (index, coeff) in mc.items()) else: - return sum(( coeff * self._on_basis(*(before+(index,)+after)) for (index, coeff) in iteritems(mc) ), self._zero) + return sum((coeff * self._on_basis(*(before+(index,)+after)) + for (index, coeff) in mc.items()), self._zero) # As per the specs of Map, we should in fact implement _call_. # However we currently need to abuse Map.__call__ (which strict diff --git a/src/sage/monoids/free_abelian_monoid.py b/src/sage/monoids/free_abelian_monoid.py index 6674037fb15..8cae763d82e 100644 --- a/src/sage/monoids/free_abelian_monoid.py +++ b/src/sage/monoids/free_abelian_monoid.py @@ -54,7 +54,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six import integer_types from sage.misc.cachefunc import cached_method from sage.structure.category_object import normalize_names @@ -193,7 +192,7 @@ def __init__(self, n, names): sage: F = FreeAbelianMonoid(6,'b') sage: TestSuite(F).run() """ - if not isinstance(n, integer_types + (Integer,)): + if not isinstance(n, (int, Integer)): raise TypeError("n (=%s) must be an integer"%n) if n < 0: raise ValueError("n (=%s) must be nonnegative"%n) diff --git a/src/sage/monoids/free_abelian_monoid_element.py b/src/sage/monoids/free_abelian_monoid_element.py index 64168e86254..b65700a244e 100644 --- a/src/sage/monoids/free_abelian_monoid_element.py +++ b/src/sage/monoids/free_abelian_monoid_element.py @@ -33,7 +33,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #***************************************************************************** -from six import integer_types from sage.structure.richcmp import richcmp from sage.rings.integer import Integer @@ -78,7 +77,7 @@ def __init__(self, F, x): """ MonoidElement.__init__(self, F) n = F.ngens() - if isinstance(x, integer_types + (Integer,)) and x == 1: + if isinstance(x, (int, Integer)) and x == 1: self._element_vector = tuple([0]*n) elif isinstance(x, (list, tuple)): if len(x) != n: @@ -174,7 +173,7 @@ def __pow__(self, n): sage: x^0 1 """ - if not isinstance(n, integer_types + (Integer,)): + if not isinstance(n, (int, Integer)): raise TypeError("argument n (= %s) must be an integer"%(n,)) if n < 0: raise IndexError("argument n (= %s) must be positive"%n) diff --git a/src/sage/monoids/free_monoid.py b/src/sage/monoids/free_monoid.py index 4b350f4d263..609c1631a71 100644 --- a/src/sage/monoids/free_monoid.py +++ b/src/sage/monoids/free_monoid.py @@ -24,7 +24,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six import integer_types from sage.rings.integer import Integer from sage.structure.category_object import normalize_names @@ -190,7 +189,7 @@ def __init__(self, n, names=None): sage: F. = FreeMonoid() sage: TestSuite(F).run() """ - if not isinstance(n, integer_types + (Integer,)): + if not isinstance(n, (int, Integer)): raise TypeError("n (=%s) must be an integer" % n) if n < 0: raise ValueError("n (=%s) must be nonnegative" % n) @@ -245,7 +244,7 @@ def _element_constructor_(self, x, check=True): return x if isinstance(x, FreeMonoidElement) and x.parent() == self: return self.element_class(self, x._element_list, check) - if isinstance(x, integer_types + (Integer,)) and x == 1: + if isinstance(x, (int, Integer)) and x == 1: return self.element_class(self, x, check) if isinstance(x, FiniteWord_class): d = self.gens_dict() diff --git a/src/sage/monoids/free_monoid_element.py b/src/sage/monoids/free_monoid_element.py index add4a903555..6c5e77ddcb3 100644 --- a/src/sage/monoids/free_monoid_element.py +++ b/src/sage/monoids/free_monoid_element.py @@ -23,7 +23,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six import iteritems, integer_types from sage.rings.integer import Integer from sage.structure.element import MonoidElement @@ -58,7 +57,7 @@ def __init__(self, F, x, check=True): This should typically be called by a FreeMonoid. """ MonoidElement.__init__(self, F) - if isinstance(x, integer_types + (Integer,)): + if isinstance(x, (int, Integer)): if x == 1: self._element_list = [] else: @@ -69,8 +68,8 @@ def __init__(self, F, x, check=True): for v in x: if not isinstance(v, tuple) and len(v) == 2: raise TypeError("x (= %s) must be a list of 2-tuples or 1."%x) - if not (isinstance(v[0], integer_types + (Integer,)) and - isinstance(v[1], integer_types + (Integer,))): + if not (isinstance(v[0], (int, Integer)) and + isinstance(v[1], (int, Integer))): raise TypeError("x (= %s) must be a list of 2-tuples of integers or 1."%x) if len(x2) > 0 and v[0] == x2[len(x2)-1][0]: x2[len(x2)-1] = (v[0], v[1]+x2[len(x2)-1][1]) @@ -194,7 +193,7 @@ def __call__(self, *x, **kwds): if kwds: x = self.gens() gens_dict = {name: i for i, name in enumerate(P.variable_names())} - for key, value in iteritems(kwds): + for key, value in kwds.items(): if key in gens_dict: x[gens_dict[key]] = value diff --git a/src/sage/monoids/indexed_free_monoid.py b/src/sage/monoids/indexed_free_monoid.py index 51494741aaf..8ee49b1fd01 100644 --- a/src/sage/monoids/indexed_free_monoid.py +++ b/src/sage/monoids/indexed_free_monoid.py @@ -12,7 +12,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # https://www.gnu.org/licenses/ # **************************************************************************** -from six import integer_types, iteritems from copy import copy from sage.misc.abstract_method import abstract_method @@ -545,7 +544,7 @@ def __pow__(self, n): sage: x^0 1 """ - if not isinstance(n, integer_types + (Integer,)): + if not isinstance(n, (int, Integer)): raise TypeError("Argument n (= {}) must be an integer".format(n)) if n < 0: raise ValueError("Argument n (= {}) must be positive".format(n)) @@ -553,7 +552,7 @@ def __pow__(self, n): return self if n == 0: return self.parent().one() - return self.__class__(self.parent(), {k:v*n for k,v in iteritems(self._monomial)}) + return self.__class__(self.parent(), {k:v*n for k,v in self._monomial.items()}) def __floordiv__(self, elt): """ @@ -581,7 +580,7 @@ def __floordiv__(self, elt): ValueError: invalid cancellation """ d = copy(self._monomial) - for k, v in iteritems(elt._monomial): + for k, v in elt._monomial.items(): if k not in d: raise ValueError("invalid cancellation") diff = d[k] - v @@ -961,7 +960,7 @@ def _element_constructor_(self, x=None): d[k] = v x = d if isinstance(x, dict): - x = {k: v for k, v in iteritems(x) if v != 0} + x = {k: v for k, v in x.items() if v != 0} return IndexedMonoid._element_constructor_(self, x) Element = IndexedFreeAbelianMonoidElement diff --git a/src/sage/monoids/string_monoid_element.py b/src/sage/monoids/string_monoid_element.py index 2e335e76769..f99d68c22fb 100644 --- a/src/sage/monoids/string_monoid_element.py +++ b/src/sage/monoids/string_monoid_element.py @@ -20,7 +20,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six import integer_types # import operator from sage.rings.integer import Integer @@ -88,7 +87,7 @@ def __init__(self, S, x, check=True): if isinstance(x, list): if check: for b in x: - if not isinstance(b, integer_types + (Integer,)): + if not isinstance(b, (int, Integer)): raise TypeError( "x (= %s) must be a list of integers." % x) self._element_list = list(x) # make copy @@ -191,7 +190,7 @@ def __pow__(self, n): ... IndexError: Argument n (= -1) must be non-negative. """ - if not isinstance(n, integer_types + (Integer,)): + if not isinstance(n, (int, Integer)): raise TypeError("Argument n (= %s) must be an integer." % n) if n < 0: raise IndexError("Argument n (= %s) must be non-negative." % n) diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py index d2f83103f2e..a1bbda47be3 100644 --- a/src/sage/numerical/optimize.py +++ b/src/sage/numerical/optimize.py @@ -10,7 +10,6 @@ Functions and Methods ---------------------- """ -from six.moves import range from sage.modules.free_module_element import vector from sage.rings.real_double import RDF @@ -80,14 +79,14 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals the function need not be defined at the endpoints:: sage: find_root(x^2*log(x,2)-1,0, 2) # abs tol 1e-6 - 1.41421356237 - + 1.41421356237 + The following is an example, again from :trac:`4942` where Brent's method - fails. Currently no other method is implemented, but at least we + fails. Currently no other method is implemented, but at least we acknowledge the fact that the algorithm fails:: - sage: find_root(1/(x-1)+1,0, 2) - 0.0 + sage: find_root(1/(x-1)+1,0, 2) + 0.0 sage: find_root(1/(x-1)+1,0.00001, 2) Traceback (most recent call last): ... @@ -111,7 +110,7 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals a, b = b, a left = f(a) right = f(b) - + if left > 0 and right > 0: # Refine further -- try to find a point where this # function is negative in the interval @@ -139,15 +138,15 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals raise RuntimeError("f appears to have no zero on the interval") a = s - # Fixing :trac:`4942` - if the answer on any of the endpoints is NaN, + # Fixing :trac:`4942` - if the answer on any of the endpoints is NaN, # we restrict to looking between minimum and maximum values in the segment - # Note - this could be used in all cases, but it requires some more + # Note - this could be used in all cases, but it requires some more # computation if (left != left) or (right != right): minval, s_1 = find_local_minimum(f, a, b) maxval, s_2 = find_local_maximum(f, a, b) - if ((minval > 0) or (maxval < 0) or + if ((minval > 0) or (maxval < 0) or (minval != minval) or (maxval != maxval)): raise RuntimeError("f appears to have no zero on the interval") a = min(s_1, s_2) @@ -344,7 +343,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default", sage: minimize(f, [.1,.3,.4]) # abs tol 1e-6 (1.0, 1.0, 1.0) - Try the newton-conjugate gradient method; the gradient and hessian are + Try the newton-conjugate gradient method; the gradient and hessian are computed automatically:: sage: minimize(f, [.1, .3, .4], algorithm="ncg") # abs tol 1e-6 diff --git a/src/sage/parallel/decorate.py b/src/sage/parallel/decorate.py index c0713fa14f2..392227334dc 100644 --- a/src/sage/parallel/decorate.py +++ b/src/sage/parallel/decorate.py @@ -2,7 +2,6 @@ Decorate interface for parallel computation """ from __future__ import print_function, absolute_import -from six import integer_types import types @@ -70,7 +69,7 @@ def __init__(self, p_iter='fork', ncpus=None, **kwds): self.p_iter = None - if isinstance(p_iter, integer_types + (Integer,)): + if isinstance(p_iter, (int, Integer)): p_iter, ncpus = 'fork', p_iter if ncpus is None: diff --git a/src/sage/parallel/map_reduce.py b/src/sage/parallel/map_reduce.py index b5296a51512..159a5811d11 100644 --- a/src/sage/parallel/map_reduce.py +++ b/src/sage/parallel/map_reduce.py @@ -538,16 +538,14 @@ """ from __future__ import print_function, absolute_import -import six - from threading import Thread -from six.moves import queue from sage.sets.recursively_enumerated_set import RecursivelyEnumeratedSet # _generic from sage.misc.lazy_attribute import lazy_attribute import collections import copy import sys import random +import queue import ctypes @@ -574,18 +572,10 @@ logger.addHandler(ch) -if six.PY2: - import multiprocessing as mp - from multiprocessing.queues import SimpleQueue - # Put SimpleQueue in the multiprocessing top-level namespace for - # compatibility with Python 3 - mp.SimpleQueue = SimpleQueue - del SimpleQueue -else: - # Set up a multiprocessing context to use for this modules (using the - # 'fork' method which is basically same as on Python 2) - import multiprocessing as mp - mp = mp.get_context('fork') +# Set up a multiprocessing context to use for this modules (using the +# 'fork' method which is basically same as on Python 2) +import multiprocessing as mp +mp = mp.get_context('fork') def proc_number(max_proc=None): diff --git a/src/sage/plot/animate.py b/src/sage/plot/animate.py index 99b9c860996..6bd3cbfd917 100644 --- a/src/sage/plot/animate.py +++ b/src/sage/plot/animate.py @@ -113,12 +113,11 @@ ############################################################################ from __future__ import print_function, absolute_import +import builtins import os import struct import zlib -import six - from sage.misc.fast_methods import WithEqualityById from sage.structure.sage_object import SageObject from sage.misc.temporary_file import tmp_dir, tmp_filename @@ -265,7 +264,6 @@ def _combine_kwds(self, *kwds_tuple): for kwds in kwds_tuple: new_kwds.update(kwds) - from six.moves import builtins for name in ['xmin', 'xmax', 'ymin', 'ymax']: values = [v for v in [kwds.get(name, None) for kwds in kwds_tuple] if v is not None] if values: @@ -1524,10 +1522,8 @@ def _hex2bin(cls, h): else: # for PNG magic b.append(ord(h[0])) h = h[1:] - if six.PY2: - return ''.join(map(chr, b)) - else: - return bytes(b) + + return bytes(b) @classmethod def _testData(cls, name, asFile): diff --git a/src/sage/plot/colors.py b/src/sage/plot/colors.py index 1860b6c948a..b1c9a9c76ae 100644 --- a/src/sage/plot/colors.py +++ b/src/sage/plot/colors.py @@ -37,7 +37,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** -import six import math import collections from colorsys import hsv_to_rgb, hls_to_rgb, rgb_to_hsv, rgb_to_hls @@ -338,7 +337,7 @@ def rgbcolor(c, space='rgb'): if isinstance(c, Color): return c.rgb() - if isinstance(c, six.string_types): + if isinstance(c, str): if len(c) > 0 and c[0] == '#': # Assume an HTML-like color, e.g., #00ffff or #ab0. return html_to_float(c) @@ -1419,7 +1418,7 @@ def get_cmap(cmap): if isinstance(cmap, Colormap): return cmap - elif isinstance(cmap, six.string_types): + elif isinstance(cmap, str): if not cmap in cm.datad: raise RuntimeError("Color map %s not known (type import matplotlib.cm; matplotlib.cm.datad.keys() for valid names)" % cmap) return cm.__dict__[cmap] diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py index 8a1917dc5ad..3c8caece494 100644 --- a/src/sage/plot/graphics.py +++ b/src/sage/plot/graphics.py @@ -35,8 +35,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import zip -from six import integer_types import os from math import isnan @@ -1121,7 +1119,7 @@ def __radd__(self, other): sage: print(sum(v)) Graphics object consisting of 2 graphics primitives """ - if isinstance(other, integer_types) and other == 0: + if isinstance(other, int) and other == 0: return self raise TypeError diff --git a/src/sage/plot/matrix_plot.py b/src/sage/plot/matrix_plot.py index 2e6a9c1ba9c..129f994de9d 100644 --- a/src/sage/plot/matrix_plot.py +++ b/src/sage/plot/matrix_plot.py @@ -18,7 +18,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six import iteritems from sage.plot.primitive import GraphicPrimitive from sage.misc.decorators import options, suboptions @@ -119,7 +118,7 @@ def get_minmax_data(self): # center the matrix so that, for example, the square representing the # (0,0) entry is centered on the origin. - for k, v in iteritems(limits): + for k, v in limits.items(): limits[k] -= 0.5 return limits diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py index 1000ef2380a..9b16c34c8f7 100644 --- a/src/sage/plot/plot.py +++ b/src/sage/plot/plot.py @@ -573,8 +573,6 @@ def f(x): return (x-3)*(x-5)*(x-7)+40 # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range -from six import iteritems from functools import reduce @@ -2999,9 +2997,9 @@ def list_plot(data, plotjoined=False, **kwargs): "and 'y' against each other, use 'list_plot(list(zip(x,y)))'.") if isinstance(data, dict): if plotjoined: - list_data = sorted(list(iteritems(data))) + list_data = sorted(list(data.items())) else: - list_data = list(iteritems(data)) + list_data = list(data.items()) return list_plot(list_data, plotjoined=plotjoined, **kwargs) try: from sage.rings.all import RDF diff --git a/src/sage/plot/plot3d/base.pyx b/src/sage/plot/plot3d/base.pyx index 81e7018681a..9ac408188be 100644 --- a/src/sage/plot/plot3d/base.pyx +++ b/src/sage/plot/plot3d/base.pyx @@ -39,8 +39,8 @@ import sys import zipfile from functools import reduce +from io import StringIO from random import randint -from six.moves import cStringIO as StringIO from sage.misc.misc import sage_makedirs from sage.misc.temporary_file import tmp_filename diff --git a/src/sage/plot/plot3d/list_plot3d.py b/src/sage/plot/plot3d/list_plot3d.py index b823460d94f..4c1a18231c8 100644 --- a/src/sage/plot/plot3d/list_plot3d.py +++ b/src/sage/plot/plot3d/list_plot3d.py @@ -2,7 +2,6 @@ List Plots """ from __future__ import absolute_import -from six.moves import range from sage.structure.element import is_Matrix from sage.matrix.all import matrix diff --git a/src/sage/plot/plot3d/plot3d.py b/src/sage/plot/plot3d/plot3d.py index 8adbca5e3ce..79f1b368314 100644 --- a/src/sage/plot/plot3d/plot3d.py +++ b/src/sage/plot/plot3d/plot3d.py @@ -144,8 +144,6 @@ def f(x,y): return math.exp(x/5)*math.cos(y) from __future__ import absolute_import import inspect -from six import iteritems - from .tri_plot import TrianglePlot from .index_face_set import IndexFaceSet from .shapes import arrow3d @@ -1176,7 +1174,7 @@ def plot3d_adaptive(f, x_range, y_range, color="automatic", span = (len(texture)-1) / (max_z - min_z) # max to avoid dividing by 0 parts = P.partition(lambda x, y, z: int((z-min_z)*span)) all = [] - for k, G in iteritems(parts): + for k, G in parts.items(): G.set_texture(texture[k], opacity=opacity) all.append(G) P = Graphics3dGroup(all) diff --git a/src/sage/plot/polygon.py b/src/sage/plot/polygon.py index 5ebfd541e7b..33090764311 100644 --- a/src/sage/plot/polygon.py +++ b/src/sage/plot/polygon.py @@ -17,7 +17,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.plot.primitive import GraphicPrimitive_xydata from sage.misc.decorators import options, rename_keyword diff --git a/src/sage/quadratic_forms/quadratic_form.py b/src/sage/quadratic_forms/quadratic_form.py index a502ddc545b..bab9760ddb3 100644 --- a/src/sage/quadratic_forms/quadratic_form.py +++ b/src/sage/quadratic_forms/quadratic_form.py @@ -17,7 +17,6 @@ # (at your option) any later version. # https://www.gnu.org/licenses/ # **************************************************************************** -from six.moves import range from warnings import warn from copy import deepcopy diff --git a/src/sage/quadratic_forms/quadratic_form__local_field_invariants.py b/src/sage/quadratic_forms/quadratic_form__local_field_invariants.py index 977126e99de..03f74d51ed0 100644 --- a/src/sage/quadratic_forms/quadratic_form__local_field_invariants.py +++ b/src/sage/quadratic_forms/quadratic_form__local_field_invariants.py @@ -15,7 +15,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range ########################################################################### ## TO DO: Add routines for hasse invariants at all places, anisotropic diff --git a/src/sage/quadratic_forms/quadratic_form__ternary_Tornaria.py b/src/sage/quadratic_forms/quadratic_form__ternary_Tornaria.py index 6d4dff71aa7..9960396049a 100644 --- a/src/sage/quadratic_forms/quadratic_form__ternary_Tornaria.py +++ b/src/sage/quadratic_forms/quadratic_form__ternary_Tornaria.py @@ -11,7 +11,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.rings.integer_ring import ZZ from sage.misc.functional import is_odd diff --git a/src/sage/quivers/algebra.py b/src/sage/quivers/algebra.py index 506378093a2..dedfb4d7392 100644 --- a/src/sage/quivers/algebra.py +++ b/src/sage/quivers/algebra.py @@ -20,7 +20,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -import six from sage.misc.cachefunc import cached_method from sage.combinat.free_module import CombinatorialFreeModule from .algebra_elements import PathAlgebraElement @@ -324,7 +323,7 @@ def _element_constructor_(self, x): # If it's a tuple or a list, try and create a QuiverPath from it and # then return the associated basis element - if isinstance(x, (tuple, list, six.string_types)): + if isinstance(x, (tuple, list, str)): return self.element_class(self, {self._semigroup(x): self.base_ring().one()}) if isinstance(x, dict): diff --git a/src/sage/quivers/path_semigroup.py b/src/sage/quivers/path_semigroup.py index 0f4c0f4b7c4..0ae0d75c22f 100644 --- a/src/sage/quivers/path_semigroup.py +++ b/src/sage/quivers/path_semigroup.py @@ -19,7 +19,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six import integer_types, string_types from sage.rings.integer import Integer from sage.rings.integer_ring import ZZ @@ -173,7 +172,7 @@ def __init__(self, Q): # Check validity of input: vertices have to be labelled 1,2,3,... and # edge labels must be unique for v in Q: - if not isinstance(v, integer_types + (Integer,)): + if not isinstance(v, (Integer, int)): raise ValueError("vertices of the digraph must be labelled by integers") # Determine the category which this (partial) semigroup belongs to @@ -341,7 +340,7 @@ def _element_constructor_(self, data, check=True): elif data == 1: start = end = next(self._quiver.vertex_iterator()) path = [] - elif isinstance(data, string_types): # one edge + elif isinstance(data, str): # one edge i = L.get(data, None) if i is None: raise ValueError("data={!r} is not the label of an edge".format(data)) @@ -349,7 +348,7 @@ def _element_constructor_(self, data, check=True): path = [i] elif not isinstance(data, (tuple, list)): raise TypeError("data={} is not valid. A path must be initialized from either a tuple or a list".format(data)) - elif isinstance(data[0], string_types): # a list of labels + elif isinstance(data[0], str): # a list of labels start = L.get(data[0]) if start is None: raise ValueError("data[0]={!r} is not the label of an edge".format(data[0])) diff --git a/src/sage/repl/attach.py b/src/sage/repl/attach.py index c6cf1b95950..73bc66c4e23 100644 --- a/src/sage/repl/attach.py +++ b/src/sage/repl/attach.py @@ -70,7 +70,6 @@ from __future__ import print_function import os -import six import time from IPython import get_ipython @@ -466,7 +465,7 @@ def detach(filename): ... ValueError: file '/dev/null/foobar.sage' is not attached, see attached_files() """ - if isinstance(filename, six.string_types): + if isinstance(filename, str): filelist = [filename] else: filelist = [str(x) for x in filename] diff --git a/src/sage/repl/display/fancy_repr.py b/src/sage/repl/display/fancy_repr.py index c72ad3f5a68..aa3b83f91e4 100644 --- a/src/sage/repl/display/fancy_repr.py +++ b/src/sage/repl/display/fancy_repr.py @@ -13,6 +13,7 @@ #***************************************************************************** import types +from io import StringIO from IPython.lib.pretty import ( _safe_getattr, _baseclass_reprs, @@ -90,7 +91,6 @@ def format_string(self, obj): 'Error: ObjectReprABC.__call__ is abstract' """ from sage.repl.display.pretty_print import SagePrettyPrinter - from six import StringIO stream = StringIO() p = SagePrettyPrinter(stream, 79, '\n') ok = self(obj, p, False) diff --git a/src/sage/repl/display/formatter.py b/src/sage/repl/display/formatter.py index e445dfd77ba..d1314bcebae 100644 --- a/src/sage/repl/display/formatter.py +++ b/src/sage/repl/display/formatter.py @@ -25,11 +25,11 @@ sage: shell = get_test_shell() sage: shell.run_cell('%display ascii_art') sage: shell.run_cell('integral(x^2/pi^x, x)') - -x / 2 2 \ - -pi *\x *log (pi) + 2*x*log(pi) + 2/ + -x / 2 2 \ + -pi *\x *log (pi) + 2*x*log(pi) + 2/ -------------------------------------- - 3 - log (pi) + 3 + log (pi) sage: shell.run_cell("i = var('i')") sage: shell.run_cell('sum(i*x^i, i, 0, 10)') 10 9 8 7 6 5 4 3 2 @@ -60,6 +60,8 @@ # http://www.gnu.org/licenses/ #***************************************************************************** +from io import StringIO + from IPython.core.formatters import DisplayFormatter, PlainTextFormatter from IPython.utils.py3compat import unicode_to_str @@ -282,7 +284,6 @@ def __call__(self, obj): if DOCTEST_MODE: # Just to show that this is never executed in any other doctests in the Sage library print('---- calling ipython formatter ----') - from six import StringIO stream = StringIO() printer = SagePrettyPrinter( stream, self.max_width, unicode_to_str(self.newline)) diff --git a/src/sage/repl/display/pretty_print.py b/src/sage/repl/display/pretty_print.py index f3863dea6a7..28f150bfb32 100644 --- a/src/sage/repl/display/pretty_print.py +++ b/src/sage/repl/display/pretty_print.py @@ -57,7 +57,7 @@ def toplevel(self): EXAMPLES:: sage: from sage.repl.display.pretty_print import SagePrettyPrinter - sage: from six import StringIO + sage: from io import StringIO sage: stream = StringIO() sage: spp = SagePrettyPrinter(stream, 78, '\n') sage: spp.toplevel() @@ -72,19 +72,19 @@ def __init__(self, output, max_width, newline, max_seq_length=None): INPUT: See IPython documentation. - + EXAMPLES:: sage: 123 123 - + IPython pretty printers:: sage: set({1, 2, 3}) {1, 2, 3} sage: dict(zzz=123, aaa=99, xab=10) # sorted by keys {'aaa': 99, 'xab': 10, 'zzz': 123} - + These are overridden in IPython in a way that we feel is somewhat confusing, and we prefer to print them like plain Python which is more informative. See :trac:`14466` :: @@ -100,7 +100,7 @@ def __init__(self, output, max_width, newline, max_seq_length=None): sage: types.BuiltinFunctionType - + sage: def foo(): pass sage: foo @@ -126,7 +126,7 @@ def pretty(self, obj): EXAMPLES:: sage: from sage.repl.display.pretty_print import SagePrettyPrinter - sage: from six import StringIO + sage: from io import StringIO sage: stream = StringIO() sage: SagePrettyPrinter(stream, 78, '\n').pretty([type, 123, 'foo']) sage: stream.getvalue() diff --git a/src/sage/repl/display/util.py b/src/sage/repl/display/util.py index 7150f3c7e38..32ab8705d17 100644 --- a/src/sage/repl/display/util.py +++ b/src/sage/repl/display/util.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- """ -Utility functions for pretty-printing +Utility functions for pretty-printing These utility functions are used in the implementations of ``_repr_`` methods elsewhere. @@ -15,7 +15,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range class TallListFormatter(object): diff --git a/src/sage/repl/ipython_kernel/widgets_sagenb.py b/src/sage/repl/ipython_kernel/widgets_sagenb.py index a206f78aff7..62e6e3ad17d 100644 --- a/src/sage/repl/ipython_kernel/widgets_sagenb.py +++ b/src/sage/repl/ipython_kernel/widgets_sagenb.py @@ -41,7 +41,6 @@ from sage.structure.all import parent from sage.arith.srange import srange from sage.plot.colors import Color -from sage.misc.six import u from sage.symbolic.ring import SR from sage.rings.all import RR @@ -145,7 +144,7 @@ def input_box(default=None, label=None, type=None, width=80, height=1): if default is not None: kwds["value"] = str(default) if label is not None: - kwds["description"] = u(label) + kwds["description"] = label w = cls(**kwds) w.layout.max_width = str(width+1) + "em" return w @@ -237,7 +236,7 @@ def slider(vmin, vmax=None, step_size=None, default=None, label=None, display_va """ kwds = {"readout": display_value} if label: - kwds["description"] = u(label) + kwds["description"] = label # If vmin is iterable, return a SelectionSlider if isinstance(vmin, Iterable): @@ -415,7 +414,7 @@ def checkbox(default=True, label=None): """ kwds = {"value": bool(default)} if label is not None: - kwds["description"] = u(label) + kwds["description"] = label return Checkbox(**kwds) @@ -491,7 +490,7 @@ def selector(values, label=None, default=None, nrows=None, ncols=None, width=Non if default is not None: kwds["value"] = default if label is not None: - kwds["description"] = u(label) + kwds["description"] = label return cls(**kwds) @@ -536,7 +535,7 @@ def input_grid(nrows, ncols, default=None, label=None, to_value=None, width=4): """ kwds = {"transform": to_value} if label is not None: - kwds["description"] = u(label) + kwds["description"] = label # Parse default if not isinstance(default, list): @@ -582,5 +581,5 @@ def color_selector(default=(0, 0, 1), label=None, widget=None, hide_box=False): kwds = {"value": Color(default).html_color(), "concise": hide_box} if label is not None: - kwds["description"] = u(label) + kwds["description"] = label return SageColorPicker(**kwds) diff --git a/src/sage/repl/preparse.py b/src/sage/repl/preparse.py index 0de43e3b46b..6a9c2b4fe42 100644 --- a/src/sage/repl/preparse.py +++ b/src/sage/repl/preparse.py @@ -227,7 +227,6 @@ import os import re -import six from sage.repl.load import load_wrap @@ -839,14 +838,10 @@ def preparse_numeric_literals(code, extract=False): postfix = m.groups()[-1].upper() if 'R' in postfix: - if not six.PY2: - postfix = postfix.replace('L', '') + postfix = postfix.replace('L', '') num_name = num_make = num + postfix.replace('R', '') elif 'L' in postfix: - if six.PY2: - continue - else: - num_name = num_make = num + postfix.replace('L', '') + num_name = num_make = num + postfix.replace('L', '') else: # The Sage preparser does extra things with numbers, which we need to handle here. @@ -1370,7 +1365,7 @@ def preparse_file(contents, globals=None, numeric_literals=True): _sage_const_100 = Integer(100) type(100 ), type(_sage_const_100 ) """ - if not isinstance(contents, six.string_types): + if not isinstance(contents, str): raise TypeError("contents must be a string") if globals is None: diff --git a/src/sage/repl/rich_output/backend_base.py b/src/sage/repl/rich_output/backend_base.py index c883bfdc32b..61ed572b253 100644 --- a/src/sage/repl/rich_output/backend_base.py +++ b/src/sage/repl/rich_output/backend_base.py @@ -49,6 +49,8 @@ #***************************************************************************** from __future__ import absolute_import +import builtins +from io import StringIO from sage.structure.sage_object import SageObject @@ -265,7 +267,6 @@ def _apply_pretty_printer(self, pretty_printer_class, obj): sage: backend._apply_pretty_printer(SagePrettyPrinter, 1/2) '1/2' """ - from six import StringIO stream = StringIO() printer = pretty_printer_class( stream, self.max_width(), self.newline()) @@ -510,7 +511,6 @@ def set_underscore_variable(self, obj): sage: _ # indirect doctest 'foo' """ - from six.moves import builtins builtins._ = obj def displayhook(self, plain_text, rich_output): diff --git a/src/sage/repl/rich_output/backend_doctest.py b/src/sage/repl/rich_output/backend_doctest.py index 19563357a71..bc66e6b0d56 100644 --- a/src/sage/repl/rich_output/backend_doctest.py +++ b/src/sage/repl/rich_output/backend_doctest.py @@ -24,8 +24,6 @@ import sys -import six - from sage.repl.rich_output.backend_base import BackendBase from sage.repl.rich_output.output_catalog import * @@ -300,10 +298,7 @@ def validate(self, rich_output): assert data[4:8] == b'ftyp' assert data.startswith(b'\0\0\0') # See http://www.ftyps.com/ - if six.PY2: - ftyps = [data[i:i+4] for i in range(8, ord(data[3]), 4)] - else: - ftyps = [data[i:i+4] for i in range(8, data[3], 4)] + ftyps = [data[i:i+4] for i in range(8, data[3], 4)] del ftyps[1] # version number, not an ftyp expected = [b'avc1', b'iso2', b'mp41', b'mp42'] assert any(i in ftyps for i in expected) diff --git a/src/sage/repl/rich_output/buffer.py b/src/sage/repl/rich_output/buffer.py index 0eb216023a2..a0241318d2f 100644 --- a/src/sage/repl/rich_output/buffer.py +++ b/src/sage/repl/rich_output/buffer.py @@ -32,7 +32,6 @@ import os -import six from sage.structure.sage_object import SageObject @@ -232,10 +231,7 @@ def get_str(self): True """ - if six.PY2: - return self.get() - else: - return self.get_unicode() + return self.get_unicode() def filename(self, ext=None): """ diff --git a/src/sage/rings/algebraic_closure_finite_field.py b/src/sage/rings/algebraic_closure_finite_field.py index 959579b194a..f0ae8adc70e 100644 --- a/src/sage/rings/algebraic_closure_finite_field.py +++ b/src/sage/rings/algebraic_closure_finite_field.py @@ -54,7 +54,6 @@ """ from __future__ import print_function -from six.moves import range from sage.misc.abstract_method import abstract_method from sage.misc.fast_methods import WithEqualityById @@ -974,7 +973,7 @@ def _roots_univariate_polynomial(self, p, ring=None, multiplicities=None, algori roots = [] # a list of pair (root,multiplicity) while polys: g,m,l,phi = polys.pop() - + if g.degree() == 1: # found a root r = phi(-g.constant_coefficient()) roots.append((r,m)) diff --git a/src/sage/rings/asymptotic/asymptotic_ring.py b/src/sage/rings/asymptotic/asymptotic_ring.py index fdfd67534c8..829f4d22657 100644 --- a/src/sage/rings/asymptotic/asymptotic_ring.py +++ b/src/sage/rings/asymptotic/asymptotic_ring.py @@ -416,8 +416,6 @@ from __future__ import print_function from __future__ import absolute_import -from six import iteritems - from sage.rings.ring import Algebra from sage.structure.element import CommutativeAlgebraElement from sage.structure.unique_representation import UniqueRepresentation @@ -2644,7 +2642,7 @@ def substitute(self, rules=None, domain=None, **kwds): # update with rules if isinstance(rules, dict): - for k, v in iteritems(rules): + for k, v in rules.items(): if not isinstance(k, str) and k not in gens: raise TypeError('Cannot substitute %s in %s ' 'since it is neither an ' @@ -2694,7 +2692,7 @@ def substitute(self, rules=None, domain=None, **kwds): from .misc import combine_exceptions rules = '{' + ', '.join( '%s: %s' % (k, v) - for k, v in sorted(iteritems(locals), + for k, v in sorted(locals.items(), key=lambda k: str(k[0])) if not k.startswith('_') and not any(k == str(g) and v is g for g in gens)) + '}' diff --git a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py index 8b03d221b61..2c2a40092f7 100644 --- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py +++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py @@ -196,7 +196,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range from functools import total_ordering from itertools import combinations_with_replacement diff --git a/src/sage/rings/asymptotic/misc.py b/src/sage/rings/asymptotic/misc.py index 36e3f9f2419..66bf657ec34 100644 --- a/src/sage/rings/asymptotic/misc.py +++ b/src/sage/rings/asymptotic/misc.py @@ -28,7 +28,6 @@ #***************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range from sage.misc.cachefunc import cached_method from sage.structure.sage_object import SageObject diff --git a/src/sage/rings/big_oh.py b/src/sage/rings/big_oh.py index 330bd18b9e6..9a3e3f1fc16 100644 --- a/src/sage/rings/big_oh.py +++ b/src/sage/rings/big_oh.py @@ -9,7 +9,6 @@ - `polynomials <../../../polynomial_rings/index.html>`_ """ from __future__ import absolute_import -from six import integer_types import sage.arith.all as arith from . import laurent_series_ring_element @@ -146,7 +145,7 @@ def O(*x, **kwds): elif isinstance(x, PuiseuxSeries): return x.add_bigoh(x.valuation(), **kwds) - elif isinstance(x, integer_types + (integer.Integer, rational.Rational)): + elif isinstance(x, (int, integer.Integer, rational.Rational)): # p-adic number if x <= 0: raise ArithmeticError("x must be a prime power >= 2") diff --git a/src/sage/rings/cfinite_sequence.py b/src/sage/rings/cfinite_sequence.py index 278eed76d76..1b8ea677ccb 100644 --- a/src/sage/rings/cfinite_sequence.py +++ b/src/sage/rings/cfinite_sequence.py @@ -86,8 +86,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range -from six import add_metaclass from sage.categories.fields import Fields from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass @@ -162,8 +160,8 @@ def CFiniteSequences(base_ring, names = None, category = None): return CFiniteSequences_generic(polynomial_ring, category) -@add_metaclass(InheritComparisonClasscallMetaclass) -class CFiniteSequence(FieldElement): +class CFiniteSequence(FieldElement, + metaclass=InheritComparisonClasscallMetaclass): r""" Create a C-finite sequence given its ordinary generating function. @@ -586,7 +584,7 @@ def __ne__(self, other): False """ return not self.__eq__(other) - + def __getitem__(self, key): r""" Return a slice of the sequence. diff --git a/src/sage/rings/complex_interval_field.py b/src/sage/rings/complex_interval_field.py index e6c681f06cb..84fc08969f0 100644 --- a/src/sage/rings/complex_interval_field.py +++ b/src/sage/rings/complex_interval_field.py @@ -37,8 +37,6 @@ from __future__ import absolute_import -from six import integer_types - from sage.structure.parent import Parent from .integer_ring import ZZ from .rational_field import QQ @@ -398,9 +396,9 @@ def __eq__(self, other): def __hash__(self): """ Return the hash. - + EXAMPLES:: - + sage: C = ComplexIntervalField(200) sage: from sage.rings.complex_interval_field import ComplexIntervalField_class sage: D = ComplexIntervalField_class(200) @@ -519,7 +517,7 @@ def _coerce_map_from_(self, S): # Direct and efficient conversions if S is ZZ or S is QQ or S is float: return True - if any(S is T for T in integer_types): + if S is int: return True if isinstance(S, (ComplexIntervalField_class, RealIntervalField_class)): diff --git a/src/sage/rings/continued_fraction.py b/src/sage/rings/continued_fraction.py index f3a614b4531..0e93a9b2f6b 100644 --- a/src/sage/rings/continued_fraction.py +++ b/src/sage/rings/continued_fraction.py @@ -200,7 +200,6 @@ """ # python3 from __future__ import division, print_function, absolute_import -from six.moves import range from sage.structure.sage_object import SageObject from sage.structure.richcmp import richcmp_method, rich_to_bool diff --git a/src/sage/rings/finite_rings/conway_polynomials.py b/src/sage/rings/finite_rings/conway_polynomials.py index a6b7783072d..398e5376e48 100644 --- a/src/sage/rings/finite_rings/conway_polynomials.py +++ b/src/sage/rings/finite_rings/conway_polynomials.py @@ -10,8 +10,6 @@ - Peter Bruin """ from __future__ import absolute_import -import six -from six.moves import range from sage.misc.fast_methods import WithEqualityById from sage.structure.sage_object import SageObject @@ -238,7 +236,7 @@ def polynomial(self, n): # Construct a compatible element having order the lcm of orders q, x = xi.popitem() v = p**(n//q) - 1 - for q, xitem in six.iteritems(xi): + for q, xitem in xi.items(): w = p**(n//q) - 1 g, alpha, beta = v.xgcd(w) x = x**beta * xitem**alpha @@ -409,7 +407,7 @@ def _frobenius_shift(K, generators, check_only=False): from .integer_mod import mod for m in n.divisors(): compatible[m] = {} - for q, x in six.iteritems(generators): + for q, x in generators.items(): for m in (n//q).divisors(): compatible[m][q] = x**((p**(n//q)-1)//(p**m-1)) if check_only: @@ -418,7 +416,7 @@ def _frobenius_shift(K, generators, check_only=False): q, x = compatible[m].popitem() except KeyError: break - for qq, xx in six.iteritems(compatible[m]): + for qq, xx in compatible[m].items(): assert x == xx return crt = {} diff --git a/src/sage/rings/fraction_field.py b/src/sage/rings/fraction_field.py index 1c4285d039f..9dfa3ebcaee 100644 --- a/src/sage/rings/fraction_field.py +++ b/src/sage/rings/fraction_field.py @@ -70,8 +70,6 @@ # http://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import range -import six from . import ring from . import fraction_field_element @@ -623,13 +621,13 @@ def _element_constructor_(self, x, y=None, coerce=True): except (TypeError, ValueError): pass - if isinstance(x, six.string_types): + if isinstance(x, str): from sage.misc.sage_eval import sage_eval try: x = sage_eval(x, self.gens_dict_recursive()) except NameError: raise TypeError("unable to evaluate {!r} in {}".format(x, self)) - if isinstance(y, six.string_types): + if isinstance(y, str): from sage.misc.sage_eval import sage_eval try: y = sage_eval(y, self.gens_dict_recursive()) diff --git a/src/sage/rings/infinity.py b/src/sage/rings/infinity.py index 5bff9669bc7..af45fa01c23 100644 --- a/src/sage/rings/infinity.py +++ b/src/sage/rings/infinity.py @@ -216,7 +216,6 @@ #***************************************************************************** # python3 from __future__ import division -from six import integer_types from sys import maxsize from sage.rings.ring import Ring @@ -752,7 +751,7 @@ def _coerce_map_from_(self, R): sage: UnsignedInfinityRing.has_coerce_map_from(SymmetricGroup(13)) False """ - return isinstance(R, Ring) or R in integer_types + (float, complex) + return isinstance(R, Ring) or R in (int, float, complex) UnsignedInfinityRing = UnsignedInfinityRing_class() diff --git a/src/sage/rings/multi_power_series_ring_element.py b/src/sage/rings/multi_power_series_ring_element.py index e5e92420a20..dd1f5df5e47 100644 --- a/src/sage/rings/multi_power_series_ring_element.py +++ b/src/sage/rings/multi_power_series_ring_element.py @@ -154,7 +154,6 @@ # Distributed under the terms of the GNU General Public License (GPL) # https://www.gnu.org/licenses/ # **************************************************************************** -from six import iteritems, integer_types from sage.structure.richcmp import richcmp @@ -554,7 +553,7 @@ def _subs_formal(self, *x, **kwds): base_map = kwds.get('base_map') if base_map is None: base_map = lambda t: t - for m, c in iteritems(self.dict()): + for m, c in self.dict().items(): y += base_map(c)*prod([x[i]**m[i] for i in range(n) if m[i] != 0]) if self.prec() == infinity: return y @@ -1086,7 +1085,7 @@ def __mod__(self, other): sage: g.polynomial() == f.polynomial() % 2 True """ - if isinstance(other, integer_types + (Integer,)): + if isinstance(other, (int, Integer)): return self.change_ring(Zmod(other)) raise NotImplementedError("Mod on multivariate power series ring elements not defined except modulo an integer.") @@ -1285,7 +1284,7 @@ def V(self, n): -x^3*y^12*z^21 - 1/4*y^3*z^36 + 1/2*x^21*y^15*z^6 + 2/3*y^18*z^24 + O(x, y, z)^45 """ cd = self.coefficients() - Vs = sum(v * k**n for k, v in iteritems(cd)) + Vs = sum(v * k**n for k, v in cd.items()) return Vs.add_bigoh(self.prec()*n) def prec(self): @@ -1711,7 +1710,7 @@ def _integral(self, xx): xxe = xx.exponents()[0] pos = [i for i, c in enumerate(xxe) if c != 0][0] # get the position of the variable res = {mon.eadd(xxe): R(co / (mon[pos]+1)) - for mon, co in iteritems(self.dict())} + for mon, co in self.dict().items()} return P( res ).add_bigoh(self.prec()+1) def ogf(self): diff --git a/src/sage/rings/number_field/S_unit_solver.py b/src/sage/rings/number_field/S_unit_solver.py index 02160e99305..16593f89eeb 100644 --- a/src/sage/rings/number_field/S_unit_solver.py +++ b/src/sage/rings/number_field/S_unit_solver.py @@ -71,7 +71,6 @@ from sage.arith.all import gcd, lcm, CRT from copy import copy import itertools -from six.moves import range, zip def column_Log(SUK, iota, U, prec=106): diff --git a/src/sage/rings/number_field/bdd_height.py b/src/sage/rings/number_field/bdd_height.py index 1a45fb46cdd..9b47ffb1f60 100644 --- a/src/sage/rings/number_field/bdd_height.py +++ b/src/sage/rings/number_field/bdd_height.py @@ -28,7 +28,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, division -from six.moves import range from copy import copy from itertools import product @@ -346,7 +345,7 @@ def integer_points_in_polytope(matrix, interval_radius): def bdd_height(K, height_bound, tolerance=1e-2, precision=53): - r""" + r""" Compute all elements in the number field `K` which have relative multiplicative height at most ``height_bound``. @@ -532,7 +531,7 @@ def packet_height(n, pair, u): possible_norm_set.add(m * class_group_rep_norms[n]) bdd_ideals = bdd_norm_pr_ideal_gens(K, possible_norm_set) - # Stores it in form of an dictionary and gives lambda(g)_approx for key g + # Stores it in form of an dictionary and gives lambda(g)_approx for key g for norm in possible_norm_set: gens = bdd_ideals[norm] for g in gens: @@ -618,7 +617,7 @@ def packet_height(n, pair, u): U_copy = copy(U) inter_bound = b - (5*t)/12 - for u in U: + for u in U: u_log = sum([u[j]*vector(fund_unit_log_approx[j]) for j in range(r)]) unit_log_dict[u] = u_log u_height = sum([max(u_log[k], 0) for k in range(r + 1)]) diff --git a/src/sage/rings/number_field/class_group.py b/src/sage/rings/number_field/class_group.py index b60048f9cf0..46d0ca8c9d3 100644 --- a/src/sage/rings/number_field/class_group.py +++ b/src/sage/rings/number_field/class_group.py @@ -40,7 +40,6 @@ sage: (O*(2, 1/2*a + 1/2))^3 Fractional ideal (1/2*a - 3/2) """ -from six.moves import range from sage.groups.abelian_gps.values import AbelianGroupWithValues_class, AbelianGroupWithValuesElement from sage.groups.abelian_gps.abelian_group_element import AbelianGroupElement diff --git a/src/sage/rings/number_field/number_field.py b/src/sage/rings/number_field/number_field.py index 2732f22a093..26e219c1ed1 100644 --- a/src/sage/rings/number_field/number_field.py +++ b/src/sage/rings/number_field/number_field.py @@ -96,8 +96,6 @@ # **************************************************************************** from __future__ import absolute_import, print_function -from six.moves import range -from six import integer_types from sage.misc.cachefunc import cached_method @@ -1779,7 +1777,7 @@ def _convert_non_number_field_element(self, x): sage: K(sqrt(-3)*I) 1/4*a0^3 - 7/2*a0 """ - if isinstance(x, integer_types + (Rational, Integer, pari_gen, list)): + if isinstance(x, (int, Rational, Integer, pari_gen, list)): return self._element_class(self, x) if isinstance(x, sage.rings.polynomial.polynomial_quotient_ring_element.PolynomialQuotientRingElement)\ @@ -7689,7 +7687,7 @@ def _coerce_map_from_(self, R): """ - if R in integer_types: + if R is int: return self._generic_coerce_map(R) elif R in (ZZ, QQ, self.base()): return self._generic_coerce_map(R) diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py index fcb3aefe85b..35ee5a6e4ba 100644 --- a/src/sage/rings/number_field/number_field_ideal.py +++ b/src/sage/rings/number_field/number_field_ideal.py @@ -36,7 +36,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import range SMALL_DISC = 1000000 diff --git a/src/sage/rings/number_field/number_field_rel.py b/src/sage/rings/number_field/number_field_rel.py index 142129125c8..5d24ae4121b 100644 --- a/src/sage/rings/number_field/number_field_rel.py +++ b/src/sage/rings/number_field/number_field_rel.py @@ -71,7 +71,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import, print_function -from six import integer_types import sage.libs.ntl.all as ntl @@ -999,7 +998,7 @@ def _coerce_map_from_(self, R): 2/3 sage: c = a + b # no output """ - if R in integer_types: + if R is int: return self._generic_coerce_map(R) elif R in (ZZ, QQ, self.base_field()): return self._generic_coerce_map(R) diff --git a/src/sage/rings/number_field/order.py b/src/sage/rings/number_field/order.py index bb5ad06f5de..82e2cd2d078 100644 --- a/src/sage/rings/number_field/order.py +++ b/src/sage/rings/number_field/order.py @@ -44,8 +44,6 @@ # **************************************************************************** from __future__ import absolute_import -import six - from sage.misc.cachefunc import cached_method from sage.rings.ring import IntegralDomain from sage.structure.sequence import Sequence @@ -250,7 +248,7 @@ def _coerce_map_from_(self, R): sage: Ok.has_coerce_map_from(ZZ) True """ - return R is ZZ or R in six.integer_types + return R is ZZ or R is int def __mul__(self, right): """ diff --git a/src/sage/rings/padics/generic_nodes.py b/src/sage/rings/padics/generic_nodes.py index 902c1942bc4..a2dc8b2d2e8 100644 --- a/src/sage/rings/padics/generic_nodes.py +++ b/src/sage/rings/padics/generic_nodes.py @@ -18,9 +18,8 @@ # as published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # -# https://www.gnu.org/licenses/ -# **************************************************************************** -from six import iteritems +# http://www.gnu.org/licenses/ +#***************************************************************************** from sage.rings.padics.local_generic import LocalGeneric from sage.rings.padics.padic_generic import pAdicGeneric @@ -669,7 +668,7 @@ def convert_multiple(self, *elts): ans = len(elts)*[None] selfprec = self._precision # First the elements with precision lattice - for (prec, L) in iteritems(elt_by_prec): + for (prec, L) in elt_by_prec.items(): if prec is selfprec: # Here, we use the _copy method in order # to be sharp on precision diff --git a/src/sage/rings/padics/misc.py b/src/sage/rings/padics/misc.py index 3bedd534e69..41278a9dfff 100644 --- a/src/sage/rings/padics/misc.py +++ b/src/sage/rings/padics/misc.py @@ -27,11 +27,11 @@ #***************************************************************************** from __future__ import absolute_import -from six.moves.builtins import min as python_min -from six.moves.builtins import max as python_max -from six.moves.builtins import range, zip from sage.rings.infinity import infinity +python_min = min +python_max = max + def gauss_sum(a, p, f, prec=20, factored=False, algorithm='pari', parent=None): r""" Return the Gauss sum `g_q(a)` as a `p`-adic number. diff --git a/src/sage/rings/polynomial/flatten.py b/src/sage/rings/polynomial/flatten.py index 61d9364eaff..f7168a487b6 100644 --- a/src/sage/rings/polynomial/flatten.py +++ b/src/sage/rings/polynomial/flatten.py @@ -32,7 +32,6 @@ from __future__ import absolute_import, print_function import itertools -import six from sage.categories.homset import Homset from sage.categories.morphism import Morphism @@ -217,15 +216,15 @@ def _call_(self, p): for ring in self._intermediate_rings: new_p = {} if is_PolynomialRing(ring): - for mon, pp in six.iteritems(p): + for mon, pp in p.items(): assert pp.parent() is ring - for i, j in six.iteritems(pp.dict()): - new_p[(i,) + (mon)] = j + for i, j in pp.dict().items(): + new_p[(i,)+(mon)] = j elif is_MPolynomialRing(ring): - for mon, pp in six.iteritems(p): + for mon, pp in p.items(): assert pp.parent() is ring - for mmon, q in six.iteritems(pp.dict()): - new_p[tuple(mmon) + mon] = q + for mmon, q in pp.dict().items(): + new_p[tuple(mmon)+mon] = q else: raise RuntimeError p = new_p diff --git a/src/sage/rings/polynomial/infinite_polynomial_element.py b/src/sage/rings/polynomial/infinite_polynomial_element.py index 4b16bad76c1..8aeea8ee992 100644 --- a/src/sage/rings/polynomial/infinite_polynomial_element.py +++ b/src/sage/rings/polynomial/infinite_polynomial_element.py @@ -88,7 +88,6 @@ # # https://www.gnu.org/licenses/ # **************************************************************************** -from six.moves import range from sage.rings.integer_ring import ZZ from sage.rings.integer import Integer diff --git a/src/sage/rings/polynomial/infinite_polynomial_ring.py b/src/sage/rings/polynomial/infinite_polynomial_ring.py index b9c93cbb1f5..281b8129d14 100644 --- a/src/sage/rings/polynomial/infinite_polynomial_ring.py +++ b/src/sage/rings/polynomial/infinite_polynomial_ring.py @@ -254,9 +254,7 @@ # # https://www.gnu.org/licenses/ # **************************************************************************** -from six.moves import range -import six from sage.rings.ring import CommutativeRing from sage.categories.rings import Rings from sage.structure.all import SageObject, parent @@ -484,7 +482,7 @@ def __getitem__(self, k): """ - if not isinstance(k, six.string_types): + if not isinstance(k, str): raise KeyError("String expected") L = k.split('_') try: @@ -704,12 +702,12 @@ def __init__(self, R, names, order): if not names: names = ['x'] for n in names: - if not (isinstance(n, six.string_types) and n.isalnum() and (not n[0].isdigit())): - raise ValueError("generator names must be alpha-numeric strings not starting with a digit, but %s isn't" % n) + if not (isinstance(n, str) and n.isalnum() and (not n[0].isdigit())): + raise ValueError("generator names must be alpha-numeric strings not starting with a digit, but %s isn't"%n) if len(names) != len(set(names)): raise ValueError("generator names must be pairwise different") self._names = tuple(names) - if not isinstance(order, six.string_types): + if not isinstance(order, str): raise TypeError("The monomial order must be given as a string") if not R in Rings().Commutative(): raise TypeError("The given 'base ring' (= %s) must be a commutative ring" % R) @@ -895,7 +893,7 @@ def _element_constructor_(self, x): # In many cases, the easiest solution is to "simply" evaluate # the string representation. from sage.misc.sage_eval import sage_eval - if isinstance(x, six.string_types): + if isinstance(x, str): try: x = sage_eval(x, self.gens_dict()) except Exception: diff --git a/src/sage/rings/polynomial/laurent_polynomial_ring.py b/src/sage/rings/polynomial/laurent_polynomial_ring.py index 914d49d10c0..207c63ee724 100644 --- a/src/sage/rings/polynomial/laurent_polynomial_ring.py +++ b/src/sage/rings/polynomial/laurent_polynomial_ring.py @@ -42,7 +42,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import range from sage.structure.element import parent from sage.structure.parent import Parent @@ -1179,7 +1178,7 @@ def _element_constructor_(self, x, mon=None): elif isinstance(x, (LaurentPolynomial_univariate, LaurentPolynomial_mpair)): if self.variable_names() == P.variable_names(): - # No special processing needed here; + # No special processing needed here; # handled by LaurentPolynomial_mpair.__init__ pass elif set(self.variable_names()) & set(P.variable_names()): diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py index e5d692150c6..691c84009b9 100644 --- a/src/sage/rings/polynomial/multi_polynomial_element.py +++ b/src/sage/rings/polynomial/multi_polynomial_element.py @@ -53,8 +53,6 @@ # https://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six.moves import range -from six import iteritems, integer_types from sage.structure.element import CommutativeRingElement, coerce_binop from sage.misc.all import prod @@ -158,7 +156,7 @@ def __call__(self, *x, **kwds): except AttributeError: K = self.parent().base_ring() y = K(0) - for (m,c) in iteritems(self.element().dict()): + for (m,c) in self.element().dict().items(): y += c*prod([ x[i]**m[i] for i in range(n) if m[i] != 0]) return y @@ -220,7 +218,7 @@ def _im_gens_(self, codomain, im_gens, base_map=None): if base_map is None: # Just use conversion base_map = codomain - for (m,c) in iteritems(self.element().dict()): + for (m,c) in self.element().dict().items(): y += base_map(c)*prod([ im_gens[i]**m[i] for i in range(n) if m[i] ]) return y @@ -336,7 +334,7 @@ def _div_(self, right): return self.parent().fraction_field()(self, right, coerce=False) def __rpow__(self, n): - if not isinstance(n, integer_types + (sage.rings.integer.Integer,)): + if not isinstance(n, (int, sage.rings.integer.Integer)): raise TypeError("The exponent must be an integer.") return self.parent()(self.__element**n) @@ -1616,14 +1614,14 @@ def _derivative(self, var=None): except ValueError: # var is not a generator; do term-by-term differentiation recursively # var may be, for example, a generator of the base ring - d = dict([(e, x._derivative(var)) for (e, x) in iteritems(self.dict())]) + d = dict([(e, x._derivative(var)) for (e, x) in self.dict().items()]) d = polydict.PolyDict(d, self.parent().base_ring()(0), remove_zero=True) return MPolynomial_polydict(self.parent(), d) # differentiate w.r.t. indicated variable d = {} v = polydict.ETuple({index:1}, len(gens)) - for (exp, coeff) in iteritems(self.dict()): + for (exp, coeff) in self.dict().items(): if exp[index] > 0: d[exp.esub(v)] = coeff * exp[index] d = polydict.PolyDict(d, self.parent().base_ring()(0), remove_zero=True) @@ -1688,7 +1686,7 @@ def integral(self, var=None): # var is not a generator; do term-by-term integration recursively # var may be, for example, a generator of the base ring d = dict([(e, x.integral(var)) - for (e, x) in iteritems(self.dict())]) + for (e, x) in self.dict().items()]) d = polydict.PolyDict(d, self.parent().base_ring()(0), remove_zero=True) return MPolynomial_polydict(self.parent(), d) @@ -1696,7 +1694,7 @@ def integral(self, var=None): # integrate w.r.t. indicated variable d = {} v = polydict.ETuple({index:1}, len(gens)) - for (exp, coeff) in iteritems(self.dict()): + for (exp, coeff) in self.dict().items(): d[exp.eadd(v)] = coeff / (1+exp[index]) d = polydict.PolyDict(d, self.parent().base_ring()(0), remove_zero=True) return MPolynomial_polydict(self.parent(), d) diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py index 35c2374fbcb..547dc32ee8e 100644 --- a/src/sage/rings/polynomial/multi_polynomial_ideal.py +++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py @@ -233,8 +233,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six import iteritems -from six.moves import range from sage.interfaces.all import (singular as singular_default, macaulay2 as macaulay2_default, @@ -529,7 +527,7 @@ def _groebner_basis_libsingular(self, algorithm="groebner", *args, **kwds): if get_verbose()>=2: opt['prot'] = True - for name, value in iteritems(kwds): + for name, value in kwds.items(): if value is not None: opt[name] = value @@ -1428,7 +1426,7 @@ def _groebner_basis_singular_raw(self, algorithm="groebner", singular=singular_d if get_verbose() >= 2: kwds['prot'] = True - for o, v in iteritems(kwds): + for o, v in kwds.items(): o = _options_py_to_singular.get(o,o) if v: if o in ['degBound','multBound']: @@ -3761,7 +3759,7 @@ def __richcmp__(self, other, op): if other_new.groebner_basis.is_in_cache(): r = other_new.groebner_basis() elif len(other_new._gb_by_ordering): - o, r = next(iteritems(other_new._gb_by_ordering)) + o, r = next(iter(other_new._gb_by_ordering.items())) l = self.change_ring(R.change_ring(order=o)).gens() else: # use easy GB otherwise newR = R.change_ring(order="degrevlex") diff --git a/src/sage/rings/polynomial/multi_polynomial_ring.py b/src/sage/rings/polynomial/multi_polynomial_ring.py index 27203ce42e6..20f1574e900 100644 --- a/src/sage/rings/polynomial/multi_polynomial_ring.py +++ b/src/sage/rings/polynomial/multi_polynomial_ring.py @@ -60,7 +60,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six.moves import range from sage.rings.ring import IntegralDomain import sage.rings.fraction_field_element as fraction_field_element diff --git a/src/sage/rings/polynomial/multi_polynomial_sequence.py b/src/sage/rings/polynomial/multi_polynomial_sequence.py index 56ab5182b60..5681663d134 100644 --- a/src/sage/rings/polynomial/multi_polynomial_sequence.py +++ b/src/sage/rings/polynomial/multi_polynomial_sequence.py @@ -149,7 +149,6 @@ ------- """ from __future__ import print_function -from six.moves import range from sage.misc.cachefunc import cached_method @@ -1002,7 +1001,7 @@ def __reduce__(self): True """ - return PolynomialSequence, (self._ring, self._parts, self._is_immutable, + return PolynomialSequence, (self._ring, self._parts, self._is_immutable, self._Sequence_generic__cr, self._Sequence_generic__cr_str) @singular_gb_standard_options diff --git a/src/sage/rings/polynomial/omega.py b/src/sage/rings/polynomial/omega.py index 80813b856e4..d9da191eb7a 100644 --- a/src/sage/rings/polynomial/omega.py +++ b/src/sage/rings/polynomial/omega.py @@ -53,7 +53,6 @@ from __future__ import print_function from __future__ import absolute_import -from six import iteritems import operator from sage.misc.cachefunc import cached_function @@ -322,7 +321,7 @@ def MacMahonOmega(var, expression, denominator=None, op=operator.ge, if not D: raise ZeroDivisionError('Denominator contains a factor 0.') elif len(D) == 1: - exponent, coefficient = next(iteritems(D)) + exponent, coefficient = next(iter(D.items())) if exponent == 0: other_factors.append(L0(factor)) else: @@ -331,7 +330,7 @@ def MacMahonOmega(var, expression, denominator=None, op=operator.ge, if D.get(0, 0) != 1: raise NotImplementedError('Factor {} is not normalized.'.format(factor)) D.pop(0) - exponent, coefficient = next(iteritems(D)) + exponent, coefficient = next(iter(D.items())) decoded_factors.append((-coefficient, exponent)) else: raise NotImplementedError('Cannot handle factor {}.'.format(factor)) @@ -446,7 +445,7 @@ def _Omega_(A, decoded_factors): (x + 1) * (-x*y + 1)^-1 """ if not decoded_factors: - return sum(c for a, c in iteritems(A) if a >= 0), tuple() + return sum(c for a, c in A.items() if a >= 0), tuple() # Below we sort to make the caching more efficient. Doing this here # (in contrast to directly in Omega_ge) results in much cleaner @@ -456,7 +455,7 @@ def _Omega_(A, decoded_factors): numerator = 0 factors_denominator = None rules = None - for a, c in iteritems(A): + for a, c in A.items(): n, fd = Omega_ge(a, exponents) if factors_denominator is None: factors_denominator = fd @@ -603,7 +602,7 @@ def subs_e(e): e[p] = e[p] // exponent return tuple(e) parent = expression.parent() - result = parent({subs_e(e): c for e, c in iteritems(expression.dict())}) + result = parent({subs_e(e): c for e, c in expression.dict().items()}) return result def de_power(expression): diff --git a/src/sage/rings/polynomial/padics/polynomial_padic.py b/src/sage/rings/polynomial/padics/polynomial_padic.py index cad8caed367..88b032ef92c 100644 --- a/src/sage/rings/polynomial/padics/polynomial_padic.py +++ b/src/sage/rings/polynomial/padics/polynomial_padic.py @@ -22,8 +22,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range -from builtins import zip import re from sage.rings.padics.precision_error import PrecisionError diff --git a/src/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py b/src/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py index 6bfb935cfda..9ef55881d35 100644 --- a/src/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py +++ b/src/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py @@ -8,7 +8,6 @@ # the License, or (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range import sage.rings.polynomial.polynomial_element_generic from sage.rings.polynomial.polynomial_element import Polynomial @@ -21,7 +20,6 @@ import sage.rings.fraction_field_element as fraction_field_element import copy from sage.structure.element import coerce_binop -import six from sage.libs.all import pari, pari_gen from sage.libs.ntl.all import ZZX @@ -111,7 +109,7 @@ def __init__(self, parent, x=None, check=True, is_gen=False, construct = False, zero = parentbr.zero() n = max(x.keys()) if x else 0 v = [zero] * (n + 1) - for i, z in six.iteritems(x): + for i, z in x.items(): v[i] = z x = v elif isinstance(x, pari_gen): @@ -753,11 +751,11 @@ def degree(self, secure=False): - secure -- a boolean (default: ``False``) If ``secure`` is ``True`` and the degree of this polynomial - is not determined (because the leading coefficient is + is not determined (because the leading coefficient is indistinguishable from 0), an error is raised. - If ``secure`` is ``False``, the returned value is the largest - $n$ so that the coefficient of $x^n$ does not compare equal + If ``secure`` is ``False``, the returned value is the largest + $n$ so that the coefficient of $x^n$ does not compare equal to $0$. EXAMPLES:: @@ -1264,7 +1262,7 @@ def is_eisenstein(self, secure=False): ... PrecisionError: Not enough precision on the constant coefficient - sage: g = R([5,K(0,0),0,1]); g + sage: g = R([5,K(0,0),0,1]); g (1 + O(5^20))*t^3 + O(5^0)*t + 5 + O(5^21) sage: g.is_eisenstein() True @@ -1293,7 +1291,7 @@ def is_eisenstein(self, secure=False): for i in range(1, deg): if relprecs[i] < compval: # not enough precision if valaddeds[i] < relprecs[i]: return False - if secure: + if secure: if i == 1: raise PrecisionError("Not enough precision on the coefficient of %s" % self.variable_name()) else: diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index 2d933e8c455..3bf9cc5fc3a 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -6515,13 +6515,6 @@ cdef class Polynomial(CommutativeAlgebraElement): TESTS: - In Python 2, ``operator.div`` still works:: - - sage: from six import PY2 - sage: div = getattr(operator, "div" if PY2 else "truediv") - sage: p1.composed_op(p2, div) - x^6 + x^5 + x^4 + x^2 + 1 - :: sage: y = polygen(ZZ) diff --git a/src/sage/rings/polynomial/polynomial_element_generic.py b/src/sage/rings/polynomial/polynomial_element_generic.py index 81aee6e5deb..7319ae55443 100644 --- a/src/sage/rings/polynomial/polynomial_element_generic.py +++ b/src/sage/rings/polynomial/polynomial_element_generic.py @@ -30,8 +30,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -import six -from six.moves import range from sage.rings.polynomial.polynomial_element import Polynomial, Polynomial_generic_dense, Polynomial_generic_dense_inexact from sage.structure.element import IntegralDomainElement, EuclideanDomainElement @@ -100,7 +98,7 @@ def __init__(self, parent, x=None, check=True, is_gen=False, construct=False): x = {0:x} else: w = {} - for n, c in six.iteritems(x.dict()): + for n, c in x.dict().items(): w[n] = R(c) # The following line has been added in trac ticket #9944. # Apparently, the "else" case has never occured before. @@ -117,7 +115,7 @@ def __init__(self, parent, x=None, check=True, is_gen=False, construct=False): x = {0:x} # constant polynomials if check: self.__coeffs = {} - for i, z in six.iteritems(x): + for i, z in x.items(): self.__coeffs[i] = R(z) else: self.__coeffs = x @@ -258,7 +256,7 @@ def _derivative(self, var=None): # compute formal derivative with respect to generator d = {} - for n, c in six.iteritems(self.__coeffs): + for n, c in self.__coeffs.items(): d[n-1] = n*c if -1 in d: del d[-1] @@ -324,9 +322,9 @@ def integral(self, var=None): Q = R.change_ring(F) if var is not None and var != R.gen(): - return Q({k:v.integral(var) for k,v in six.iteritems(self.__coeffs)}, check=False) + return Q({k:v.integral(var) for k,v in self.__coeffs.items()}, check=False) - return Q({ k+1:v/(k+1) for k,v in six.iteritems(self.__coeffs)}, check=False) + return Q({ k+1:v/(k+1) for k,v in self.__coeffs.items()}, check=False) def _dict_unsafe(self): """ @@ -373,7 +371,7 @@ def _repr(self, name=None): if name is None: name = self.parent().variable_name() atomic_repr = self.parent().base_ring()._repr_option('element_is_atomic') - coeffs = sorted(six.iteritems(self.__coeffs)) + coeffs = sorted(self.__coeffs.items()) for (n, x) in reversed(coeffs): if x: if n != m-1: @@ -399,7 +397,7 @@ def _repr(self, name=None): def __normalize(self): x = self.__coeffs - D = [n for n, z in six.iteritems(x) if not z] + D = [n for n, z in x.items() if not z] for n in D: del x[n] @@ -519,7 +517,7 @@ def list(self, copy=True): """ zero = self.base_ring().zero() v = [zero] * (self.degree()+1) - for n, x in six.iteritems(self.__coeffs): + for n, x in self.__coeffs.items(): v[n] = x return v @@ -552,7 +550,7 @@ def _add_(self, right): """ output = dict(self.__coeffs) - for (index, coeff) in six.iteritems(right.__coeffs): + for (index, coeff) in right.__coeffs.items(): if index in output: output[index] += coeff else: @@ -573,7 +571,7 @@ def _neg_(self): -x^10000000 """ output = { } - for (index, coeff) in six.iteritems(self.__coeffs): + for (index, coeff) in self.__coeffs.items(): output[index] = -coeff output = self.parent()(output, check=False) return output @@ -593,8 +591,8 @@ def _mul_(self, right): """ output = {} - for (index1, coeff1) in six.iteritems(self.__coeffs): - for (index2, coeff2) in six.iteritems(right.__coeffs): + for (index1, coeff1) in self.__coeffs.items(): + for (index2, coeff2) in right.__coeffs.items(): product = coeff1 * coeff2 index = index1 + index2 if index in output: @@ -622,7 +620,7 @@ def _rmul_(self, left): """ output = {} - for (index, coeff) in six.iteritems(self.__coeffs): + for (index, coeff) in self.__coeffs.items(): output[index] = left * coeff output = self.parent()(output, check=False) @@ -645,7 +643,7 @@ def _lmul_(self, right): """ output = {} - for (index, coeff) in six.iteritems(self.__coeffs): + for (index, coeff) in self.__coeffs.items(): output[index] = coeff * right output = self.parent()(output, check=False) @@ -750,10 +748,10 @@ def shift(self, n): if n == 0: return self if n > 0: - output = {index+n: coeff for index, coeff in six.iteritems(self.__coeffs)} + output = {index+n: coeff for index, coeff in self.__coeffs.items()} return self.parent()(output, check=False) if n < 0: - output = {index+n:coeff for index, coeff in six.iteritems(self.__coeffs) if index + n >= 0} + output = {index+n:coeff for index, coeff in self.__coeffs.items() if index + n >= 0} return self.parent()(output, check=False) @coerce_binop @@ -941,7 +939,7 @@ def reverse(self, degree=None): degree = self.degree() if not isinstance(degree, (int,Integer)): raise ValueError("degree argument must be a nonnegative integer, got %s"%degree) - d = {degree-k: v for k,v in six.iteritems(self.__coeffs) if degree >= k} + d = {degree-k: v for k,v in self.__coeffs.items() if degree >= k} return self.parent()(d, check=False) def truncate(self, n): diff --git a/src/sage/rings/polynomial/polynomial_quotient_ring.py b/src/sage/rings/polynomial/polynomial_quotient_ring.py index 1e2052c1ece..de62148fd46 100644 --- a/src/sage/rings/polynomial/polynomial_quotient_ring.py +++ b/src/sage/rings/polynomial/polynomial_quotient_ring.py @@ -37,9 +37,7 @@ #***************************************************************************** from __future__ import absolute_import, print_function -from six.moves import range -import six import sage.rings.number_field.all from . import polynomial_element import sage.rings.rational_field @@ -489,7 +487,7 @@ def _element_constructor_(self, x): -x """ - if not isinstance(x, six.string_types): + if not isinstance(x, str): try: return self.element_class(self, self.__ring(x) , check=True) except TypeError: @@ -1785,7 +1783,7 @@ def _isomorphic_ring(self): # recursively try to rewrite the isomorphic_quotient isomorphic_ring_to_isomorphic_quotient, isomorphic_quotient_to_isomorphic_ring, isomorphic_ring = isomorphic_quotient._isomorphic_ring() - + # the process has likely refined the category of # isomorphic_quotient (to Fields e.g.) so we use the same category # for self @@ -1857,7 +1855,7 @@ def _isomorphic_ring(self): x = A.solve_left(A.column_space().basis()[1]) primitive_element = sum(c*b for c,b in zip(x.list(), basis)) from_isomorphic_ring = isomorphic_ring.hom([primitive_element], check=False) - + return from_isomorphic_ring, to_isomorphic_ring, isomorphic_ring from sage.categories.all import NumberFields diff --git a/src/sage/rings/polynomial/polynomial_quotient_ring_element.py b/src/sage/rings/polynomial/polynomial_quotient_ring_element.py index 0feda96675d..e84c2d9c5fd 100644 --- a/src/sage/rings/polynomial/polynomial_quotient_ring_element.py +++ b/src/sage/rings/polynomial/polynomial_quotient_ring_element.py @@ -83,7 +83,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.structure.element import CommutativeRingElement from sage.structure.richcmp import richcmp diff --git a/src/sage/rings/polynomial/polynomial_ring.py b/src/sage/rings/polynomial/polynomial_ring.py index ce311014d39..f19e94c7667 100644 --- a/src/sage/rings/polynomial/polynomial_ring.py +++ b/src/sage/rings/polynomial/polynomial_ring.py @@ -141,7 +141,6 @@ from __future__ import absolute_import, print_function import sys -from six.moves import range from sage.structure.element import Element @@ -375,7 +374,6 @@ def _element_constructor_(self, x=None, check=True, is_gen=False, Python 3 range is allowed:: - sage: from six.moves import range sage: R = PolynomialRing(ZZ,'x') sage: R(range(4)) 3*x^3 + 2*x^2 + x diff --git a/src/sage/rings/polynomial/symmetric_ideal.py b/src/sage/rings/polynomial/symmetric_ideal.py index 9503e1b417c..989bc6cb4a2 100644 --- a/src/sage/rings/polynomial/symmetric_ideal.py +++ b/src/sage/rings/polynomial/symmetric_ideal.py @@ -55,7 +55,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range from sage.rings.ideal import Ideal_generic from sage.rings.integer import Integer diff --git a/src/sage/rings/polynomial/toy_variety.py b/src/sage/rings/polynomial/toy_variety.py index b2bb3bfd747..77084f8760d 100644 --- a/src/sage/rings/polynomial/toy_variety.py +++ b/src/sage/rings/polynomial/toy_variety.py @@ -28,7 +28,7 @@ documentation were stolen shamelessly from Martin Albrecht's ``toy_buchberger.py``. """ -from six.moves import range + def is_triangular(B): diff --git a/src/sage/rings/power_series_ring.py b/src/sage/rings/power_series_ring.py index d42578a4fe9..d9e7aa124c2 100644 --- a/src/sage/rings/power_series_ring.py +++ b/src/sage/rings/power_series_ring.py @@ -122,7 +122,6 @@ """ from __future__ import absolute_import -from six import integer_types from . import power_series_poly from . import power_series_mpoly @@ -352,7 +351,7 @@ def PowerSeriesRing(base_ring, name=None, arg2=None, names=None, arg2 = names names = num_gens if (isinstance(arg2, str) and - isinstance(names, integer_types + (integer.Integer,))): + isinstance(names, (int, integer.Integer))): return _multi_variate(base_ring, num_gens=names, names=arg2, order=order, default_prec=default_prec, sparse=sparse) @@ -377,7 +376,7 @@ def PowerSeriesRing(base_ring, name=None, arg2=None, names=None, # the following is the original, univariate-only code - if isinstance(name, integer_types + (integer.Integer,)): + if isinstance(name, (int, integer.Integer)): default_prec = name if not names is None: name = names diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py index dc6556c8902..7fc0cb99173 100644 --- a/src/sage/rings/qqbar.py +++ b/src/sage/rings/qqbar.py @@ -522,8 +522,6 @@ """ from __future__ import absolute_import, print_function, division -from six.moves import range -from six import integer_types, iteritems import itertools import operator @@ -2073,7 +2071,7 @@ def clear_denominators(poly): min_e = (e + (deg - i) - 1) // (deg - i) factors[f] = max(oe, min_e) change = 1 - for f, e in iteritems(factors): + for f, e in factors.items(): change = change * f**e poly = poly * (change**deg) poly = poly(poly.parent().gen() / change) @@ -3412,7 +3410,7 @@ def __init__(self, parent, x): 22/7 """ sage.structure.element.FieldElement.__init__(self, parent) - if isinstance(x, integer_types + (sage.rings.integer.Integer, + if isinstance(x, (int, sage.rings.integer.Integer, sage.rings.rational.Rational)): self._descr = ANRational(x) elif isinstance(x, ANDescr): @@ -6038,7 +6036,7 @@ def __init__(self, x): if isinstance(x, (sage.rings.integer.Integer, sage.rings.rational.Rational)): self._value = x - elif isinstance(x, integer_types): + elif isinstance(x, int): self._value = ZZ(x) else: raise TypeError("Illegal initializer for algebraic number rational") diff --git a/src/sage/rings/qqbar_decorators.py b/src/sage/rings/qqbar_decorators.py index e0d04f41c56..48f784d7fc9 100644 --- a/src/sage/rings/qqbar_decorators.py +++ b/src/sage/rings/qqbar_decorators.py @@ -11,8 +11,6 @@ ========== """ -from six.moves import map - from sage.misc.decorators import decorator_keywords, sage_wraps @decorator_keywords diff --git a/src/sage/rings/quotient_ring.py b/src/sage/rings/quotient_ring.py index ea2a847474c..09c5ba2d02f 100644 --- a/src/sage/rings/quotient_ring.py +++ b/src/sage/rings/quotient_ring.py @@ -108,7 +108,6 @@ #***************************************************************************** from __future__ import absolute_import -from six.moves import range import sage.misc.latex as latex from . import ring, ideal, quotient_ring_element diff --git a/src/sage/rings/rational_field.py b/src/sage/rings/rational_field.py index 6afb04bd1bc..3e45f269934 100644 --- a/src/sage/rings/rational_field.py +++ b/src/sage/rings/rational_field.py @@ -55,12 +55,6 @@ """ from __future__ import print_function, absolute_import -import six -if six.PY2: - _long_type = long -else: - _long_type = int - from .rational import Rational from .integer import Integer @@ -389,10 +383,8 @@ def _coerce_map_from_(self, S): ZZ = integer_ring.ZZ if S is ZZ: return rational.Z_to_Q() - elif S is _long_type: - return rational.long_to_Q() elif S is int: - return rational.int_to_Q() + return rational.long_to_Q() elif ZZ.has_coerce_map_from(S): return rational.Z_to_Q() * ZZ._internal_coerce_map_from(S) from sage.rings.localization import Localization diff --git a/src/sage/rings/universal_cyclotomic_field.py b/src/sage/rings/universal_cyclotomic_field.py index a1956ac9a2a..2a69af743fe 100644 --- a/src/sage/rings/universal_cyclotomic_field.py +++ b/src/sage/rings/universal_cyclotomic_field.py @@ -163,7 +163,6 @@ - Sebastian Oehms (2019): add :meth:`_factor_univariate_polynomial` (see :trac:`28631`) """ from __future__ import absolute_import, print_function -from six.moves import range from sage.misc.cachefunc import cached_method diff --git a/src/sage/sandpiles/sandpile.py b/src/sage/sandpiles/sandpile.py index 6eb0df739df..eca470cc596 100644 --- a/src/sage/sandpiles/sandpile.py +++ b/src/sage/sandpiles/sandpile.py @@ -313,7 +313,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function, division -from six.moves import zip, range from collections import Counter from copy import deepcopy diff --git a/src/sage/sat/boolean_polynomials.py b/src/sage/sat/boolean_polynomials.py index facd4414683..dbba7ce6c97 100644 --- a/src/sage/sat/boolean_polynomials.py +++ b/src/sage/sat/boolean_polynomials.py @@ -25,9 +25,6 @@ from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence -import six - - def solve(F, converter=None, solver=None, n=1, target_variables=None, **kwds): """ Solve system of Boolean polynomials ``F`` by solving the @@ -243,7 +240,7 @@ def solve(F, converter=None, solver=None, n=1, target_variables=None, **kwds): if not isinstance(solver, SatSolver): solver_kwds = {} - for k, v in six.iteritems(kwds): + for k, v in kwds.items(): if k.startswith("s_"): solver_kwds[k[2:]] = v @@ -256,7 +253,7 @@ def solve(F, converter=None, solver=None, n=1, target_variables=None, **kwds): if not isinstance(converter, ANF2CNFConverter): converter_kwds = {} - for k, v in six.iteritems(kwds): + for k, v in kwds.items(): if k.startswith("c_"): converter_kwds[k[2:]] = v @@ -362,7 +359,7 @@ def learn(F, converter=None, solver=None, max_learnt_length=3, interreduction=Fa from sage.sat.solvers.cryptominisat import CryptoMiniSat as solver solver_kwds = {} - for k, v in six.iteritems(kwds): + for k, v in kwds.items(): if k.startswith("s_"): solver_kwds[k[2:]] = v @@ -374,7 +371,7 @@ def learn(F, converter=None, solver=None, max_learnt_length=3, interreduction=Fa from sage.sat.converters.polybori import CNFEncoder as converter converter_kwds = {} - for k, v in six.iteritems(kwds): + for k, v in kwds.items(): if k.startswith("c_"): converter_kwds[k[2:]] = v diff --git a/src/sage/sat/converters/polybori.py b/src/sage/sat/converters/polybori.py index f3516d545a2..0eb892e937e 100644 --- a/src/sage/sat/converters/polybori.py +++ b/src/sage/sat/converters/polybori.py @@ -35,8 +35,6 @@ from sage.combinat.permutation import Permutations from sage.sat.converters import ANF2CNFConverter -import six - class CNFEncoder(ANF2CNFConverter): """ @@ -281,7 +279,7 @@ def clauses_sparse(self, f): # any zero block of f+1 blocks = self.zero_blocks(f + 1) - C = [{variable: 1 - value for variable, value in six.iteritems(b)} + C = [{variable: 1 - value for variable, value in b.items()} for b in blocks] def to_dimacs_index(v): @@ -290,7 +288,7 @@ def to_dimacs_index(v): def clause(c): return [to_dimacs_index(variable) if value == 1 else -to_dimacs_index(variable) - for variable, value in six.iteritems(c)] + for variable, value in c.items()] data = (clause(c) for c in C) for d in sorted(data): diff --git a/src/sage/sat/solvers/satsolver.pyx b/src/sage/sat/solvers/satsolver.pyx index 8b1af2dfd3c..08affa6e34f 100644 --- a/src/sage/sat/solvers/satsolver.pyx +++ b/src/sage/sat/solvers/satsolver.pyx @@ -115,7 +115,7 @@ cdef class SatSolver: EXAMPLES:: - sage: from six import StringIO # for python 2/3 support + sage: from io import StringIO sage: file_object = StringIO("c A sample .cnf file.\np cnf 3 2\n1 -3 0\n2 3 -1 0 ") sage: from sage.sat.solvers.dimacs import DIMACS sage: solver = DIMACS() @@ -125,7 +125,7 @@ cdef class SatSolver: With xor clauses:: - sage: from six import StringIO # for python 2/3 support + sage: from io import StringIO sage: file_object = StringIO("c A sample .cnf file with xor clauses.\np cnf 3 3\n1 2 0\n3 0\nx1 2 3 0") sage: from sage.sat.solvers.cryptominisat import CryptoMiniSat # optional - cryptominisat sage: solver = CryptoMiniSat() # optional - cryptominisat @@ -137,7 +137,7 @@ cdef class SatSolver: TESTS:: - sage: from six import StringIO # for python 2/3 support + sage: from io import StringIO sage: file_object = StringIO("c A sample .cnf file with xor clauses.\np cnf 3 3\n1 2 0\n3 0\nx1 2 3 0") sage: from sage.sat.solvers.sat_lp import SatLP sage: solver = SatLP() diff --git a/src/sage/schemes/affine/affine_rational_point.py b/src/sage/schemes/affine/affine_rational_point.py index f7db3b3d17f..122103dacc4 100644 --- a/src/sage/schemes/affine/affine_rational_point.py +++ b/src/sage/schemes/affine/affine_rational_point.py @@ -50,7 +50,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.rings.all import ZZ, QQ from sage.misc.all import cartesian_product_iterator diff --git a/src/sage/schemes/affine/affine_space.py b/src/sage/schemes/affine/affine_space.py index 00886ac549d..0c847dbea65 100644 --- a/src/sage/schemes/affine/affine_space.py +++ b/src/sage/schemes/affine/affine_space.py @@ -10,7 +10,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -from six import integer_types from sage.functions.orthogonal_polys import chebyshev_T, chebyshev_U from sage.rings.all import (PolynomialRing, ZZ, Integer) @@ -119,7 +118,7 @@ def AffineSpace(n, R=None, names=None, ambient_projective_space=None, names = '' else: names = 'x' - if isinstance(R, integer_types + (Integer,)): + if isinstance(R, (Integer, int)): n, R = R, n if R is None: R = ZZ # default is the integers diff --git a/src/sage/schemes/elliptic_curves/constructor.py b/src/sage/schemes/elliptic_curves/constructor.py index c3d758f0c89..6a53a384081 100644 --- a/src/sage/schemes/elliptic_curves/constructor.py +++ b/src/sage/schemes/elliptic_curves/constructor.py @@ -23,7 +23,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six import string_types, integer_types import sage.rings.all as rings @@ -415,7 +414,7 @@ def create_key_and_extra_args(self, x=None, y=None, j=None, minimal_twist=True, # x is a cubic, y a rational point x = EllipticCurve_from_cubic(x, y, morphism=False).ainvs() - if isinstance(x, string_types): + if isinstance(x, str): # Interpret x as a Cremona or LMFDB label. from sage.databases.cremona import CremonaDatabase x, data = CremonaDatabase().coefficients_and_data(x) @@ -433,7 +432,7 @@ def create_key_and_extra_args(self, x=None, y=None, j=None, minimal_twist=True, if R is None: R = Sequence(x).universe() - if R in (rings.ZZ,) + integer_types: + if R in (rings.ZZ, int): R = rings.QQ return (R, tuple(R(a) for a in x)), kwds diff --git a/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py b/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py index 710cbfba2e7..df609ffeb1b 100644 --- a/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py +++ b/src/sage/schemes/elliptic_curves/ell_curve_isogeny.py @@ -63,7 +63,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range from copy import copy diff --git a/src/sage/schemes/elliptic_curves/ell_finite_field.py b/src/sage/schemes/elliptic_curves/ell_finite_field.py index 76fc0f9503b..623b067e277 100644 --- a/src/sage/schemes/elliptic_curves/ell_finite_field.py +++ b/src/sage/schemes/elliptic_curves/ell_finite_field.py @@ -25,8 +25,6 @@ from __future__ import print_function, absolute_import -from six.moves import range - from sage.schemes.curves.projective_curve import Hasse_bounds from .ell_field import EllipticCurve_field from .constructor import EllipticCurve diff --git a/src/sage/schemes/elliptic_curves/ell_generic.py b/src/sage/schemes/elliptic_curves/ell_generic.py index 730cb2bce90..72d3796bd0d 100644 --- a/src/sage/schemes/elliptic_curves/ell_generic.py +++ b/src/sage/schemes/elliptic_curves/ell_generic.py @@ -44,7 +44,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function, absolute_import -from six import integer_types import math @@ -1439,7 +1438,7 @@ def scale_curve(self, u): Elliptic Curve defined by y^2 + u*x*y + 3*u^3*y = x^3 + 2*u^2*x^2 + 4*u^4*x + 5*u^6 over Fraction Field of Univariate Polynomial Ring in u over Rational Field """ - if isinstance(u, integer_types): + if isinstance(u, int): u = self.base_ring()(u) # because otherwise 1/u would round! return self.change_weierstrass_model(1/u, 0, 0, 0) diff --git a/src/sage/schemes/elliptic_curves/ell_local_data.py b/src/sage/schemes/elliptic_curves/ell_local_data.py index 657051358ef..83e6e1fc2f7 100644 --- a/src/sage/schemes/elliptic_curves/ell_local_data.py +++ b/src/sage/schemes/elliptic_curves/ell_local_data.py @@ -86,7 +86,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six import integer_types from sage.structure.sage_object import SageObject from sage.misc.misc import verbose @@ -1132,7 +1131,7 @@ def check_prime(K, P): TypeError: No compatible natural embeddings found for Number Field in a with defining polynomial x^2 - 5 and Number Field in b with defining polynomial x^2 + 3 """ if K is QQ: - if P in ZZ or isinstance(P, integer_types + (Integer,)): + if P in ZZ or isinstance(P, (Integer, int)): P = Integer(P) if P.is_prime(): return P diff --git a/src/sage/schemes/elliptic_curves/ell_number_field.py b/src/sage/schemes/elliptic_curves/ell_number_field.py index 2967f085cae..46e7af54bc3 100644 --- a/src/sage/schemes/elliptic_curves/ell_number_field.py +++ b/src/sage/schemes/elliptic_curves/ell_number_field.py @@ -92,7 +92,6 @@ from .constructor import EllipticCurve from sage.rings.all import PolynomialRing, ZZ, QQ, RealField, Integer from sage.misc.all import cached_method, verbose, prod, union -from six import reraise as raise_ class EllipticCurve_number_field(EllipticCurve_field): @@ -886,10 +885,7 @@ def _reduce_model(self): try: a1, a2, a3, a4, a6 = (ZK(a) for a in self.a_invariants()) except TypeError: - import sys - raise_(TypeError, - TypeError("_reduce_model() requires an integral model."), - sys.exc_info()[2]) + raise TypeError("_reduce_model() requires an integral model.") # N.B. Must define s, r, t in the right order. if ZK.absolute_degree() == 1: diff --git a/src/sage/schemes/elliptic_curves/ell_rational_field.py b/src/sage/schemes/elliptic_curves/ell_rational_field.py index da748c5e9cc..328f4c4b456 100644 --- a/src/sage/schemes/elliptic_curves/ell_rational_field.py +++ b/src/sage/schemes/elliptic_curves/ell_rational_field.py @@ -50,8 +50,6 @@ # https://www.gnu.org/licenses/ ############################################################################## from __future__ import print_function, division, absolute_import -from six import integer_types, iteritems -from six.moves import range from . import constructor from . import BSD @@ -5137,7 +5135,7 @@ def _shortest_paths(self): G.set_vertices(dict([(v,isocls[v]) for v in G.vertices()])) v = G.shortest_path_lengths(0, by_weight=True) # Now exponentiate and round to get degrees of isogenies - v = dict([(i, j.exp().round() if j else 0) for i,j in iteritems(v)]) + v = dict([(i, j.exp().round() if j else 0) for i,j in v.items()]) return isocls.curves, v def _multiple_of_degree_of_isogeny_to_optimal_curve(self): @@ -5170,7 +5168,7 @@ def _multiple_of_degree_of_isogeny_to_optimal_curve(self): # enumeration is complete (which need not be the case a priori!), the LCM # of these numbers is a multiple of the degree of the isogeny # to the optimal curve. - v = [deg for num, deg in iteritems(v) if deg] # get just the degrees + v = [deg for num, deg in v.items() if deg] # get just the degrees return arith.LCM(v) ########################################################## @@ -6782,7 +6780,7 @@ def cremona_curves(conductors): ('39a3', 0), ('39a4', 0)] """ - if isinstance(conductors, integer_types + (rings.RingElement,)): + if isinstance(conductors, (rings.RingElement, int)): conductors = [conductors] return sage.databases.cremona.CremonaDatabase().iter(conductors) @@ -6808,7 +6806,7 @@ def cremona_optimal_curves(conductors): ['990a1', '990b1', '990c1', '990d1', '990e1', '990f1', '990g1', '990h3', '990i1', '990j1', '990k1', '990l1'] """ - if isinstance(conductors, integer_types + (rings.RingElement,)): + if isinstance(conductors, (rings.RingElement, int)): conductors = [conductors] return sage.databases.cremona.CremonaDatabase().iter_optimal(conductors) diff --git a/src/sage/schemes/elliptic_curves/ell_wp.py b/src/sage/schemes/elliptic_curves/ell_wp.py index de2aa3a06c0..42e9e94c7bb 100644 --- a/src/sage/schemes/elliptic_curves/ell_wp.py +++ b/src/sage/schemes/elliptic_curves/ell_wp.py @@ -49,7 +49,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.rings.laurent_series_ring import LaurentSeriesRing from sage.rings.power_series_ring import PowerSeriesRing diff --git a/src/sage/schemes/elliptic_curves/gal_reps_number_field.py b/src/sage/schemes/elliptic_curves/gal_reps_number_field.py index 87468aeb9fb..d05087d108a 100644 --- a/src/sage/schemes/elliptic_curves/gal_reps_number_field.py +++ b/src/sage/schemes/elliptic_curves/gal_reps_number_field.py @@ -45,7 +45,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import division -from six.moves import range from sage.structure.sage_object import SageObject from sage.rings.number_field.number_field import NumberField diff --git a/src/sage/schemes/elliptic_curves/heegner.py b/src/sage/schemes/elliptic_curves/heegner.py index b4123adfd00..a10f0e4a3ba 100644 --- a/src/sage/schemes/elliptic_curves/heegner.py +++ b/src/sage/schemes/elliptic_curves/heegner.py @@ -94,8 +94,6 @@ from __future__ import print_function, absolute_import, division -from six.moves import range - from sage.misc.all import verbose, prod from sage.misc.cachefunc import cached_method @@ -5536,11 +5534,6 @@ def rational_kolyvagin_divisor(self, D, c): i = min(v.nonzero_positions()) return self.kolyvagin_sigma_operator(D, c, i) - #w = 0 - #for i, a in six.iteritems(v.dict()): - # w += a * self.kolyvagin_sigma_operator(D, c, i) - # return w - @cached_method def kolyvagin_point_on_curve(self, D, c, E, p, bound=10): r""" diff --git a/src/sage/schemes/elliptic_curves/height.py b/src/sage/schemes/elliptic_curves/height.py index c1f678a7da2..a84f3954077 100644 --- a/src/sage/schemes/elliptic_curves/height.py +++ b/src/sage/schemes/elliptic_curves/height.py @@ -27,7 +27,6 @@ # https://www.gnu.org/licenses/ ############################################################################## from __future__ import print_function -from six.moves import zip import numpy import math diff --git a/src/sage/schemes/elliptic_curves/isogeny_class.py b/src/sage/schemes/elliptic_curves/isogeny_class.py index 6742a4635d8..6fc7cfce66a 100644 --- a/src/sage/schemes/elliptic_curves/isogeny_class.py +++ b/src/sage/schemes/elliptic_curves/isogeny_class.py @@ -25,8 +25,6 @@ # https://www.gnu.org/licenses/ ############################################################################## from __future__ import print_function, absolute_import -import six -from six.moves import range from sage.structure.sage_object import SageObject from sage.structure.richcmp import richcmp_method, richcmp @@ -534,9 +532,9 @@ def reorder(self, order): Elliptic Curve defined by y^2 + x*y + y = x^3 + x^2 over Rational Field Elliptic Curve defined by y^2 + x*y + y = x^3 + x^2 + 35*x - 28 over Rational Field """ - if order is None or isinstance(order, six.string_types) and order == self._algorithm: + if order is None or isinstance(order, str) and order == self._algorithm: return self - if isinstance(order, six.string_types): + if isinstance(order, str): if order == "lmfdb": reordered_curves = sorted(self.curves, key = lambda E: E.a_invariants()) else: diff --git a/src/sage/schemes/elliptic_curves/lseries_ell.py b/src/sage/schemes/elliptic_curves/lseries_ell.py index 2ba89cdbfa3..da9096fc55d 100644 --- a/src/sage/schemes/elliptic_curves/lseries_ell.py +++ b/src/sage/schemes/elliptic_curves/lseries_ell.py @@ -19,9 +19,8 @@ # 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. -# https://www.gnu.org/licenses/ -# **************************************************************************** -from six.moves import range +# http://www.gnu.org/licenses/ +#***************************************************************************** from sage.structure.sage_object import SageObject from sage.rings.all import RealField, RationalField @@ -161,7 +160,7 @@ def dokchitser(self, prec=53, """ if algorithm is None: algorithm = 'pari' - + if algorithm == 'magma': from sage.interfaces.all import magma return magma(self.__E).LSeries(Precision=prec) diff --git a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py index 372d33a6007..eb4898f6013 100644 --- a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +++ b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py @@ -48,7 +48,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six.moves import range from sage.rings.all import ZZ, RR, QQ, GF from sage.arith.all import binomial diff --git a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py index 6bf07d8fe81..a2e77601180 100644 --- a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +++ b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py @@ -11,7 +11,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import -from six.moves import range from sage.rings.all import (PowerSeriesRing, PolynomialRing, ZZ, QQ, diff --git a/src/sage/schemes/hyperelliptic_curves/jacobian_homset.py b/src/sage/schemes/hyperelliptic_curves/jacobian_homset.py index eada99d05b2..4ebc5c97d1a 100644 --- a/src/sage/schemes/hyperelliptic_curves/jacobian_homset.py +++ b/src/sage/schemes/hyperelliptic_curves/jacobian_homset.py @@ -46,7 +46,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import absolute_import -from six import integer_types from sage.rings.all import PolynomialRing, Integer, ZZ from sage.rings.integer import is_Integer @@ -122,7 +121,7 @@ def __call__(self, P): sage: D1+D2 (x^2 + 2*x + 2, y + 2*x + 1) """ - if isinstance(P, integer_types + (Integer,)) and P == 0: + if isinstance(P, (Integer, int)) and P == 0: R = PolynomialRing(self.value_ring(), 'x') return JacobianMorphism_divisor_class_field(self, (R.one(), R.zero())) diff --git a/src/sage/schemes/product_projective/space.py b/src/sage/schemes/product_projective/space.py index d850c094f9f..ee780eed732 100644 --- a/src/sage/schemes/product_projective/space.py +++ b/src/sage/schemes/product_projective/space.py @@ -40,7 +40,6 @@ #***************************************************************************** -import six from sage.misc.cachefunc import cached_method from sage.misc.all import prod from sage.rings.all import (PolynomialRing, QQ, Integer, CommutativeRing) @@ -148,7 +147,7 @@ def ProductProjectiveSpaces(n, R=None, names='x'): raise ValueError("must be a commutative ring") from sage.structure.category_object import normalize_names n_vars = sum(d+1 for d in n) - if isinstance(names, six.string_types): + if isinstance(names, str): names = normalize_names(n_vars, names) else: name_list = list(names) @@ -1205,7 +1204,7 @@ def points_of_bounded_height(self, **kwds): m = self.num_components() iters = [ self[i].points_of_bounded_height(bound=B, tolerance=tol, precision=prec) for i in range(m) ] dim = [self[i].dimension_relative() + 1 for i in range(m)] - + dim_prefix = [0, dim[0]] # prefixes dim list for i in range(1, len(dim)): dim_prefix.append(dim_prefix[i] + dim[i]) diff --git a/src/sage/schemes/projective/projective_space.py b/src/sage/schemes/projective/projective_space.py index 64a40170de0..2a2916ef49c 100644 --- a/src/sage/schemes/projective/projective_space.py +++ b/src/sage/schemes/projective/projective_space.py @@ -79,8 +79,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range -from six import integer_types from sage.arith.all import gcd, binomial, srange from sage.rings.all import (PolynomialRing, @@ -245,7 +243,7 @@ def ProjectiveSpace(n, R=None, names=None): return A if names is None: names = 'x' - if isinstance(R, integer_types + (Integer,)): + if isinstance(R, (Integer, int)): n, R = R, n if R is None: R = ZZ # default is the integers diff --git a/src/sage/schemes/riemann_surfaces/riemann_surface.py b/src/sage/schemes/riemann_surfaces/riemann_surface.py index 3eac1ea46f7..ef5fcf50e07 100644 --- a/src/sage/schemes/riemann_surfaces/riemann_surface.py +++ b/src/sage/schemes/riemann_surfaces/riemann_surface.py @@ -63,7 +63,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import division -from six.moves import range from scipy.spatial import Voronoi from sage.arith.misc import GCD, algdep @@ -1147,13 +1146,13 @@ def homology_basis(self): (7, 1), (10, 1), (3, 1)])], [(1, [(8, 0), (6, 0), (7, 0), (10, 0), (2, 0), (4, 0), (7, 1), (10, 1), (9, 1), (8, 0)])]] - + In order to check that the answer returned above is reasonable, we test some basic properties. We express the faces of the downstairs graph as ZZ-linear combinations of the edges and check that the projection of the homology basis upstairs projects down to independent linear combinations of an even number of faces:: - + sage: dg = S.downstairs_graph() sage: edges = dg.edges() sage: E = ZZ^len(edges) diff --git a/src/sage/schemes/toric/divisor.py b/src/sage/schemes/toric/divisor.py index 4f23e253a79..e03b724ae6f 100644 --- a/src/sage/schemes/toric/divisor.py +++ b/src/sage/schemes/toric/divisor.py @@ -163,9 +163,8 @@ # 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. -# https://www.gnu.org/licenses/ -# **************************************************************************** -from six.moves import zip +# http://www.gnu.org/licenses/ +#***************************************************************************** from sage.combinat.combination import Combinations from sage.geometry.cone import is_Cone @@ -185,8 +184,6 @@ from sage.structure.unique_representation import UniqueRepresentation from sage.structure.element import is_Vector -import six - # forward declaration class ToricDivisor_generic(Divisor_generic): @@ -1488,7 +1485,7 @@ def Kodaira_map(self, names='z'): If the divisor is ample and the toric variety smooth or of dimension 2, then this is an embedding. - + INPUT: - ``names`` -- string (optional; default ``'z'``). The @@ -1501,7 +1498,7 @@ def Kodaira_map(self, names='z'): sage: D.Kodaira_map() Scheme morphism: From: 1-d CPR-Fano toric variety covered by 2 affine patches - To: Closed subscheme of Projective Space of dimension 2 + To: Closed subscheme of Projective Space of dimension 2 over Rational Field defined by: -z1^2 + z0*z2 Defn: Defined on coordinates by sending [u : v] to @@ -1526,7 +1523,7 @@ def Kodaira_map(self, names='z'): -x1*x5^2 + x2*x3*x6, -x1*x5^3 + x2^2*x6^2 Defn: Defined on coordinates by sending [x : u : y : v : z : w] to - (x*u^2*y^2*v : x^2*u^2*y*w : u*y^2*v^2*z : x*u*y*v*z*w : + (x*u^2*y^2*v : x^2*u^2*y*w : u*y^2*v^2*z : x*u*y*v*z*w : x^2*u*z*w^2 : y*v^2*z^2*w : x*v*z^2*w^2) """ sections = self.sections_monomials() @@ -1622,7 +1619,7 @@ def _sheaf_cohomology(self, cplx): HH = cplx.homology(base_ring=QQ, cohomology=True) HH_list = [0]*(d+1) - for h in six.iteritems(HH): + for h in HH.items(): degree = h[0]+1 cohomology_dim = h[1].dimension() if degree>d or degree<0: diff --git a/src/sage/schemes/toric/fano_variety.py b/src/sage/schemes/toric/fano_variety.py index 6ad4129c2ea..78357a1caca 100644 --- a/src/sage/schemes/toric/fano_variety.py +++ b/src/sage/schemes/toric/fano_variety.py @@ -133,7 +133,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range import re @@ -1582,9 +1581,9 @@ def __init__(self, P_Delta, nef_partition, def cohomology_class(self): r""" Return the class of ``self`` in the ambient space cohomology ring. - + OUTPUT: - + - a :class:`cohomology class `. @@ -1611,7 +1610,7 @@ def cohomology_class(self): return prod(sum(H.gen(X._point_to_ray[point]) for point in part if point in X._coordinate_points) for part in self.nef_partition().parts(all_points=True)) - + def nef_partition(self): r""" Return the nef-partition associated to ``self``. diff --git a/src/sage/schemes/toric/ideal.py b/src/sage/schemes/toric/ideal.py index 8fc31e72342..fc0c5ecde5c 100644 --- a/src/sage/schemes/toric/ideal.py +++ b/src/sage/schemes/toric/ideal.py @@ -139,9 +139,6 @@ from sage.rings.polynomial.multi_polynomial_ideal import MPolynomialIdeal -import six - - class ToricIdeal(MPolynomialIdeal): r""" This class represents a toric ideal defined by an integral matrix. @@ -424,8 +421,8 @@ def subtract(e, power): def divide_by_x_n(p): d_old = p.dict() power = min([ e[0] for e in d_old.keys() ]) - d_new = dict( (subtract(exponent, power), coefficient) - for exponent, coefficient in six.iteritems(d_old) ) + d_new = dict((subtract(exponent, power), coefficient) + for exponent, coefficient in d_old.items()) return p.parent()(d_new) basis = [divide_by_x_n(b) for b in basis] quotient = ring.ideal(basis) diff --git a/src/sage/schemes/toric/library.py b/src/sage/schemes/toric/library.py index b45da763faa..7de2cd950bc 100644 --- a/src/sage/schemes/toric/library.py +++ b/src/sage/schemes/toric/library.py @@ -37,7 +37,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.structure.sage_object import SageObject @@ -1478,7 +1477,7 @@ def torus(self, n, names='z+', base_ring=QQ): sage: T3.gens() (z0, z1, z2) sage: sorted(T3.change_ring(GF(3)).point_set().list()) - [[1 : 1 : 1], [1 : 1 : 2], [1 : 2 : 1], [1 : 2 : 2], + [[1 : 1 : 1], [1 : 1 : 2], [1 : 2 : 1], [1 : 2 : 2], [2 : 1 : 1], [2 : 1 : 2], [2 : 2 : 1], [2 : 2 : 2]] """ try: diff --git a/src/sage/schemes/toric/morphism.py b/src/sage/schemes/toric/morphism.py index 9818f2ada99..d2cee6fe379 100644 --- a/src/sage/schemes/toric/morphism.py +++ b/src/sage/schemes/toric/morphism.py @@ -360,7 +360,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six import iteritems # For now, the scheme morphism base class cannot derive from Morphism # since this would clash with elliptic curves. So we derive only on @@ -654,7 +653,7 @@ def _reverse_ray_map(self): orbit = self.parent().domain() codomain_fan = self.parent().codomain().fan() reverse_ray_dict = dict() - for n1, n2 in iteritems(self._ray_map): + for n1, n2 in self._ray_map.items(): ray_index = codomain_fan.rays().index(n1) if n2.is_zero(): assert ray_index in self._defining_cone.ambient_ray_indices() @@ -1964,7 +1963,7 @@ def _image_ray_multiplicity(self, fiber_ray): pass multiplicity = None image_ray_index = None - for ray, index in iteritems(self._ray_index_map): + for ray, index in self._ray_index_map.items(): d = gcd(ray) if d * fiber_ray != ray: continue diff --git a/src/sage/schemes/toric/variety.py b/src/sage/schemes/toric/variety.py index e1d964200d1..189c6d3569d 100644 --- a/src/sage/schemes/toric/variety.py +++ b/src/sage/schemes/toric/variety.py @@ -316,7 +316,6 @@ # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import print_function -from six.moves import range import sys @@ -2188,7 +2187,7 @@ def sheaves(self): for details. EXAMPLES:: - + sage: dP6 = toric_varieties.dP6() sage: dP6.sheaves Sheaf constructor on 2-d CPR-Fano toric variety covered by 6 affine patches diff --git a/src/sage/schemes/toric/weierstrass.py b/src/sage/schemes/toric/weierstrass.py index 788dc3d1ae2..3f93cccd242 100644 --- a/src/sage/schemes/toric/weierstrass.py +++ b/src/sage/schemes/toric/weierstrass.py @@ -144,8 +144,6 @@ from sage.geometry.polyhedron.ppl_lattice_polytope import LatticePolytope_PPL from sage.rings.invariants.all import invariant_theory -import six - ###################################################################### # @@ -346,7 +344,7 @@ def Newton_polygon_embedded(polynomial, variables): embedding = newton_polytope.embed_in_reflexive_polytope('points') x, y = variables[0:2] embedded_polynomial = polynomial.parent().zero() - for e, c in six.iteritems(p_dict): + for e, c in p_dict.items(): e_embed = embedding[e] embedded_polynomial += c * x**(e_embed[0]) * y**(e_embed[1]) return newton_polytope, embedded_polynomial, (x, y) diff --git a/src/sage/schemes/toric/weierstrass_covering.py b/src/sage/schemes/toric/weierstrass_covering.py index d2c6e8f0baa..9a631813c1a 100644 --- a/src/sage/schemes/toric/weierstrass_covering.py +++ b/src/sage/schemes/toric/weierstrass_covering.py @@ -103,7 +103,6 @@ # # https://www.gnu.org/licenses/ ######################################################################## -from six import iteritems from sage.rings.all import ZZ from sage.modules.all import vector @@ -255,9 +254,9 @@ def homogenize(inhomog, degree): result = vector(ZZ, result) result.set_immutable() return result - X_dict = dict((homogenize(e, 2), v) for e, v in iteritems(X.dict())) - Y_dict = dict((homogenize(e, 3), v) for e, v in iteritems(Y.dict())) - Z_dict = dict((homogenize(e, 1), v) for e, v in iteritems(Z.dict())) + X_dict = dict((homogenize(e, 2), v) for e, v in X.dict().items()) + Y_dict = dict((homogenize(e, 3), v) for e, v in Y.dict().items()) + Z_dict = dict((homogenize(e, 1), v) for e, v in Z.dict().items()) # shift to non-negative exponents if necessary min_deg = [0] * R.ngens() for var in variables: @@ -267,9 +266,9 @@ def homogenize(inhomog, degree): min_Z = min([e[i] for e in Z_dict]) if Z_dict else 0 min_deg[i] = min(min_X / 2, min_Y / 3, min_Z) min_deg = vector(min_deg) - X_dict = dict((tuple(e - 2 * min_deg), v) for e, v in iteritems(X_dict)) - Y_dict = dict((tuple(e - 3 * min_deg), v) for e, v in iteritems(Y_dict)) - Z_dict = dict((tuple(e - 1 * min_deg), v) for e, v in iteritems(Z_dict)) + X_dict = dict((tuple(e - 2 * min_deg), v) for e, v in X_dict.items()) + Y_dict = dict((tuple(e - 3 * min_deg), v) for e, v in Y_dict.items()) + Z_dict = dict((tuple(e - 1 * min_deg), v) for e, v in Z_dict.items()) return (R(X_dict), R(Y_dict), R(Z_dict)) diff --git a/src/sage/sets/family.py b/src/sage/sets/family.py index f8f3540e58d..ed9b550a0b9 100644 --- a/src/sage/sets/family.py +++ b/src/sage/sets/family.py @@ -37,8 +37,6 @@ from copy import copy from pprint import pformat, saferepr -from six.moves import range - from sage.misc.cachefunc import cached_method from sage.structure.parent import Parent from sage.categories.enumerated_sets import EnumeratedSets diff --git a/src/sage/sets/set.py b/src/sage/sets/set.py index ff4c2a536eb..60fa1601fb9 100644 --- a/src/sage/sets/set.py +++ b/src/sage/sets/set.py @@ -36,8 +36,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** from __future__ import print_function -import six -from six import integer_types from sage.misc.latex import latex from sage.misc.prandom import choice @@ -140,7 +138,6 @@ def Set(X=[]): Set also accepts iterators, but be careful to only give *finite* sets:: - sage: from six.moves import range sage: sorted(Set(range(1,6))) [1, 2, 3, 4, 5] sage: sorted(Set(list(range(1,6)))) @@ -257,7 +254,7 @@ def __init__(self, X, category=None): and 'Integer Ring' """ from sage.rings.integer import is_Integer - if isinstance(X, integer_types) or is_Integer(X): + if isinstance(X, int) or is_Integer(X): # The coercion model will try to call Set_object(0) raise ValueError('underlying object cannot be an integer') @@ -857,12 +854,9 @@ def _repr_(self): {} """ py_set = self.set() - if six.PY3: - if not py_set: - return "{}" - return repr(py_set) - else: - return "{" + repr(py_set)[5:-2] + "}" + if not py_set: + return "{}" + return repr(py_set) def list(self): """ diff --git a/src/sage/sets/set_from_iterator.py b/src/sage/sets/set_from_iterator.py index da60677f166..b243290358a 100644 --- a/src/sage/sets/set_from_iterator.py +++ b/src/sage/sets/set_from_iterator.py @@ -61,7 +61,6 @@ # http://www.gnu.org/licenses/ #****************************************************************************** from __future__ import print_function -from six.moves import range from sage.structure.parent import Parent from sage.categories.enumerated_sets import EnumeratedSets @@ -576,7 +575,6 @@ class EnumeratedSetFromIterator_function_decorator(Decorator): EXAMPLES:: sage: from sage.sets.set_from_iterator import set_from_function - sage: from six.moves import range sage: @set_from_function ....: def f(n): ....: for i in range(n): diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py index 803009c257c..2c0c2df4277 100644 --- a/src/sage/stats/basic_stats.py +++ b/src/sage/stats/basic_stats.py @@ -37,8 +37,7 @@ # # The full text of the GPL is available at: # https://www.gnu.org/licenses/ -# *********************************************************************** -from six import integer_types +###################################################################### from sage.rings.integer_ring import ZZ from sage.symbolic.constants import NaN @@ -81,7 +80,7 @@ def mean(v): if not v: return NaN s = sum(v) - if isinstance(s, integer_types): + if isinstance(s, int): # python integers are stupid. return s / ZZ(len(v)) return s / len(v) @@ -316,12 +315,12 @@ def variance(v, bias=False): x += (vi - mu)**2 if bias: # population variance - if isinstance(x, integer_types): + if isinstance(x, int): return x / ZZ(len(v)) return x / len(v) else: # sample variance - if isinstance(x, integer_types): + if isinstance(x, int): return x / ZZ(len(v)-1) return x / (len(v)-1) diff --git a/src/sage/stats/distributions/discrete_gaussian_integer.pyx b/src/sage/stats/distributions/discrete_gaussian_integer.pyx index ac0804b0584..4b27cc98e12 100644 --- a/src/sage/stats/distributions/discrete_gaussian_integer.pyx +++ b/src/sage/stats/distributions/discrete_gaussian_integer.pyx @@ -21,7 +21,6 @@ We construct a sampler for the distribution `D_{3,c}` with width `σ=3` and cent We ask for 100000 samples:: - sage: from six.moves import range sage: n=100000; l = [D() for _ in range(n)] These are sampled with a probability proportional to `\exp(-x^2/18)`. More @@ -52,7 +51,6 @@ We construct an instance with a larger width:: ask for 100000 samples:: - sage: from six.moves import range sage: n=100000; l = [D() for _ in range(n)] # long time and check if the proportions fit:: @@ -67,7 +65,6 @@ We construct a sampler with `c\%1 != 0`:: sage: from sage.stats.distributions.discrete_gaussian_integer import DiscreteGaussianDistributionIntegerSampler sage: sigma = 3 sage: D = DiscreteGaussianDistributionIntegerSampler(sigma=sigma, c=1/2) - sage: from six.moves import range sage: n=100000; l = [D() for _ in range(n)] # long time sage: mean(l).n() # long time 0.486650000000000 @@ -227,21 +224,18 @@ cdef class DiscreteGaussianDistributionIntegerSampler(SageObject): sage: from sage.stats.distributions.discrete_gaussian_integer import DiscreteGaussianDistributionIntegerSampler sage: D = DiscreteGaussianDistributionIntegerSampler(1.0, c=0, tau=2) - sage: from six.moves import range sage: l = [D() for _ in range(2^16)] sage: min(l) == 0-2*1.0, max(l) == 0+2*1.0, abs(mean(l)) < 0.01 (True, True, True) sage: from sage.stats.distributions.discrete_gaussian_integer import DiscreteGaussianDistributionIntegerSampler sage: D = DiscreteGaussianDistributionIntegerSampler(1.0, c=2.5, tau=2) - sage: from six.moves import range sage: l = [D() for _ in range(2^18)] sage: min(l)==2-2*1.0, max(l)==2+2*1.0, mean(l).n() (True, True, 2.45...) sage: from sage.stats.distributions.discrete_gaussian_integer import DiscreteGaussianDistributionIntegerSampler sage: D = DiscreteGaussianDistributionIntegerSampler(1.0, c=2.5, tau=6) - sage: from six.moves import range sage: l = [D() for _ in range(2^18)] sage: min(l), max(l), abs(mean(l)-2.5) < 0.01 (-2, 7, True) @@ -250,21 +244,18 @@ cdef class DiscreteGaussianDistributionIntegerSampler(SageObject): sage: from sage.stats.distributions.discrete_gaussian_integer import DiscreteGaussianDistributionIntegerSampler sage: D = DiscreteGaussianDistributionIntegerSampler(1.0, c=0, tau=2, precision="dp") - sage: from six.moves import range sage: l = [D() for _ in range(2^16)] sage: min(l) == 0-2*1.0, max(l) == 0+2*1.0, abs(mean(l)) < 0.05 (True, True, True) sage: from sage.stats.distributions.discrete_gaussian_integer import DiscreteGaussianDistributionIntegerSampler sage: D = DiscreteGaussianDistributionIntegerSampler(1.0, c=2.5, tau=2, precision="dp") - sage: from six.moves import range sage: l = [D() for _ in range(2^18)] sage: min(l)==2-2*1.0, max(l)==2+2*1.0, mean(l).n() (True, True, 2.4...) sage: from sage.stats.distributions.discrete_gaussian_integer import DiscreteGaussianDistributionIntegerSampler sage: D = DiscreteGaussianDistributionIntegerSampler(1.0, c=2.5, tau=6, precision="dp") - sage: from six.moves import range sage: l = [D() for _ in range(2^18)] sage: min(l)<=-1, max(l)>=6, abs(mean(l)-2.5) < 0.1 (True, True, True) diff --git a/src/sage/stats/distributions/discrete_gaussian_lattice.py b/src/sage/stats/distributions/discrete_gaussian_lattice.py index c16659f309e..ff79a9cfa43 100644 --- a/src/sage/stats/distributions/discrete_gaussian_lattice.py +++ b/src/sage/stats/distributions/discrete_gaussian_lattice.py @@ -54,7 +54,6 @@ # policies, either expressed or implied, of the FreeBSD Project. #*****************************************************************************/ from __future__ import absolute_import -from six.moves import range from sage.functions.log import exp from sage.functions.other import ceil diff --git a/src/sage/structure/dynamic_class.py b/src/sage/structure/dynamic_class.py index 1442a80da9f..a51996381c0 100644 --- a/src/sage/structure/dynamic_class.py +++ b/src/sage/structure/dynamic_class.py @@ -119,6 +119,8 @@ class MyPermutation(UniqueRepresentation, PermutationCycleType, PosetElement, Gr # http://www.gnu.org/licenses/ #***************************************************************************** +import copyreg + from sage.misc.cachefunc import weak_cached_function from sage.misc.classcall_metaclass import ClasscallMetaclass from sage.misc.inherit_comparison import InheritComparisonMetaclass, InheritComparisonClasscallMetaclass @@ -307,8 +309,8 @@ class also has a zero ``__dictoffset__``. This means that the (, ('FooBar', (,), , None, None)) sage: type(FooBar).__reduce__(FooBar) # py3 (, ('FooBar', (,), , None, None)) - sage: from six.moves import cPickle - sage: cPickle.loads(cPickle.dumps(FooBar)) == FooBar + sage: import pickle + sage: pickle.loads(pickle.dumps(FooBar)) == FooBar True We check that instrospection works reasonably:: @@ -529,7 +531,6 @@ class DynamicInheritComparisonClasscallMetaclass(DynamicMetaclass, InheritCompar pass # This registers the appropriate reduction methods (see Trac #5985) -from six.moves import copyreg for M in [DynamicMetaclass, DynamicClasscallMetaclass, DynamicInheritComparisonMetaclass, diff --git a/src/sage/structure/factorization.py b/src/sage/structure/factorization.py index 6d92c464afb..b163e81a298 100644 --- a/src/sage/structure/factorization.py +++ b/src/sage/structure/factorization.py @@ -180,8 +180,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range -from six import iteritems, integer_types from sage.structure.sage_object import SageObject from sage.structure.element import Element @@ -824,7 +822,7 @@ def _repr_(self): mul += '\n' x = self.__x[0][0] try: - atomic = (isinstance(x, integer_types) or + atomic = (isinstance(x, int) or self.universe()._repr_option('element_is_atomic')) except AttributeError: atomic = False @@ -871,7 +869,7 @@ def _latex_(self): if len(self) == 0: return self.__unit._latex_() try: - atomic = (isinstance(self.__x[0][0], integer_types) or + atomic = (isinstance(self.__x[0][0], int) or self.universe()._repr_option('element_is_atomic')) except AttributeError: atomic = False @@ -1084,7 +1082,7 @@ def __mul__(self, other): s = {} for a in set(d1).union(set(d2)): s[a] = d1.get(a,0) + d2.get(a,0) - return Factorization(list(iteritems(s)), unit=self.unit()*other.unit()) + return Factorization(list(s.items()), unit=self.unit()*other.unit()) else: return Factorization(list(self) + list(other), unit=self.unit()*other.unit()) @@ -1238,7 +1236,7 @@ def gcd(self, other): s = {} for a in set(d1).intersection(set(d2)): s[a] = min(d1[a],d2[a]) - return Factorization(list(iteritems(s))) + return Factorization(list(s.items())) else: raise NotImplementedError("gcd is not implemented for non-commutative factorizations") @@ -1280,7 +1278,7 @@ def lcm(self, other): s = {} for a in set(d1).union(set(d2)): s[a] = max(d1.get(a,0),d2.get(a,0)) - return Factorization(list(iteritems(s))) + return Factorization(list(s.items())) else: raise NotImplementedError("lcm is not implemented for non-commutative factorizations") diff --git a/src/sage/structure/global_options.py b/src/sage/structure/global_options.py index 3c9c27d1f20..d5a85c8394a 100644 --- a/src/sage/structure/global_options.py +++ b/src/sage/structure/global_options.py @@ -508,7 +508,6 @@ class options(GlobalOptions): from __future__ import absolute_import, print_function -from six import iteritems, add_metaclass from importlib import import_module from pickle import PicklingError from textwrap import dedent @@ -753,6 +752,12 @@ def __call__(self, name, bases, dict): # classes, note that Python 2 and Python 3 have different # semantics for determining the metaclass when multiple base # classes are involved. + # + # Note: On Python 3 bases is empty if the class was declared + # without any explicted bases: + if not bases: + bases = (object,) + if len(bases) != 1: raise TypeError("GlobalOptions must be the only base class") @@ -769,7 +774,7 @@ def __call__(self, name, bases, dict): # Split dict in options for instance.__init__ and attributes to # insert in the class __dict__ kwds = {"NAME": name} - for key, value in iteritems(dict): + for key, value in dict.items(): if key.startswith("__"): instance.__dict__[key] = value else: @@ -779,8 +784,7 @@ def __call__(self, name, bases, dict): return instance -@add_metaclass(GlobalOptionsMetaMeta) -class GlobalOptionsMeta(type): +class GlobalOptionsMeta(type, metaclass=GlobalOptionsMetaMeta): """ Metaclass for :class:`GlobalOptions` @@ -790,8 +794,7 @@ class GlobalOptionsMeta(type): @instancedoc -@add_metaclass(GlobalOptionsMeta) -class GlobalOptions(object): +class GlobalOptions(metaclass=GlobalOptionsMeta): r""" The :class:`GlobalOptions` class is a generic class for setting and accessing global options for Sage objects. @@ -1388,7 +1391,7 @@ def _add_option(self, option, specifications): self._legal_values[option] = [val.lower() for val in self._legal_values[option]] if option in self._alias: self._alias[option] = {k.lower():v.lower() - for k, v in iteritems(self._alias[option])} + for k, v in self._alias[option].items()} self._case_sensitive[option] = bool(specifications[spec]) elif spec == 'checker': if not callable(specifications[spec]): diff --git a/src/sage/structure/graphics_file.py b/src/sage/structure/graphics_file.py index 92fb5d25e14..71faa7ab9b5 100644 --- a/src/sage/structure/graphics_file.py +++ b/src/sage/structure/graphics_file.py @@ -4,7 +4,6 @@ """ import os -import six from sage.misc.temporary_file import tmp_filename from sage.structure.sage_object import SageObject @@ -29,10 +28,10 @@ class Mime(object): def validate(cls, value): """ Check that input is known mime type - + INPUT: - - ``value`` -- string. + - ``value`` -- string. OUTPUT: @@ -51,7 +50,7 @@ def validate(cls, value): """ value = str(value).lower() for k, v in cls.__dict__.items(): - if isinstance(v, six.string_types) and v == value: + if isinstance(v, str) and v == value: return v raise ValueError('unknown mime type') @@ -63,7 +62,7 @@ def extension(cls, mime_type): INPUT: - ``mime_type`` -- mime type as string. - + OUTPUT: String containing the usual file extension for that type of @@ -101,7 +100,7 @@ def extension(cls, mime_type): class GraphicsFile(SageObject): - + def __init__(self, filename, mime_type=None): """ Wrapper around a graphics file. @@ -127,14 +126,14 @@ def _repr_(self): Return a string representation. """ return 'Graphics file {0}'.format(self.mime()) - + def filename(self): return self._filename def save_as(self, filename): """ Make the file available under a new filename. - + INPUT: - ``filename`` -- string. The new filename. @@ -157,7 +156,7 @@ def data(self): """ with open(self._filename, 'rb') as f: return f.read() - + def launch_viewer(self): """ Launch external viewer for the graphics file. @@ -210,13 +209,13 @@ def sagenb_embedding(self): os.chmod(fn, 0o644) -def graphics_from_save(save_function, preferred_mime_types, +def graphics_from_save(save_function, preferred_mime_types, allowed_mime_types=None, figsize=None, dpi=None): """ Helper function to construct a graphics file. INPUT: - + - ``save_function`` -- callable that can save graphics to a file and accepts options like :meth:`sage.plot.graphics.Graphics.save`. diff --git a/src/sage/structure/sequence.py b/src/sage/structure/sequence.py index ef275c0b009..eea50863c44 100644 --- a/src/sage/structure/sequence.py +++ b/src/sage/structure/sequence.py @@ -70,7 +70,6 @@ #***************************************************************************** from __future__ import print_function -from six.moves import range from sage.misc.latex import list_function as list_latex_function import sage.structure.sage_object diff --git a/src/sage/structure/unique_representation.py b/src/sage/structure/unique_representation.py index d24858673f4..75d963e0ef5 100644 --- a/src/sage/structure/unique_representation.py +++ b/src/sage/structure/unique_representation.py @@ -552,13 +552,12 @@ class that inherits from :class:`UniqueRepresentation`: By adding # ***************************************************************************** from __future__ import print_function -from sage.misc import six from sage.misc.cachefunc import weak_cached_function from sage.misc.classcall_metaclass import ClasscallMetaclass, typecall from sage.misc.fast_methods import WithEqualityById -class CachedRepresentation(six.with_metaclass(ClasscallMetaclass)): +class CachedRepresentation(metaclass=ClasscallMetaclass): """ Classes derived from CachedRepresentation inherit a weak cache for their instances. diff --git a/src/sage/symbolic/benchmark.py b/src/sage/symbolic/benchmark.py index 1325f24acd5..720b700255f 100644 --- a/src/sage/symbolic/benchmark.py +++ b/src/sage/symbolic/benchmark.py @@ -28,7 +28,6 @@ Problem R3:: - sage: from six.moves import range sage: f = sum(var('x,y,z')); a = [bool(f==f) for _ in range(100000)] Problem R4:: @@ -48,13 +47,11 @@ Problem R6:: - sage: from six.moves import range sage: sum(((x+sin(i))/x+(x-sin(i))/x) for i in range(100)).expand() 200 Problem R7:: - sage: from six.moves import range sage: f = x^24+34*x^12+45*x^3+9*x^18 +34*x^10+ 32*x^21 sage: a = [f(x=random()) for _ in range(10^4)] diff --git a/src/sage/symbolic/function_factory.py b/src/sage/symbolic/function_factory.py index ffc835d1b13..7938d21480c 100644 --- a/src/sage/symbolic/function_factory.py +++ b/src/sage/symbolic/function_factory.py @@ -10,7 +10,6 @@ # https://www.gnu.org/licenses/ ############################################################################### from __future__ import print_function -from six import string_types from sage.symbolic.function import (SymbolicFunction, sfunctions_funcs, unpickle_wrapper) @@ -338,7 +337,7 @@ def function(s, *args, **kwds): sage: E E """ - if not isinstance(s, string_types): + if not isinstance(s, str): raise TypeError("expect string as first argument") # create the function diff --git a/src/sage/symbolic/integration/external.py b/src/sage/symbolic/integration/external.py index b9ef5e6148a..764363ec8b8 100644 --- a/src/sage/symbolic/integration/external.py +++ b/src/sage/symbolic/integration/external.py @@ -157,8 +157,8 @@ def request_wolfram_alpha(input, verbose=False): """ # import compatible with py2 and py3 - from six.moves.urllib.parse import urlencode - from six.moves.urllib.request import Request, build_opener, HTTPCookieProcessor + from urllib.parse import urlencode + from urllib.request import Request, build_opener, HTTPCookieProcessor import json from http.cookiejar import CookieJar diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py index 028f6287971..e48613e95ba 100644 --- a/src/sage/symbolic/relation.py +++ b/src/sage/symbolic/relation.py @@ -358,7 +358,6 @@ """ from __future__ import print_function -from six.moves import range import operator @@ -478,10 +477,10 @@ def test_relation_maxima(relation): sage: test_relation_maxima(f1 - f2 == 0) True sage: forget() - + In case an equation is to be solved for non-integers, ''assume()'' is used:: - + sage: k = var('k') sage: assume(k,'noninteger') sage: solve([k^3==1],k) @@ -908,7 +907,7 @@ def solve(f, *args, **kwds): (-z + 1, -z^2 + z - 1) sage: solve(abs(x + 3) - 2*abs(x - 3),x,algorithm='sympy',domain='real') [x == 1, x == 9] - + We cannot translate all results from SymPy but we can at least print them:: diff --git a/src/sage/symbolic/units.py b/src/sage/symbolic/units.py index f2939fa7ec7..0607fae8f3a 100644 --- a/src/sage/symbolic/units.py +++ b/src/sage/symbolic/units.py @@ -87,11 +87,9 @@ ############################################################################### from __future__ import print_function from __future__ import absolute_import -from six import iteritems # standard Python libraries import re -import six # Sage library from .ring import SR @@ -502,8 +500,8 @@ def evalunitdict(): sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval - for key, value in six.iteritems(unitdict): - unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in six.iteritems(value)]) + for key, value in unitdict.items(): + unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.items()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about @@ -512,13 +510,13 @@ def evalunitdict(): # # Format the table for easier use. # - for k, v in six.iteritems(unitdict): + for k, v in unitdict.items(): for a in v: unit_to_type[a] = k for w in unitdict: for j in unitdict[w]: if isinstance(unitdict[w][j], tuple): unitdict[w][j] = unitdict[w][j][0] - value_to_unit[w] = {b: a for a, b in iteritems(unitdict[w])} + value_to_unit[w] = {b: a for a, b in unitdict[w].items()} ############################################################################### @@ -1124,7 +1122,7 @@ def __ne__(self, other): True """ return not (self == other) - + def _tab_completion(self): """ Return tab completions. diff --git a/src/sage/tensor/differential_form_element.py b/src/sage/tensor/differential_form_element.py index 6721da31c57..c4b57580128 100644 --- a/src/sage/tensor/differential_form_element.py +++ b/src/sage/tensor/differential_form_element.py @@ -30,9 +30,6 @@ from sage.combinat.permutation import Permutation -import six - - def sort_subscript(subscript): """ A subscript is a range of integers. This function sorts a subscript @@ -643,9 +640,8 @@ def __eq__(self, other): # over both dictionaries in one go and compare (key, value) # pairs as we go along. - for (key1, val1), (key2, val2) in \ - zip(six.iteritems(self._components), \ - six.iteritems(other._components)): + for (key1, val1), (key2, val2) in zip(self._components.items(), + other._components.items()): if key1 != key2 or str(val1) != str(val2): return False return True diff --git a/src/sage/tensor/differential_forms.py b/src/sage/tensor/differential_forms.py index 72e8dd0b530..d9b1028dc76 100644 --- a/src/sage/tensor/differential_forms.py +++ b/src/sage/tensor/differential_forms.py @@ -38,7 +38,6 @@ # # http://www.gnu.org/licenses/ #***************************************************************************** -from six.moves import range from sage.rings.ring import Algebra from sage.tensor.coordinate_patch import CoordinatePatch diff --git a/src/sage/tensor/modules/comp.py b/src/sage/tensor/modules/comp.py index 3693a429d32..dd28a630d2a 100644 --- a/src/sage/tensor/modules/comp.py +++ b/src/sage/tensor/modules/comp.py @@ -245,9 +245,8 @@ # 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. -# https://www.gnu.org/licenses/ -# ***************************************************************************** -from six.moves import range +# http://www.gnu.org/licenses/ +#****************************************************************************** from sage.structure.sage_object import SageObject from sage.rings.integer import Integer @@ -860,7 +859,7 @@ def _gen_list(self, ind, no_format=True, format_type=None): si = self._sindex nsi = si + self._dim return [self._gen_list(ind + [i], no_format, format_type) - for i in range(si, nsi)] + for i in range(si, nsi)] def __setitem__(self, args, value): r""" diff --git a/src/sage/tensor/modules/format_utilities.py b/src/sage/tensor/modules/format_utilities.py index 0012b375731..aafa0a8751a 100644 --- a/src/sage/tensor/modules/format_utilities.py +++ b/src/sage/tensor/modules/format_utilities.py @@ -21,7 +21,6 @@ # http://www.gnu.org/licenses/ #****************************************************************************** -import six from sage.structure.sage_object import SageObject def is_atomic(expr, sep=['+', '-']): @@ -67,11 +66,11 @@ def is_atomic(expr, sep=['+', '-']): True """ - if not isinstance(expr, six.string_types): + if not isinstance(expr, str): raise TypeError("The argument must be a string") if not isinstance(sep, list): raise TypeError("the argument 'sep' must be a list") - elif any(not isinstance(s, six.string_types) for s in sep): + elif any(not isinstance(s, str) for s in sep): raise TypeError("the argument 'sep' must consist of strings") level = 0 for n, c in enumerate(expr): diff --git a/src/sage/tests/article_heuberger_krenn_kropf_fsm-in-sage.py b/src/sage/tests/article_heuberger_krenn_kropf_fsm-in-sage.py index 3a3abb76005..cb599d27106 100644 --- a/src/sage/tests/article_heuberger_krenn_kropf_fsm-in-sage.py +++ b/src/sage/tests/article_heuberger_krenn_kropf_fsm-in-sage.py @@ -304,7 +304,7 @@ Sage example in fsm-in-sage.tex, line 815:: - sage: from six.moves import zip_longest + sage: from itertools import zip_longest sage: def final_minus(state1, state2): ....: return [x - y for x, y in ....: zip_longest(state1.final_word_out, diff --git a/src/sage/tests/arxiv_0812_2725.py b/src/sage/tests/arxiv_0812_2725.py index 08cb8cf06f6..db34c1db51e 100644 --- a/src/sage/tests/arxiv_0812_2725.py +++ b/src/sage/tests/arxiv_0812_2725.py @@ -35,7 +35,6 @@ # # See http://www.gnu.org/licenses/. #***************************************************************************** -from six.moves import range from sage.combinat.set_partition import SetPartitions as SetPartitions diff --git a/src/sage/tests/benchmark.py b/src/sage/tests/benchmark.py index 81c4f8f49db..ea35f6459b4 100644 --- a/src/sage/tests/benchmark.py +++ b/src/sage/tests/benchmark.py @@ -16,7 +16,6 @@ sage: import sage.tests.benchmark """ from __future__ import print_function -from six.moves import range from sage.all import * # QQ, alarm, ModularSymbols, gp, pari, cputime, EllipticCurve diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py index 0e367a57419..8fe82bfcc11 100644 --- a/src/sage/tests/cmdline.py +++ b/src/sage/tests/cmdline.py @@ -60,8 +60,6 @@ import sys import select -import six - def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False, **kwds): r""" @@ -846,12 +844,7 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False 'ignore::DeprecationWarning', ]) - encoding = kwds.pop('encoding', 'utf-8') - errors = kwds.pop('errors', None) - - if six.PY3: - kwds['encoding'] = encoding - kwds['errors'] = errors + kwds['encoding'] = kwds.pop('encoding', 'utf-8') p = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, env=pexpect_env, **kwds) diff --git a/src/sage/typeset/character_art_factory.py b/src/sage/typeset/character_art_factory.py index 988076a9c85..0a5db2bc037 100644 --- a/src/sage/typeset/character_art_factory.py +++ b/src/sage/typeset/character_art_factory.py @@ -14,10 +14,8 @@ # # The full text of the GPL is available at: # -# https://www.gnu.org/licenses/ -# ****************************************************************************** -from six import iteritems, string_types, text_type, binary_type -from six.moves import range +# http://www.gnu.org/licenses/ +#******************************************************************************* from sage.structure.sage_object import SageObject @@ -62,7 +60,7 @@ def __init__(self, """ self.art_type = art_type - assert isinstance(string_type('a'), string_types) + assert isinstance(string_type('a'), str) self.string_type = string_type assert magic_method_name in ['_ascii_art_', '_unicode_art_'] self.magic_method_name = magic_method_name @@ -214,13 +212,13 @@ def build_from_string(self, obj, baseline=0): bb ccc """ - if self.string_type is text_type and not isinstance(obj, text_type): - if isinstance(obj, binary_type): + if self.string_type is str and not isinstance(obj, str): + if isinstance(obj, bytes): obj = obj.decode('utf-8') else: - obj = text_type(obj) - if self.string_type is binary_type and not isinstance(obj, binary_type): - obj = text_type(obj).encode('utf-8') + obj = str(obj) + if self.string_type is bytes and not isinstance(obj, bytes): + obj = str(obj).encode('utf-8') return self.art_type(obj.splitlines(), baseline=baseline) def build_container(self, content, left_border, right_border, baseline=0): @@ -346,7 +344,7 @@ def concat_no_breakpoint(k,v): elt._breakpoints.remove(k._l + 1) return elt repr_elems = self.concatenate( - (concat_no_breakpoint(k, v) for k, v in iteritems(d)), + (concat_no_breakpoint(k, v) for k, v in d.items()), comma, nested=True) return self.build_container( repr_elems, self.left_curly_brace, self.right_curly_brace, diff --git a/src/sage/typeset/unicode_art.py b/src/sage/typeset/unicode_art.py index dd55a398446..9daf613addf 100644 --- a/src/sage/typeset/unicode_art.py +++ b/src/sage/typeset/unicode_art.py @@ -25,7 +25,6 @@ from sage.typeset.character_art import CharacterArt from sage.typeset.character_art_factory import CharacterArtFactory import sage.typeset.symbols as symbol -from six import text_type class UnicodeArt(CharacterArt): @@ -50,7 +49,7 @@ class UnicodeArt(CharacterArt): π⋅x ℯ """ - _string_type = text_type + _string_type = str def __unicode__(self): r""" @@ -68,7 +67,7 @@ def __unicode__(self): return repr(self).decode("utf-8") _unicode_art_factory = CharacterArtFactory( - UnicodeArt, text_type, '_unicode_art_', + UnicodeArt, str, '_unicode_art_', (symbol.unicode_left_parenthesis, symbol.unicode_right_parenthesis), (symbol.unicode_left_square_bracket, symbol.unicode_right_square_bracket), (symbol.unicode_left_curly_brace, symbol.unicode_right_curly_brace), @@ -122,11 +121,11 @@ def unicode_art(*obj, **kwds): sage: sep_line = unicode_art('\n'.join(u' ⎟ ' for _ in range(5)), baseline=5) sage: unicode_art(*AlternatingSignMatrices(3), ....: separator=sep_line, sep_baseline=1) - ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ + ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎛1 0 0⎞ ⎟ ⎛0 1 0⎞ ⎟ ⎛1 0 0⎞ ⎟ ⎛ 0 1 0⎞ ⎟ ⎛0 0 1⎞ ⎟ ⎛0 1 0⎞ ⎟ ⎛0 0 1⎞ ⎜0 1 0⎟ ⎟ ⎜1 0 0⎟ ⎟ ⎜0 0 1⎟ ⎟ ⎜ 1 -1 1⎟ ⎟ ⎜1 0 0⎟ ⎟ ⎜0 0 1⎟ ⎟ ⎜0 1 0⎟ ⎝0 0 1⎠ ⎟ ⎝0 0 1⎠ ⎟ ⎝0 1 0⎠ ⎟ ⎝ 0 1 0⎠ ⎟ ⎝0 1 0⎠ ⎟ ⎝1 0 0⎠ ⎟ ⎝1 0 0⎠ - ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ + ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ TESTS:: @@ -136,7 +135,7 @@ def unicode_art(*obj, **kwds): -⎝2⋅x + ╲╱ 1 - 4⋅x - 1⎠ ───────────────────────── _________ - 2⋅x⋅╲╱ 1 - 4⋅x + 2⋅x⋅╲╱ 1 - 4⋅x sage: unicode_art(list(DyckWords(3))) ⎡ ╱╲ ⎤ ⎢ ╱╲ ╱╲ ╱╲╱╲ ╱ ╲ ⎥ diff --git a/src/sage_setup/autogen/interpreters/generator.py b/src/sage_setup/autogen/interpreters/generator.py index 15dff66ca76..63eca61b70c 100644 --- a/src/sage_setup/autogen/interpreters/generator.py +++ b/src/sage_setup/autogen/interpreters/generator.py @@ -14,8 +14,7 @@ from __future__ import print_function, absolute_import from collections import defaultdict - -from six.moves import cStringIO as StringIO +from io import StringIO from .memory import string_of_addr from .utils import je, indent_lines, reindent_lines as ri @@ -75,7 +74,7 @@ def gen_code(self, instr_desc, write): sage: from sage_setup.autogen.interpreters import * sage: interp = RDFInterpreter() sage: gen = InterpreterGenerator(interp) - sage: from six.moves import cStringIO as StringIO + sage: from io import StringIO sage: buff = StringIO() sage: instrs = dict([(ins.name, ins) for ins in interp.instr_descs]) sage: gen.gen_code(instrs['div'], buff.write) @@ -265,7 +264,7 @@ def write_interpreter(self, write): sage: from sage_setup.autogen.interpreters import * sage: interp = RDFInterpreter() sage: gen = InterpreterGenerator(interp) - sage: from six.moves import cStringIO as StringIO + sage: from io import StringIO sage: buff = StringIO() sage: gen.write_interpreter(buff.write) sage: print(buff.getvalue()) @@ -312,7 +311,7 @@ def write_wrapper(self, write): sage: from sage_setup.autogen.interpreters import * sage: interp = RDFInterpreter() sage: gen = InterpreterGenerator(interp) - sage: from six.moves import cStringIO as StringIO + sage: from io import StringIO sage: buff = StringIO() sage: gen.write_wrapper(buff.write) sage: print(buff.getvalue()) @@ -481,7 +480,7 @@ def write_pxd(self, write): sage: from sage_setup.autogen.interpreters import * sage: interp = RDFInterpreter() sage: gen = InterpreterGenerator(interp) - sage: from six.moves import cStringIO as StringIO + sage: from io import StringIO sage: buff = StringIO() sage: gen.write_pxd(buff.write) sage: print(buff.getvalue()) diff --git a/src/sage_setup/autogen/interpreters/instructions.py b/src/sage_setup/autogen/interpreters/instructions.py index 7d3988ae27f..d45a34e629a 100644 --- a/src/sage_setup/autogen/interpreters/instructions.py +++ b/src/sage_setup/autogen/interpreters/instructions.py @@ -14,7 +14,6 @@ from __future__ import print_function, absolute_import import re -import six from .storage import ty_int @@ -253,7 +252,7 @@ def __init__(self, name, io, code=None, uses_error_handler=False, if len is None: n_inputs += 1 in_effect += 'S' - elif isinstance(len, six.integer_types): + elif isinstance(len, int): n_inputs += len in_effect += 'S%d' % len else: @@ -266,7 +265,7 @@ def __init__(self, name, io, code=None, uses_error_handler=False, if len is None: n_outputs += 1 out_effect += 'S' - elif isinstance(len, six.integer_types): + elif isinstance(len, int): n_outputs += len out_effect += 'S%d' % len else: diff --git a/src/sage_setup/autogen/interpreters/memory.py b/src/sage_setup/autogen/interpreters/memory.py index 624d1e67a5a..70e9d350711 100644 --- a/src/sage_setup/autogen/interpreters/memory.py +++ b/src/sage_setup/autogen/interpreters/memory.py @@ -13,8 +13,6 @@ from __future__ import print_function, absolute_import -import six - from .utils import je, reindent_lines as ri @@ -36,7 +34,7 @@ def string_of_addr(a): sage: string_of_addr(42r) '42' """ - if isinstance(a, six.integer_types): + if isinstance(a, int): return str(a) assert(isinstance(a, MemoryChunk)) return '*%s++' % a.name diff --git a/src/sage_setup/clean.py b/src/sage_setup/clean.py index 49191a09009..84d1970a5c9 100644 --- a/src/sage_setup/clean.py +++ b/src/sage_setup/clean.py @@ -13,10 +13,7 @@ import os -import six - -if not six.PY2: - import importlib.util +import importlib.util from sage_setup.find import installed_files_by_module, get_extensions @@ -63,9 +60,7 @@ def _remove(file_set, module_base, to_remove): remove = [filename] - if not six.PY2: - remove.append(importlib.util.cache_from_source(filename)) - + remove.append(importlib.util.cache_from_source(filename)) file_set.difference_update(remove) diff --git a/src/sage_setup/docbuild/__init__.py b/src/sage_setup/docbuild/__init__.py index 128117b960f..fd151511d91 100644 --- a/src/sage_setup/docbuild/__init__.py +++ b/src/sage_setup/docbuild/__init__.py @@ -39,16 +39,17 @@ # **************************************************************************** from __future__ import absolute_import, print_function -from six.moves import range import logging import optparse import os +import pickle import re import shutil import subprocess import sys import time +import types import warnings logger = logging.getLogger(__name__) @@ -782,10 +783,9 @@ def get_cache(self): filename = self.cache_filename() if not os.path.exists(filename): return {} - from six.moves import cPickle with open(self.cache_filename(), 'rb') as file: try: - cache = cPickle.load(file) + cache = pickle.load(file) except Exception: logger.debug("Cache file '%s' is corrupted; ignoring it..." % filename) cache = {} @@ -798,9 +798,8 @@ def save_cache(self): Pickle the current reference cache for later retrieval. """ cache = self.get_cache() - from six.moves import cPickle with open(self.cache_filename(), 'wb') as file: - cPickle.dump(cache, file) + pickle.dump(cache, file) logger.debug("Saved the reference cache: %s", self.cache_filename()) def get_sphinx_environment(self): @@ -845,8 +844,6 @@ def update_mtimes(self): # env.topickle(env_pickle), which first writes a temporary # file. We adapt sphinx.environment's # BuildEnvironment.topickle: - from six.moves import cPickle - import types # remove unpicklable attributes env.set_warnfunc(None) @@ -858,7 +855,7 @@ def update_mtimes(self): types.FunctionType, type)): del env.config[key] - cPickle.dump(env, picklefile, cPickle.HIGHEST_PROTOCOL) + pickle.dump(env, picklefile, pickle.HIGHEST_PROTOCOL) logger.debug("Saved Sphinx environment: %s", env_pickle) diff --git a/src/sage_setup/docbuild/ext/multidocs.py b/src/sage_setup/docbuild/ext/multidocs.py index 71a08cd9379..ff7b8282973 100644 --- a/src/sage_setup/docbuild/ext/multidocs.py +++ b/src/sage_setup/docbuild/ext/multidocs.py @@ -18,11 +18,9 @@ - the javascript index; - the citations. """ -import six -from six.moves import cPickle -from six import text_type import os +import pickle import shutil import sphinx from sphinx.util.console import bold @@ -87,14 +85,14 @@ def merge_environment(app, env): # merge the citations newcite = {} citations = docenv.domaindata["std"]["citations"] - for ind, (path, tag, lineno) in six.iteritems(docenv.domaindata["std"]["citations"]): + for ind, (path, tag, lineno) in docenv.domaindata["std"]["citations"].items(): # TODO: Warn on conflicts newcite[ind] = (fixpath(path), tag, lineno) env.domaindata["std"]["citations"].update(newcite) # merge the py:module indexes newmodules = {} for ind,(modpath,v1,v2,v3) in ( - six.iteritems(docenv.domaindata['py']['modules'])): + docenv.domaindata['py']['modules'].items()): newmodules[ind] = (fixpath(modpath),v1,v2,v3) env.domaindata['py']['modules'].update(newmodules) logger.info(", %s modules"%(len(newmodules))) @@ -119,7 +117,7 @@ def get_env(app, curdoc): logger.info("") logger.warning("Unable to fetch %s " % filename) return None - docenv = cPickle.load(f) + docenv = pickle.load(f) f.close() return docenv @@ -138,18 +136,18 @@ def merge_js_index(app): if index is not None: # merge the mappings logger.info(" %s js index entries"%(len(index._mapping))) - for (ref, locs) in six.iteritems(index._mapping): + for (ref, locs) in index._mapping.items(): newmapping = set(map(fixpath, locs)) if ref in mapping: newmapping = mapping[ref] | newmapping - mapping[text_type(ref)] = newmapping + mapping[str(ref)] = newmapping # merge the titles titles = app.builder.indexer._titles - for (res, title) in six.iteritems(index._titles): + for (res, title) in index._titles.items(): titles[fixpath(res)] = title # merge the filenames filenames = app.builder.indexer._filenames - for (res, filename) in six.iteritems(index._filenames): + for (res, filename) in index._filenames.items(): filenames[fixpath(res)] = fixpath(filename) # TODO: merge indexer._objtypes, indexer._objnames as well @@ -237,7 +235,7 @@ def write_citations(app, citations): from sage.misc.temporary_file import atomic_write outdir = citation_dir(app) with atomic_write(os.path.join(outdir, CITE_FILENAME), binary=True) as f: - cPickle.dump(citations, f) + pickle.dump(citations, f) logger.info("Saved pickle file: %s" % CITE_FILENAME) @@ -251,10 +249,10 @@ def fetch_citation(app, env): if not os.path.isfile(filename): return with open(filename, 'rb') as f: - cache = cPickle.load(f) + cache = pickle.load(f) logger.info("done (%s citations)."%len(cache)) cite = env.domaindata["std"]["citations"] - for ind, (path, tag, lineno) in six.iteritems(cache): + for ind, (path, tag, lineno) in cache.items(): if ind not in cite: # don't override local citation cite[ind] = (os.path.join("..", path), tag, lineno) diff --git a/src/sage_setup/docbuild/ext/sage_autodoc.py b/src/sage_setup/docbuild/ext/sage_autodoc.py index bba274fe359..727ce30ec9c 100644 --- a/src/sage_setup/docbuild/ext/sage_autodoc.py +++ b/src/sage_setup/docbuild/ext/sage_autodoc.py @@ -487,7 +487,7 @@ def get_doc(self, encoding=None, ignore=1): docstring = getdoc(self.object) # make sure we have Unicode docstrings, then sanitize and split # into lines - if isinstance(docstring, text_type): + if isinstance(docstring, str): return [prepare_docstring(docstring, ignore)] elif isinstance(docstring, str): # this will not trigger on Py3 return [prepare_docstring(force_decode(docstring, encoding), @@ -511,9 +511,9 @@ def get_sourcename(self): # type: () -> unicode if self.analyzer: # prevent encoding errors when the file name is non-ASCII - if not isinstance(self.analyzer.srcname, text_type): - filename = text_type(self.analyzer.srcname, - sys.getfilesystemencoding(), 'replace') + if not isinstance(self.analyzer.srcname, str): + filename = str(self.analyzer.srcname, + sys.getfilesystemencoding(), 'replace') else: filename = self.analyzer.srcname return u'%s:docstring of %s' % (filename, self.fullname) @@ -699,7 +699,7 @@ def document_members(self, all_members=False): # document non-skipped members memberdocumenters = [] # type: List[Tuple[Documenter, bool]] for (mname, member, isattr) in self.filter_members(members, want_all): - classes = [cls for cls in itervalues(self.documenters) + classes = [cls for cls in self.documenters.values() if cls.can_document_member(member, mname, isattr, self)] if not classes: # don't know how to document this member @@ -887,7 +887,7 @@ def get_object_members(self, want_all): memberlist = self.object.__all__ # Sometimes __all__ is broken... if not isinstance(memberlist, (list, tuple)) or not \ - all(isinstance(entry, string_types) for entry in memberlist): + all(isinstance(entry, str) for entry in memberlist): logger.warning( '__all__ should be a list of strings, not %r ' '(in module %s) -- ignoring __all__' % @@ -1112,7 +1112,7 @@ class ClassDocumenter(DocstringSignatureMixin, ModuleLevelDocumenter): @classmethod def can_document_member(cls, member, membername, isattr, parent): # type: (Any, unicode, bool, Any) -> bool - return isinstance(member, class_types) + return isinstance(member, type) def import_object(self): # type: () -> Any @@ -1282,7 +1282,7 @@ def get_doc(self, encoding=None, ignore=1): docstrings.append(initdocstring) doc = [] for docstring in docstrings: - if isinstance(docstring, text_type): + if isinstance(docstring, str): doc.append(prepare_docstring(docstring, ignore)) elif isinstance(docstring, str): # this will not trigger on Py3 doc.append(prepare_docstring(force_decode(docstring, encoding), @@ -1295,7 +1295,7 @@ def add_content(self, more_content, no_docstring=False): # We cannot rely on __qualname__ yet for Python 2, because of a # Cython bug: https://github.com/cython/cython/issues/2772. See # trac #27002. - classname = None if PY2 else safe_getattr(self.object, '__qualname__', None) + classname = safe_getattr(self.object, '__qualname__', None) if not classname: classname = safe_getattr(self.object, '__name__', None) if classname: @@ -1340,8 +1340,7 @@ class ExceptionDocumenter(ClassDocumenter): @classmethod def can_document_member(cls, member, membername, isattr, parent): # type: (Any, unicode, bool, Any) -> bool - return isinstance(member, class_types) and \ - issubclass(member, BaseException) + return isinstance(member, type) and issubclass(member, BaseException) class DataDocumenter(ModuleLevelDocumenter): diff --git a/src/sage_setup/find.py b/src/sage_setup/find.py index 83d1803f957..12914419fe3 100644 --- a/src/sage_setup/find.py +++ b/src/sage_setup/find.py @@ -12,14 +12,13 @@ #***************************************************************************** +import importlib.machinery +import importlib.util + import os -import six from collections import defaultdict -if not six.PY2: - import importlib.util - def find_python_sources(src_dir, modules=['sage']): """ @@ -221,10 +220,9 @@ def add(module, filename, dirpath): module_files[module].add(filename) - if not six.PY2: - cache_filename = importlib.util.cache_from_source(filename) - if os.path.exists(cache_filename): - module_files[module].add(cache_filename) + cache_filename = importlib.util.cache_from_source(filename) + if os.path.exists(cache_filename): + module_files[module].add(cache_filename) cwd = os.getcwd() try: @@ -289,32 +287,15 @@ def get_extensions(type=None): return [ext for ext in _get_extensions(type) if ext[0] == '.'] -if six.PY2: - import imp - - def _get_extensions(type): - """ - Python 2 implementation of ``get_extensions()`` using the `imp` module. - """ - - if type: - type = {'source': imp.PY_SOURCE, 'bytecode': imp.PY_COMPILED, - 'extension': imp.C_EXTENSION}[type] - - return [s[0] for s in imp.get_suffixes() - if type is None or type == s[2]] -else: - import importlib.machinery - - def _get_extensions(type): - """ - Python 3.3+ implementation of ``get_extensions()`` using the - `importlib.extensions` module. - """ +def _get_extensions(type): + """ + Python 3.3+ implementation of ``get_extensions()`` using the + `importlib.extensions` module. + """ - if type: - return {'source': importlib.machinery.SOURCE_SUFFIXES, - 'bytecode': importlib.machinery.BYTECODE_SUFFIXES, - 'extension': importlib.machinery.EXTENSION_SUFFIXES}[type] + if type: + return {'source': importlib.machinery.SOURCE_SUFFIXES, + 'bytecode': importlib.machinery.BYTECODE_SUFFIXES, + 'extension': importlib.machinery.EXTENSION_SUFFIXES}[type] - return importlib.machinery.all_suffixes() + return importlib.machinery.all_suffixes() From 4ec5aacd326c453458c87fea31f58d86886a20ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Wed, 13 May 2020 10:21:59 +0200 Subject: [PATCH 156/301] spring cleanup for pushout.py --- src/sage/categories/pushout.py | 272 +++++++++++++++++---------------- 1 file changed, 142 insertions(+), 130 deletions(-) diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py index 27e436c6360..573411d772e 100644 --- a/src/sage/categories/pushout.py +++ b/src/sage/categories/pushout.py @@ -2,7 +2,6 @@ Coercion via construction functors """ from __future__ import print_function, absolute_import -from six.moves import range import six from sage.misc.lazy_import import lazy_import @@ -129,9 +128,9 @@ def __mul__(self, other): """ if not isinstance(self, ConstructionFunctor) and not isinstance(other, ConstructionFunctor): raise CoercionException("Non-constructive product") - if isinstance(other,IdentityConstructionFunctor): + if isinstance(other, IdentityConstructionFunctor): return self - if isinstance(self,IdentityConstructionFunctor): + if isinstance(self, IdentityConstructionFunctor): return other return CompositeConstructionFunctor(other, self) @@ -235,7 +234,7 @@ def _repr_(self): def merge(self, other): """ - Merge ``self`` with another construction functor, or return None. + Merge ``self`` with another construction functor, or return ̀̀None``. .. NOTE:: @@ -532,7 +531,7 @@ def __mul__(self, other): """ if isinstance(self, CompositeConstructionFunctor): all = [other] + self.all - elif isinstance(other,IdentityConstructionFunctor): + elif isinstance(other, IdentityConstructionFunctor): return self else: all = other.all + [self] @@ -550,7 +549,7 @@ def _repr_(self): """ s = "..." for c in self.all: - s = "%s(%s)" % (c,s) + s = "%s(%s)" % (c, s) return s def expand(self): @@ -646,7 +645,6 @@ def __eq__(self, other): """ c = (type(self) == type(other)) if not c: - from sage.categories.functor import IdentityFunctor_generic if isinstance(other, IdentityFunctor_generic): return True return c @@ -921,7 +919,7 @@ def __ne__(self, other): def merge(self, other): """ - Merge ``self`` with another construction functor, or return None. + Merge ``self`` with another construction functor, or return ``None``. NOTE: @@ -1076,7 +1074,7 @@ def __mul__(self, other): sage: G*F MPoly[x,y,t] """ - if isinstance(other,IdentityConstructionFunctor): + if isinstance(other, IdentityConstructionFunctor): return self if isinstance(other, MultiPolynomialFunctor): if self.term_order != other.term_order: @@ -1084,15 +1082,15 @@ def __mul__(self, other): if set(self.vars).intersection(other.vars): raise CoercionException("Overlapping variables (%s,%s)" % (self.vars, other.vars)) return MultiPolynomialFunctor(other.vars + self.vars, self.term_order) - elif isinstance(other, CompositeConstructionFunctor) \ - and isinstance(other.all[-1], MultiPolynomialFunctor): + elif (isinstance(other, CompositeConstructionFunctor) + and isinstance(other.all[-1], MultiPolynomialFunctor)): return CompositeConstructionFunctor(other.all[:-1], self * other.all[-1]) else: return CompositeConstructionFunctor(other, self) def merge(self, other): """ - Merge ``self`` with another construction functor, or return None. + Merge ``self`` with another construction functor, or return ``None``. EXAMPLES:: @@ -1251,7 +1249,7 @@ def __init__(self, gens, order, implementation): True """ - if len(gens)<1: + if not gens: raise ValueError("Infinite Polynomial Rings have at least one generator") ConstructionFunctor.__init__(self, Rings(), Rings()) self._gens = tuple(gens) @@ -1298,7 +1296,7 @@ def _repr_(self): InfPoly{[a,b,x], "degrevlex", "sparse"} """ - return 'InfPoly{[%s], "%s", "%s"}'%(','.join(self._gens), self._order, self._imple) + return 'InfPoly{[%s], "%s", "%s"}' % (','.join(self._gens), self._order, self._imple) def __eq__(self, other): """ @@ -1360,7 +1358,7 @@ def __mul__(self, other): InfPoly{[x,y], "degrevlex", "dense"}(FractionField(...)) """ - if isinstance(other,IdentityConstructionFunctor): + if isinstance(other, IdentityConstructionFunctor): return self if isinstance(other, self.__class__): # INT = set(self._gens).intersection(other._gens) @@ -1400,7 +1398,7 @@ def __mul__(self, other): BadOverlap = False for x in othervars: if x.count('_') == 1: - g,n = x.split('_') + g, n = x.split('_') if n.isdigit(): if g.isalnum(): # we can interprete x in any InfinitePolynomialRing if g in self._gens: # we can interprete x in self, hence, we will not use it as a variable anymore. @@ -1408,12 +1406,12 @@ def __mul__(self, other): IsOverlap = True # some variables of other can be interpreted in self. if OverlappingVars: # Is OverlappingVars in the right order? - g0,n0 = OverlappingVars[-1].split('_') + g0, n0 = OverlappingVars[-1].split('_') i = self._gens.index(g) i0 = self._gens.index(g0) - if iint(n0): # wrong order + if i == i0 and int(n) > int(n0): # wrong order BadOverlap = True OverlappingVars.append(x) else: @@ -1431,18 +1429,18 @@ def __mul__(self, other): if BadOverlap: # the overlapping variables appear in the wrong order raise CoercionException("Overlapping variables (%s,%s) are incompatible" % (self._gens, OverlappingVars)) - if len(OverlappingVars)>1: # multivariate, hence, the term order matters - if other.term_order.name()!=self._order: + if len(OverlappingVars) > 1: # multivariate, hence, the term order matters + if other.term_order.name() != self._order: raise CoercionException("Incompatible term orders %s, %s" % (self._order, other.term_order.name())) # ok, the overlap is fine, we will return something. if RemainingVars: # we can only partially merge other into self - if len(RemainingVars)>1: - return CompositeConstructionFunctor(MultiPolynomialFunctor(RemainingVars,term_order=other.term_order), self) + if len(RemainingVars) > 1: + return CompositeConstructionFunctor(MultiPolynomialFunctor(RemainingVars, term_order=other.term_order), self) return CompositeConstructionFunctor(PolynomialFunctor(RemainingVars[0]), self) return self return CompositeConstructionFunctor(other, self) - def merge(self,other): + def merge(self, other): """ Merge two construction functors of infinite polynomial rings, regardless of monomial order and implementation. @@ -1475,13 +1473,13 @@ def merge(self,other): return self return None try: - OUT = self*other + OUT = self * other # The following happens if "other" has the same order type etc. if not isinstance(OUT, CompositeConstructionFunctor): return OUT except CoercionException: pass - if isinstance(other,InfinitePolynomialFunctor): + if isinstance(other, InfinitePolynomialFunctor): # We don't require that the orders coincide. This is a difference to self*other # We only merge if other's generators are an ordered subset of self's generators for g in other._gens: @@ -1489,7 +1487,7 @@ def merge(self,other): return None # The sequence of variables is part of the ordering. It must coincide in both rings Ind = [self._gens.index(g) for g in other._gens] - if sorted(Ind)!=Ind: + if sorted(Ind) != Ind: return None # OK, other merges into self. Now, choose the default dense implementation, # unless both functors refer to the sparse implementation @@ -1635,6 +1633,7 @@ def __ne__(self, other): def merge(self, other): """ Merging is only happening if both functors are matrix functors of the same dimension. + The result is sparse if and only if both given functors are sparse. EXAMPLES:: @@ -1715,7 +1714,7 @@ def __init__(self, var, multi_variate=False): """ Functor.__init__(self, Rings(), Rings()) - if not isinstance(var, (six.string_types,tuple,list)): + if not isinstance(var, (six.string_types, tuple, list)): raise TypeError("variable name or list of variable names expected") self.var = var self.multi_variate = multi_variate or not isinstance(var, six.string_types) @@ -1791,6 +1790,7 @@ def __ne__(self, other): def merge(self, other): """ Two Laurent polynomial construction functors merge if the variable names coincide. + The result is multivariate if one of the arguments is multivariate. EXAMPLES:: @@ -1860,7 +1860,7 @@ def __init__(self, n, is_sparse=False, inner_product_matrix=None): """ # Functor.__init__(self, Rings(), FreeModules()) # FreeModules() takes a base ring # Functor.__init__(self, Objects(), Objects()) # Object() makes no sense, since FreeModule raises an error, e.g., on Set(['a',1]). - ## FreeModule requires a commutative ring. Thus, we have + # FreeModule requires a commutative ring. Thus, we have Functor.__init__(self, CommutativeRings(), CommutativeAdditiveGroups()) self.n = n self.is_sparse = is_sparse @@ -1908,7 +1908,7 @@ def _apply_functor_to_morphism(self, f): ... NotImplementedError: Can not create induced morphisms of free modules yet """ - ## TODO: Implement this! + # TODO: Implement this! raise NotImplementedError("Can not create induced morphisms of free modules yet") def __eq__(self, other): @@ -1928,7 +1928,8 @@ def __eq__(self, other): True """ if isinstance(other, VectorFunctor): - return (self.n == other.n and self.inner_product_matrix==other.inner_product_matrix) + return (self.n == other.n and + self.inner_product_matrix == other.inner_product_matrix) return False def __ne__(self, other): @@ -2064,11 +2065,11 @@ def __init__(self, basis): [1 2 3] [4 0 1] """ -## Functor.__init__(self, FreeModules(), FreeModules()) # takes a base ring -## Functor.__init__(self, Objects(), Objects()) # is too general - ## It seems that the category of commutative additive groups - ## currently is the smallest base ring free category that - ## contains in- and output +# Functor.__init__(self, FreeModules(), FreeModules()) # takes a base ring +# Functor.__init__(self, Objects(), Objects()) # is too general + # It seems that the category of commutative additive groups + # currently is the smallest base ring free category that + # contains in- and output Functor.__init__(self, CommutativeAdditiveGroups(), CommutativeAdditiveGroups()) self.basis = basis @@ -2239,7 +2240,8 @@ def merge(self, other): if not self.basis: return other try: - P = pushout(self.basis[0].parent().ambient_module(),other.basis[0].parent().ambient_module()) + P = pushout(self.basis[0].parent().ambient_module(), + other.basis[0].parent().ambient_module()) except CoercionException: return None try: @@ -2248,7 +2250,7 @@ def merge(self, other): submodule = P.span except AttributeError: return None - S = submodule(self.basis+other.basis).echelonized_basis() + S = submodule(self.basis + other.basis).echelonized_basis() return SubspaceFunctor(S) else: return None @@ -2402,10 +2404,10 @@ def __init__(self, p, prec, extras=None): from sage.rings.infinity import Infinity if self.p == Infinity: if self.type not in self._real_types: - raise ValueError("completion type must be one of %s"%(", ".join(self._real_types))) + raise ValueError("completion type must be one of %s" % (", ".join(self._real_types))) else: if self.type not in self._dvr_types: - raise ValueError("completion type must be one of %s"%(", ".join(self._dvr_types[1:]))) + raise ValueError("completion type must be one of %s" % (", ".join(self._dvr_types[1:]))) def _repr_(self): """ @@ -2434,28 +2436,28 @@ def _apply_functor(self, R): """ try: - if len(self.extras) == 0: + if not self.extras: if self.type is None: try: return R.completion(self.p, self.prec) except TypeError: return R.completion(self.p, self.prec, {}) else: - return R.completion(self.p, self.prec, {'type':self.type}) + return R.completion(self.p, self.prec, {'type': self.type}) else: extras = self.extras.copy() extras['type'] = self.type return R.completion(self.p, self.prec, extras) - except (NotImplementedError,AttributeError): + except (NotImplementedError, AttributeError): if R.construction() is None: - raise NotImplementedError("Completion is not implemented for %s"%R.__class__) + raise NotImplementedError("Completion is not implemented for %s" % R.__class__) F, BR = R.construction() M = self.merge(F) or F.merge(self) if M is not None: return M(BR) if self.commutes(F) or F.commutes(self): return F(self(BR)) - raise NotImplementedError("Don't know how to apply %s to %s"%(repr(self),repr(R))) + raise NotImplementedError("Don't know how to apply %s to %s" % (repr(self), repr(R))) def __eq__(self, other): """ @@ -2586,11 +2588,16 @@ def merge(self, other): from sage.all import Infinity if self.p == Infinity: new_prec = min(self.prec, other.prec) - new_type = self._real_types[min(self._real_types.index(self.type), \ + new_type = self._real_types[min(self._real_types.index(self.type), self._real_types.index(other.type))] - new_scinot = max(self.extras.get('sci_not',0), other.extras.get('sci_not',0)) - new_rnd = min(self.extras.get('rnd', 0), other.extras.get('rnd', 0)) - return CompletionFunctor(self.p, new_prec, {'type':new_type, 'sci_not':new_scinot, 'rnd':new_rnd}) + new_scinot = max(self.extras.get('sci_not', 0), + other.extras.get('sci_not', 0)) + new_rnd = min(self.extras.get('rnd', 0), + other.extras.get('rnd', 0)) + return CompletionFunctor(self.p, new_prec, + {'type': new_type, + 'sci_not': new_scinot, + 'rnd': new_rnd}) else: new_type = self._dvr_types[min(self._dvr_types.index(self.type), self._dvr_types.index(other.type))] if new_type in ('fixed-mod', 'floating-point'): @@ -2604,13 +2611,13 @@ def merge(self, other): extras['type'] = new_type return CompletionFunctor(self.p, new_prec, extras) -## Completion has a lower rank than FractionField -## and is thus applied first. However, fact is that -## both commute. This is used in the call method, -## since some fraction fields have no completion method -## implemented. +# Completion has a lower rank than FractionField +# and is thus applied first. However, fact is that +# both commute. This is used in the call method, +# since some fraction fields have no completion method +# implemented. - def commutes(self,other): + def commutes(self, other): """ Completion commutes with fraction fields. @@ -2755,12 +2762,12 @@ def _apply_functor(self, R): if I.ring().has_coerce_map_from(R): R = I.ring() else: - R = pushout(R,I.ring().base_ring()) - I = [R(1)*t for t in I.gens()]*R + R = pushout(R, I.ring().base_ring()) + I = [R.one() * t for t in I.gens()] * R try: - Q = R.quo(I,names=self.names) + Q = R.quo(I, names=self.names) except IndexError: # That may happen! - raise CoercionException("Can not apply this quotient functor to %s"%R) + raise CoercionException("Can not apply this quotient functor to %s" % R) if self.as_field:# and hasattr(Q, 'field'): try: Q = Q.field() @@ -3049,9 +3056,9 @@ def _apply_functor(self, R): """ from sage.all import QQ, ZZ, CyclotomicField if self.cyclotomic: - if R==QQ: + if R == QQ: return CyclotomicField(self.cyclotomic) - if R==ZZ: + if R == ZZ: return CyclotomicField(self.cyclotomic).maximal_order() if len(self.polys) == 1: return R.extension(self.polys[0], names=self.names[0], embedding=self.embeddings[0], @@ -3093,7 +3100,7 @@ def __ne__(self, other): __hash__ = ConstructionFunctor.__hash__ - def merge(self,other): + def merge(self, other): """ Merging with another :class:`AlgebraicExtensionFunctor`. @@ -3116,7 +3123,7 @@ def merge(self,other): - If these two extensions are defined by Conway polynomials over finite fields, merges them into a single extension of degree the lcm of the two degrees. - - Otherwise, None is returned. + - Otherwise, ``None`` is returned. REMARK: @@ -3187,12 +3194,12 @@ def merge(self,other): # *after* expanding the functors. Hence, we can # assume that both functors have a single variable. # But for being on the safe side...: - if len(self.names)!=1 or len(other.names)!=1: + if not (len(self.names) == 1 == len(other.names)): return None -## We don't accept a forgetful coercion, since, together -## with bidirectional coercions between two embedded -## number fields, it would yield to contradictions in -## the coercion system. +# We don't accept a forgetful coercion, since, together +# with bidirectional coercions between two embedded +# number fields, it would yield to contradictions in +# the coercion system. # if self.polys==other.polys and self.names==other.names: # # We have a forgetful functor: # if self.embeddings==[None]: @@ -3200,7 +3207,7 @@ def merge(self,other): # if other.embeddings==[None]: # return other # ... or we may use the given embeddings: - if self.embeddings!=[None] and other.embeddings!=[None]: + if self.embeddings != [None] and other.embeddings != [None]: from sage.all import QQ KS = self(QQ) KO = other(QQ) @@ -3219,10 +3226,11 @@ def merge(self,other): # Finite fields and unramified local extensions may use # integers to encode degrees of extensions. from sage.rings.integer import Integer - if (isinstance(self.polys[0], Integer) and isinstance(other.polys[0], Integer) - and self.embeddings == other.embeddings == [None] - and self.structures == other.structures == [None] - and self.kwds == other.kwds): + if (isinstance(self.polys[0], Integer) + and isinstance(other.polys[0], Integer) + and self.embeddings == other.embeddings == [None] + and self.structures == other.structures == [None] + and self.kwds == other.kwds): return AlgebraicExtensionFunctor([self.polys[0].lcm(other.polys[0])], [None], **self.kwds) def __mul__(self, other): @@ -3244,7 +3252,7 @@ def __mul__(self, other): True """ - if isinstance(other,IdentityConstructionFunctor): + if isinstance(other, IdentityConstructionFunctor): return self if isinstance(other, AlgebraicExtensionFunctor): if set(self.names).intersection(other.names): @@ -3255,8 +3263,8 @@ def __mul__(self, other): precs=self.precs + other.precs, implementations=self.implementations + other.implementations, **self.kwds) - elif isinstance(other, CompositeConstructionFunctor) \ - and isinstance(other.all[-1], AlgebraicExtensionFunctor): + elif (isinstance(other, CompositeConstructionFunctor) + and isinstance(other.all[-1], AlgebraicExtensionFunctor)): return CompositeConstructionFunctor(other.all[:-1], self * other.all[-1]) else: return CompositeConstructionFunctor(other, self) @@ -3336,7 +3344,7 @@ def _apply_functor(self, R): """ try: c = R.construction() - if c is not None and c[0]==self: + if c is not None and c[0] == self: return R except AttributeError: pass @@ -3350,14 +3358,14 @@ def merge(self, other): TESTS:: - sage: K.=NumberField(x^3+x^2+1) + sage: K. = NumberField(x^3+x^2+1) sage: CDF.construction()[0].merge(K.construction()[0]) is None True sage: CDF.construction()[0].merge(CDF.construction()[0]) AlgebraicClosureFunctor """ - if self==other: + if self == other: return self return None # Mathematically, Algebraic Closure subsumes Algebraic Extension. @@ -3392,7 +3400,7 @@ def _repr_(self): sage: PF PermutationGroupFunctor[(1,2)] """ - return "PermutationGroupFunctor%s"%self.gens() + return "PermutationGroupFunctor%s" % self.gens() def __call__(self, R): """ @@ -3420,7 +3428,7 @@ def gens(self): def merge(self, other): """ - Merge ``self`` with another construction functor, or return None. + Merge ``self`` with another construction functor, or return ``None``. EXAMPLES:: @@ -3487,7 +3495,7 @@ def __init__(self, box): sage: FM == loads(dumps(FM)) True """ - ConstructionFunctor.__init__(self,Objects(),Objects()) + ConstructionFunctor.__init__(self, Objects(), Objects()) if not callable(box): raise TypeError("input must be callable") self.box = box @@ -3987,8 +3995,8 @@ def pushout(R, S): S_tower = expand_tower(S_tower[:len(Ss)]) else: # Rc is a list of functors from Z to R and Sc is a list of functors from Z to S - R_tower = expand_tower(R_tower[:len(Rs)+1]) - S_tower = expand_tower(S_tower[:len(Ss)+1]) + R_tower = expand_tower(R_tower[:len(Rs) + 1]) + S_tower = expand_tower(S_tower[:len(Ss) + 1]) Rc = [c[0] for c in R_tower[1:]] Sc = [c[0] for c in S_tower[1:]] @@ -4007,9 +4015,9 @@ def apply_from(Xc): try: while Rc or Sc: # if we are out of functors in either tower, there is no ambiguity - if len(Sc) == 0: + if not Sc: all = apply_from(Rc) - elif len(Rc) == 0: + elif not Rc: all = apply_from(Sc) # if one of the functors has lower rank, do it first elif Rc[-1].rank < Sc[-1].rank: @@ -4066,7 +4074,6 @@ def apply_from(Xc): raise CoercionException(ex) - def pushout_lattice(R, S): r""" Given a pair of objects `R` and `S`, try to construct a @@ -4117,11 +4124,11 @@ def pushout_lattice(R, S): return None # truncate at common ancestor - R_tower = list(reversed(R_tower[:Rs.index(start)+1])) - S_tower = list(reversed(S_tower[:Ss.index(start)+1])) - Rs = [c[1] for c in R_tower] # the list of objects + R_tower = list(reversed(R_tower[:Rs.index(start) + 1])) + S_tower = list(reversed(S_tower[:Ss.index(start) + 1])) + Rs = [c[1] for c in R_tower] # the list of objects Ss = [c[1] for c in S_tower] - Rc = [c[0] for c in R_tower] # the list of functors + Rc = [c[0] for c in R_tower] # the list of functors Sc = [c[0] for c in S_tower] # Here we try and construct a 2-dimensional lattice as follows. @@ -4135,10 +4142,10 @@ def pushout_lattice(R, S): # / \ # Qp Frac(Z[t]) # - for i in range(len(Rs)): - lattice[i,0] = Rs[i] - for j in range(len(Ss)): - lattice[0,j] = Ss[j] + for i, Rsi in enumerate(Rs): + lattice[i, 0] = Rsi + for j, Ssj in enumerate(Ss): + lattice[0, j] = Ssj # Now we attempt to fill in the center, one (diagonal) row at a time, # one commuting square at a time. @@ -4158,42 +4165,43 @@ def pushout_lattice(R, S): # Note that when applying the functors in the correct order, base extension # is not needed (though it may occur in the resulting morphisms). # - for i in range(len(Rc)-1): - for j in range(len(Sc)-1): + for i in range(len(Rc) - 1): + for j in range(len(Sc) - 1): try: - if lattice[i,j+1] == lattice[i+1,j]: + if lattice[i, j + 1] == lattice[i + 1, j]: # In this case we have R <- S -> R # We don't want to perform the operation twice # and all subsequent squares will come from objects # where the operation was already performed (either # to the left or right) Rc[i] = Sc[j] = None # IdentityConstructionFunctor() - lattice[i+1,j+1] = lattice[i,j+1] + lattice[i + 1, j + 1] = lattice[i, j + 1] elif Rc[i] is None and Sc[j] is None: - lattice[i+1,j+1] = lattice[i,j+1] + lattice[i + 1, j + 1] = lattice[i, j + 1] elif Rc[i] is None: - lattice[i+1,j+1] = Sc[j](lattice[i+1,j]) + lattice[i + 1, j + 1] = Sc[j](lattice[i + 1, j]) elif Sc[j] is None: - lattice[i+1,j+1] = Rc[i](lattice[i,j+1]) + lattice[i + 1, j + 1] = Rc[i](lattice[i, j + 1]) else: # For now, we just look at the rank. # TODO: be more sophisticated and query the functors themselves if Rc[i].rank < Sc[j].rank: - lattice[i+1,j+1] = Sc[j](lattice[i+1,j]) - Rc[i] = None # force us to use pre-applied Rc[i] + lattice[i + 1, j + 1] = Sc[j](lattice[i + 1, j]) + Rc[i] = None # force us to use pre-applied Rc[i] else: - lattice[i+1,j+1] = Rc[i](lattice[i,j+1]) - Sc[j] = None # force us to use pre-applied Sc[i] + lattice[i + 1, j + 1] = Rc[i](lattice[i, j + 1]) + Sc[j] = None # force us to use pre-applied Sc[i] except (AttributeError, NameError): # pp(lattice) - for i in range(100): - for j in range(100): + for ni in range(100): + for nj in range(100): try: - R = lattice[i,j] - print(i, j, R) + R = lattice[ni, nj] + print(ni, nj, R) except KeyError: break - raise CoercionException("%s does not support %s" % (lattice[i,j], 'F')) + raise CoercionException("%s does not support %s" + % (lattice[ni, nj], 'F')) # If we are successful, we should have something that looks like this. # @@ -4207,41 +4215,43 @@ def pushout_lattice(R, S): # \ / # Frac(Qp[t]) # - R_loc = len(Rs)-1 - S_loc = len(Ss)-1 + R_loc = len(Rs) - 1 + S_loc = len(Ss) - 1 # Find the composition coercion morphisms along the bottom left... if S_loc > 0: - R_map = lattice[R_loc,1].coerce_map_from(R) + R_map = lattice[R_loc, 1].coerce_map_from(R) for i in range(1, S_loc): - map = lattice[R_loc, i+1].coerce_map_from(lattice[R_loc, i]) # The functor used is implicit here, should it be? + map = lattice[R_loc, i + 1].coerce_map_from(lattice[R_loc, i]) + # The functor used is implicit here, should it be? R_map = map * R_map else: - R_map = R.coerce_map_from(R) # id + R_map = R.coerce_map_from(R) # id # ... and bottom right if R_loc > 0: S_map = lattice[1, S_loc].coerce_map_from(S) for i in range(1, R_loc): - map = lattice[i+1, S_loc].coerce_map_from(lattice[i, S_loc]) + map = lattice[i + 1, S_loc].coerce_map_from(lattice[i, S_loc]) S_map = map * S_map else: - S_map = S.coerce_map_from(S) # id + S_map = S.coerce_map_from(S) # id return R_map, S_map -## def pp(lattice): -## """ -## Used in debugging to print the current lattice. -## """ -## for i in range(100): -## for j in range(100): -## try: -## R = lattice[i,j] -## print(i, j, R) -## except KeyError: -## break +# def pp(lattice): +# """ +# Used in debugging to print the current lattice. +# """ +# for i in range(100): +# for j in range(100): +# try: +# R = lattice[i,j] +# print(i, j, R) +# except KeyError: +# break + def construction_tower(R): """ @@ -4271,12 +4281,13 @@ def construction_tower(R): f, R = c if not isinstance(f, ConstructionFunctor): f = BlackBoxConstructionFunctor(f) - tower.append((f,R)) + tower.append((f, R)) if not isinstance(R, Parent): break c = R.construction() return tower + def expand_tower(tower): """ An auxiliary function that is used in :func:`pushout`. @@ -4315,6 +4326,7 @@ def expand_tower(tower): new_tower.append((fs[0], R)) return list(reversed(new_tower)) + def type_to_parent(P): """ An auxiliary function that is used in :func:`pushout`. From bc4b8c1c1a4a4c6a7d102c404834e48a0c51d894 Mon Sep 17 00:00:00 2001 From: John Cremona Date: Mon, 4 May 2020 14:32:29 +0100 Subject: [PATCH 157/301] #29645: elliptic curve omega ignored prec parameter for complex embeddings --- src/sage/schemes/elliptic_curves/period_lattice.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/period_lattice.py b/src/sage/schemes/elliptic_curves/period_lattice.py index 18c197ccbf4..acc85b9740f 100644 --- a/src/sage/schemes/elliptic_curves/period_lattice.py +++ b/src/sage/schemes/elliptic_curves/period_lattice.py @@ -899,19 +899,21 @@ def omega(self, prec = None): A complex example (taken from J.E.Cremona and E.Whitley, *Periods of cusp forms and elliptic curves over imaginary quadratic fields*, Mathematics of Computation 62 No. 205 - (1994), 407-429):: + (1994), 407-429). See :trac:`29645`:: sage: K. = QuadraticField(-1) sage: E = EllipticCurve([0,1-i,i,-i,0]) sage: L = E.period_lattice(K.embeddings(CC)[0]) sage: L.omega() 8.80694160502647 + sage: L.omega(prec=200) + 8.8069416050264741493250743632295462227858630765392114070032 """ if self.is_real(): n_components = (self.real_flag+3)//2 return self.real_period(prec) * n_components else: - return self.complex_area() + return self.complex_area(prec) @cached_method def basis_matrix(self, prec=None, normalised=False): From ce17336c2090bef8c0145f30a00ba3be0c934f3c Mon Sep 17 00:00:00 2001 From: John Cremona Date: Tue, 5 May 2020 16:37:27 +0100 Subject: [PATCH 158/301] #29645: fix pycodestyle warnings --- .../schemes/elliptic_curves/period_lattice.py | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/period_lattice.py b/src/sage/schemes/elliptic_curves/period_lattice.py index acc85b9740f..d4863d9a16e 100644 --- a/src/sage/schemes/elliptic_curves/period_lattice.py +++ b/src/sage/schemes/elliptic_curves/period_lattice.py @@ -726,11 +726,14 @@ def _compute_periods_complex(self, prec=None, normalise=True): # precision used! pi = C.pi() a, b, c = (C(x) for x in self._abc) - if (a+b).abs() < (a-b).abs(): b=-b - if (a+c).abs() < (a-c).abs(): c=-c + if (a+b).abs() < (a-b).abs(): + b=-b + if (a+c).abs() < (a-c).abs(): + c=-c w1 = pi/a.agm(b) w2 = pi*C.gen()/a.agm(c) - if (w1/w2).imag()<0: w2=-w2 + if (w1/w2).imag()<0: + w2=-w2 if normalise: w1w2, mat = normalise_periods(w1,w2) return w1w2 @@ -1249,7 +1252,8 @@ def reduce(self, z): # NB We assume here that when the embedding is real then the # point is also real! - if self.real_flag == 0: return z + if self.real_flag == 0: + return z if self.real_flag == -1: k = (z.imag()/w2.imag()).round() z = z-k*w2 @@ -1392,9 +1396,11 @@ def e_log_RC(self, xP, yP, prec=None, reduce=True): a = C((e1-e3).sqrt()) b = C((e1-e2).sqrt()) - if (a+b).abs() < (a-b).abs(): b=-b + if (a+b).abs() < (a-b).abs(): + b=-b r = C(((xP-e3)/(xP-e2)).sqrt()) - if r.real()<0: r=-r + if r.real()<0: + r=-r t = -C(wP)/(2*r*(xP-e2)) # eps controls the end of the loop. Since we aim at a target # precision of prec bits, eps = 2^(-prec) is enough. @@ -1402,10 +1408,13 @@ def e_log_RC(self, xP, yP, prec=None, reduce=True): while True: s = b*r+a a, b = (a+b)/2, (a*b).sqrt() - if (a+b).abs() < (a-b).abs(): b=-b + if (a+b).abs() < (a-b).abs(): + b=-b r = (a*(r+1)/s).sqrt() - if (r.abs()-1).abs() < eps: break - if r.real()<0: r=-r + if (r.abs()-1).abs() < eps: + break + if r.real()<0: + r=-r t *= r z = ((a/t).arctan())/a z = ComplexField(prec)(z) @@ -1424,7 +1433,8 @@ def e_log_RC(self, xP, yP, prec=None, reduce=True): else: # real, disconnected case a = R(e3-e1).sqrt() b = R(e3-e2).sqrt() - if (a+b).abs() < (a-b).abs(): b=-b + if (a+b).abs() < (a-b).abs(): + b=-b on_egg = (xP Date: Sun, 10 May 2020 17:41:05 +0100 Subject: [PATCH 159/301] #29666: fix precision of elliptic curve point height computation --- src/sage/schemes/elliptic_curves/ell_point.py | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/ell_point.py b/src/sage/schemes/elliptic_curves/ell_point.py index fdd20ab16fd..69a519af208 100644 --- a/src/sage/schemes/elliptic_curves/ell_point.py +++ b/src/sage/schemes/elliptic_curves/ell_point.py @@ -2784,30 +2784,36 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): return h from sage.rings.number_field.number_field import refine_embedding + from sage.all import RealField, ComplexField, Infinity prec_v = v.codomain().prec() if prec is None: prec = prec_v if K is rings.QQ: - vv = K.embeddings(rings.RealField(max(2*prec, prec_v)))[0] - else: - vv = refine_embedding(v, 2*prec) # vv.prec() = max(2*prec, prec_v) + v = K.embeddings(RealField())[0] + v_inf = refine_embedding(v, Infinity) + + v_is_real = v_inf(K.gen()).imag().is_zero() + working_prec = prec+100 + RC = RealField(working_prec) if v_is_real else ComplexField(working_prec) - absdisc = vv(E.discriminant()).abs() - while absdisc==0: - vv = refine_embedding(vv) - # print("doubling precision") - absdisc = vv(E.discriminant()).abs() - temp = 0 if absdisc>=1 else absdisc.log()/3 + # NB We risk losing much precision if we compute the embedding + # of K into RR or CC to some precision and then apply that to + # elements of K. Instead we map elements of K into AA or Qbar + # (with infinite precision) and then trim back to RR or CC. - b2, b4, b6, b8 = [vv(b) for b in E.b_invariants()] - H = max(vv(4), abs(b2), 2*abs(b4), 2*abs(b6), abs(b8)) + x = RC(v_inf(self[0])) + b2, b4, b6, b8 = [RC(v_inf(b)) for b in E.b_invariants()] # The following comes from Silverman Theorem 4.2. Silverman # uses decimal precision d, so his term (5/3)d = # (5/3)*(log(2)/log(10))*prec = 0.5017*prec, which we round # up. The rest of the expression was wrongly transcribed in # Sage versions <5.6 (see #12509). - nterms = int(math.ceil(0.51*prec + 0.5 + 0.75 * (7 + 4*H.log()/3 - temp).log())) + + H = max(RC(4).abs(), b2.abs(), 2*b4.abs(), 2*b6.abs(), b8.abs()) + absdisc = RC(v_inf(E.discriminant())).abs() + adl3 = 0 if absdisc>=1 else absdisc.log()/3 + nterms = int(math.ceil(0.51*working_prec + 0.5 + 0.75 * (7 + 4*H.log()/3 - adl3).log())) b2p = b2 - 12 b4p = b4 - b2 + 6 @@ -2819,7 +2825,6 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): fw = lambda T: T*(4 + T*(b2 + T*(2*b4 + T*b6))) fwp = lambda T: T*(4 + T*(b2p + T*(2*b4p + T*b6p))) - x = vv(self[0]) if abs(x) >= .5: t = 1/x beta = True @@ -2834,7 +2839,7 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): if beta: w = fw(t) z = fz(t) - if abs(w) <= 2 * abs(z): + if abs(w) <= 2 * z.abs(): mu += four_to_n * z.abs().log() t = w/z else: @@ -2844,7 +2849,7 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): else: w = fwp(t) z = fzp(t) - if abs(w) <= 2 * abs(z): + if abs(w) <= 2 * z.abs(): mu += four_to_n * z.abs().log() t = w/z else: @@ -2852,8 +2857,9 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): t = w/(z-w) beta = not beta four_to_n >>= 2 - h = rings.RealField(prec)(lam + mu/4) - if weighted and not v.im_gens()[0] in rings.RR: + + h = RealField(prec)(lam + mu/4) + if weighted and not v_is_real: h *= 2 return h From 8ccf04219369808a0a59577883ae3c888bdf8ad3 Mon Sep 17 00:00:00 2001 From: John Cremona Date: Mon, 11 May 2020 12:18:40 +0100 Subject: [PATCH 160/301] #29666: further minor improvement and added doctest --- src/sage/schemes/elliptic_curves/ell_point.py | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/ell_point.py b/src/sage/schemes/elliptic_curves/ell_point.py index 69a519af208..ff4d5b68baf 100644 --- a/src/sage/schemes/elliptic_curves/ell_point.py +++ b/src/sage/schemes/elliptic_curves/ell_point.py @@ -2755,7 +2755,7 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): sage: E = EllipticCurve(v) sage: P = E([72*a - 509/5, -682/25*a - 434/25]) sage: P.archimedean_local_height() - -0.2206607955468278492183362746930 + -0.220660795546828 See :trac:`19276`:: @@ -2763,28 +2763,46 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): sage: E = EllipticCurve([1, a - 1, 1, -816765673272*a - 7931030674178, 1478955604013312315*a + 14361086227143654561]) sage: P = E(5393511/49*a + 52372721/49 , -33896210324/343*a - 329141996591/343 ) sage: P.height() - 0.974232017827740 + 0.974232017827741 + + See :trac:`29966`:: + + sage: K. = NumberField(x^3 - x^2 - 6*x + 2) + sage: E = EllipticCurve([1, -a^2 + 2*a + 4, 0, -6056450500590472699700624*a^2 - 11239394326797569935861742*a + 4241549693833829432516231, 1904879037869682826729875958079326124520*a^2 + 3535022146945771697732350459284777382011*a - 1334055169621036218710397707677347972626]) + sage: P = E([1033399668533*a^2 + 1917754693229*a - 723726883800 , 12536493059202326563*a^2 + 23264879148900575548*a - 8779756111574815918 , 1]) + sage: P.height() + 0.297318833424763 + sage: (2*P).height() / P.height() + 4.00000000000000 + sage: P.height(200) + 0.29731883342476341806143743594519935578696537745294661858984 + sage: (2*P).height(200) / P.height(200) + 4.0000000000000000000000000000000000000000000000000000000000 """ + from sage.rings.number_field.number_field import refine_embedding + from sage.all import RealField, ComplexField, Infinity + E = self.curve() K = E.base_ring() if v is None: + + if prec is None: + prec = 53 if K is rings.QQ: v = K.embeddings(rings.RR)[0] - h = self.archimedean_local_height(v, prec) + h = self.archimedean_local_height(v, prec+10) else: r1, r2 = K.signature() pl = K.places() - h = (sum(self.archimedean_local_height(pl[i], prec, weighted=False) + h = (sum(self.archimedean_local_height(pl[i], prec+10, weighted=False) for i in range(r1)) - + 2 * sum(self.archimedean_local_height(pl[i], prec, weighted=False) + + 2 * sum(self.archimedean_local_height(pl[i], prec+10, weighted=False) for i in range(r1, r1 + r2))) if not weighted: h /= K.degree() - return h + return RealField(prec)(h) - from sage.rings.number_field.number_field import refine_embedding - from sage.all import RealField, ComplexField, Infinity prec_v = v.codomain().prec() if prec is None: prec = prec_v From b11bd4bd1891749cfb0de7630353f60ca005d2e4 Mon Sep 17 00:00:00 2001 From: John Cremona Date: Wed, 13 May 2020 12:18:41 +0100 Subject: [PATCH 161/301] #29666: better choice of working precision for archimdean local height when disc is very small --- src/sage/schemes/elliptic_curves/ell_point.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/sage/schemes/elliptic_curves/ell_point.py b/src/sage/schemes/elliptic_curves/ell_point.py index ff4d5b68baf..0a5f3ebc6c7 100644 --- a/src/sage/schemes/elliptic_curves/ell_point.py +++ b/src/sage/schemes/elliptic_curves/ell_point.py @@ -2811,8 +2811,22 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False): v_inf = refine_embedding(v, Infinity) v_is_real = v_inf(K.gen()).imag().is_zero() - working_prec = prec+100 + + # Find a suitable working precision. See trac#29666 for an + # example where 100 extra bits is not enough when the + # discriminant is ~1e-92, but this code uses a working + # precision of 333 and gets it right. + + D = v_inf(E.discriminant()) + + if D.abs().real_number(RealField()).round(): + extra_prec = 100 + else: # then |D| is small + extra_prec = 10 + (1/D).abs().real_number(RealField()).round().nbits() + + working_prec = prec + extra_prec RC = RealField(working_prec) if v_is_real else ComplexField(working_prec) + #print("Using working precision {}, |D| = {}".format(working_prec, RC(D).abs())) # NB We risk losing much precision if we compute the embedding # of K into RR or CC to some precision and then apply that to From d17c73033ab3427bdf8119066c56a7611dc7201b Mon Sep 17 00:00:00 2001 From: John Cremona Date: Wed, 13 May 2020 17:53:09 +0100 Subject: [PATCH 162/301] improve precision handling for elliptic curve lower height bound --- src/sage/schemes/elliptic_curves/height.py | 23 +++++++++++++------ .../schemes/elliptic_curves/period_lattice.py | 7 +++--- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/height.py b/src/sage/schemes/elliptic_curves/height.py index c1f678a7da2..bf46fec0ad4 100644 --- a/src/sage/schemes/elliptic_curves/height.py +++ b/src/sage/schemes/elliptic_curves/height.py @@ -1210,7 +1210,7 @@ def S(self, xi1, xi2, v): ([0.0781194447253472, 0.0823423732016403] U [0.917657626798360, 0.921880555274653]) """ L = self.E.period_lattice(v) - w1, w2 = L.basis() + w1, w2 = L.basis(prec = v.codomain().prec()) beta = L.elliptic_exponential(w1/2)[0] if xi2 < beta: return UnionOfIntervals([]) @@ -1832,13 +1832,22 @@ def test_mu(self, mu, N, verbose=True): # a chance to prove the lower bound. We try each in turn, # stopping if one gives a True result. + from sage.rings.number_field.number_field import refine_embedding for v in self.K.places(): - if v(self.K.gen()) in RR: - if self.real_intersection_is_empty(Bk, v): - return True - else: - if self.complex_intersection_is_empty(Bk, v): - return True + ok = False + while not ok: + try: + if v(self.K.gen()) in RR: + if self.real_intersection_is_empty(Bk, v): + return True + else: + if self.complex_intersection_is_empty(Bk, v): + return True + ok = True + except ArithmeticError: + v = refine_embedding(v) + if verbose: + print("Refining embedding, codomain now {}".format(v.codomain())) return False # Couldn't prove it... def min_gr(self, tol, n_max, verbose=False): diff --git a/src/sage/schemes/elliptic_curves/period_lattice.py b/src/sage/schemes/elliptic_curves/period_lattice.py index d4863d9a16e..ee0131ec11f 100644 --- a/src/sage/schemes/elliptic_curves/period_lattice.py +++ b/src/sage/schemes/elliptic_curves/period_lattice.py @@ -1832,11 +1832,12 @@ def elliptic_exponential(self, z, to_curve=True): y = y.real() if to_curve: - a1,a2,a3,a4,a6 = [self.embedding(a) for a in self.E.ainvs()] - b2 = self.embedding(self.E.b2()) + K = x.parent() + v = refine_embedding(self.embedding, Infinity) + a1,a2,a3,a4,a6 = [K(v(a)) for a in self.E.ainvs()] + b2 = K(v(self.E.b2())) x = x - b2 / 12 y = (y - (a1 * x + a3)) / 2 - K = x.parent() EK = EllipticCurve(K,[a1,a2,a3,a4,a6]) return EK.point((x,y,K(1)), check=False) else: From 9a0bd59765680485099e4bb43cb501e40dd23383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Wed, 13 May 2020 20:09:04 +0200 Subject: [PATCH 163/301] fix some details in the doc of Zinbiel algebras --- src/sage/algebras/free_zinbiel_algebra.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sage/algebras/free_zinbiel_algebra.py b/src/sage/algebras/free_zinbiel_algebra.py index ce378ef1e0a..63cd7023e57 100644 --- a/src/sage/algebras/free_zinbiel_algebra.py +++ b/src/sage/algebras/free_zinbiel_algebra.py @@ -40,7 +40,7 @@ class FreeZinbielAlgebra(CombinatorialFreeModule): .. MATH:: - a \circ (b \circ c) = a \circ (b \circ c) + a \circ (c \circ b). + (a \circ b) \circ c = a \circ (b \circ c) + a \circ (c \circ b). Zinbiel algebras were first introduced by Loday (see [Lod1995]_ and [LV2012]_) as the Koszul dual to Leibniz algebras (hence the name @@ -114,7 +114,7 @@ class FreeZinbielAlgebra(CombinatorialFreeModule): sage: x*(y*z) + x*(z*y) Z[xyz] + Z[xzy] - We see that the Zinbiel algebra is not associative, nor even + We see that the Zinbiel algebra is not associative, not even power associative:: sage: x*(y*z) @@ -124,7 +124,7 @@ class FreeZinbielAlgebra(CombinatorialFreeModule): sage: (x*x)*x 2*Z[xxx] - We verify that it is a divided powers algebra:: + We verify that it is a divided power algebra:: sage: (x*(x*x)) * (x*(x*(x*x))) 15*Z[xxxxxxx] @@ -479,7 +479,7 @@ def _coerce_map_from_(self, R): def construction(self): """ Return a pair ``(F, R)``, where ``F`` is a :class:`ZinbielFunctor` - and `R` is a ring, such that ``F(R)`` returns ``self``. + and ``R`` is a ring, such that ``F(R)`` returns ``self``. EXAMPLES:: @@ -654,7 +654,7 @@ def check(x): def merge(self, other): """ - Merge ``self`` with another construction functor, or return None. + Merge ``self`` with another construction functor, or return ``None``. EXAMPLES:: From 7051806db961bc5a27608badb101087dbe2dd30f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Wed, 13 May 2020 20:27:19 +0200 Subject: [PATCH 164/301] trac 29682 fix unicode detail --- src/sage/categories/pushout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py index 573411d772e..9e15c67a938 100644 --- a/src/sage/categories/pushout.py +++ b/src/sage/categories/pushout.py @@ -234,7 +234,7 @@ def _repr_(self): def merge(self, other): """ - Merge ``self`` with another construction functor, or return ̀̀None``. + Merge ``self`` with another construction functor, or return ``None``. .. NOTE:: From 178d3b7a1c005b50c47b8ca8e7e6528c00add5c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Wed, 13 May 2020 21:53:41 +0200 Subject: [PATCH 165/301] enhance conversion of dilog to sympy --- src/sage/functions/log.py | 41 ++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/src/sage/functions/log.py b/src/sage/functions/log.py index 1f9ddcb0be2..08f9d9a2eb6 100644 --- a/src/sage/functions/log.py +++ b/src/sage/functions/log.py @@ -8,8 +8,6 @@ - Tomas Kalvoda (2015-04-01): Add :meth:`exp_polar()` (:trac:`18085`) """ -from six.moves import range - from sage.symbolic.function import GinacFunction, BuiltinFunction from sage.symbolic.constants import e as const_e from sage.symbolic.constants import pi as const_pi @@ -445,6 +443,7 @@ def log(*args, **kwds): except (AttributeError, TypeError): return logb(args[0], args[1]) + class Function_polylog(GinacFunction): def __init__(self): r""" @@ -538,14 +537,21 @@ def __init__(self): [1.644934066848226 +/- ...] sage: parent(_) Complex ball field with 53 bits of precision + + sage: polylog(1,-1) # known bug + -log(2) """ - GinacFunction.__init__(self, "polylog", nargs=2) + GinacFunction.__init__(self, "polylog", nargs=2, + conversions=dict(mathematica='PolyLog', + magma='Polylog', + matlab='polylog', + sympy='polylog')) def _maxima_init_evaled_(self, *args): """ EXAMPLES: - These are indirect doctests for this function.:: + These are indirect doctests for this function:: sage: polylog(2, x)._maxima_() li[2](_SAGE_VAR_x) @@ -562,14 +568,15 @@ def _maxima_init_evaled_(self, *args): args_maxima.append(str(a)) n, x = args_maxima - if int(n) in [1,2,3]: - return 'li[%s](%s)'%(n, x) + if int(n) in [1, 2, 3]: + return 'li[%s](%s)' % (n, x) else: - return 'polylog(%s, %s)'%(n, x) + return 'polylog(%s, %s)' % (n, x) polylog = Function_polylog() + class Function_dilog(GinacFunction): def __init__(self): r""" @@ -657,8 +664,27 @@ def __init__(self): """ GinacFunction.__init__(self, 'dilog', conversions=dict(maxima='li[2]', + magma='Dilog', fricas='(x+->dilog(1-x))')) + def _sympy_(self, z): + r""" + Special case for sympy, where there is no dilog function. + + EXAMPLES:: + + sage: w = dilog(x)._sympy_(); w + polylog(2, x) + sage: w.diff() + polylog(1, x)/x + sage: w._sage_() + dilog(x) + """ + import sympy + from sympy import polylog as sympy_polylog + return sympy_polylog(2, sympy.sympify(z, evaluate=False)) + + dilog = Function_dilog() @@ -1389,6 +1415,7 @@ def _swap_harmonic(a,b): return harmonic_number(b,a) register_symbol(_swap_harmonic,{'maxima':'gen_harmonic_number'}) register_symbol(_swap_harmonic,{'maple':'harmonic'}) + class Function_harmonic_number(BuiltinFunction): r""" Harmonic number function, defined by: From 256c9f83745ab9b084533d8da3c848d9c127aacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Thu, 14 May 2020 18:23:08 +0200 Subject: [PATCH 166/301] yet another little fix in shuffle algebras --- src/sage/algebras/shuffle_algebra.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/sage/algebras/shuffle_algebra.py b/src/sage/algebras/shuffle_algebra.py index c9816cd1e27..86b8b8c1cac 100644 --- a/src/sage/algebras/shuffle_algebra.py +++ b/src/sage/algebras/shuffle_algebra.py @@ -115,6 +115,15 @@ class ShuffleAlgebra(CombinatorialFreeModule): sage: R = ShuffleAlgebra(QQ,'xy') sage: R.is_commutative() True + + Check for a fix when using numbers as generators:: + + sage: A = algebras.Shuffle(QQ,[0,1]) + sage: A_d = A.dual_pbw_basis() + sage: W = A.basis().keys() + sage: x = A(W([0,1,0])) + sage: A_d(x) + -2*S[word: 001] + S[word: 010] """ @staticmethod def __classcall_private__(cls, R, names, prefix=None): @@ -379,6 +388,12 @@ def algebra_generators(self): sage: A = ShuffleAlgebra(QQ, ['x1','x2']) sage: A.algebra_generators() Family (B[word: x1], B[word: x2]) + + TESTS:: + + sage: A = ShuffleAlgebra(ZZ,[0,1]) + sage: A.algebra_generators() + Family (B[word: 0], B[word: 1]) """ Words = self.basis().keys() return Family([self.monomial(Words([a])) for a in self._alphabet]) @@ -765,7 +780,7 @@ def algebra_generators(self): (S[word: a], S[word: b]) """ W = self.basis().keys() - return tuple(self.monomial(W(a)) for a in self._alphabet) + return tuple(self.monomial(W([a])) for a in self._alphabet) gens = algebra_generators @@ -941,7 +956,7 @@ def expansion_on_basis(self, w): return self._alg.monomial(w) if w.is_lyndon(): W = self.basis().keys() - letter = W(w[0]) + letter = W([w[0]]) expansion = self.expansion_on_basis(W(w[1:])) return self._alg.sum_of_terms((letter * i, c) for i, c in expansion) From 273b81652d5f894a4a7828eb690bf218d25af60f Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Tue, 12 May 2020 20:12:42 -0700 Subject: [PATCH 167/301] trac 29680: change message printed by "sage --package fix-checksum" --- build/sage_bootstrap/app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/sage_bootstrap/app.py b/build/sage_bootstrap/app.py index 45818546a18..30a4d90c917 100644 --- a/build/sage_bootstrap/app.py +++ b/build/sage_bootstrap/app.py @@ -137,10 +137,10 @@ def fix_all_checksums(self): log.debug('Ignoring {0} because tarball is not cached'.format(pkg.tarball_filename)) continue if pkg.tarball.checksum_verifies(): - log.debug('Checksum of {0} unchanged'.format(pkg.tarball_filename)) + log.debug('Checksum of {0} (tarball {1}) unchanged'.format(pkg.name, pkg.tarball_filename)) continue update = ChecksumUpdater(pkg.name) - print('Updating checksum of {0}'.format(pkg.tarball_filename)) + print('Updating checksum of {0} (tarball {1})'.format(pkg.name, pkg.tarball_filename)) update.fix_checksum() def fix_checksum(self, package_name): @@ -154,9 +154,9 @@ def fix_checksum(self, package_name): update = ChecksumUpdater(package_name) pkg = update.package if pkg.tarball.checksum_verifies(): - print('Checksum of {0} unchanged'.format(pkg.tarball_filename)) + print('Checksum of {0} (tarball {1}) unchanged'.format(package_name, pkg.tarball_filename)) else: - print('Updating checksum of {0}'.format(pkg.tarball_filename)) + print('Updating checksum of {0} (tarball {1})'.format(package_name, pkg.tarball_filename)) update.fix_checksum() def create(self, package_name, version, tarball, pkg_type, upstream_url): From 8dd8523a19f41c9711a5ad9201dfa57e0f256e02 Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Thu, 14 May 2020 16:02:12 -0700 Subject: [PATCH 168/301] trac 29680: documentation and testing fixes --- build/sage_bootstrap/cmdline.py | 2 +- build/test/test_package_cmdline.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/sage_bootstrap/cmdline.py b/build/sage_bootstrap/cmdline.py index abb617dd65a..48dc0d9c3fe 100644 --- a/build/sage_bootstrap/cmdline.py +++ b/build/sage_bootstrap/cmdline.py @@ -134,7 +134,7 @@ EXAMPLE: $ sage --package fix-checksum pari - Updating checksum of pari-2.8-2044-g89b0f1e.tar.gz + Updating checksum of pari (tarball pari-2.8-2044-g89b0f1e.tar.gz) """ epilog_create = \ diff --git a/build/test/test_package_cmdline.py b/build/test/test_package_cmdline.py index 69011314e1f..739fbe76d30 100644 --- a/build/test/test_package_cmdline.py +++ b/build/test/test_package_cmdline.py @@ -140,7 +140,7 @@ def test_fix_checksum(self): # Prints to stdout self.assertEqual( stdout.rstrip(), - 'Checksum of {0} unchanged'.format(pkg.tarball_filename)) + 'Checksum of {0} (tarball {1}) unchanged'.format(pkg.name, pkg.tarball_filename)) def test_create(self): tmp = tempfile.mkdtemp() From 506edd61bcaac326b5449577cbbdac2100d37665 Mon Sep 17 00:00:00 2001 From: Dave Witte Morris Date: Fri, 15 May 2020 17:04:14 -0600 Subject: [PATCH 169/301] fix bug in closure of braid --- src/sage/knots/link.py | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/sage/knots/link.py b/src/sage/knots/link.py index eda927fb177..015c0dab4b9 100644 --- a/src/sage/knots/link.py +++ b/src/sage/knots/link.py @@ -312,6 +312,15 @@ def __init__(self, data): Traceback (most recent call last): ... ValueError: invalid input: data must be either a list or a braid + + Verify that :trac:`29692` is fixed:: + + sage: B = BraidGroup(5) + sage: L = Link(B([3,4,3,-4])) + sage: L + Link with 1 component represented by 4 crossings + sage: L.braid() + s0*s1*s0*s1^-1 """ if isinstance(data, list): if len(data) != 2 or not all(isinstance(i, list) for i in data[0]): @@ -340,20 +349,7 @@ def __init__(self, data): from sage.groups.braid import Braid, BraidGroup if isinstance(data, Braid): # Remove all unused strands - support = sorted(set(abs(x) for x in data.Tietze())) - i = 0 - cur = 1 - while i < len(support): - if support[i] == cur: - cur += 1 - i += 1 - elif support[i] == cur + 1: - support.insert(i, cur+1) - cur += 2 - i += 2 - else: - cur = support[i] - i += 1 + support = sorted(set().union(*((abs(x), abs(x) + 1) for x in data.Tietze()))) d = {} for i,s in enumerate(support): d[s] = i+1 @@ -361,7 +357,7 @@ def __init__(self, data): if not support: B = BraidGroup(2) else: - B = BraidGroup(len(support)+1) + B = BraidGroup(len(support)) self._braid = B([d[x] for x in data.Tietze()]) self._oriented_gauss_code = None self._pd_code = None From 9a57ddea1e8ed2966573d14b977cf920543fa147 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sat, 16 May 2020 11:00:35 +1000 Subject: [PATCH 170/301] Improve the iterator, monomial, and exponents of libsingular MPolys. --- .../multi_polynomial_libsingular.pyx | 61 ++++++++++++++----- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index ab1879650e4..626a23be8a4 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -3126,6 +3126,39 @@ cdef class MPolynomial_libsingular(MPolynomial): p_Delete(&m,r) return self._parent._base._zero_element + def __iter__(self): + """ + Facilitates iterating over the monomials of self, + returning tuples of the form ``(coeff, mon)`` for each + non-zero monomial. + + EXAMPLES:: + + sage: R. = PolynomialRing(QQ, order='degrevlex') + sage: f = 23*x^6*y^7 + x^3*y+6*x^7*z + sage: list(f) + [(23, x^6*y^7), (6, x^7*z), (1, x^3*y)] + + sage: R. = PolynomialRing(QQ, order='lex') + sage: f = 23*x^6*y^7 + x^3*y+6*x^7*z + sage: list(f) + [(6, x^7*z), (23, x^6*y^7), (1, x^3*y)] + """ + cdef MPolynomialRing_libsingular parent = self._parent + cdef ring *_ring = parent._ring + if _ring != currRing: rChangeCurrRing(_ring) + base = parent._base + cdef poly *p = p_Copy(self._poly, _ring) + + while p: + t = pNext(p) + p.next = NULL + coeff = si2sa(p_GetCoeff(p, _ring), _ring, base) + p_SetCoeff(p, n_Init(1,_ring), _ring) + p_Setm(p, _ring) + yield (coeff, new_MP(parent, p)) + p = t + def exponents(self, as_ETuples=True): """ Return the exponents of the monomials appearing in this @@ -3133,9 +3166,8 @@ cdef class MPolynomial_libsingular(MPolynomial): INPUT: - - ``as_ETuples`` - (default: ``True``) if true returns the result as an list of ETuples - otherwise returns a list of tuples - + - ``as_ETuples`` -- (default: ``True``) if ``True`` returns the + result as an list of ETuples, otherwise returns a list of tuples EXAMPLES:: @@ -3153,16 +3185,18 @@ cdef class MPolynomial_libsingular(MPolynomial): pl = list() ml = list(xrange(r.N)) - while p: - for v from 1 <= v <= r.N: - ml[v-1] = p_GetExp(p,v,r) - - if as_ETuples: + if as_ETuples: + while p: + for v from 1 <= v <= r.N: + ml[v-1] = p_GetExp(p,v,r) pl.append(ETuple(ml)) - else: + p = pNext(p) + else: + while p: + for v from 1 <= v <= r.N: + ml[v-1] = p_GetExp(p,v,r) pl.append(tuple(ml)) - - p = pNext(p) + p = pNext(p) return pl def inverse_of_unit(self): @@ -3609,16 +3643,13 @@ cdef class MPolynomial_libsingular(MPolynomial): sage: p.monomials() [x] """ - l = list() + cdef list l = [] cdef MPolynomialRing_libsingular parent = self._parent cdef ring *_ring = parent._ring if(_ring != currRing): rChangeCurrRing(_ring) cdef poly *p = p_Copy(self._poly, _ring) cdef poly *t - if p == NULL: - return [] - while p: t = pNext(p) p.next = NULL From ede384712ab4fd6bd68d71a965591ed37531e2d3 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sat, 16 May 2020 11:23:12 +1000 Subject: [PATCH 171/301] Improving generic MPoly iterator, monomials, and exponents. --- .../polynomial/multi_polynomial_element.py | 116 ++++++++++++------ 1 file changed, 80 insertions(+), 36 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py index e5d692150c6..d8e4eec0541 100644 --- a/src/sage/rings/polynomial/multi_polynomial_element.py +++ b/src/sage/rings/polynomial/multi_polynomial_element.py @@ -66,6 +66,7 @@ from sage.structure.sequence import Sequence from .multi_polynomial import MPolynomial from sage.categories.morphism import Morphism +from sage.misc.lazy_attribute import lazy_attribute def is_MPolynomial(x): @@ -784,12 +785,12 @@ def dict(self): def __getitem__(self, x): """ - INPUT: - + Return the coefficient corresponding to ``x``. - - ``x`` - a tuple or, in case of a single-variable - MPolynomial ring x can also be an integer. + INPUT: + - ``x`` -- a tuple or, in case of a single-variable + MPolynomial ring x can also be an integer EXAMPLES:: @@ -823,6 +824,41 @@ def __getitem__(self, x): except KeyError: return self.parent().base_ring()(0) + def __iter__(self): + """ + Iterate over ``self`` respecting the term order. + + EXAMPLES:: + + sage: R. = PolynomialRing(QQbar, order='lex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f) + [(1, x^4*y*z^3), (1, x^2*z), (1, x*y^5*z^2)] + + :: + + sage: R. = PolynomialRing(QQbar, order='deglex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f) + [(1, x^4*y*z^3), (1, x*y^5*z^2), (1, x^2*z)] + + :: + + sage: R. = PolynomialRing(QQbar, order='degrevlex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f) + [(1, x*y^5*z^2), (1, x^4*y*z^3), (1, x^2*z)] + """ + elt = self.element() + ring = self.parent() + one = ring.base_ring()(1) + for exp in self._exponents: + yield (elt[exp], + MPolynomial_polydict(ring, polydict.PolyDict({exp:one}, + force_int_exponents=False, + force_etuples=False)) + ) + def coefficient(self, degrees): """ Return the coefficient of the variables with the degrees specified @@ -899,7 +935,7 @@ def coefficient(self, degrees): """ looking_for = None if isinstance(degrees, MPolynomial) and degrees.parent() == self.parent() and degrees.is_monomial(): - looking_for = [e if e > 0 else None for e in degrees.exponents()[0]] + looking_for = [e if e > 0 else None for e in degrees._exponents[0]] elif isinstance(degrees, list): looking_for = degrees elif isinstance(degrees, dict): @@ -913,18 +949,33 @@ def coefficient(self, degrees): raise ValueError("You must pass a dictionary list or monomial.") return self.parent()(self.element().polynomial_coefficient(looking_for)) - def exponents(self, as_ETuples=True): + @lazy_attribute + def _exponents(self): + """ + Return the exponents of the monomials appearing in ``self`` for + internal use only. + + EXAMPLES:: + + sage: R. = PolynomialRing(QQbar, 3) + sage: f = a^3 + b + 2*b^2 + sage: f._exponents + [(3, 0, 0), (0, 2, 0), (0, 1, 0)] """ - Return the exponents of the monomials appearing in self. + return sorted(self.element().dict(), key=self.parent().term_order().sortkey, reverse=True) + + def exponents(self, as_ETuples=True): + r""" + Return the exponents of the monomials appearing in ``self``. INPUT: - - as_ETuples (default: ``True``): return the list of exponents as a list - of ETuples. + - ``as_ETuples`` -- (default: ``True``): return the list of + exponents as a list of ETuples OUTPUT: - Return the list of exponents as a list of ETuples or tuples. + The list of exponents as a list of ETuples or tuples. EXAMPLES:: @@ -939,24 +990,24 @@ def exponents(self, as_ETuples=True): sage: type(f.exponents(as_ETuples=False)[0]) <... 'tuple'> + + TESTS: + + Check that we can mutate the list and not change the result:: + + sage: R. = PolynomialRing(QQbar, 3) + sage: f = a^3 + b + 2*b^2 + sage: E = f.exponents(); E + [(3, 0, 0), (0, 2, 0), (0, 1, 0)] + sage: E.pop() + (0, 1, 0) + sage: E != f.exponents() + True """ - try: - exp = self.__exponents - if as_ETuples: - return exp - else: - return [tuple(e) for e in exp] - except AttributeError: - self.__exponents = list(self.element().dict()) - try: - self.__exponents.sort(key=self.parent().term_order().sortkey, - reverse=True) - except AttributeError: - pass - if as_ETuples: - return self.__exponents - else: - return [tuple(e) for e in self.__exponents] + if as_ETuples: + return list(self._exponents) # Make a shallow copy + else: + return [tuple(e) for e in self._exponents] def inverse_of_unit(self): """ @@ -1182,15 +1233,8 @@ def monomials(self): """ ring = self.parent() one = ring.base_ring()(1) - return [MPolynomial_polydict(ring, polydict.PolyDict({m:one}, force_int_exponents=False, force_etuples=False)) for m in self.exponents()] - try: - return self.__monomials - except AttributeError: - ring = self.parent() - one = self.parent().base_ring()(1) - self.__monomials = sorted([ MPolynomial_polydict(ring, polydict.PolyDict( {m:one}, force_int_exponents=False, force_etuples=False ) ) \ - for m in self._MPolynomial_element__element.dict().keys() ], reverse=True) - return self.__monomials + return [MPolynomial_polydict(ring, polydict.PolyDict({m:one}, force_int_exponents=False, force_etuples=False)) + for m in self._exponents] def constant_coefficient(self): """ From 9c6e84a4cd7872590025c7c9578e3be7b9d4997f Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sat, 16 May 2020 11:53:20 +1000 Subject: [PATCH 172/301] Improving some is_* methods of generic MPolys. --- .../polynomial/multi_polynomial_element.py | 44 +++++++------------ src/sage/rings/polynomial/polydict.pyx | 20 +++++++++ 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py index d8e4eec0541..96a4b7559ac 100644 --- a/src/sage/rings/polynomial/multi_polynomial_element.py +++ b/src/sage/rings/polynomial/multi_polynomial_element.py @@ -1020,12 +1020,11 @@ def inverse_of_unit(self): sage: l.inverse_of_unit().parent() Univariate Polynomial Ring in c over Rational Field """ - d = self.element().dict() - k = list(d) if self.is_unit(): - if len(k) != 1: + d = self.element().dict() + if len(d) != 1: raise NotImplementedError - return d[k[0]].inverse_of_unit() + return list(d.values())[0].inverse_of_unit() raise ArithmeticError("is not a unit") def is_homogeneous(self): @@ -1084,7 +1083,7 @@ def _homogenize(self, var): def is_generator(self): """ - Returns True if self is a generator of it's parent. + Return ``True`` if ``self`` is a generator of its parent. EXAMPLES:: @@ -1096,19 +1095,18 @@ def is_generator(self): sage: (x*y).is_generator() False """ - d = self.element().dict() - if len(d) == 1: - (e, c), = d.items() - if c.is_one() and len(e.nonzero_positions()) == 1 and e.nonzero_values()[0] == 1: - return True + elt = self.element() + if len(elt) == 1: + (e, c), = elt.dict().items() + return e.nonzero_values() == [1] and c.is_one() return False def is_monomial(self): """ - Returns True if self is a monomial, which we define to be a + Return ``True`` if ``self`` is a monomial, which we define to be a product of generators with coefficient 1. - Use is_term to allow the coefficient to not be 1. + Use :meth:`is_term` to allow the coefficient to not be 1. EXAMPLES:: @@ -1129,18 +1127,11 @@ def is_monomial(self): sage: (2*x*y).is_monomial() False """ - term = (len(self.element().dict().keys()) == 1) - if term: - if self.coefficients()[0] == 1: - return True - else: - return False - else: - return False + return len(self.element()) == 1 and self.element().coefficients()[0] == 1 def is_term(self): """ - Returns True if self is a term, which we define to be a + Return ``True`` if ``self`` is a term, which we define to be a product of generators times some coefficient, which need not be 1. @@ -1165,7 +1156,7 @@ def is_term(self): sage: (2*x*y).is_term() True """ - return len(self.element().dict().keys()) == 1 + return len(self.element()) == 1 def subs(self, fixed=None, **kw): """ @@ -1276,7 +1267,7 @@ def is_univariate(self): sage: f.is_univariate() True """ - mons = self.element().dict().keys() + mons = self.element().dict() found = -1 for mon in mons: @@ -1424,7 +1415,7 @@ def nvariables(self): def is_constant(self): """ - True if polynomial is constant, and False otherwise. + Return ``True`` if ``self`` is a constant and ``False`` otherwise. EXAMPLES:: @@ -1436,10 +1427,7 @@ def is_constant(self): sage: g.is_constant() True """ - if len(self.dict()) <= 1 and self.degrees().is_constant(): - return True - else: - return False + return self.element().is_constant() def lm(self): """ diff --git a/src/sage/rings/polynomial/polydict.pyx b/src/sage/rings/polynomial/polydict.pyx index f86c7c79905..48567384b9e 100644 --- a/src/sage/rings/polynomial/polydict.pyx +++ b/src/sage/rings/polynomial/polydict.pyx @@ -493,6 +493,26 @@ cdef class PolyDict: # exponent sums is at most 1. return len(set(map(sum, self.__repn))) <= 1 + def is_constant(self): + """ + Return ``True`` if ``self`` is a constant and ``False`` otherwise. + + EXAMPLES:: + + sage: from sage.rings.polynomial.polydict import PolyDict + sage: f = PolyDict({(2,3):2, (1,2):3, (2,1):4}) + sage: f.is_constant() + False + sage: g = PolyDict({(0,0):2}) + sage: g.is_constant() + True + sage: h = PolyDict({}) + sage: h.is_constant() + True + """ + cdef int ell = len(self.__repn) + return ell == 0 or (ell == 1 and sum(sum(k) for k in self.__repn) == 0) + def homogenize(PolyDict self, var): R = self.__repn H = {} From 56312bea9a2122b3d607cfcd75ae32f764252823 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sat, 16 May 2020 12:17:16 +1000 Subject: [PATCH 173/301] Implementing an iterator_exp_coeff method for MPolys as a helper method. --- .../rings/polynomial/multi_polynomial.pyx | 35 ++++++++++--- .../polynomial/multi_polynomial_element.py | 29 +++++++++++ .../multi_polynomial_libsingular.pyx | 49 ++++++++++++++++++- 3 files changed, 104 insertions(+), 9 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 7000594fdf1..5005386cf4e 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -1155,11 +1155,6 @@ cdef class MPolynomial(CommutativeRingElement): returning tuples of the form ``(coeff, mon)`` for each non-zero monomial. - .. NOTE:: - - This function creates the entire list upfront because Cython - doesn't (yet) support iterators. - EXAMPLES:: sage: P. = PolynomialRing(QQ,3) @@ -1170,8 +1165,34 @@ cdef class MPolynomial(CommutativeRingElement): sage: sum(c*m for c,m in f) == f True """ - L = zip(self.coefficients(), self.monomials()) - return iter(L) + for exp, coeff in self.iterator_exp_coeff(): + yield (coeff, self.monomial(exp)) + + def iterator_exp_coeff(self, as_ETuples=True): + """ + Iterate over ``self`` as pairs of ((E)Tuple, coefficient). + + INPUT: + + - ``as_ETuples`` -- (default: ``True``) if ``True`` iterate over + pairs whose first element is an ETuple, otherwise as a tuples + + EXAMPLES:: + + sage: R. = QQ[] + sage: f = a*c^3 + a^2*b + 2*b^4 + sage: list(f.iterator_exp_coeff()) + [((0, 4, 0), 2), ((1, 0, 3), 1), ((2, 1, 0), 1)] + sage: list(f.iterator_exp_coeff(as_ETuples=False)) + [((0, 4, 0), 2), ((1, 0, 3), 1), ((2, 1, 0), 1)] + + sage: R. = PolynomialRing(QQ, 3, order='lex') + sage: f = a*c^3 + a^2*b + 2*b^4 + sage: list(f.iterator_exp_coeff()) + [((2, 1, 0), 1), ((1, 0, 3), 1), ((0, 4, 0), 2)] + """ + for exp in self.exponents(): + yield (exp, self.monomial_coefficient(exp)) def content(self): """ diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py index 96a4b7559ac..ea51eebf0e1 100644 --- a/src/sage/rings/polynomial/multi_polynomial_element.py +++ b/src/sage/rings/polynomial/multi_polynomial_element.py @@ -859,6 +859,35 @@ def __iter__(self): force_etuples=False)) ) + def iterator_exp_coeff(self, as_ETuples=True): + """ + Iterate over ``self`` as pairs of ((E)Tuple, coefficient). + + INPUT: + + - ``as_ETuples`` -- (default: ``True``) if ``True`` iterate over + pairs whose first element is an ETuple, otherwise as a tuples + + EXAMPLES:: + + sage: R. = PolynomialRing(QQbar, order='lex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f.iterator_exp_coeff()) + [((4, 1, 3), 1), ((2, 0, 1), 1), ((1, 5, 2), 1)] + + sage: R. = PolynomialRing(QQbar, order='deglex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f.iterator_exp_coeff(as_ETuples=False)) + [((4, 1, 3), 1), ((1, 5, 2), 1), ((2, 0, 1), 1)] + """ + elt = self.element() + if as_ETuples: + for exp in self._exponents: + yield (exp, elt[exp]) + else: + for exp in self._exponents: + yield (tuple(exp), elt[exp]) + def coefficient(self, degrees): """ Return the coefficient of the variables with the degrees specified diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index 626a23be8a4..7b61b0f4d79 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -2989,12 +2989,12 @@ cdef class MPolynomial_libsingular(MPolynomial): if r!=currRing: rChangeCurrRing(r) base = self._parent._base p = self._poly - pd = dict() + cdef dict d, pd = dict() while p: d = dict() for v from 1 <= v <= r.N: n = p_GetExp(p,v,r) - if n!=0: + if n != 0: d[v-1] = n pd[ETuple(d,r.N)] = si2sa(p_GetCoeff(p, r), r, base) @@ -3002,6 +3002,51 @@ cdef class MPolynomial_libsingular(MPolynomial): p = pNext(p) return pd + def iterator_exp_coeff(self, as_ETuples=True): + """ + Iterate over ``self`` as pairs of ((E)Tuple, coefficient). + + INPUT: + + - ``as_ETuples`` -- (default: ``True``) if ``True`` iterate over + pairs whose first element is an ETuple, otherwise as a tuples + + EXAMPLES:: + + sage: R. = QQ[] + sage: f = a*c^3 + a^2*b + 2*b^4 + sage: list(f.iterator_exp_coeff()) + [((0, 4, 0), 2), ((1, 0, 3), 1), ((2, 1, 0), 1)] + sage: list(f.iterator_exp_coeff(as_ETuples=False)) + [((0, 4, 0), 2), ((1, 0, 3), 1), ((2, 1, 0), 1)] + + sage: R. = PolynomialRing(QQ, 3, order='lex') + sage: f = a*c^3 + a^2*b + 2*b^4 + sage: list(f.iterator_exp_coeff()) + [((2, 1, 0), 1), ((1, 0, 3), 1), ((0, 4, 0), 2)] + """ + cdef poly *p + cdef ring *r = self._parent_ring + cdef int n + cdef int v + if r!=currRing: rChangeCurrRing(r) + base = self._parent._base + p = self._poly + cdef dict d + while p: + d = dict() + for v from 1 <= v <= r.N: + n = p_GetExp(p,v,r) + if n != 0: + d[v-1] = n + + exp = ETuple(d,r.N) + if as_ETuples: + yield (exp, si2sa(p_GetCoeff(p, r), r, base)) + else: + yield (tuple(exp), si2sa(p_GetCoeff(p, r), r, base)) + p = pNext(p) + cpdef long number_of_terms(self): """ Return the number of non-zero coefficients of this polynomial. From a245839c427727192b073b4b1859137ef6778e93 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sat, 16 May 2020 14:03:00 +1000 Subject: [PATCH 174/301] Using old-style loop syntax to get good C code (and hence speed). --- src/sage/rings/polynomial/polydict.pyx | 32 +++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/sage/rings/polynomial/polydict.pyx b/src/sage/rings/polynomial/polydict.pyx index 48567384b9e..57e6f719379 100644 --- a/src/sage/rings/polynomial/polydict.pyx +++ b/src/sage/rings/polynomial/polydict.pyx @@ -1268,7 +1268,9 @@ cdef class ETuple: d = [self[ind] for ind from start <= ind < stop] return ETuple(d) else: - for ind in range(0, 2*self._nonzero, 2): + # Do NOT change this as it will not produce an efficient for loop + #for ind in range(0, 2*self._nonzero, 2): + for ind from 0 <= ind < 2*self._nonzero by 2: if self._data[ind] == i: return self._data[ind+1] elif self._data[ind] > i: @@ -1281,7 +1283,9 @@ cdef class ETuple: Return the exponent for the ``i``-th variable. """ cdef size_t ind = 0 - for ind in range(0, 2*self._nonzero, 2): + # Do NOT change this as it will not produce an efficient for loop + #for ind in range(0, 2*self._nonzero, 2): + for ind from 0 <= ind < 2*self._nonzero by 2: if self._data[ind] == i: return self._data[ind+1] elif self._data[ind] > i: @@ -1502,7 +1506,9 @@ cdef class ETuple: """ cdef size_t degree = 0 cdef size_t i - for i in range(1, 2*self._nonzero, 2): + # Do NOT change this as it will not produce an efficient for loop + #for i in range(1, 2*self._nonzero, 2): + for i from 1 <= i < 2*self._nonzero by 2: degree += self._data[i] return degree @@ -1524,7 +1530,9 @@ cdef class ETuple: cdef size_t i cdef size_t deg = 0 assert len(w) == self._length - for i in range(0, 2*self._nonzero, 2): + # Do NOT change this as it will not produce an efficient for loop + #for i in range(0, 2*self._nonzero, 2): + for i from 0 <= i < 2*self._nonzero by 2: deg += self._data[i+1] * w[self._data[i]] return deg @@ -2001,17 +2009,23 @@ cdef class ETuple: if exp1>1: # division doesn't change the number of nonzero positions result._nonzero = self._nonzero - for j in range(0, 2*self._nonzero, 2): + # Do NOT change this as it will not produce an efficient for loop + #for j in range(0, 2*self._nonzero, 2): + for j from 0 <= j < 2*self._nonzero by 2: result._data[j] = self._data[j] result._data[j+1] = self._data[j+1] result._data[i+1] = exp1-1 else: # var(index) disappears from self result._nonzero = self._nonzero-1 - for j in range(0, i, 2): + # Do NOT change this as it will not produce an efficient for loop + #for ind in range(0, i, 2): + for j from 0 <= j < i by 2: result._data[j] = self._data[j] result._data[j+1] = self._data[j+1] - for j in range(i+2, 2*self._nonzero, 2): + # Do NOT change this as it will not produce an efficient for loop + #for j in range(i+2, 2*self._nonzero, 2): + for j from i+2 <= j < 2*self._nonzero by 2: result._data[j-2] = self._data[j] result._data[j-1] = self._data[j+1] return result @@ -2029,7 +2043,9 @@ cdef class ETuple: # Trivially self cannot divide other return False cdef size_t othernz2 = 2 * other._nonzero - for ind1 in range(0, 2*self._nonzero, 2): + # Do NOT change this as it will not produce an efficient for loop + #for ind1 in range(0, 2*self._nonzero, 2): + for ind1 from 0 <= ind1 < 2*self._nonzero by 2: pos1 = self._data[ind1] exp1 = self._data[ind1+1] # Because of the above trivial test, other._nonzero>0. From e85d0f4ab98d0afb0e528a7a5c54985319ade0b4 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sat, 16 May 2020 14:06:20 +1000 Subject: [PATCH 175/301] Adding is_term and fixing bug with is_monomial of MPoly libsingular. --- .../multi_polynomial_libsingular.pyx | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index 7b61b0f4d79..fff23e091ad 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -3351,6 +3351,10 @@ cdef class MPolynomial_libsingular(MPolynomial): True sage: (x*y + x).is_monomial() False + sage: P(2).is_monomial() + False + sage: P.zero().is_monomial() + False """ cdef poly *_p cdef ring *_ring @@ -3358,7 +3362,7 @@ cdef class MPolynomial_libsingular(MPolynomial): _ring = self._parent_ring if self._poly == NULL: - return True + return False if(_ring != currRing): rChangeCurrRing(_ring) @@ -3370,6 +3374,32 @@ cdef class MPolynomial_libsingular(MPolynomial): p_Delete(&_p, _ring) return ret + def is_term(self): + """ + Return ``True`` if ``self`` is a term, which we define to be a + product of generators times some coefficient, which need + not be 1. + + Use :meth:`is_monomial()` to require that the coefficient be 1. + + EXAMPLES:: + + sage: P. = PolynomialRing(QQ) + sage: x.is_term() + True + sage: (2*x).is_term() + True + sage: (x*y).is_term() + True + sage: (x*y + x).is_term() + False + sage: P(2).is_term() + True + sage: P.zero().is_term() + True + """ + return self._poly == NULL or self._poly.next == NULL + def subs(self, fixed=None, **kw): """ Fixes some given variables in a given multivariate polynomial From 6e40f5ce6e560a2db785c2961baa6f1da0ce966e Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sat, 16 May 2020 14:13:05 +1000 Subject: [PATCH 176/301] Improving Laurent MPolys and the 0 polynomial is not a term. --- .../rings/polynomial/laurent_polynomial.pyx | 109 ++++++++++-------- .../multi_polynomial_libsingular.pyx | 4 +- 2 files changed, 64 insertions(+), 49 deletions(-) diff --git a/src/sage/rings/polynomial/laurent_polynomial.pyx b/src/sage/rings/polynomial/laurent_polynomial.pyx index 17904ad8b17..01b16cd627d 100644 --- a/src/sage/rings/polynomial/laurent_polynomial.pyx +++ b/src/sage/rings/polynomial/laurent_polynomial.pyx @@ -2045,7 +2045,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): cdef int p cdef int n = len(var_name_hash) cdef long c_hash - for m,c in self._poly.dict().iteritems(): + for m, c in self._poly.iterator_exp_coeff(): c_hash = hash(c) if c_hash != 0: for p in range(n): @@ -2117,10 +2117,12 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): self._mon = ETuple({}, int(self._parent.ngens())) return - cdef dict D = self._poly._mpoly_dict_recursive( - self._parent.variable_names(), - self._parent.base_ring() - ) + #cdef dict D = self._poly._mpoly_dict_recursive( + # self._parent.variable_names(), + # self._parent.base_ring() + # ) + cdef dict D = self._poly.dict() + cdef ETuple e if i is None: e = None @@ -2150,8 +2152,9 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): sage: a.dict() # indirect doctest {(0, 0): 3, (2, -1): 1} """ - cdef dict D = self._poly._mpoly_dict_recursive(self._parent.variable_names(), - self._parent.base_ring()) + #cdef dict D = self._poly._mpoly_dict_recursive(self._parent.variable_names(), + # self._parent.base_ring()) + cdef dict D = self._poly.dict() cdef dict DD if self._mon.is_constant(): self._prod = PolyDict(D, force_etuples=False) @@ -2369,9 +2372,10 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): cdef ETuple t = ETuple(n) if self._prod is None: self._compute_polydict() - if t not in self._prod.exponents(): + try: + return self._prod[t] + except KeyError: return self._parent.base_ring().zero() - return self._prod[t] def __iter__(self): """ @@ -2385,17 +2389,28 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): sage: sorted(f) # indirect doctest [(-7, x^-2*y^3), (-1, x^6), (1, x^-3*y^2), (5, x^-2*y)] """ - if self._prod is None: - self._compute_polydict() - cdef tuple G = self._parent.gens() - cdef Py_ssize_t i - cdef list exps - for c, e in self._prod.list(): - exps = e - prod = self._parent.one() - for i in range(len(exps)): - prod *= G[i]**exps[i] - yield (c, prod) + P = self._parent + one = P._R.one() + if self._mon.is_constant(): + for exp, coeff in self._poly.iterator_exp_coeff(): + yield (coeff, P.element_class(P, one, exp)) + else: + for exp, coeff in self._poly.iterator_exp_coeff(): + yield (coeff, P.element_class(P, one, exp.eadd(self._mon))) + + def iterator_exp_coeff(self): + """ + Iterate over ``self`` as pairs of (ETuple, coefficient). + + EXAMPLES:: + + sage: P. = LaurentPolynomialRing(QQ) + sage: f = (y^2 - x^9 - 7*x*y^3 + 5*x*y)*x^-3 + sage: list(f.iterator_exp_coeff()) + [((6, 0), -1), ((-2, 3), -7), ((-2, 1), 5), ((-3, 2), 1)] + """ + for exp, coeff in self._poly.iterator_exp_coeff(): + yield (exp.eadd(self._mon), coeff) def monomials(self): """ @@ -2408,18 +2423,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): sage: sorted(f.monomials()) [x^-3*y^2, x^-2*y, x^-2*y^3, x^6] """ - cdef list L = [] - if self._prod is None: - self._compute_polydict() - cdef tuple gens = self._parent.gens() - cdef list exps - for c, e in self._prod.list(): - exps = e - prod = self._parent.one() - for i in range(len(exps)): - prod *= gens[i]**exps[i] - L.append(prod) - return L + return [mon for coeff, mon in self] def monomial_coefficient(self, mon): """ @@ -2448,18 +2452,29 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): -7 sage: f.monomial_coefficient(x^2) 0 + + TESTS:: + + sage: P. = LaurentPolynomialRing(QQ) + sage: f = y^2 * x^-2 + sage: f.monomial_coefficient(x + y) + Traceback (most recent call last): + ... + ValueError: input must be a monomial """ if mon.parent() != self._parent: raise TypeError("input must have the same parent") cdef LaurentPolynomial_mpair m = mon - if self._prod is None: - self._compute_polydict() if m._prod is None: m._compute_polydict() + if len(m._prod) != 1: + raise ValueError("input must be a monomial") + if self._prod is None: + self._compute_polydict() c = self._prod.monomial_coefficient(m._prod.dict()) return self._parent.base_ring()(c) - def constant_coefficient(self): + def constant_coefficient(self, method=True): """ Return the constant coefficient of ``self``. @@ -2598,6 +2613,8 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): cpdef dict dict(self): """ + Return ``self`` represented as a ``dict``. + EXAMPLES:: sage: L. = LaurentPolynomialRing(QQ) @@ -2626,15 +2643,15 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): (4*x^7*y^7*z + 3*x^3*y^8*z^2 + 2*x^4*y^7 + x^6*z^2, y^7*z^2) """ ring = self._parent._R - numer = self._poly - denom = ring.one() - var = ring.gens() + n = ring.ngens() + numer = [0] * n # monomial we multiply the numerator by + denom = [0] * n for i, j in enumerate(self._mon): if j > 0: - numer *= var[i] ** j + numer[i] = j else: - denom *= var[i] ** (-j) - return (numer, denom) + denom[i] = -j + return (self._poly * ring.monomial(*numer), ring.monomial(*denom)) cpdef _add_(self, _right): """ @@ -2713,8 +2730,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): cdef LaurentPolynomial_mpair right = rhs if right.is_zero(): raise ZeroDivisionError - cdef dict d = right.dict() - if len(d) == 1: + if right._poly.is_term(): return self * ~right else: return RingElement._div_(self, rhs) @@ -2737,9 +2753,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): sage: (38*z^-2909).is_monomial() False """ - - d = self._poly.dict() - return len(d) == 1 and 1 in d.values() + return self._poly.is_monomial() cpdef _neg_(self): """ @@ -2905,7 +2919,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): ( right)._compute_polydict() try: - sortkey = self.parent().term_order().sortkey + sortkey = self._parent.term_order().sortkey except AttributeError: sortkey = None @@ -3418,3 +3432,4 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): ans._mon = mon ans._poly = root return (True, ans) + diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index fff23e091ad..83e6f4567ae 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -3396,9 +3396,9 @@ cdef class MPolynomial_libsingular(MPolynomial): sage: P(2).is_term() True sage: P.zero().is_term() - True + False """ - return self._poly == NULL or self._poly.next == NULL + return self._poly != NULL and self._poly.next == NULL def subs(self, fixed=None, **kw): """ From 08a2b7100ef8838ecc6c5681fdd154faf721f6c8 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sat, 16 May 2020 15:26:41 +1000 Subject: [PATCH 177/301] Doing some cleanup and some reverts from timing and looking at the C code. --- .../rings/polynomial/laurent_polynomial.pyx | 21 ++++++------ src/sage/rings/polynomial/polydict.pyx | 32 +++++-------------- 2 files changed, 18 insertions(+), 35 deletions(-) diff --git a/src/sage/rings/polynomial/laurent_polynomial.pyx b/src/sage/rings/polynomial/laurent_polynomial.pyx index 01b16cd627d..c9af44acde8 100644 --- a/src/sage/rings/polynomial/laurent_polynomial.pyx +++ b/src/sage/rings/polynomial/laurent_polynomial.pyx @@ -2286,12 +2286,11 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): sage: parent(g.coefficients()[0]) is parent(g).base_ring() True """ - cdef dict d = self.dict() cdef ETuple e - if len(d) == 1: - (e, c), = d.items() + if self._poly.is_term(): + (e, c), = self.dict().items() e = e.emul(-1) - P = self.parent() + P = self._parent try: c = c.inverse_of_unit() except (AttributeError, ZeroDivisionError, ArithmeticError): @@ -2474,7 +2473,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): c = self._prod.monomial_coefficient(m._prod.dict()) return self._parent.base_ring()(c) - def constant_coefficient(self, method=True): + def constant_coefficient(self): """ Return the constant coefficient of ``self``. @@ -2643,15 +2642,15 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): (4*x^7*y^7*z + 3*x^3*y^8*z^2 + 2*x^4*y^7 + x^6*z^2, y^7*z^2) """ ring = self._parent._R - n = ring.ngens() - numer = [0] * n # monomial we multiply the numerator by - denom = [0] * n + numer = self._poly + denom = ring.one() + var = ring.gens() for i, j in enumerate(self._mon): if j > 0: - numer[i] = j + numer *= var[i] ** j else: - denom[i] = -j - return (self._poly * ring.monomial(*numer), ring.monomial(*denom)) + denom *= var[i] ** (-j) + return (numer, denom) cpdef _add_(self, _right): """ diff --git a/src/sage/rings/polynomial/polydict.pyx b/src/sage/rings/polynomial/polydict.pyx index 57e6f719379..48567384b9e 100644 --- a/src/sage/rings/polynomial/polydict.pyx +++ b/src/sage/rings/polynomial/polydict.pyx @@ -1268,9 +1268,7 @@ cdef class ETuple: d = [self[ind] for ind from start <= ind < stop] return ETuple(d) else: - # Do NOT change this as it will not produce an efficient for loop - #for ind in range(0, 2*self._nonzero, 2): - for ind from 0 <= ind < 2*self._nonzero by 2: + for ind in range(0, 2*self._nonzero, 2): if self._data[ind] == i: return self._data[ind+1] elif self._data[ind] > i: @@ -1283,9 +1281,7 @@ cdef class ETuple: Return the exponent for the ``i``-th variable. """ cdef size_t ind = 0 - # Do NOT change this as it will not produce an efficient for loop - #for ind in range(0, 2*self._nonzero, 2): - for ind from 0 <= ind < 2*self._nonzero by 2: + for ind in range(0, 2*self._nonzero, 2): if self._data[ind] == i: return self._data[ind+1] elif self._data[ind] > i: @@ -1506,9 +1502,7 @@ cdef class ETuple: """ cdef size_t degree = 0 cdef size_t i - # Do NOT change this as it will not produce an efficient for loop - #for i in range(1, 2*self._nonzero, 2): - for i from 1 <= i < 2*self._nonzero by 2: + for i in range(1, 2*self._nonzero, 2): degree += self._data[i] return degree @@ -1530,9 +1524,7 @@ cdef class ETuple: cdef size_t i cdef size_t deg = 0 assert len(w) == self._length - # Do NOT change this as it will not produce an efficient for loop - #for i in range(0, 2*self._nonzero, 2): - for i from 0 <= i < 2*self._nonzero by 2: + for i in range(0, 2*self._nonzero, 2): deg += self._data[i+1] * w[self._data[i]] return deg @@ -2009,23 +2001,17 @@ cdef class ETuple: if exp1>1: # division doesn't change the number of nonzero positions result._nonzero = self._nonzero - # Do NOT change this as it will not produce an efficient for loop - #for j in range(0, 2*self._nonzero, 2): - for j from 0 <= j < 2*self._nonzero by 2: + for j in range(0, 2*self._nonzero, 2): result._data[j] = self._data[j] result._data[j+1] = self._data[j+1] result._data[i+1] = exp1-1 else: # var(index) disappears from self result._nonzero = self._nonzero-1 - # Do NOT change this as it will not produce an efficient for loop - #for ind in range(0, i, 2): - for j from 0 <= j < i by 2: + for j in range(0, i, 2): result._data[j] = self._data[j] result._data[j+1] = self._data[j+1] - # Do NOT change this as it will not produce an efficient for loop - #for j in range(i+2, 2*self._nonzero, 2): - for j from i+2 <= j < 2*self._nonzero by 2: + for j in range(i+2, 2*self._nonzero, 2): result._data[j-2] = self._data[j] result._data[j-1] = self._data[j+1] return result @@ -2043,9 +2029,7 @@ cdef class ETuple: # Trivially self cannot divide other return False cdef size_t othernz2 = 2 * other._nonzero - # Do NOT change this as it will not produce an efficient for loop - #for ind1 in range(0, 2*self._nonzero, 2): - for ind1 from 0 <= ind1 < 2*self._nonzero by 2: + for ind1 in range(0, 2*self._nonzero, 2): pos1 = self._data[ind1] exp1 = self._data[ind1+1] # Because of the above trivial test, other._nonzero>0. From df935f01c72aed5e027bfa9c1d27e1f6fde18cb2 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sat, 16 May 2020 15:39:04 +1000 Subject: [PATCH 178/301] Declaring one more variable type. --- src/sage/rings/polynomial/multi_polynomial_libsingular.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index 83e6f4567ae..63b4154362e 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -3183,6 +3183,7 @@ cdef class MPolynomial_libsingular(MPolynomial): sage: f = 23*x^6*y^7 + x^3*y+6*x^7*z sage: list(f) [(23, x^6*y^7), (6, x^7*z), (1, x^3*y)] + sage: list(R.zero()) sage: R. = PolynomialRing(QQ, order='lex') sage: f = 23*x^6*y^7 + x^3*y+6*x^7*z @@ -3193,7 +3194,7 @@ cdef class MPolynomial_libsingular(MPolynomial): cdef ring *_ring = parent._ring if _ring != currRing: rChangeCurrRing(_ring) base = parent._base - cdef poly *p = p_Copy(self._poly, _ring) + cdef poly *t, *p = p_Copy(self._poly, _ring) while p: t = pNext(p) From 1f8587cf688d6cc2de9be506dd7ddad78801fd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 16 May 2020 09:27:16 +0200 Subject: [PATCH 179/301] fix handling of dead ticket in testing-code function --- src/sage/databases/oeis.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/sage/databases/oeis.py b/src/sage/databases/oeis.py index 77cdce92fa9..38441791bfe 100644 --- a/src/sage/databases/oeis.py +++ b/src/sage/databases/oeis.py @@ -1990,14 +1990,25 @@ def test_compile_sage_code(self): This returns ``True`` if the code compiles, and raises an error otherwise. - EXAMPLES:: + EXAMPLES: + + One correct sequence:: + + sage: s = oeis.find_by_id('A027642') # optional -- internet + sage: s.test_compile_sage_code() # optional -- internet + True + + One dead sequence:: - sage: s = oeis.find_by_id('A27642') # optional -- internet + sage: s = oeis.find_by_id('A000154') # optional -- internet sage: s.test_compile_sage_code() # optional -- internet + doctest:warning + ... + RuntimeWarning: This sequence is dead: ... True """ if self.is_dead(): - raise True + return True filt = self.programs(language='sage') if filt: for v in filt: From 4c8424ee3759d00e548d341b775dce40b919091d Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sat, 16 May 2020 17:30:28 +1000 Subject: [PATCH 180/301] Fixing a doctest. --- src/sage/rings/polynomial/multi_polynomial_libsingular.pyx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index 63b4154362e..1bae398726d 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -3184,6 +3184,7 @@ cdef class MPolynomial_libsingular(MPolynomial): sage: list(f) [(23, x^6*y^7), (6, x^7*z), (1, x^3*y)] sage: list(R.zero()) + [] sage: R. = PolynomialRing(QQ, order='lex') sage: f = 23*x^6*y^7 + x^3*y+6*x^7*z From a62f873141e24293bf2b87933f7d761eadddac29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 16 May 2020 10:39:55 +0200 Subject: [PATCH 181/301] some doc details in oeis.py --- src/sage/databases/oeis.py | 50 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/sage/databases/oeis.py b/src/sage/databases/oeis.py index 38441791bfe..bbbe5a32a35 100644 --- a/src/sage/databases/oeis.py +++ b/src/sage/databases/oeis.py @@ -105,7 +105,7 @@ ... -What does the Taylor expansion of the `e^(e^x-1)`` function have to do with +What does the Taylor expansion of the `e^(e^x-1)` function have to do with primes ? :: @@ -186,7 +186,7 @@ def _fetch(url): INPUT: - - ``url`` - a string corresponding to the URL to be fetched. + - ``url`` -- a string corresponding to the URL to be fetched. OUTPUT: @@ -217,7 +217,7 @@ def _urls(html_string): INPUT: - - ``html_string`` - a string representing some HTML code. + - ``html_string`` -- a string representing some HTML code. OUTPUT: @@ -402,10 +402,10 @@ def find_by_id(self, ident, fetch=False): INPUT: - - ``ident`` - a string representing the A-number of the sequence + - ``ident`` -- a string representing the A-number of the sequence or an integer representing its number. - - ``fetch`` - (bool, default: ``False``) whether to force fetching the + - ``fetch`` -- (bool, default: ``False``) whether to force fetching the content of the sequence on the internet. OUTPUT: @@ -430,7 +430,7 @@ def find_by_entry(self, entry): INPUT: - - ``entry`` - a string corresponding to an entry in the internal format + - ``entry`` -- a string corresponding to an entry in the internal format of the OEIS. OUTPUT: @@ -455,13 +455,13 @@ def find_by_description(self, description, max_results=3, first_result=0): INPUT: - - ``description`` - (string) the description the searched sequences. + - ``description`` -- (string) the description the searched sequences. - - ``max_results`` - (integer, default: 3) the maximum number of results + - ``max_results`` -- (integer, default: 3) the maximum number of results we want. In any case, the on-line encyclopedia will not return more than 100 results. - - ``first_result`` - (integer, default: 0) allow to skip the + - ``first_result`` -- (integer, default: 0) allow to skip the ``first_result`` first results in the search, to go further. This is useful if you are looking for a sequence that may appear after the 100 first found sequences. @@ -509,11 +509,11 @@ def find_by_subsequence(self, subsequence, max_results=3, first_result=0): INPUT: - - ``subsequence`` - a list of integers. + - ``subsequence`` -- a list of integers. - - ``max_results`` - (integer, default: 3), the maximum of results requested. + - ``max_results`` -- (integer, default: 3), the maximum of results requested. - - ``first_result`` - (integer, default: 0) allow to skip the + - ``first_result`` -- (integer, default: 0) allow to skip the ``first_result`` first results in the search, to go further. This is useful if you are looking for a sequence that may appear after the 100 first found sequences. @@ -554,9 +554,9 @@ def _imaginary_entry(self, ident='A999999', keywords=''): INPUT: - - ``ident`` - a string representing the A-number of the sequence. + - ``ident`` -- a string representing the A-number of the sequence. - - ``keywords`` - a string corresponding to the keyword field of the + - ``keywords`` -- a string corresponding to the keyword field of the sequence. OUTPUT: @@ -614,9 +614,9 @@ def _imaginary_sequence(self, ident='A999999', keywords='sign,easy'): INPUT: - - ``ident`` - a string representing the A-number of the sequence. + - ``ident`` -- a string representing the A-number of the sequence. - - ``keywords`` - string (default: 'sign,easy'), a list of words + - ``keywords`` -- string (default: 'sign,easy'), a list of words separated by commas. OUTPUT: @@ -692,7 +692,7 @@ def __init__(self, ident): INPUT: - - ``ident`` - a string representing the A-number of the sequence or an + - ``ident`` -- a string representing the A-number of the sequence or an integer representing its number. TESTS:: @@ -753,7 +753,7 @@ def id(self, format='A'): INPUT: - - ``format`` - (string, default: 'A'). + - ``format`` -- (string, default: 'A'). OUTPUT: @@ -1103,7 +1103,7 @@ def is_dead(self, warn_only=False): INPUT: - - warn_only - (bool, default: ``False``), whether to warn when the + - warn_only -- (bool, default: ``False``), whether to warn when the sequence is dead instead of returning a boolean. EXAMPLES: @@ -1244,7 +1244,7 @@ def first_terms(self, number=None): INPUT: - - ``number`` - (integer or ``None``, default: ``None``) the number of + - ``number`` -- (integer or ``None``, default: ``None``) the number of terms returned (if less than the number of available terms). When set to None, returns all the known terms. @@ -1307,7 +1307,7 @@ def __call__(self, k): INPUT: - - ``k`` - integer. + - ``k`` -- integer. OUTPUT: @@ -1371,7 +1371,7 @@ def __getitem__(self, i): INPUT: - - ``i`` - integer. + - ``i`` -- integer. OUTPUT: @@ -1514,10 +1514,10 @@ def links(self, browse=None, format='guess'): INPUT: - - ``browse`` - an integer, a list of integers, or the word 'all' + - ``browse`` -- an integer, a list of integers, or the word 'all' (default: ``None``) : which links to open in a web browser. - - ``format`` - string (default: 'guess') : how to display the links. + - ``format`` -- string (default: 'guess') : how to display the links. OUTPUT: @@ -1616,7 +1616,7 @@ def cross_references(self, fetch=False): INPUT: - - ``fetch`` - boolean (default: ``False``). + - ``fetch`` -- boolean (default: ``False``). OUTPUT: From c0d93fcb4df5ed6af2d48934c02b2fe1bc67a323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 16 May 2020 11:21:15 +0200 Subject: [PATCH 182/301] fix latex --- src/sage/databases/oeis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/databases/oeis.py b/src/sage/databases/oeis.py index bbbe5a32a35..f94e4fc0714 100644 --- a/src/sage/databases/oeis.py +++ b/src/sage/databases/oeis.py @@ -105,7 +105,7 @@ ... -What does the Taylor expansion of the `e^(e^x-1)` function have to do with +What does the Taylor expansion of the `e^{e^x-1}` function have to do with primes ? :: From 203f9eb6b8624111047656a4ffd805aa53809b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 16 May 2020 12:49:42 +0200 Subject: [PATCH 183/301] bandaid for giac pexpect unwanted timing display --- src/sage/interfaces/giac.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/sage/interfaces/giac.py b/src/sage/interfaces/giac.py index f21a06774e4..54b523b36ef 100644 --- a/src/sage/interfaces/giac.py +++ b/src/sage/interfaces/giac.py @@ -580,7 +580,6 @@ def cputime(self, t=None): else: return float(self('time() - %s'%float(t))) - def _eval_line(self, line, allow_use_file=True, wait_for_prompt=True, restart_if_needed=False): """ EXAMPLES:: @@ -588,16 +587,23 @@ def _eval_line(self, line, allow_use_file=True, wait_for_prompt=True, restart_if sage: giac._eval_line('2+2') '4' - sage: A=matrix([range(280)]) - sage: GA=giac(A) + sage: A = matrix([range(280)]) + sage: GA = giac(A) + + TESTS:: + + sage: h='int(1/x*((-2*x^(1/3)+1)^(1/4))^3,x)' + sage: giac(h) + 12*(...) """ with gc_disabled(): z = Expect._eval_line(self, line, allow_use_file=allow_use_file, wait_for_prompt=wait_for_prompt) if z.lower().find("error") != -1: raise RuntimeError("An error occurred running a Giac command:\nINPUT:\n%s\nOUTPUT:\n%s"%(line, z)) - return z - + lines = (line for line in z.splitlines() + if not line.startswith('Evaluation time:')) + return "\n".join(lines) def eval(self, code, strip=True, **kwds): r""" From edf44cce318f542dc32d246fda1da84a3cebec5a Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sun, 17 May 2020 09:58:49 +1000 Subject: [PATCH 184/301] Speed up multiplication of diagram algebras by avoiding checks. --- src/sage/combinat/diagram_algebras.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sage/combinat/diagram_algebras.py b/src/sage/combinat/diagram_algebras.py index 5037c6062fa..06bfda76e2e 100644 --- a/src/sage/combinat/diagram_algebras.py +++ b/src/sage/combinat/diagram_algebras.py @@ -246,7 +246,7 @@ class AbstractPartitionDiagram(AbstractSetPartition): ... ValueError: {{1, 2}, {3, 4}} does not represent two rows of vertices of order 2 """ - def __init__(self, parent, d): + def __init__(self, parent, d, check=True): r""" Initialize ``self``. @@ -257,7 +257,7 @@ def __init__(self, parent, d): sage: pd1 = da.AbstractPartitionDiagram(pd, ((-2,-1),(1,2)) ) """ self._base_diagram = tuple(sorted(tuple(sorted(i)) for i in d)) - super(AbstractPartitionDiagram, self).__init__(parent, self._base_diagram) + super(AbstractPartitionDiagram, self).__init__(parent, self._base_diagram, check=check) def check(self): r""" @@ -402,7 +402,7 @@ def set_partition(self): """ return SetPartitions()(self) - def compose(self, other): + def compose(self, other, check=True): r""" Compose ``self`` with ``other``. @@ -427,7 +427,7 @@ def compose(self, other): ({{-2, -1}, {1, 2}}, 1) """ (composite_diagram, loops_removed) = set_partition_composition(self._base_diagram, other._base_diagram) - return (self.__class__(self.parent(), composite_diagram), loops_removed) + return (self.__class__(self.parent(), composite_diagram, check=check), loops_removed) def propagating_number(self): r""" @@ -1216,7 +1216,7 @@ def __iter__(self): # treat it like an attribute, so we call the underlying # __func__. for i in self._diagram_func.__func__(self.order): - yield self.element_class(self, i) + yield self.element_class(self, i, check=False) def __contains__(self, obj): r""" @@ -2165,7 +2165,7 @@ def product_on_basis(self, d1, d2): d1 = self._indices(d1) if not self._indices.is_parent_of(d2): d2 = self._indices(d2) - (composite_diagram, loops_removed) = d1.compose(d2) + (composite_diagram, loops_removed) = d1.compose(d2, check=False) return self.term(composite_diagram, self._q**loops_removed) class PartitionAlgebra(DiagramBasis, UnitDiagramMixin): @@ -3088,7 +3088,7 @@ def matchings(A, B): for sigma in Permutations(Y): yield [x.union(y) for x, y in zip(X, sigma)] + restA + restB - D, removed = d1.compose(d2) + D, removed = d1.compose(d2, check=False) only_top = set([frozenset(part) for part in d1 if all(i > 0 for i in part)]) only_bottom = set([frozenset(part) for part in d2 From 5e02fc68e97e18a06949b3bda2e3a39ace990184 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sun, 17 May 2020 09:52:44 +1000 Subject: [PATCH 185/301] Initial implementation of blob algebras. --- src/doc/en/reference/references/index.rst | 13 + src/sage/algebras/catalog.py | 2 + src/sage/combinat/blob_algebra.py | 590 ++++++++++++++++++++++ 3 files changed, 605 insertions(+) create mode 100644 src/sage/combinat/blob_algebra.py diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 644ac84d23c..48c86767a6a 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -2349,6 +2349,10 @@ REFERENCES: .. [Gr2007] \J. Green, Polynomial representations of `GL_n`, Springer Verlag, 2007. +.. [Graham1985] \J. Graham, + *Modular representations of Hecke algebras and related algebras*. + PhD thesis, University of Sydney, 1985. + .. [GriRei18] Darij Grinberg, Victor Reiner, *Hopf Algebras in Combinatorics*, :arxiv:`1409.8356v5`. @@ -2770,6 +2774,11 @@ REFERENCES: Science, 447, 74–84 (2012). :doi:`10.1016/j.tcs.2011.11.011` +.. [ILZ2018] \K. Iohara, G. Gehrer, and R. Zhang. + *Schur-Weyl duality for certain infinite dimensional* + `U_q(\mathfrak{sl}_2`-*modules*. + Preprint, :arxiv:`1811.01325` (2018). + .. [IR1990] \K. Ireland and M. Rosen, *A Classical Introduction to Modern Number Theory*, Springer-Verlag, GTM volume 84, 1990. @@ -3867,6 +3876,10 @@ REFERENCES: .. [MS1977] \F. J. MacWilliams, N. J. A. Sloane, *The Theory of Error-Correcting Codes*, North-Holland, Amsterdam, 1977 +.. [MS1994] \P. Martin and H. Saleur. + *The blob algebra and the periodic Temperley-Lieb algebra*. + Lett. Math. Phys., **30** (1994), no. 3. pp. 189-206. + .. [MS2003] \T. Mulders, A. Storjohann, "On lattice reduction for polynomial matrices", J. Symbolic Comput. 35 (2003), no. 4, 377--401 diff --git a/src/sage/algebras/catalog.py b/src/sage/algebras/catalog.py index a4423f44267..0e04afc9d76 100644 --- a/src/sage/algebras/catalog.py +++ b/src/sage/algebras/catalog.py @@ -11,6 +11,7 @@ - :class:`algebras.AskeyWilson ` - :class:`algebras.Brauer ` +- :class:`algebras.Blob ` - :class:`algebras.Clifford ` - :class:`algebras.ClusterAlgebra ` - :class:`algebras.Descent ` @@ -99,6 +100,7 @@ lazy_import('sage.combinat.diagram_algebras', 'PartitionAlgebra', 'Partition') lazy_import('sage.combinat.diagram_algebras', 'PlanarAlgebra', 'PlanarPartition') lazy_import('sage.combinat.diagram_algebras', 'TemperleyLiebAlgebra', 'TemperleyLieb') +lazy_import('sage.combinat.blob_algebra', 'BlobAlgebra', 'Blob') lazy_import('sage.combinat.posets.moebius_algebra', 'MoebiusAlgebra', 'Moebius') lazy_import('sage.combinat.free_prelie_algebra', 'FreePreLieAlgebra', 'FreePreLie') lazy_import('sage.combinat.free_dendriform_algebra', 'FreeDendriformAlgebra', 'FreeDendriform') diff --git a/src/sage/combinat/blob_algebra.py b/src/sage/combinat/blob_algebra.py new file mode 100644 index 00000000000..6a7a65245a2 --- /dev/null +++ b/src/sage/combinat/blob_algebra.py @@ -0,0 +1,590 @@ +r""" +Blob Algebras + +AUTHORS: + +- Travis Scrimshaw (2020-05-16): Initial version +""" + +# **************************************************************************** +# Copyright (C) 2020 Travis Scrimshaw +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# https://www.gnu.org/licenses/ +# **************************************************************************** + +from sage.structure.parent import Parent +from sage.structure.unique_representation import UniqueRepresentation +from sage.structure.element import Element, get_coercion_model +from sage.structure.richcmp import richcmp +#from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass +from sage.misc.cachefunc import cached_method +from sage.misc.misc import powerset +from sage.functions.other import binomial +from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets +from sage.categories.algebras import Algebras +from sage.combinat.diagram_algebras import TemperleyLiebDiagrams +from sage.combinat.free_module import CombinatorialFreeModule +from sage.combinat.dyck_word import DyckWords + +#@add_metaclass(InheritComparisonClasscallMetaclass) +class BlobDiagram(Element): + r""" + A blob diagram. + + A blob diagram consists of a perfect matching of the set + `\{1, \ldots, n\} \sqcup \{-1, \ldots, -n\}` such that the result + is a noncrossing matching (a :class:`Temperley-Lieb diagram + `), divided + into two sets of pairs: one for the pairs with blobs and one for + those without. The blobed pairs must either be either the leftmost + propagating strand or to the left of it and not nested. + """ + def __init__(self, parent, marked, unmarked): + r""" + Initialize ``self``. + + TESTS:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: B = BD4([[1,-3]], [[2,-4], [3,4], [-1,-2]]) + sage: TestSuite(B).run() + """ + Element.__init__(self, parent) + self.marked = tuple(sorted([tuple(sorted(pair)) for pair in marked])) + self.unmarked = tuple(sorted([tuple(sorted(pair)) for pair in unmarked])) + + def _repr_(self): + r""" + Return a string representation of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: BD4([[1,-3]], [[2,-4], [3,4], [-1,-2]]) + ({{-3, 1}}, {{-4, 2}, {-2, -1}, {3, 4}}) + """ + return '({{{}}}, {{{}}})'.format(', '.join('{' + repr(X)[1:-1] + '}' + for X in self.marked), + ', '.join('{' + repr(X)[1:-1] + '}' + for X in self.unmarked)) + + def __hash__(self): + r""" + Return the hash of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: B = BD4([[1,-3]], [[2,-4], [3,4], [-1,-2]]) + sage: hash(B) in [hash(D) for D in BD4] + True + sage: len(set([hash(D) for D in BD4])) == len(BD4) + True + """ + return hash((self.marked, self.unmarked)) + + def _richcmp_(self, other, op): + r""" + Compare ``self`` to ``other`` with operation ``op``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: B = BD4([[1,-3]], [[2,-4], [3,4], [-1,-2]]) + sage: any(B == D for D in BD4) + True + sage: B2 = BD4([], [[1,-3], [2,-4], [3,4], [-1,-2]]) + sage: B == B2 + False + sage: B != B2 + True + sage: sorted(BlobDiagrams(3)) + [({}, {{-3, -2}, {-1, 1}, {2, 3}}), + ({}, {{-3, -2}, {-1, 3}, {1, 2}}), + ({}, {{-3, 1}, {-2, -1}, {2, 3}}), + ({}, {{-3, 3}, {-2, -1}, {1, 2}}), + ({}, {{-3, 3}, {-2, 2}, {-1, 1}}), + ({{-3, 1}}, {{-2, -1}, {2, 3}}), + ({{-3, 1}, {-2, -1}}, {{2, 3}}), + ({{-3, 3}}, {{-2, -1}, {1, 2}}), + ({{-3, 3}, {-2, -1}}, {{1, 2}}), + ({{-3, 3}, {-2, -1}, {1, 2}}, {}), + ({{-3, 3}, {1, 2}}, {{-2, -1}}), + ({{-2, -1}}, {{-3, 1}, {2, 3}}), + ({{-2, -1}}, {{-3, 3}, {1, 2}}), + ({{-2, -1}, {1, 2}}, {{-3, 3}}), + ({{-1, 1}}, {{-3, -2}, {2, 3}}), + ({{-1, 1}}, {{-3, 3}, {-2, 2}}), + ({{-1, 3}}, {{-3, -2}, {1, 2}}), + ({{-1, 3}, {1, 2}}, {{-3, -2}}), + ({{1, 2}}, {{-3, -2}, {-1, 3}}), + ({{1, 2}}, {{-3, 3}, {-2, -1}})] + """ + return richcmp((self.marked, self.unmarked), + (other.marked, other.unmarked), + op) + + def temperley_lieb_diagram(self): + r""" + Return the Temperley-Lieb diagram corresponding to ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: B = BD4([[1,-3]], [[2,-4], [3,4], [-1,-2]]) + sage: B.temperley_lieb_diagram() + {{-4, 2}, {-3, 1}, {-2, -1}, {3, 4}} + """ + return self.parent()._TL_diagrams(self.marked + self.unmarked) + +class BlobDiagrams(Parent, UniqueRepresentation): + """ + The set of all blob diagrams. + """ + def __init__(self, n): + r""" + Initialize ``self``. + + TESTS:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: TestSuite(BD4).run() + """ + self._n = n + self._TL_diagrams = TemperleyLiebDiagrams(n) + Parent.__init__(self, category=FiniteEnumeratedSets()) + + def _repr_(self): + r""" + Return a string representation of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BlobDiagrams(4) + Blob diagrams of order 4 + """ + return "Blob diagrams of order {}".format(self._n) + + def cardinality(self): + r""" + Return the cardinality of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: BD4.cardinality() + 70 + """ + return binomial(2*self._n, self._n) + + def order(self): + r""" + Return the order of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: BD4.order() + 4 + """ + return self._n + + @cached_method + def base_set(self): + r""" + Return the base set of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: sorted(BD4.base_set()) + [-4, -3, -2, -1, 1, 2, 3, 4] + """ + return frozenset(range(1,self._n+1)).union(range(-self._n,0)) + + def _element_constructor_(self, marked, unmarked=None): + r""" + Construct an element of ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: BD4([[1,-3]], [[-1,-2], [2,3], [-4,4]]) + ({{-3, 1}}, {{-4, 4}, {-2, -1}, {2, 3}}) + sage: BD4([[(1,-3)], ([-1,-2], (2,3), [-4,4])]) + ({{-3, 1}}, {{-4, 4}, {-2, -1}, {2, 3}}) + """ + if unmarked is None: + marked, unmarked = marked + ret = self.element_class(self, marked, unmarked) + if ret not in self: + raise ValueError("not a blob diagram of order {}".format(self._n)) + return ret + + def __contains__(self, X): + r""" + Check if ``X`` is contained in ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD4 = BlobDiagrams(4) + sage: BD4([[1,-3], [-1,-2]], [[2,-4], [3,4]]) # indirect doctest + ({{-3, 1}, {-2, -1}}, {{-4, 2}, {3, 4}}) + sage: BD4([[1,4], [-1,-2], [-3,-4]], [[2,3]]) # indirect doctest + ({{-4, -3}, {-2, -1}, {1, 4}}, {{2, 3}}) + + sage: BD4([[1,-2], [-1,-3]], [[2,-4], [3,4]]) # crossing strands + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[1,-4], [-1,-2]], [[2,-3], [3,4]]) # crossing strands + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[1,-2], [-1,-3]], [[3,-4], [2,4]]) # crossing strands + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[1,-3], [-1,-2], [3,4]], [[2,-4]]) # trapped blob cup + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[-1,3], [1,2], [-3,-4]], [[-2,4]]) # trapped blob cap + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[1,4], [-1,-2], [-3,-4], [2,3]], []) # nested blob cup + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[-1,-4], [1,2], [3,4], [-2,-3]], []) # nested blob cap + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + sage: BD4([[3,-3]], [[1,-1],[2,-2],[4,-4]]) # trapped propogating line + Traceback (most recent call last): + ... + ValueError: not a blob diagram of order 4 + """ + if not isinstance(X, BlobDiagram): + return False + # Check that it is a Temperley-Lieb diagram + TL = X.marked + X.unmarked # the TL diagram + if TL not in self._TL_diagrams: + return False + # Check left escaping + for x, y in X.marked: + if x > 0: # Must be a cup + for P in TL: + if P[1] < 0: # P is a cap + continue + if P[1] < x: + if P[0] < 0: # A propogating line to the left + return False + else: # Note that P[1] != x + if 0 < P[0] < x: # A nesting line + return False + elif y < 0: # Must be a cap + for P in TL: + if P[0] > 0: # P is a cup + continue + if P[0] > y: + if P[1] > 0: # A propogating line to the left + return False + else: # Note that P[0] != y + if 0 > P[1] > y: # A nesting line + return False + else: # Must be a propogating line + if any(P[0] < 0 and P[1] > 0 and P[1] < y for P in TL): + return False + return True + + def __iter__(self): + r""" + Iterate over ``self``. + + EXAMPLES:: + + sage: from sage.combinat.blob_algebra import BlobDiagrams + sage: BD3 = BlobDiagrams(3) + sage: for b in BD3: b + ({}, {{-3, 3}, {-2, -1}, {1, 2}}) + ({{1, 2}}, {{-3, 3}, {-2, -1}}) + ({{-2, -1}}, {{-3, 3}, {1, 2}}) + ({{-2, -1}, {1, 2}}, {{-3, 3}}) + ({{-3, 3}}, {{-2, -1}, {1, 2}}) + ({{-3, 3}, {1, 2}}, {{-2, -1}}) + ({{-3, 3}, {-2, -1}}, {{1, 2}}) + ({{-3, 3}, {-2, -1}, {1, 2}}, {}) + ({}, {{-3, -2}, {-1, 3}, {1, 2}}) + ({{1, 2}}, {{-3, -2}, {-1, 3}}) + ({{-1, 3}}, {{-3, -2}, {1, 2}}) + ({{-1, 3}, {1, 2}}, {{-3, -2}}) + ({}, {{-3, 1}, {-2, -1}, {2, 3}}) + ({{-3, 1}}, {{-2, -1}, {2, 3}}) + ({{-2, -1}}, {{-3, 1}, {2, 3}}) + ({{-3, 1}, {-2, -1}}, {{2, 3}}) + ({}, {{-3, -2}, {-1, 1}, {2, 3}}) + ({{-1, 1}}, {{-3, -2}, {2, 3}}) + ({}, {{-3, 3}, {-2, 2}, {-1, 1}}) + ({{-1, 1}}, {{-3, 3}, {-2, 2}}) + """ + for D in DyckWords(self._n): + markable = set() + unmarked = [] + unpaired = [] + # Determine the pairing and which pairings are markable + for i,d in enumerate(D): + if i >= self._n: + i = -2*self._n + i + else: + i += 1 + if d == 1: + unpaired.append(i) + else: # d == 0 + m = unpaired.pop() + if not unpaired: + markable.add((m, i)) + else: + unmarked.append((m, i)) + for X in powerset(markable): + yield self.element_class(self, X, unmarked + list(markable.difference(X))) + + Element = BlobDiagram + +class BlobAlgebra(CombinatorialFreeModule): + r""" + The blob algebra. + + The *blob algebra* (also known as the Temperley-Lieb algebra of type `B` + in [ILZ2018]_, but is a quotient of the Temperley-Lieb algebra of type `B` + defined in [Graham1985]_) is a diagram-type algebra introduced in + [MS1994]_ whose basis consists of :class:`Temperley-Lieb diagrams + `, noncrossing + perfect matchings, that may contain blobs on strands that can be + deformed so that the blob touches the left side (which we can think of + as a frozen pole). + + The form we give here has 3 parameters, the natural one from the + :class:`Temperley-Lieb algebra `, + one for the idempotent relation, and one for a loop with a blob. + + INPUT: + + - ``k`` -- the order + - ``q1`` -- the loop parameter + - ``q2`` -- the idempotent parameter + - ``q3`` -- the blob loop parameter + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B4 = algebras.Blob(4, q, r, s) + sage: B = list(B4.basis()) + sage: B[2] + B({{-4, -3}}, {{-2, -1}, {1, 2}, {3, 4}}) + sage: B[4] + B({{3, 4}}, {{-4, -3}, {-2, -1}, {1, 2}}) + sage: B[2] * B[4] + q*r*s*B({}, {{-4, -3}, {-2, -1}, {1, 2}, {3, 4}}) + + REFERENCES: + + - [MS1994]_ + - [ILZ2018]_ + """ + @staticmethod + def __classcall_private__(cls, k, q1, q2, q3, base_ring=None, prefix='B'): + """ + Normalize input to ensure a unique representation. + + TESTS:: + + sage: R. = ZZ[] + sage: B3 = algebras.Blob(3, q, r, s) + sage: Bp = algebras.Blob(3, q, r, s, R, prefix='B') + sage: B3 is Bp + True + """ + if base_ring is None: + base_ring = get_coercion_model().common_parent(q1, q2, q3) + q1 = base_ring(q1) + q2 = base_ring(q2) + q3 = base_ring(q3) + return super(BlobAlgebra, cls).__classcall__(cls, k, q1, q2, q3, base_ring, prefix) + + def __init__(self, k, q1, q2, q3, base_ring, prefix): + """ + Initialize ``self``. + + TESTS:: + + sage: R. = ZZ[] + sage: B4 = algebras.Blob(4, q, r, s) + sage: TestSuite(B4).run() + + sage: B3 = algebras.Blob(3, q, r, s) + sage: B = list(B3.basis()) + sage: TestSuite(B3).run(elements=B) # long time + """ + self._q1 = q1 + self._q2 = q2 + self._q3 = q3 + diagrams = BlobDiagrams(k) + cat = Algebras(base_ring.category()).FiniteDimensional().WithBasis() + CombinatorialFreeModule.__init__(self, base_ring, diagrams, category=cat, + prefix=prefix, bracket=False) + + def order(self): + """ + Return the order of ``self``. + + The order of a partition algebra is defined as half of the number + of nodes in the diagrams. + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B4 = algebras.Blob(4, q, r, s) + sage: B4.order() + 4 + """ + return self._indices.order() + + @cached_method + def one_basis(self): + r""" + Return the index of the basis element `1`. + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B4 = algebras.Blob(4, q, r, s) + sage: B4.one_basis() + ({}, {{-4, 4}, {-3, 3}, {-2, 2}, {-1, 1}}) + """ + B = self._indices + return B.element_class(B, [], [[i, -i] for i in range(1, self.order()+1)]) + + def product_on_basis(self, top, bot): + """ + Return the product of the basis elements indexed by ``top`` + and ``bot``. + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B4 = algebras.Blob(4, q, r, s) + sage: B = B4.basis() + sage: BD = B.keys() + sage: BD[2] + ({{-4, -3}}, {{-2, -1}, {1, 2}, {3, 4}}) + sage: BD[4] + ({{3, 4}}, {{-4, -3}, {-2, -1}, {1, 2}}) + sage: B4.product_on_basis(BD[2], BD[4]) + q*r*s*B({}, {{-4, -3}, {-2, -1}, {1, 2}, {3, 4}}) + sage: all(len((x*y).support()) == 1 for x in B for y in B) + True + """ + ret_lists = [[], []] + coeff = self.base_ring().one() + top_marked = set(top.marked) + top_unmarked = set(top.unmarked) + bot_marked = set(bot.marked) + bot_unmarked = set(bot.unmarked) + + for top_set, is_unmarked in [(top_marked, 0), (top_unmarked, 1)]: + while top_set: + # We are starting a new strand + cur, stop = top_set.pop() # note that cur < stop + unmarked = is_unmarked + #print(top_set, unmarked, cur, stop) + if cur > 0: # Both are anchored to the top + ret_lists[unmarked].append((cur, stop)) + continue + anchored = bool(stop > 0) # Possibly only stop is anchored + + # Follow the path from cur until we either reach stop or + # we break out of the loop because both ends are anchored + while anchored or cur != stop: + #print(anchored, unmarked, cur, stop) + cur = -cur # Move cur to the bottom diagram + for X in bot_marked: + if cur in X: + if unmarked: + unmarked = 0 + else: + coeff *= self._q2 + prev = cur + cur = X[1-X.index(prev)] + bot_marked.remove(X) + break + for X in bot_unmarked: + if cur in X: + prev = cur + cur = X[1-X.index(prev)] + bot_unmarked.remove(X) + break + if cur < 0: # cur is anchored at the bottom + if anchored: + ret_lists[unmarked].append((stop, cur)) + break + else: + anchored = True + stop, cur = cur, stop # stop is now anchored to the bottom + continue + cur = -cur # bring cur back to the top diagram + for X in top_marked: + if cur in X: + if unmarked: + unmarked = 0 + else: + coeff *= self._q2 + prev = cur + cur = X[1-X.index(prev)] + top_marked.remove(X) + break + for X in top_unmarked: + if cur in X: + prev = cur + cur = X[1-X.index(prev)] + top_unmarked.remove(X) + break + if cur > 0: # cur is anchored at the top + if anchored: + ret_lists[unmarked].append((stop, cur)) + break + else: + anchored = True + stop, cur = cur, stop # stop is now anchored to the top + if cur == stop: # We have found a (marked) loop + if unmarked: + coeff *= self._q1 + else: + coeff *= self._q3 + # Everything remaining in the bottom sets are just anchored + # at the bottom, (i.e., are of the form {-i, -j}). + ret_lists[0].extend(bot_marked) + ret_lists[1].extend(bot_unmarked) + + if coeff == 0: + return self.zero() + diagram = self._indices.element_class(self._indices, ret_lists[0], ret_lists[1]) + return self._from_dict({diagram: coeff}, remove_zeros=False) + From 53f0359017fc1909498de22c4c4b8c5310e76bdb Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 16 May 2020 20:01:00 -0700 Subject: [PATCH 186/301] src/sage/env.py (sage_include_directories): Do not put SAGE_INC in front of the sage source include directories --- src/sage/env.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sage/env.py b/src/sage/env.py index 18d86fe6c49..5ecec20f105 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -364,8 +364,7 @@ def sage_include_directories(use_sources=False): TOP = SAGE_SRC if use_sources else SAGE_LIB - return [SAGE_INC, - TOP, + return [TOP, os.path.join(TOP, 'sage', 'ext'), distutils.sysconfig.get_python_inc(), numpy.get_include()] From 16247ad9675343f1d3e1158cc5e43137aec82645 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 16 May 2020 20:01:37 -0700 Subject: [PATCH 187/301] src/setup.py: Do not put SAGE_LOCAL/lib in front of the library directories --- src/setup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/setup.py b/src/setup.py index 8025a3d0c89..d8b700e9b12 100755 --- a/src/setup.py +++ b/src/setup.py @@ -83,11 +83,12 @@ def excepthook(*exc): keep_going = False -# search for dependencies and add to gcc -I +# Search for dependencies in the source tree and add to gcc -I include_dirs = sage_include_directories(use_sources=True) -# Look for libraries in $SAGE_LOCAL/lib -library_dirs = [os.path.join(SAGE_LOCAL, "lib")] +# Look for libraries only in what is configured already through distutils +# and environment variables +library_dirs = [] # Manually add -fno-strict-aliasing, which is needed to compile Cython # and disappears from the default flags if the user has set CFLAGS. From fb4cb464afe1d91051efc36b15e3e7dfb7cd3b07 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sun, 17 May 2020 13:08:12 +1000 Subject: [PATCH 188/301] Slightly abstracting the latex code for diagrams to use in blob algebra. --- src/sage/combinat/blob_algebra.py | 83 ++++++++++--- src/sage/combinat/diagram_algebras.py | 162 +++++++++++++++----------- 2 files changed, 163 insertions(+), 82 deletions(-) diff --git a/src/sage/combinat/blob_algebra.py b/src/sage/combinat/blob_algebra.py index 6a7a65245a2..fb2fee244bc 100644 --- a/src/sage/combinat/blob_algebra.py +++ b/src/sage/combinat/blob_algebra.py @@ -26,7 +26,7 @@ from sage.functions.other import binomial from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets from sage.categories.algebras import Algebras -from sage.combinat.diagram_algebras import TemperleyLiebDiagrams +from sage.combinat.diagram_algebras import (TemperleyLiebDiagrams, diagram_latex) from sage.combinat.free_module import CombinatorialFreeModule from sage.combinat.dyck_word import DyckWords @@ -113,23 +113,23 @@ def _richcmp_(self, other, op): ({}, {{-3, 3}, {-2, -1}, {1, 2}}), ({}, {{-3, 3}, {-2, 2}, {-1, 1}}), ({{-3, 1}}, {{-2, -1}, {2, 3}}), - ({{-3, 1}, {-2, -1}}, {{2, 3}}), ({{-3, 3}}, {{-2, -1}, {1, 2}}), - ({{-3, 3}, {-2, -1}}, {{1, 2}}), - ({{-3, 3}, {-2, -1}, {1, 2}}, {}), - ({{-3, 3}, {1, 2}}, {{-2, -1}}), ({{-2, -1}}, {{-3, 1}, {2, 3}}), ({{-2, -1}}, {{-3, 3}, {1, 2}}), - ({{-2, -1}, {1, 2}}, {{-3, 3}}), ({{-1, 1}}, {{-3, -2}, {2, 3}}), ({{-1, 1}}, {{-3, 3}, {-2, 2}}), ({{-1, 3}}, {{-3, -2}, {1, 2}}), - ({{-1, 3}, {1, 2}}, {{-3, -2}}), ({{1, 2}}, {{-3, -2}, {-1, 3}}), - ({{1, 2}}, {{-3, 3}, {-2, -1}})] + ({{1, 2}}, {{-3, 3}, {-2, -1}}), + ({{-3, 1}, {-2, -1}}, {{2, 3}}), + ({{-3, 3}, {-2, -1}}, {{1, 2}}), + ({{-3, 3}, {1, 2}}, {{-2, -1}}), + ({{-2, -1}, {1, 2}}, {{-3, 3}}), + ({{-1, 3}, {1, 2}}, {{-3, -2}}), + ({{-3, 3}, {-2, -1}, {1, 2}}, {})] """ - return richcmp((self.marked, self.unmarked), - (other.marked, other.unmarked), + return richcmp((len(self.marked), self.marked, self.unmarked), + (len(other.marked), other.marked, other.unmarked), op) def temperley_lieb_diagram(self): @@ -147,7 +147,7 @@ def temperley_lieb_diagram(self): return self.parent()._TL_diagrams(self.marked + self.unmarked) class BlobDiagrams(Parent, UniqueRepresentation): - """ + r""" The set of all blob diagrams. """ def __init__(self, n): @@ -411,7 +411,7 @@ class BlobAlgebra(CombinatorialFreeModule): """ @staticmethod def __classcall_private__(cls, k, q1, q2, q3, base_ring=None, prefix='B'): - """ + r""" Normalize input to ensure a unique representation. TESTS:: @@ -430,7 +430,7 @@ def __classcall_private__(cls, k, q1, q2, q3, base_ring=None, prefix='B'): return super(BlobAlgebra, cls).__classcall__(cls, k, q1, q2, q3, base_ring, prefix) def __init__(self, k, q1, q2, q3, base_ring, prefix): - """ + r""" Initialize ``self``. TESTS:: @@ -451,8 +451,61 @@ def __init__(self, k, q1, q2, q3, base_ring, prefix): CombinatorialFreeModule.__init__(self, base_ring, diagrams, category=cat, prefix=prefix, bracket=False) - def order(self): + def _latex_term(self, diagram): + r""" + Return a latex representation of ``diagram``. + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B2 = algebras.Blob(2, q, r, s) + sage: latex(B2.an_element()) + 2\begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] + \tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] + \node[vertex] (G--2) at (1.5, -1) [shape = circle, draw] {}; + \node[vertex] (G--1) at (0.0, -1) [shape = circle, draw] {}; + \node[vertex] (G-1) at (0.0, 1) [shape = circle, draw] {}; + \node[vertex] (G-2) at (1.5, 1) [shape = circle, draw] {}; + \draw[] (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); + \draw[] (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); + \end{tikzpicture} + + 3\begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] + \tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] + \node[vertex] (G--2) at (1.5, -1) [shape = circle, draw] {}; + \node[vertex] (G--1) at (0.0, -1) [shape = circle, draw] {}; + \node[vertex] (G-1) at (0.0, 1) [shape = circle, draw] {}; + \node[vertex] (G-2) at (1.5, 1) [shape = circle, draw] {}; + \draw[blue,very thick] (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. node[midway,circle,fill,scale=0.6] {} (G--1); + \draw[] (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); + \end{tikzpicture} + + 2\begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] + \tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] + \node[vertex] (G-1) at (0.0, 1) [shape = circle, draw] {}; + \node[vertex] (G-2) at (1.5, 1) [shape = circle, draw] {}; + \node[vertex] (G--2) at (1.5, -1) [shape = circle, draw] {}; + \node[vertex] (G--1) at (0.0, -1) [shape = circle, draw] {}; + \draw[blue,very thick] (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. node[midway,circle,fill,scale=0.6] {} (G-2); + \draw[] (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); + \end{tikzpicture} """ + def edge_options(P): + if P[1] < P[0]: + P = [P[1], P[0]] + if tuple(P) in diagram.marked: + return 'blue,very thick' + return '' + def edge_additions(P): + if P[1] < P[0]: + P = [P[1], P[0]] + if tuple(P) in diagram.marked: + return 'node[midway,circle,fill,scale=0.6] {} ' + return '' + return diagram_latex(diagram.marked+diagram.unmarked, + edge_options=edge_options, + edge_additions=edge_additions) + + def order(self): + r""" Return the order of ``self``. The order of a partition algebra is defined as half of the number @@ -483,7 +536,7 @@ def one_basis(self): return B.element_class(B, [], [[i, -i] for i in range(1, self.order()+1)]) def product_on_basis(self, top, bot): - """ + r""" Return the product of the basis elements indexed by ``top`` and ``bot``. diff --git a/src/sage/combinat/diagram_algebras.py b/src/sage/combinat/diagram_algebras.py index 5037c6062fa..a259d23a177 100644 --- a/src/sage/combinat/diagram_algebras.py +++ b/src/sage/combinat/diagram_algebras.py @@ -1998,8 +1998,8 @@ def _latex_term(self, diagram): \node[vertex] (G--1) at (0.0, -1) [shape = circle, draw] {}; \node[vertex] (G-1) at (0.0, 1) [shape = circle, draw] {}; \node[vertex] (G-2) at (1.5, 1) [shape = circle, draw] {}; - \draw (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); - \draw (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); + \draw[] (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); + \draw[] (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); \end{tikzpicture} sage: latex(P.orbit_basis()([[1,2],[-2,-1]])) # indirect doctest @@ -2009,73 +2009,11 @@ def _latex_term(self, diagram): \node[vertex] (G--1) at (0.0, -1) [shape = circle, draw, fill] {}; \node[vertex] (G-1) at (0.0, 1) [shape = circle, draw, fill] {}; \node[vertex] (G-2) at (1.5, 1) [shape = circle, draw, fill] {}; - \draw (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); - \draw (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); + \draw[] (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); + \draw[] (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); \end{tikzpicture} - """ - # these allow the view command to work (maybe move them - # somewhere more appropriate?) - from sage.misc.latex import latex - latex.add_to_mathjax_avoid_list('tikzpicture') - latex.add_package_to_preamble_if_available('tikz') - if hasattr(self, '_fill'): - filled_str = ", fill" - else: - filled_str = "" - - def sgn(x): - # Define the sign function - if x > 0: - return 1 - if x < 0: - return -1 - return 0 - l1 = [] # list of blocks - l2 = [] # list of nodes - for i in list(diagram): - l1.append(list(i)) - for j in list(i): - l2.append(j) - output = "\\begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] \n\\tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] \n" #setup beginning of picture - for i in l2: #add nodes - output = output + "\\node[vertex] (G-{}) at ({}, {}) [shape = circle, draw{}] {{}}; \n".format(i, (abs(i)-1)*1.5, sgn(i), filled_str) - for i in l1: #add edges - if len(i) > 1: - l4 = list(i) - posList = [] - negList = [] - for j in l4: # sort list so rows are grouped together - if j > 0: - posList.append(j) - elif j < 0: - negList.append(j) - posList.sort() - negList.sort() - l4 = posList + negList - l5 = l4[:] #deep copy - for j in range(len(l5)): - l5[j-1] = l4[j] #create a permuted list - if len(l4) == 2: - l4.pop() - l5.pop() #pops to prevent duplicating edges - for j in zip(l4, l5): - xdiff = abs(j[1])-abs(j[0]) - y1 = sgn(j[0]) - y2 = sgn(j[1]) - if y2-y1 == 0 and abs(xdiff) < 5: #if nodes are close to each other on same row - diffCo = (0.5+0.1*(abs(xdiff)-1)) #gets bigger as nodes are farther apart; max value of 1; min value of 0.5. - outVec = (sgn(xdiff)*diffCo, -1*diffCo*y1) - inVec = (-1*diffCo*sgn(xdiff), -1*diffCo*y2) - elif y2-y1 != 0 and abs(xdiff) == 1: #if nodes are close enough curviness looks bad. - outVec = (sgn(xdiff)*0.75, -1*y1) - inVec = (-1*sgn(xdiff)*0.75, -1*y2) - else: - outVec = (sgn(xdiff)*1, -1*y1) - inVec = (-1*sgn(xdiff), -1*y2) - output = output + "\\draw (G-{}) .. controls +{} and +{} .. (G-{}); \n".format(j[0], outVec, inVec, j[1]) - output = output + "\\end{tikzpicture} \n" #end picture - return output + return diagram_latex(diagram, fill=hasattr(self, '_fill')) # The following subclass provides a few additional methods for # (sub)partition algebra elements. @@ -3767,6 +3705,96 @@ def __pow__(self, n): raise ValueError("can only take positive integer powers") return generic_power(self, n) +def diagram_latex(diagram, fill=False, edge_options=None, edge_additions=None): + r""" + Return latex code for the diagram ``diagram`` using tikz. + + EXAMPLES:: + + sage: from sage.combinat.diagram_algebras import PartitionDiagrams, diagram_latex + sage: P = PartitionDiagrams(2) + sage: D = P([[1,2],[-2,-1]]) + sage: print(diagram_latex(D)) # indirect doctest + \begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] + \tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] + \node[vertex] (G--2) at (1.5, -1) [shape = circle, draw] {}; + \node[vertex] (G--1) at (0.0, -1) [shape = circle, draw] {}; + \node[vertex] (G-1) at (0.0, 1) [shape = circle, draw] {}; + \node[vertex] (G-2) at (1.5, 1) [shape = circle, draw] {}; + \draw[] (G--2) .. controls +(-0.5, 0.5) and +(0.5, 0.5) .. (G--1); + \draw[] (G-1) .. controls +(0.5, -0.5) and +(-0.5, -0.5) .. (G-2); + \end{tikzpicture} + """ + # these allow the view command to work (maybe move them + # somewhere more appropriate?) + from sage.misc.latex import latex + latex.add_to_mathjax_avoid_list('tikzpicture') + latex.add_package_to_preamble_if_available('tikz') + + if fill: + filled_str = ", fill" + else: + filled_str = "" + + if edge_options is None: + edge_options = lambda P: '' + if edge_additions is None: + edge_additions = lambda P: '' + + def sgn(x): + # Define the sign function + if x > 0: + return 1 + if x < 0: + return -1 + return 0 + l1 = [] # list of blocks + l2 = [] # list of nodes + for i in list(diagram): + l1.append(list(i)) + for j in list(i): + l2.append(j) + output = "\\begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] \n\\tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] \n" #setup beginning of picture + for i in l2: #add nodes + output = output + "\\node[vertex] (G-{}) at ({}, {}) [shape = circle, draw{}] {{}}; \n".format(i, (abs(i)-1)*1.5, sgn(i), filled_str) + for i in l1: #add edges + if len(i) > 1: + l4 = list(i) + posList = [] + negList = [] + for j in l4: # sort list so rows are grouped together + if j > 0: + posList.append(j) + elif j < 0: + negList.append(j) + posList.sort() + negList.sort() + l4 = posList + negList + l5 = l4[:] #deep copy + for j in range(len(l5)): + l5[j-1] = l4[j] #create a permuted list + if len(l4) == 2: + l4.pop() + l5.pop() #pops to prevent duplicating edges + for j in zip(l4, l5): + xdiff = abs(j[1])-abs(j[0]) + y1 = sgn(j[0]) + y2 = sgn(j[1]) + if y2-y1 == 0 and abs(xdiff) < 5: #if nodes are close to each other on same row + diffCo = (0.5+0.1*(abs(xdiff)-1)) #gets bigger as nodes are farther apart; max value of 1; min value of 0.5. + outVec = (sgn(xdiff)*diffCo, -1*diffCo*y1) + inVec = (-1*diffCo*sgn(xdiff), -1*diffCo*y2) + elif y2-y1 != 0 and abs(xdiff) == 1: #if nodes are close enough curviness looks bad. + outVec = (sgn(xdiff)*0.75, -1*y1) + inVec = (-1*sgn(xdiff)*0.75, -1*y2) + else: + outVec = (sgn(xdiff)*1, -1*y1) + inVec = (-1*sgn(xdiff), -1*y2) + output = output + "\\draw[{}] (G-{}) .. controls +{} and +{} .. {}(G-{}); \n".format( + edge_options(j), j[0], outVec, inVec, edge_additions(j), j[1]) + output = output + "\\end{tikzpicture}" #end picture + return output + ######################################################################### # START BORROWED CODE ######################################################################### From 9a50cba23abb1c6ff4b022c62624da800b88e282 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 16 May 2020 20:31:06 -0700 Subject: [PATCH 189/301] src/sage/env.py (sage_include_directories): Fixup doctest --- src/sage/env.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sage/env.py b/src/sage/env.py index 5ecec20f105..4579f21c46e 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -342,8 +342,7 @@ def sage_include_directories(use_sources=False): sage: import sage.env sage: sage.env.sage_include_directories() - ['.../include', - '.../python.../site-packages/sage/ext', + ['.../python.../site-packages/sage/ext', '.../include/python...', '.../python.../numpy/core/include'] From f33b09b73c081bd0ced2fc79c9fa7d06570cd325 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sun, 17 May 2020 14:35:54 +1000 Subject: [PATCH 190/301] Implementation of the cohomology ring of a RAAG. --- src/doc/en/reference/references/index.rst | 4 + src/sage/groups/raag.py | 317 ++++++++++++++++++++++ 2 files changed, 321 insertions(+) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 644ac84d23c..a13c939349c 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -1154,6 +1154,10 @@ REFERENCES: .. [Car1972] \R. W. Carter. *Simple groups of Lie type*, volume 28 of Pure and Applied Mathematics. John Wiley and Sons, 1972. +.. [CQ2019] \A. Cassella and C. Quadrelli. + *Right-angled Artin groups and enhanced Koszul properties*. + Preprint, :arxiv:`1907.03824`, (2019). + .. [CS1996] \G. Call and J. Silverman. Computing the Canonical Height on K3 Surfaces. Mathematics of Comp. , 65 (1996), 259-290. diff --git a/src/sage/groups/raag.py b/src/sage/groups/raag.py index dbe06b18494..982416d96dd 100644 --- a/src/sage/groups/raag.py +++ b/src/sage/groups/raag.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- r""" Right-Angled Artin Groups @@ -35,6 +36,16 @@ from sage.combinat.root_system.coxeter_matrix import CoxeterMatrix from sage.combinat.root_system.coxeter_group import CoxeterGroup +from sage.structure.parent import Parent +from sage.structure.unique_representation import UniqueRepresentation +from sage.combinat.free_module import CombinatorialFreeModule +from sage.categories.fields import Fields +from sage.categories.algebras_with_basis import AlgebrasWithBasis +from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets +from sage.algebras.clifford_algebra import CliffordAlgebraElement +from sage.typeset.ascii_art import ascii_art +from sage.typeset.unicode_art import unicode_art + class RightAngledArtinGroup(ArtinGroup): r""" The right-angled Artin group defined by a graph `G`. @@ -369,6 +380,23 @@ def _normal_form(self, word): pos += len(comm_set) return tuple(w) + def cohomology(self, F=None): + """ + Return the cohomology ring of ``self`` over the field ``F``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: A.cohomology() + Cohomology ring of Right-angled Artin group of Cycle graph + with coefficients in Rational Field + """ + if F is None: + from sage.rings.rational_field import QQ + F = QQ + return CohomologyRAAG(F, self) + class Element(ArtinGroupElement): """ An element of a right-angled Artin group (RAAG). @@ -568,3 +596,292 @@ def _richcmp_(self, other, op): """ return richcmp(self._data, other._data, op) +class CohomologyRAAG(CombinatorialFreeModule): + r""" + The cohomology ring of a right-angled Artin group. + + The cohomology ring of a right-angled Artin group `A`, defined by + the graph `G`, with coefficients in a field `F` is isomorphic to + the exterior algebra of `F^N`, where `N` is the number of vertices + in `G`, modulo the quadratic relations `e_i \wedge e_j = 0` if and + only if `(i, j)` is an edge in `G`. This algebra is sometimes also + known as the Cartier-Foata algebra. + + REFERENCES: + + - [CQ2019]_ + """ + def __init__(self, R, A): + """ + Initialize ``self``. + + TESTS:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: TestSuite(H).run() + """ + if R not in Fields(): + raise NotImplementedError("only implemented with coefficients in a field") + self._group = A + + names = tuple(['e' + name[1:] for name in A.variable_names()]) + from sage.graphs.independent_sets import IndependentSets + from sage.sets.finite_enumerated_set import FiniteEnumeratedSet + indices = [tuple(ind_set) for ind_set in IndependentSets(A._graph)] + indices = FiniteEnumeratedSet(indices) + cat = AlgebrasWithBasis(R.category()).Super().Graded().FiniteDimensional() + CombinatorialFreeModule.__init__(self, R, indices, category=cat, prefix='H') + self._assign_names(names) + + def _repr_(self): + """ + Return a string representation of ``self``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: A.cohomology() + Cohomology ring of Right-angled Artin group of Cycle graph + with coefficients in Rational Field + """ + return "Cohomology ring of {} with coefficients in {}".format(self._group, self.base_ring()) + + def _repr_term(self, m): + """ + Return a string representation of the basis element indexed by + ``m``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H._repr_term((0,1,3)) + 'e0*e1*e3' + sage: w,x,y,z = H.algebra_generators() + sage: y*w + x*z + -e0*e2 + e1*e3 + """ + if len(m) == 0: + return '1' + term = '' + V = self + for i in m: + if len(term) != 0: + term += '*' + term += 'e' + str(i) + return term + + def _ascii_art_term(self, m): + r""" + Return ascii art for the basis element indexed by ``m``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H._ascii_art_term((0,1,3)) + e0/\e1/\e3 + sage: w,x,y,z = H.algebra_generators() + sage: ascii_art(y*w + 2*x*z) + -e0/\e2 + 2*e1/\e3 + """ + if len(m) == 0: + return ascii_art('1') + wedge = '/\\' + return ascii_art(*['e' + str(i) for i in m], sep=wedge) + + def _unicode_art_term(self, m): + """ + Return unicode art for the basis element indexed by ``m``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H._unicode_art_term((0,1,3)) + e0∧e1∧e3 + sage: w,x,y,z = H.algebra_generators() + sage: unicode_art(y*w + x*z) + -e0∧e2 + e1∧e3 + """ + if len(m) == 0: + return unicode_art('1') + import unicodedata + wedge = unicodedata.lookup('LOGICAL AND') + return unicode_art(*['e' + str(i) for i in m], sep=wedge) + + def _latex_term(self, m): + r""" + Return a `\LaTeX` representation of the basis element indexed + by ``m``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H._latex_term((0,1,3)) + ' e_{0} \\wedge e_{1} \\wedge e_{3}' + """ + if len(m) == 0: + return '1' + term = '' + from sage.misc.latex import latex + for i in m: + if len(term) != 0: + term += ' \\wedge' + term += ' e_{{{}}}'.format(latex(i)) + return term + + def gen(self, i): + """ + Return the ``i``-th standard generator of the algebra ``self``. + + This corresponds to the ``i``-th vertex in the graph + (under a fixed ordering of the vertices). + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H.gen(0) + e0 + sage: H.gen(1) + e1 + """ + return self._from_dict({(i,): self.base_ring().one()}, remove_zeros=False) + + @cached_method + def one_basis(self): + """ + Return the basis element indexing `1` of ``self``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H.one_basis() + () + """ + return () + + @cached_method + def algebra_generators(self): + """ + Return the algebra generators of ``self``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H.algebra_generators() + Finite family {0: e0, 1: e1, 2: e2, 3: e3} + """ + V = self._group._graph.vertices() + d = {x: self.gen(i) for i,x in enumerate(V)} + from sage.sets.family import Family + return Family(V, lambda x: d[x]) + + def gens(self): + r""" + Return the generators of ``self`` (as an algebra). + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H.gens() + (e0, e1, e2, e3) + """ + return tuple(self.algebra_generators()) + + def ngens(self): + """ + Return the number of algebra generators of ``self``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: H.ngens() + 4 + """ + return self._group._graph.num_verts() + + def degree_on_basis(self, I): + """ + Return the degree on the basis element ``clique``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: sorted([H.degree_on_basis(I) for I in H.basis().keys()]) + [0, 1, 1, 1, 1, 2, 2] + """ + return len(I) + + class Element(CliffordAlgebraElement): + """ + An element in the cohomology ring of a right-angled Artin group. + """ + def _mul_(self, other): + """ + Return ``self`` multiplied by ``other``. + + EXAMPLES:: + + sage: C4 = graphs.CycleGraph(4) + sage: A = groups.misc.RightAngledArtin(C4) + sage: H = A.cohomology() + sage: b = sum(H.basis()) + sage: b * b + 2*e0*e2 + 2*e1*e3 + 2*e0 + 2*e1 + 2*e2 + 2*e3 + 1 + """ + zero = self.parent().base_ring().zero() + I = self.parent()._indices + d = {} + + for ml,cl in self: + for mr,cr in other: + # Create the next term + t = list(mr) + for i in reversed(ml): + pos = 0 + for j in t: + if i == j: + pos = None + break + if i < j: + break + pos += 1 + cr = -cr + if pos is None: + t = None + break + t.insert(pos, i) + + if t is None: # The next term is 0, move along + continue + + t = tuple(t) + if t not in I: # not an independent set, so this term is also 0 + continue + d[t] = d.get(t, zero) + cl * cr + if d[t] == zero: + del d[t] + + return self.__class__(self.parent(), d) + From 297033a040583cc934757c4c94376d5146054265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 17 May 2020 07:54:10 +0200 Subject: [PATCH 191/301] trac 28913 adding yet another doctest --- src/sage/symbolic/integration/integral.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/sage/symbolic/integration/integral.py b/src/sage/symbolic/integration/integral.py index 7035ba77624..3828760bd42 100644 --- a/src/sage/symbolic/integration/integral.py +++ b/src/sage/symbolic/integration/integral.py @@ -56,6 +56,13 @@ def __init__(self): sage: indefinite_integral(exp(x), 2*x) 2*e^x + TESTS: + + Check for :trac:`28913`:: + + sage: Ex = (1-2*x^(1/3))^(3/4)/x + sage: integrate(Ex, x, algorithm="giac") # long time + 4*(-2*x^(1/3) + 1)^(3/4) + 6*arctan((-2*x^(1/3) + 1)^(1/4)) - 3*log((-2*x^(1/3) + 1)^(1/4) + 1) + 3*log(abs((-2*x^(1/3) + 1)^(1/4) - 1)) """ # The automatic evaluation routine will try these integrators # in the given order. This is an attribute of the class instead of @@ -179,7 +186,7 @@ def __init__(self): def _eval_(self, f, x, a, b): """ - Return the results of symbolic evaluation of the integral + Return the results of symbolic evaluation of the integral. EXAMPLES:: @@ -217,12 +224,13 @@ def _eval_(self, f, x, a, b): def _evalf_(self, f, x, a, b, parent=None, algorithm=None): """ - Return a numerical approximation of the integral + Return a numerical approximation of the integral. EXAMPLES:: sage: from sage.symbolic.integration.integral import definite_integral - sage: h = definite_integral(sin(x)*log(x)/x^2, x, 1, 2); h + sage: f = sin(x)*log(x)/x^2 + sage: h = definite_integral(f, x, 1, 2, hold=True); h integrate(log(x)*sin(x)/x^2, x, 1, 2) sage: h.n() # indirect doctest 0.14839875208053... @@ -241,7 +249,7 @@ def _evalf_(self, f, x, a, b, parent=None, algorithm=None): def _tderivative_(self, f, x, a, b, diff_param=None): """ - Return the derivative of symbolic integration + Return the derivative of symbolic integration. EXAMPLES:: @@ -260,8 +268,9 @@ def _tderivative_(self, f, x, a, b, diff_param=None): ans = definite_integral(f.diff(diff_param), x, a, b) else: ans = SR.zero() - return (ans + f.subs(x == b) * b.diff(diff_param) - - f.subs(x == a) * a.diff(diff_param)) + return (ans + + f.subs(x == b) * b.diff(diff_param) + - f.subs(x == a) * a.diff(diff_param)) def _print_latex_(self, f, x, a, b): r""" From 1709daffedc00828e7658c8b51a9481d6192ddb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 17 May 2020 11:08:56 +0200 Subject: [PATCH 192/301] spring cleanup for partition tuples, replace gp call by pari call --- src/sage/combinat/partition_tuple.py | 173 ++++++++++++++------------- 1 file changed, 93 insertions(+), 80 deletions(-) diff --git a/src/sage/combinat/partition_tuple.py b/src/sage/combinat/partition_tuple.py index a78798746a1..45b75b582e6 100644 --- a/src/sage/combinat/partition_tuple.py +++ b/src/sage/combinat/partition_tuple.py @@ -244,7 +244,7 @@ class of modules for the algebras, which are generalisations of the Specht """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2012 Andrew Mathas # # This program is free software: you can redistribute it and/or modify @@ -252,11 +252,9 @@ class of modules for the algebras, which are generalisations of the Specht # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # https://www.gnu.org/licenses/ -#***************************************************************************** +# **************************************************************************** from __future__ import print_function, absolute_import -from six.moves import range - import itertools from .combinat import CombinatorialElement @@ -266,7 +264,7 @@ class of modules for the algebras, which are generalisations of the Specht from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets from sage.groups.perm_gps.permgroup import PermutationGroup -from sage.interfaces.all import gp +from sage.libs.pari.all import pari from sage.misc.cachefunc import cached_method from sage.rings.all import NN, ZZ, IntegerModRing from sage.rings.integer import Integer @@ -274,10 +272,11 @@ class of modules for the algebras, which are generalisations of the Specht from sage.structure.parent import Parent from sage.structure.unique_representation import UniqueRepresentation - -#-------------------------------------------------- +# ------------------------------------------------- # Partition tuple - element class -#-------------------------------------------------- +# ------------------------------------------------- + + class PartitionTuple(CombinatorialElement): r""" A tuple of :class:`Partition`. @@ -556,7 +555,7 @@ def _repr_list(self): sage: PartitionTuple(([2,1],[3,2],[1,1,1]))._repr_list() '([2, 1], [3, 2], [1, 1, 1])' """ - return '('+', '.join(nu._repr_() for nu in self)+')' + return '(' + ', '.join(nu._repr_() for nu in self) + ')' def _repr_exp_low(self): """ @@ -615,12 +614,11 @@ def _repr_compact_high(self): return '%s' % '|'.join(mu._repr_compact_high() for mu in self) # override default string representation which is str(self._list) - __str__=lambda self: self._repr_() - + __str__ = lambda self: self._repr_() def _latex_(self): r""" - Returns a LaTeX version of ``self``. + Return a LaTeX version of ``self``. For more on the latex options, see :meth:`Partitions.option`. @@ -688,7 +686,8 @@ def _latex_young_diagram(self): sage: mu = PartitionTuple([[2, 1],[1,1,1]])._latex_young_diagram() """ from sage.combinat.output import tex_from_array_tuple - return tex_from_array_tuple([ [["\\phantom{x}"]*row for row in mu] for mu in self._list ]) + return tex_from_array_tuple([[["\\phantom{x}"] * row for row in mu] + for mu in self._list]) def _latex_diagram(self): """ @@ -700,7 +699,8 @@ def _latex_diagram(self): """ entry = self.parent().options("latex_diagram_str") from sage.combinat.output import tex_from_array_tuple - return tex_from_array_tuple([ [[entry]*row for row in mu] for mu in self._list ], with_lines=False) + return tex_from_array_tuple([[[entry] * row for row in mu] + for mu in self._list], with_lines=False) def _latex_list(self): """ @@ -720,8 +720,10 @@ def _latex_exp_low(self): sage: mu = PartitionTuple([[2, 1],[1,1,1,1,1,1,1,1,1,1]])._latex_exp_low() """ - return '(%s)' % '|'.join(','.join('%s%s'%(a+1,'' if e==1 else '^{%s}'%e) - for (a,e) in enumerate(mu)) for mu in self.to_exp()) + txt = '|'.join(','.join('%s%s' % (a + 1, '' if e == 1 else '^{%s}' % e) + for a, e in enumerate(mu)) + for mu in self.to_exp()) + return '(' + txt + ')' def _latex_exp_high(self): """ @@ -731,9 +733,10 @@ def _latex_exp_high(self): sage: mu = PartitionTuple([[2, 1],[1,1,1,1,1,1,1,1,1,1]])._latex_exp_high() """ - return '(%s)' % '|'.join(','.join(['%s%s'%(a+1,'' if e==1 else '^{%s}'%e) - for (a,e) in enumerate(mu)][::-1]) for mu in self.to_exp()) - + txt = '|'.join(','.join(['%s%s' % (a + 1, '' if e == 1 else '^{%s}' % e) + for a, e in enumerate(mu)][::-1]) + for mu in self.to_exp()) + return '(' + txt + ')' def components(self): r""" @@ -760,8 +763,7 @@ def components(self): *** ** """ - return [ t for t in self ] - + return [t for t in self] def diagram(self): r""" @@ -786,7 +788,7 @@ def diagram(self): *** ** - * sage: PartitionTuples.options._reset() """ - col_len = [len(mu)>0 and mu[0] or 1 for mu in self] # columns per component + col_len = [mu and mu[0] or 1 for mu in self] # columns per component row_max = max(len(mu) for mu in self) # maximum row length # There should be a fancier list compression for this but I couldn't get # one to work in the cases where a component was the empty partition @@ -809,7 +811,6 @@ def diagram(self): ferrers_diagram = diagram - def pp(self): r""" Pretty prints this partition tuple. See :meth:`diagram`. @@ -824,7 +825,6 @@ def pp(self): """ print(self.diagram()) - def size(self): """ Return the size of a partition tuple. @@ -945,7 +945,7 @@ def cells(self): def content(self, k,r,c, multicharge): r""" - Returns the content of the cell. + Return the content of the cell. Let `m_k =` ``multicharge[k]``, then the content of a cell is `m_k + c - r`. @@ -1004,8 +1004,10 @@ def content_tableau(self,multicharge): 2 """ from sage.combinat.tableau_tuple import TableauTuple - return TableauTuple([[[multicharge[k]-r+c for c in range(self[k][r])] - for r in range(len(self[k]))] for k in range(len(self))]) + return TableauTuple([[[multicharge[k] - r + c + for c in range(self[k][r])] + for r in range(len(self[k]))] + for k in range(len(self))]) def conjugate(self): """ @@ -1018,7 +1020,6 @@ def conjugate(self): sage: PartitionTuple([[2,1],[1],[1,1,1]]).conjugate() ([3], [1], [2, 1]) - """ return PartitionTuple([nu.conjugate() for nu in self[::-1]]) @@ -1056,22 +1057,25 @@ def dominates(self, mu): except ValueError: raise ValueError('%s must be a PartitionTuple' % mu) - if mu==self: return True - level=0 - ssum=0 # sum of successive rows in self - musum=0 # sum of successive rows in self + if mu == self: + return True + level = 0 + ssum = 0 # sum of successive rows in self + musum = 0 # sum of successive rows in self while levelssum: return False + if musum>ssum: + return False row+=1 if rowssum: return False + if musum>ssum: + return False level+=1 return True @@ -1247,12 +1251,14 @@ def top_garnir_tableau(self,e,cell): g=self.garnir_tableau(cell) - if e==0: return # no more dominant tableau of the same residue + if e==0: + return # no more dominant tableau of the same residue a=e*int((self[comp][row]-col)/e) # number of cells in the e-bricks in row `row` b=e*int((col+1)/e) # number of cells in the e-bricks in row `row+1` - if a==0 or b==0: return self.garnir_tableau(cell) + if a==0 or b==0: + return self.garnir_tableau(cell) t=g.to_list() m=t[comp][row+1][0] # smallest number of 0-Garnir belt @@ -1327,7 +1333,7 @@ def leg_length(self, k,r,c): def contains(self, mu): r""" - Returns ``True`` if this partition tuple contains `\mu`. + Return ``True`` if this partition tuple contains `\mu`. If `\lambda=(\lambda^{(1)}, \ldots, \lambda^{(l)})` and `\mu=(\mu^{(1)}, \ldots, \mu^{(m)})` are two partition tuples then @@ -1379,7 +1385,7 @@ def to_exp(self, k=0): def removable_cells(self): """ - Returns a list of the removable cells of this partition tuple. + Return a list of the removable cells of this partition tuple. All indices are of the form ``(k, r, c)``, where ``r`` is the row-index, ``c`` is the column index and ``k`` is the component. @@ -1415,7 +1421,7 @@ def addable_cells(self): outside_corners = addable_cells # for compatibility with partitions - def add_cell(self, k,r,c): + def add_cell(self, k, r, c): r""" Return the partition tuple obtained by adding a cell in row ``r``, column ``c``, and component ``k``. @@ -1426,17 +1432,18 @@ def add_cell(self, k,r,c): sage: PartitionTuple([[1,1],[4,3],[2,1,1]]).add_cell(0,0,1) ([2, 1], [4, 3], [2, 1, 1]) - """ - if (k,r,c) in self.addable_cells(): # an addable cell - mu=self.to_list() - if c==0: mu[k].append(1) - else: mu[k][r]+=1 + if (k, r, c) in self.addable_cells(): # an addable cell + mu = self.to_list() + if c == 0: + mu[k].append(1) + else: + mu[k][r] += 1 return PartitionTuple(mu) else: - raise ValueError("%s is not an addable cell"%((k,r,c),)) + raise ValueError("%s is not an addable cell" % ((k, r, c),)) - def remove_cell(self, k,r,c): + def remove_cell(self, k, r, c): """ Return the partition tuple obtained by removing a cell in row ``r``, column ``c``, and component ``k``. @@ -1447,14 +1454,13 @@ def remove_cell(self, k,r,c): sage: PartitionTuple([[1,1],[4,3],[2,1,1]]).remove_cell(0,1,0) ([1], [4, 3], [2, 1, 1]) - """ - if (k,r,c) in self.removable_cells(): # a removable cell - mu=self.to_list() - mu[k][r]-=1 + if (k, r, c) in self.removable_cells(): # a removable cell + mu = self.to_list() + mu[k][r] -= 1 return PartitionTuple(mu) else: - raise ValueError("%s is not a removable cell"%((k,r,c),)) + raise ValueError("%s is not a removable cell" % ((k, r, c),)) def to_list(self): r""" @@ -1470,7 +1476,7 @@ def to_list(self): sage: all(mu==PartitionTuple(mu.to_list()) for mu in PartitionTuples(4,4)) True """ - return [ mu.to_list() for mu in self] + return [mu.to_list() for mu in self] def young_subgroup(self): """ @@ -1482,14 +1488,14 @@ def young_subgroup(self): sage: PartitionTuple([[2,1],[4,2],[1]]).young_subgroup() Permutation Group with generators [(), (8,9), (6,7), (5,6), (4,5), (1,2)] """ - gens=[] - m=0 + gens = [] + m = 0 for comp in self: for row in comp: - gens.extend([(c,c+1) for c in range(m+1,m+row)]) - m+=row - gens.append(list(range(1,self.size()+1))) # to ensure we get a subgroup of Sym_n - return PermutationGroup( gens ) + gens.extend([(c, c+1) for c in range(m+1, m+row)]) + m += row + gens.append(list(range(1, self.size()+1))) # to ensure we get a subgroup of Sym_n + return PermutationGroup(gens) def young_subgroup_generators(self): """ @@ -1501,12 +1507,12 @@ def young_subgroup_generators(self): sage: PartitionTuple([[2,1],[4,2],[1]]).young_subgroup_generators() [1, 4, 5, 6, 8] """ - gens=[] - m=0 + gens = [] + m = 0 for comp in self: for row in comp: - gens.extend([c for c in range(m+1,m+row)]) - m+=row + gens.extend([c for c in range(m + 1, m + row)]) + m += row return gens @cached_method @@ -1759,9 +1765,11 @@ def defect(self, e, multicharge): return (sum(beta.get(r, 0) for r in multicharge) - sum(beta[r]**2 - beta[r] * beta.get(Ie(r+1), 0) for r in beta)) -#-------------------------------------------------- +# ------------------------------------------------- # Partition tuples - parent classes -#-------------------------------------------------- +# ------------------------------------------------- + + class PartitionTuples(UniqueRepresentation, Parent): """ Class of all partition tuples. @@ -2019,7 +2027,7 @@ def _an_element_(self): sage: PartitionTuples().an_element() ([1, 1, 1, 1], [2, 1, 1], [3, 1], [4]) """ - return PartitionTuple( ([1,1,1,1],[2,1,1],[3,1],[4]) ) + return PartitionTuple(([1, 1, 1, 1], [2, 1, 1], [3, 1], [4])) class PartitionTuples_all(PartitionTuples): @@ -2112,7 +2120,7 @@ def __init__(self, level): Partition tuples of level 6 sage: TestSuite( PartitionTuples(level=4) ).run() """ - if not level in NN: + if level not in NN: raise ValueError('level must be a non-negative integer') super(PartitionTuples_level, self).__init__(category=InfiniteEnumeratedSets()) self._level=level @@ -2195,7 +2203,7 @@ def _an_element_(self): sage: PartitionTuples(level=4).an_element() ([], [1], [2], [3]) """ - return self.element_class(self, tuple([l] for l in range(self.level()) )) + return self.element_class(self, tuple([l] for l in range(self.level()))) class PartitionTuples_size(PartitionTuples): @@ -2204,7 +2212,7 @@ class PartitionTuples_size(PartitionTuples): """ def __init__(self, size): r""" - Initializes this class. + Initialize this class. EXAMPLES:: @@ -2215,7 +2223,7 @@ def __init__(self, size): sage: TestSuite( PartitionTuples(size=6) ).run() """ - if not size in NN: + if size not in NN: raise ValueError('size must be a non-negative integer') super(PartitionTuples_size, self).__init__(category=InfiniteEnumeratedSets()) self._size=size @@ -2300,7 +2308,7 @@ def _an_element_(self): sage: PartitionTuples(size=4).an_element() ([1], [1], [1], [1]) """ - return self.element_class(self, tuple([1] for l in range(self._size) )) + return self.element_class(self, tuple([1] for l in range(self._size))) class PartitionTuples_level_size(PartitionTuples): @@ -2393,7 +2401,6 @@ def __iter__(self): for cp in itertools.product(*[p[i] for i in iv]): yield self._element_constructor_(cp) - def _an_element_(self): """ Return a generic element. @@ -2403,9 +2410,10 @@ def _an_element_(self): sage: PartitionTuples(level=4,size=4).an_element() ([1], [], [], [3]) """ - mu=[[] for l in range(self._level)] + mu = [[] for l in range(self._level)] if self._size > 0: - if self._level == 1: mu=[self._size-1,1] + if self._level == 1: + mu=[self._size-1,1] else: mu[0]=[1] mu[-1]=[self._size-1] @@ -2413,9 +2421,9 @@ def _an_element_(self): def cardinality(self): r""" - Returns the number of ``level``-tuples of partitions of size ``n``. + Return the number of ``level``-tuples of partitions of size ``n``. - Wraps a pari function call. + Wraps a pari function call using :pari:`eta`. EXAMPLES:: @@ -2440,7 +2448,8 @@ def cardinality(self): These answers were checked against Gap4 (the last of which takes an awful long time for gap to compute). """ - return ZZ(gp.eval('polcoeff((1/eta(x+O(x^%s)))^%s, %s, x)'%(self.size()+1,self.level(), self.size()))) + eta = pari(f'Ser(x,x,{self.size()})').eta() + return ZZ((1 / eta**self.level()).polcoef(self.size(), pari('x'))) def __setstate__(self, state): r""" @@ -2463,7 +2472,8 @@ def __setstate__(self, state): super(PartitionTuples, self).__setstate__(state) ############################################################################### -## Regular partition tuples +# Regular partition tuples + class RegularPartitionTuples(PartitionTuples): r""" @@ -2539,6 +2549,7 @@ def _an_element_(self): elt = RegularPartitionTuples_level_size(lvl, size, self._ell).an_element() return self.element_class(self, list(elt)) + class RegularPartitionTuples_all(RegularPartitionTuples): r""" Class of `\ell`-regular partition tuples. @@ -2686,6 +2697,7 @@ def __iter__(self): for mu in RegularPartitionTuples_level_size(self._level, size, self._ell): yield self.element_class(self, list(mu)) + class RegularPartitionTuples_size(RegularPartitionTuples): r""" Class of `\ell`-regular partition tuples with a fixed size. @@ -2743,9 +2755,10 @@ def __contains__(self, mu): sage: [4, 3, 2] in RPT True """ - return ( (mu in RegularPartitions_all(self._ell) and self._size == sum(mu)) - or (RegularPartitionTuples.__contains__(self, mu) and self._size == sum(map(sum,mu))) - ) + return ((mu in RegularPartitions_all(self._ell) + and self._size == sum(mu)) + or (RegularPartitionTuples.__contains__(self, mu) + and self._size == sum(map(sum, mu)))) def __iter__(self): r""" From 1039ed05cdb3fe1e115df52221f8600614d257ee Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sun, 17 May 2020 21:01:31 +1000 Subject: [PATCH 193/301] Adding ascii/unicode art for Temperley-Lieb/blob diagrams. --- src/doc/en/reference/references/index.rst | 2 +- src/sage/combinat/blob_algebra.py | 42 +++- src/sage/combinat/diagram_algebras.py | 230 ++++++++++++++++++++++ 3 files changed, 271 insertions(+), 3 deletions(-) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 48c86767a6a..47427469bd9 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -2774,7 +2774,7 @@ REFERENCES: Science, 447, 74–84 (2012). :doi:`10.1016/j.tcs.2011.11.011` -.. [ILZ2018] \K. Iohara, G. Gehrer, and R. Zhang. +.. [ILZ2018] \K. Iohara, G. Lehrer, and R. Zhang. *Schur-Weyl duality for certain infinite dimensional* `U_q(\mathfrak{sl}_2`-*modules*. Preprint, :arxiv:`1811.01325` (2018). diff --git a/src/sage/combinat/blob_algebra.py b/src/sage/combinat/blob_algebra.py index fb2fee244bc..cd57332e97a 100644 --- a/src/sage/combinat/blob_algebra.py +++ b/src/sage/combinat/blob_algebra.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- r""" Blob Algebras @@ -26,7 +27,8 @@ from sage.functions.other import binomial from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets from sage.categories.algebras import Algebras -from sage.combinat.diagram_algebras import (TemperleyLiebDiagrams, diagram_latex) +from sage.combinat.diagram_algebras import (TemperleyLiebDiagrams, diagram_latex, + TL_diagram_ascii_art) from sage.combinat.free_module import CombinatorialFreeModule from sage.combinat.dyck_word import DyckWords @@ -451,6 +453,42 @@ def __init__(self, k, q1, q2, q3, base_ring, prefix): CombinatorialFreeModule.__init__(self, base_ring, diagrams, category=cat, prefix=prefix, bracket=False) + def _ascii_art_term(self, diagram): + r""" + Return an ascii art representation of ``diagram``. + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B2 = algebras.Blob(2, q, r, s) + sage: x = B2.an_element() + sage: ascii_art(x) # indirect doctest + o o o o o o + 2* `-` + 3* `-` + 2* `0` + .-. .0. .-. + o o o o o o + """ + return TL_diagram_ascii_art(diagram.marked+diagram.unmarked, use_unicode=False, + blobs=diagram.marked) + + def _unicode_art_term(self, diagram): + r""" + Return a unicode art representation of ``diagram``. + + EXAMPLES:: + + sage: R. = ZZ[] + sage: B2 = algebras.Blob(2, q, r, s) + sage: x = B2.an_element() + sage: unicode_art(x) # indirect doctest + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + 2* ╰─╯ + 3* ╰─╯ + 2* ╰⚫╯ + ╭─╮ ╭⚫╮ ╭─╮ + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + """ + return TL_diagram_ascii_art(diagram.marked+diagram.unmarked, use_unicode=True, + blobs=diagram.marked) + def _latex_term(self, diagram): r""" Return a latex representation of ``diagram``. @@ -459,7 +497,7 @@ def _latex_term(self, diagram): sage: R. = ZZ[] sage: B2 = algebras.Blob(2, q, r, s) - sage: latex(B2.an_element()) + sage: latex(B2.an_element()) # indirect doctest 2\begin{tikzpicture}[scale = 0.5,thick, baseline={(0,-1ex/2)}] \tikzstyle{vertex} = [shape = circle, minimum size = 7pt, inner sep = 1pt] \node[vertex] (G--2) at (1.5, -1) [shape = circle, draw] {}; diff --git a/src/sage/combinat/diagram_algebras.py b/src/sage/combinat/diagram_algebras.py index a259d23a177..23e3729be57 100644 --- a/src/sage/combinat/diagram_algebras.py +++ b/src/sage/combinat/diagram_algebras.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- r""" Diagram and Partition Algebras @@ -3482,6 +3483,41 @@ def _element_constructor_(self, set_partition): set_partition = to_Brauer_partition(set_partition, k=self.order()) return SubPartitionAlgebra._element_constructor_(self, set_partition) + def _ascii_art_term(self, diagram): + r""" + Return an ascii art representation of ``diagram``. + + EXAMPLES:: + + sage: R. = QQ[] + sage: TL = TemperleyLiebAlgebra(4, q, R) + sage: x = TL.an_element() + sage: ascii_art(x) # indirect doctest + o o o o o o o o + o o o o | `-` | | `-` | + 2* `-` `-` + 2* `-----` + 3* `---. | + .-. .-. .-. .-. .-. | | + o o o o o o o o o o o o + """ + return TL_diagram_ascii_art(diagram, use_unicode=False) + + def _unicode_art_term(self, diagram): + r""" + Return a unicode art representation of ``diagram``. + + EXAMPLES:: + + sage: R. = QQ[] + sage: TL = TemperleyLiebAlgebra(4, q, R) + sage: x = TL.an_element() + sage: unicode_art(x) # indirect doctest + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + ⚬ ⚬ ⚬ ⚬ │ ╰─╯ │ │ ╰─╯ │ + 2* ╰─╯ ╰─╯ + 2* ╰─────╯ + 3* ╰───╮ │ + ╭─╮ ╭─╮ ╭─╮ ╭─╮ ╭─╮ │ │ + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + """ + return TL_diagram_ascii_art(diagram, use_unicode=True) class PlanarAlgebra(SubPartitionAlgebra, UnitDiagramMixin): r""" @@ -3705,6 +3741,200 @@ def __pow__(self, n): raise ValueError("can only take positive integer powers") return generic_power(self, n) +def TL_diagram_ascii_art(diagram, use_unicode=False, blobs=[]): + """ + Return ascii art for a Temperley-Lieb diagram ``diagram``. + + INPUT: + + - ``diagram`` -- a list of pairs of matchings of the set + `\{-1, \dotsc, -n, 1, \dotsc, n\}` + - ``use_unicode`` -- (default: ``False``): whether or not + to use unicode art instead of ascii art + - ``blobs`` -- (optional) a list of matchings with blobs on them + + EXAMPLES:: + + sage: from sage.combinat.diagram_algebras import TL_diagram_ascii_art + sage: TL = [(-15,-12), (-14,-13), (-11,15), (-10,14), (-9,-6), + ....: (-8,-7), (-5,-4), (-3,1), (-2,-1), (2,3), (4,5), + ....: (6,11), (7, 8), (9,10), (12,13)] + sage: TL_diagram_ascii_art(TL, use_unicode=False) + o o o o o o o o o o o o o o o + | `-` `-` | `-` `-` | `-` | | + | `---------` | | + | .-------` | + `---. | .-------` + | .-----. | | .-----. + .-. | .-. | .-. | | | | .-. | + o o o o o o o o o o o o o o o + sage: TL_diagram_ascii_art(TL, use_unicode=True) + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + │ ╰─╯ ╰─╯ │ ╰─╯ ╰─╯ │ ╰─╯ │ │ + │ ╰─────────╯ │ │ + │ ╭───────╯ │ + ╰───╮ │ ╭───────╯ + │ ╭─────╮ │ │ ╭─────╮ + ╭─╮ │ ╭─╮ │ ╭─╮ │ │ │ │ ╭─╮ │ + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + + sage: TL = [(-20,-9), (-19,-10), (-18,-11), (-17,-16), (-15,-12), (2,3), + ....: (-14,-13), (-8,16), (-7,7), (-6,6), (-5,1), (-4,-3), (-2,-1), + ....: (4,5), (8,15), (9,10), (11,14), (12,13), (17,20), (18,19)] + sage: TL_diagram_ascii_art(TL, use_unicode=False, blobs=[(-2,-1), (-5,1)]) + o o o o o o o o o o o o o o o o o o o o + | `-` `-` | | | `-` | `-` | | | | `-` | + | | | | `-----` | | `-----` + | | | `-------------` | + `---0---. | | .---------------` + | | | | .---------------------. + | | | | | .-----------------. | + | | | | | | .-------------. | | + | | | | | | | .-----. | | | + .0. .-. | | | | | | | | .-. | .-. | | | + o o o o o o o o o o o o o o o o o o o o + sage: TL_diagram_ascii_art(TL, use_unicode=True, blobs=[(-2,-1), (-5,1)]) + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + │ ╰─╯ ╰─╯ │ │ │ ╰─╯ │ ╰─╯ │ │ │ │ ╰─╯ │ + │ │ │ │ ╰─────╯ │ │ ╰─────╯ + │ │ │ ╰─────────────╯ │ + ╰───⚫───╮ │ │ ╭───────────────╯ + │ │ │ │ ╭─────────────────────╮ + │ │ │ │ │ ╭─────────────────╮ │ + │ │ │ │ │ │ ╭─────────────╮ │ │ + │ │ │ │ │ │ │ ╭─────╮ │ │ │ + ╭⚫╮ ╭─╮ │ │ │ │ │ │ │ │ ╭─╮ │ ╭─╮ │ │ │ + ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ + """ + def insert_pairing(cur, intervals): + """ + Helper function to insert a possibly nested interval + and push the others up, assuming inserting points from + right-to-left. + """ + for level in intervals: + for j, I in enumerate(level): + # Singleton intervals are vertical lines, + # so we don't need to worry about them + if len(I) > 1 and I[0] < cur[0]: + cur, level[j] = level[j], cur + level.append([cur[0]]) + level.append([cur[1]]) + break + else: + level.append(cur) + return # We have stopped + else: + intervals.append([cur]) + # Build a set of intervals that defines where to draw the diagram + intervals = [[]] + propogating = [] + vertical = [] + top_intervals = [[]] + num_left = 0 + num_right = 0 + def key_func(P): + if P[1] < 0: # cap + return (0, P[0], P[1]) + elif P[0] > 0: # cup + return (3, -P[1], -P[0]) + else: + bot, top = -P[0], P[1] + if top < bot: # left moving + return (1, top, bot) + elif top > bot: # right moving + return (2, -bot, -top) + else: # vertical line + return (1, top, bot) + diagram = sorted(diagram, key=key_func) + # Since diagram is sorted in lex order, we will first do the matchings + # from right-to-left on the bottom, then the propogating lines, and + # then the matchings on the top from right-to-left. + # Note that we need the top to go from right-to-left so the + # insert_pairing() function's assumptions are satisfied. + for P in diagram: + if P[1] < 0: # Bottom matching + insert_pairing([-P[1], -P[0], False, False], intervals) + elif P[0] > 0: # Top matching + insert_pairing([P[0], P[1], True, True], top_intervals) + else: # Propogating line + if -P[0] == P[1]: + vertical.append(P[1]) + else: + if -P[0] < P[1]: + num_right += 1 + else: + num_left += 1 + propogating.append(P) + + # Now piece together the intervals together + total_prop = max(num_left, num_right) + prop_intervals = [[] for _ in range(total_prop)] + count_left = 0 + # Recall that the left-moving propogating lines come before the right-moving + for i, P in enumerate(propogating): + bot, top = P + bot = -bot # This makes it equal to its x-coordinate + for level in intervals: + level.append([bot]) + for level in top_intervals: + level.append([top]) + left_moving = count_left < num_left + if not left_moving: + i -= num_left + else: + count_left += 1 + for j in range(i): + prop_intervals[j].append([bot]) + for j in range(i+1,total_prop): + prop_intervals[j].append([top]) + if not left_moving: + top, bot = bot, top + prop_intervals[i].append([top, bot, left_moving, not left_moving]) + intervals += prop_intervals + intervals += reversed(top_intervals) + for level in intervals: + level.extend([i] for i in vertical) + + n = max(max(P) for P in diagram) + + # Finally, convert to a picture + if use_unicode: + from sage.typeset.unicode_art import UnicodeArt + d = ["╭", "╮", "╰", "╯", "─", "│"] + #db = ["┏", "┓", "┗", "┛", "━", "┃"] + blob = '⚫' + ret = [" ⚬" * n] + char_art = UnicodeArt + else: + from sage.typeset.ascii_art import AsciiArt + d = [".", ".", "`", "`", "-", "|"] + #db = [".", ".", "`", "`", "=", "|"] + blob = '0' + ret = [" o" * n] + char_art = AsciiArt + def signed(val, pos): + return val if pos else -val + for level in reversed(intervals): + cur = "" + for I in sorted(level): + cur += ' '*(2*I[0]-1 - len(cur)) + if len(I) == 1: + cur += d[5] + ' ' + else: + cur += d[2] if I[2] else d[0] + if tuple(sorted([signed(I[0], I[2]), signed(I[1], I[3])])) in blobs: + cur += d[4] * (I[1]-I[0]-1) + cur += blob + cur += d[4] * (I[1]-I[0]-1) + else: + cur += d[4] * (2*(I[1]-I[0])-1) + cur += d[3] if I[3] else d[1] + ret.append(cur) + # Note that the top row and bottom row will be the same + ret.append(ret[0]) + return char_art(ret, baseline=len(ret)//2) + def diagram_latex(diagram, fill=False, edge_options=None, edge_additions=None): r""" Return latex code for the diagram ``diagram`` using tikz. From 034d71ace4312b495de3ba434566f75bbe621b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Labb=C3=A9?= Date: Sun, 17 May 2020 16:22:22 +0200 Subject: [PATCH 194/301] 29700:catching also ValueError --- src/sage/matrix/matrix2.pyx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sage/matrix/matrix2.pyx b/src/sage/matrix/matrix2.pyx index c5146cc87c0..649e6d70e10 100644 --- a/src/sage/matrix/matrix2.pyx +++ b/src/sage/matrix/matrix2.pyx @@ -13679,13 +13679,20 @@ cdef class Matrix(Matrix1): [0.750000000000000 0.800000000000000 0.833333333333333] [0.857142857142857 0.875000000000000 0.888888888888889] [0.900000000000000 0.909090909090909 0.916666666666667] + + We check that :trac:`29700` is fixed:: + + sage: M = matrix(3,[1,1,1,1,0,0,0,1,0]) + sage: A,B = M.diagonalization(QQbar) + sage: _ = A.n() + """ if prec is None: prec = digits_to_bits(digits) try: return self.change_ring(sage.rings.real_mpfr.RealField(prec)) - except TypeError: + except (TypeError, ValueError): # try to return a complex result return self.change_ring(sage.rings.complex_field.ComplexField(prec)) From b7fdccb1f2a0022e483d7e23f7f0dedca9a94ef7 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Mon, 18 May 2020 11:22:37 +1000 Subject: [PATCH 195/301] A few other micro-optimizations. --- .../rings/polynomial/multi_polynomial.pyx | 2 +- .../polynomial/multi_polynomial_element.py | 34 ++++++++++--------- .../multi_polynomial_libsingular.pyx | 2 +- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 5005386cf4e..25de569ee2f 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -357,7 +357,7 @@ cdef class MPolynomial(CommutativeRingElement): x = [etb.var(v) for v in my_vars] n = len(x) - expr = etb.constant(self.base_ring()(0)) + expr = etb.constant(self.base_ring().zero()) for (m, c) in self.dict().iteritems(): monom = prod([ x[i]**m[i] for i in range(n) if m[i] != 0], etb.constant(c)) diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py index ea51eebf0e1..3a949c31c82 100644 --- a/src/sage/rings/polynomial/multi_polynomial_element.py +++ b/src/sage/rings/polynomial/multi_polynomial_element.py @@ -394,7 +394,7 @@ def __init__(self, parent, x): True """ if not isinstance(x, polydict.PolyDict): - x = polydict.PolyDict(x, parent.base_ring()(0), remove_zero=True) + x = polydict.PolyDict(x, parent.base_ring().zero(), remove_zero=True) MPolynomial_element.__init__(self, parent, x) def _new_constant_poly(self, x, P): @@ -822,7 +822,7 @@ def __getitem__(self, x): try: return self.element()[x] except KeyError: - return self.parent().base_ring()(0) + return self.parent().base_ring().zero() def __iter__(self): """ @@ -851,7 +851,7 @@ def __iter__(self): """ elt = self.element() ring = self.parent() - one = ring.base_ring()(1) + one = ring.base_ring().one() for exp in self._exponents: yield (elt[exp], MPolynomial_polydict(ring, polydict.PolyDict({exp:one}, @@ -1252,7 +1252,7 @@ def monomials(self): True """ ring = self.parent() - one = ring.base_ring()(1) + one = ring.base_ring().one() return [MPolynomial_polydict(ring, polydict.PolyDict({m:one}, force_int_exponents=False, force_etuples=False)) for m in self._exponents] @@ -1275,7 +1275,7 @@ def constant_coefficient(self): try: return d[polydict.ETuple({},self.parent().ngens())] except KeyError: - return self.parent().base_ring()(0) + return self.parent().base_ring().zero() def is_univariate(self): """ @@ -1503,7 +1503,7 @@ def lm(self): return self R = self.parent() f = self._MPolynomial_element__element.lcmt( R.term_order().greater_tuple ) - one = R.base_ring()(1) + one = R.base_ring().one() self.__lm = MPolynomial_polydict(R,polydict.PolyDict({f:one},zero=R.base_ring().zero(),force_int_exponents=False, force_etuples=False)) return self.__lm @@ -1669,7 +1669,8 @@ def _derivative(self, var=None): if var is None: raise ValueError("must specify which variable to differentiate with respect to") - gens = list(self.parent().gens()) + P = self.parent() + gens = list(P.gens()) # check if var is one of the generators try: @@ -1678,8 +1679,8 @@ def _derivative(self, var=None): # var is not a generator; do term-by-term differentiation recursively # var may be, for example, a generator of the base ring d = dict([(e, x._derivative(var)) for (e, x) in iteritems(self.dict())]) - d = polydict.PolyDict(d, self.parent().base_ring()(0), remove_zero=True) - return MPolynomial_polydict(self.parent(), d) + d = polydict.PolyDict(d, P.base_ring().zero(), remove_zero=True) + return MPolynomial_polydict(P, d) # differentiate w.r.t. indicated variable d = {} @@ -1687,8 +1688,8 @@ def _derivative(self, var=None): for (exp, coeff) in iteritems(self.dict()): if exp[index] > 0: d[exp.esub(v)] = coeff * exp[index] - d = polydict.PolyDict(d, self.parent().base_ring()(0), remove_zero=True) - return MPolynomial_polydict(self.parent(), d) + d = polydict.PolyDict(d, P.base_ring().zero(), remove_zero=True) + return MPolynomial_polydict(P, d) def integral(self, var=None): r""" @@ -1740,7 +1741,8 @@ def integral(self, var=None): raise ValueError("must specify which variable to integrate " "with respect to") - gens = list(self.parent().gens()) + P = self.parent() + gens = list(P.gens()) # check if var is one of the generators try: @@ -1750,17 +1752,17 @@ def integral(self, var=None): # var may be, for example, a generator of the base ring d = dict([(e, x.integral(var)) for (e, x) in iteritems(self.dict())]) - d = polydict.PolyDict(d, self.parent().base_ring()(0), + d = polydict.PolyDict(d, P.base_ring().zero(), remove_zero=True) - return MPolynomial_polydict(self.parent(), d) + return MPolynomial_polydict(P, d) # integrate w.r.t. indicated variable d = {} v = polydict.ETuple({index:1}, len(gens)) for (exp, coeff) in iteritems(self.dict()): d[exp.eadd(v)] = coeff / (1+exp[index]) - d = polydict.PolyDict(d, self.parent().base_ring()(0), remove_zero=True) - return MPolynomial_polydict(self.parent(), d) + d = polydict.PolyDict(d, P.base_ring().zero(), remove_zero=True) + return MPolynomial_polydict(P, d) def factor(self, proof=None): r""" diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index 1bae398726d..aa0b7452da0 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -2121,7 +2121,7 @@ cdef class MPolynomial_libsingular(MPolynomial): coerced_x = [parent.coerce(e) for e in x] except TypeError: # give up, evaluate functional - y = parent.base_ring()(0) + y = parent.base_ring().zero() for (m,c) in self.dict().iteritems(): y += c*mul([ x[i]**m[i] for i in m.nonzero_positions()]) return y From ee73868072306af56350a288d1b2fee12457e26c Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Mon, 18 May 2020 11:25:42 +1000 Subject: [PATCH 196/301] Some last minute details to clean the generic MPoly file. --- .../polynomial/multi_polynomial_element.py | 101 ++++++++---------- 1 file changed, 45 insertions(+), 56 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py index 3a949c31c82..688d33158d1 100644 --- a/src/sage/rings/polynomial/multi_polynomial_element.py +++ b/src/sage/rings/polynomial/multi_polynomial_element.py @@ -761,27 +761,51 @@ def dict(self): """ return self.element().dict() - #def __iter__(self): - # """ - # Facilitates iterating over the monomials of self, - # returning tuples of the form (coeff, mon) for each - # non-zero monomial. - # - # EXAMPLES:: - - # sage: R = ZZ['t'] - # sage: P. = PolynomialRing(R,3) - # sage: f = 3*x^3*y + 16*x + 7 - # sage: [(c,m) for c,m in f] - # [(3, x^3*y), (16, x), (7, 1)] - # sage: f = P.random_element(10,10) - # sage: sum(c*m for c,m in f) == f - # True - # """ - # exps = self.exponents() - # parent = self.parent() - # for exp in exps: - # yield self.element()[exp], MPolynomial_polydict(parent, {exp: 1}) + def __iter__(self): + """ + Iterate over ``self`` respecting the term order. + + EXAMPLES:: + + sage: R. = PolynomialRing(QQbar, order='lex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f) + [(1, x^4*y*z^3), (1, x^2*z), (1, x*y^5*z^2)] + + :: + + sage: R. = PolynomialRing(QQbar, order='deglex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f) + [(1, x^4*y*z^3), (1, x*y^5*z^2), (1, x^2*z)] + + :: + + sage: R. = PolynomialRing(QQbar, order='degrevlex') + sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) + sage: list(f) + [(1, x*y^5*z^2), (1, x^4*y*z^3), (1, x^2*z)] + + :: + + sage: R = ZZ['t'] + sage: P. = PolynomialRing(R,3) + sage: f = 3*x^3*y + 16*x + 7 + sage: [(c,m) for c,m in f] + [(3, x^3*y), (16, x), (7, 1)] + sage: f = P.random_element(10,10) + sage: sum(c*m for c,m in f) == f + True + """ + elt = self.element() + ring = self.parent() + one = ring.base_ring().one() + for exp in self._exponents: + yield (elt[exp], + MPolynomial_polydict(ring, polydict.PolyDict({exp:one}, + force_int_exponents=False, + force_etuples=False)) + ) def __getitem__(self, x): """ @@ -824,41 +848,6 @@ def __getitem__(self, x): except KeyError: return self.parent().base_ring().zero() - def __iter__(self): - """ - Iterate over ``self`` respecting the term order. - - EXAMPLES:: - - sage: R. = PolynomialRing(QQbar, order='lex') - sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) - sage: list(f) - [(1, x^4*y*z^3), (1, x^2*z), (1, x*y^5*z^2)] - - :: - - sage: R. = PolynomialRing(QQbar, order='deglex') - sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) - sage: list(f) - [(1, x^4*y*z^3), (1, x*y^5*z^2), (1, x^2*z)] - - :: - - sage: R. = PolynomialRing(QQbar, order='degrevlex') - sage: f = (x^1*y^5*z^2 + x^2*z + x^4*y^1*z^3) - sage: list(f) - [(1, x*y^5*z^2), (1, x^4*y*z^3), (1, x^2*z)] - """ - elt = self.element() - ring = self.parent() - one = ring.base_ring().one() - for exp in self._exponents: - yield (elt[exp], - MPolynomial_polydict(ring, polydict.PolyDict({exp:one}, - force_int_exponents=False, - force_etuples=False)) - ) - def iterator_exp_coeff(self, as_ETuples=True): """ Iterate over ``self`` as pairs of ((E)Tuple, coefficient). From f36ccbacf404a18426830932f3835458c7141206 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 10 May 2020 23:46:16 +0100 Subject: [PATCH 197/301] spkg-configure for sympow --- build/pkgs/sympow/distros/conda.txt | 1 + build/pkgs/sympow/distros/debian.txt | 1 + build/pkgs/sympow/distros/fedora.txt | 1 + build/pkgs/sympow/spkg-configure.m4 | 4 ++++ 4 files changed, 7 insertions(+) create mode 100644 build/pkgs/sympow/distros/conda.txt create mode 100644 build/pkgs/sympow/distros/debian.txt create mode 100644 build/pkgs/sympow/distros/fedora.txt create mode 100644 build/pkgs/sympow/spkg-configure.m4 diff --git a/build/pkgs/sympow/distros/conda.txt b/build/pkgs/sympow/distros/conda.txt new file mode 100644 index 00000000000..a2ae7a8a59c --- /dev/null +++ b/build/pkgs/sympow/distros/conda.txt @@ -0,0 +1 @@ +sympow diff --git a/build/pkgs/sympow/distros/debian.txt b/build/pkgs/sympow/distros/debian.txt new file mode 100644 index 00000000000..a2ae7a8a59c --- /dev/null +++ b/build/pkgs/sympow/distros/debian.txt @@ -0,0 +1 @@ +sympow diff --git a/build/pkgs/sympow/distros/fedora.txt b/build/pkgs/sympow/distros/fedora.txt new file mode 100644 index 00000000000..a2ae7a8a59c --- /dev/null +++ b/build/pkgs/sympow/distros/fedora.txt @@ -0,0 +1 @@ +sympow diff --git a/build/pkgs/sympow/spkg-configure.m4 b/build/pkgs/sympow/spkg-configure.m4 new file mode 100644 index 00000000000..36a35fda866 --- /dev/null +++ b/build/pkgs/sympow/spkg-configure.m4 @@ -0,0 +1,4 @@ +SAGE_SPKG_CONFIGURE([sympow], [ + AC_PATH_PROG([SYMPOW], [sympow]) + AS_IF([test -z "$ac_cv_path_SYMPOW"], [sage_spkg_install_sympow=yes]) +]) From 99ebe047c653cccc930d667876f8c7782138d6eb Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Mon, 18 May 2020 11:02:17 +0100 Subject: [PATCH 198/301] add gentoo package name --- build/pkgs/sympow/distros/gentoo.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 build/pkgs/sympow/distros/gentoo.txt diff --git a/build/pkgs/sympow/distros/gentoo.txt b/build/pkgs/sympow/distros/gentoo.txt new file mode 100644 index 00000000000..082eebb6daa --- /dev/null +++ b/build/pkgs/sympow/distros/gentoo.txt @@ -0,0 +1 @@ +sci-mathematics/sympow From bdd22a2476d421742e1e95428b8fcb3013911c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 18 May 2020 14:26:08 +0200 Subject: [PATCH 199/301] fix some details in permutations of multisets --- src/sage/combinat/permutation.py | 38 +++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/sage/combinat/permutation.py b/src/sage/combinat/permutation.py index a68d6734f81..961a5c642ce 100644 --- a/src/sage/combinat/permutation.py +++ b/src/sage/combinat/permutation.py @@ -244,7 +244,7 @@ from sage.categories.finite_permutation_groups import FinitePermutationGroups from sage.structure.list_clone import ClonableArray from sage.structure.global_options import GlobalOptions -from sage.interfaces.all import gap +from sage.libs.gap.libgap import libgap from sage.rings.all import ZZ, Integer, PolynomialRing from sage.arith.all import factorial, multinomial from sage.matrix.matrix_space import MatrixSpace @@ -666,11 +666,11 @@ def _latex_(self): redword = self.reduced_word() if not redword: return self.parent().options.latex_empty_str - return " ".join("%s_{%s}"%(let, i) for i in redword) + return " ".join("%s_{%s}" % (let, i) for i in redword) if display == "twoline": - return "\\begin{pmatrix} %s \\\\ %s \\end{pmatrix}"%( - " & ".join("%s"%i for i in range(1, len(self._list)+1)), - " & ".join("%s"%i for i in self._list)) + return "\\begin{pmatrix} %s \\\\ %s \\end{pmatrix}" % ( + " & ".join("%s" % i for i in range(1, len(self._list)+1)), + " & ".join("%s" % i for i in self._list)) if display == "list": return repr(self._list) if display == "cycle": @@ -1883,7 +1883,7 @@ def _icondition(self, i): :meth:`ishift`, :meth:`iswitch` """ if i not in range(2, len(self)): - raise ValueError("i (= %s) must be between 2 and n-1"%i) + raise ValueError("i (= %s) must be between 2 and n-1" % i) pos_i = self.index(i) pos_ip1 = self.index(i+1) pos_im1 = self.index(i-1) @@ -5310,7 +5310,7 @@ def __classcall_private__(cls, n=None, k=None, **kwargs): if k is None: return Permutations_mset(n) else: - return Permutations_msetk(n,k) + return Permutations_msetk(n, k) elif 'descents' in kwargs: #Descent positions specified if isinstance(kwargs['descents'], tuple): @@ -5518,6 +5518,7 @@ def random_element(self): """ return sample(range(1, self.n+1), self._k) + class Permutations_mset(Permutations): r""" Permutations of a multiset `M`. @@ -5669,6 +5670,8 @@ def __iter__(self): def cardinality(self): """ + Return the cardinality of the set. + EXAMPLES:: sage: Permutations([1,2,2]).cardinality() @@ -5791,6 +5794,8 @@ def __iter__(self): def cardinality(self): """ + Return the cardinality of the set. + EXAMPLES:: sage: Permutations([1,2,3]).cardinality() @@ -5855,7 +5860,8 @@ def __contains__(self, x): sage: [2,1] in p True """ - if len(x) != self._k: return False + if len(x) != self._k: + return False s = list(self.mset) for i in x: if i in s: @@ -5871,7 +5877,18 @@ def _repr_(self): sage: Permutations([1,2,2],2) Permutations of the multi-set [1, 2, 2] of length 2 """ - return "Permutations of the multi-set %s of length %s"%(list(self.mset), self._k) + return "Permutations of the multi-set %s of length %s" % (list(self.mset), self._k) + + def cardinality(self): + """ + Return the cardinality of the set. + + EXAMPLES:: + + sage: Permutations([1,2,2],2).cardinality() + 3 + """ + return ZZ.sum(1 for z in self) def __iter__(self): """ @@ -5883,10 +5900,11 @@ def __iter__(self): mset = self.mset lmset = list(mset) mset_list = [lmset.index(x) for x in lmset] - indices = eval(gap.eval('Arrangements(%s,%s)'%(mset_list, self._k))) + indices = libgap.Arrangements(mset_list, self._k).sage() for ktuple in indices: yield self.element_class(self, [lmset[x] for x in ktuple]) + class Permutations_setk(Permutations_set): """ Length-`k` partial permutations of an arbitrary given finite set. From 7dd76f64ed82e803c8e17263e79f6a6840843d20 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Tue, 19 May 2020 10:31:37 +1000 Subject: [PATCH 200/301] Added an r""" to TL_diagram_ascii_art(). --- src/sage/combinat/diagram_algebras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/combinat/diagram_algebras.py b/src/sage/combinat/diagram_algebras.py index 23e3729be57..2bb98b120e8 100644 --- a/src/sage/combinat/diagram_algebras.py +++ b/src/sage/combinat/diagram_algebras.py @@ -3742,7 +3742,7 @@ def __pow__(self, n): return generic_power(self, n) def TL_diagram_ascii_art(diagram, use_unicode=False, blobs=[]): - """ + r""" Return ascii art for a Temperley-Lieb diagram ``diagram``. INPUT: From 1f2965b8d5114aef101bb95399990786ec3a639d Mon Sep 17 00:00:00 2001 From: John Cremona Date: Tue, 19 May 2020 14:11:17 +0100 Subject: [PATCH 201/301] #29666: fix 2 doctests --- src/sage/schemes/elliptic_curves/heegner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/schemes/elliptic_curves/heegner.py b/src/sage/schemes/elliptic_curves/heegner.py index b4123adfd00..8d715b3efc6 100644 --- a/src/sage/schemes/elliptic_curves/heegner.py +++ b/src/sage/schemes/elliptic_curves/heegner.py @@ -3280,7 +3280,7 @@ def numerical_approx(self, prec=53, algorithm=None): sage: E = EllipticCurve('389a'); P = E.heegner_point(-7, 5); P Heegner point of discriminant -7 and conductor 5 on elliptic curve of conductor 389 sage: numerical_approx(P) - (0.675507556926806 + 0.344749649302635*I : -0.377142931401887 + 0.843366227137146*I : 1.00000000000000) + (0.675507556926807 + 0.344749649302635*I : -0.377142931401887 + 0.843366227137146*I : 1.00000000000000) sage: P.numerical_approx() (0.6755075569268... + 0.3447496493026...*I : -0.3771429314018... + 0.8433662271371...*I : 1.00000000000000) sage: E.heegner_point(-7, 11).numerical_approx() @@ -4298,7 +4298,7 @@ def _recognize_point_over_QQ(self, P, n): sage: E = EllipticCurve('43a'); P = E.heegner_point(-20).kolyvagin_point() sage: PP = P.numerical_approx(); PP - (...e-16 : -1.00000000000000 : 1.00000000000000) + (0.000000000000000 : -1.00000000000000 : 1.00000000000000) sage: P._recognize_point_over_QQ(PP, 4) (0 : -1 : 1) """ From e5e91e7a8d8fbabb93ed2ff7278c7eefa19da44c Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Wed, 20 May 2020 12:41:29 +1000 Subject: [PATCH 202/301] Better unicode object for the blob. --- src/sage/combinat/blob_algebra.py | 4 ++-- src/sage/combinat/diagram_algebras.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sage/combinat/blob_algebra.py b/src/sage/combinat/blob_algebra.py index cd57332e97a..8d719b29103 100644 --- a/src/sage/combinat/blob_algebra.py +++ b/src/sage/combinat/blob_algebra.py @@ -482,8 +482,8 @@ def _unicode_art_term(self, diagram): sage: x = B2.an_element() sage: unicode_art(x) # indirect doctest ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ - 2* ╰─╯ + 3* ╰─╯ + 2* ╰⚫╯ - ╭─╮ ╭⚫╮ ╭─╮ + 2* ╰─╯ + 3* ╰─╯ + 2* ╰●╯ + ╭─╮ ╭●╮ ╭─╮ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ """ return TL_diagram_ascii_art(diagram.marked+diagram.unmarked, use_unicode=True, diff --git a/src/sage/combinat/diagram_algebras.py b/src/sage/combinat/diagram_algebras.py index 2bb98b120e8..042aad3e1c4 100644 --- a/src/sage/combinat/diagram_algebras.py +++ b/src/sage/combinat/diagram_algebras.py @@ -3798,12 +3798,12 @@ def TL_diagram_ascii_art(diagram, use_unicode=False, blobs=[]): │ ╰─╯ ╰─╯ │ │ │ ╰─╯ │ ╰─╯ │ │ │ │ ╰─╯ │ │ │ │ │ ╰─────╯ │ │ ╰─────╯ │ │ │ ╰─────────────╯ │ - ╰───⚫───╮ │ │ ╭───────────────╯ + ╰───●───╮ │ │ ╭───────────────╯ │ │ │ │ ╭─────────────────────╮ │ │ │ │ │ ╭─────────────────╮ │ │ │ │ │ │ │ ╭─────────────╮ │ │ │ │ │ │ │ │ │ ╭─────╮ │ │ │ - ╭⚫╮ ╭─╮ │ │ │ │ │ │ │ │ ╭─╮ │ ╭─╮ │ │ │ + ╭●╮ ╭─╮ │ │ │ │ │ │ │ │ ╭─╮ │ ╭─╮ │ │ │ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ ⚬ """ def insert_pairing(cur, intervals): @@ -3903,7 +3903,7 @@ def key_func(P): from sage.typeset.unicode_art import UnicodeArt d = ["╭", "╮", "╰", "╯", "─", "│"] #db = ["┏", "┓", "┗", "┛", "━", "┃"] - blob = '⚫' + blob = '●' ret = [" ⚬" * n] char_art = UnicodeArt else: From 52e465147710e82874e3f5906f3e804e7959ce77 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Wed, 20 May 2020 15:19:27 +1000 Subject: [PATCH 203/301] Allowing a larger number of things to convert into the fraction field. --- src/sage/rings/fraction_field.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/sage/rings/fraction_field.py b/src/sage/rings/fraction_field.py index 1c4285d039f..15328d7bbe8 100644 --- a/src/sage/rings/fraction_field.py +++ b/src/sage/rings/fraction_field.py @@ -81,6 +81,7 @@ from sage.rings.integer_ring import ZZ from sage.structure.richcmp import richcmp from sage.structure.parent import Parent +from sage.structure.element import parent from sage.structure.coerce import py_scalar_to_element from sage.structure.coerce_maps import CallableConvertMap, DefaultConvertMap_unique from sage.categories.basic import QuotientFields, Rings @@ -608,8 +609,21 @@ def _element_constructor_(self, x, y=None, coerce=True): sage: S. = ZZ[] sage: S.fraction_field()(s/(s+1), (t-1)/(t+2)) (s^2 + 2*s)/(s^2 - 1) + + Check that :trac:`29713` is fixed:: + + sage: F = FractionField(QQ['a']) + sage: a = F.gen() + sage: R = PolynomialRing(F, 'x') + sage: FF = FractionField(R) + sage: elt = F(-1/2/(a^2+a)) + sage: x = FF(elt) + sage: F(x) + -1/2/(a^2 + a) """ if y is None: + if parent(x) is self: + return x ring_one = self.ring().one() try: return self._element_class(self, x, ring_one, coerce=coerce) @@ -618,6 +632,9 @@ def _element_constructor_(self, x, y=None, coerce=True): y = self._element_class(self, ring_one, ring_one, coerce=False, reduce=False) else: + if parent(x) is self: + y = self(y) + x, y = x.numerator() * y.denominator(), y.numerator() * x.denominator() try: return self._element_class(self, x, y, coerce=coerce) except (TypeError, ValueError): @@ -660,12 +677,12 @@ def resolve_fractions(x, y): except (AttributeError, TypeError, ValueError): pass try: - P = yd.parent() + P = parent(yd) return (P(xn) * yd, yn * P(xd)) except (AttributeError, TypeError, ValueError): pass try: - P = xd.parent() + P = parent(xd) return (xn * P(yd), P(yn) * xd) except (AttributeError, TypeError, ValueError): pass @@ -682,7 +699,11 @@ def resolve_fractions(x, y): return self._element_class(self, x, y, coerce=coerce) except TypeError: if not x != x0: - raise + # Make one last attempt to convert x into ``self`` + x = self(x) + y *= x.denominator() + x = x.numerator() + return self._element_class(self, x, y, coerce=coerce) def construction(self): """ From a284512f6348e8141d8f395079f7577ec00e4388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Tue, 19 May 2020 13:37:58 +0200 Subject: [PATCH 204/301] spring cleanup for combinat/core.py --- src/sage/combinat/core.py | 130 ++++++++++++++++++++------------- src/sage/combinat/k_tableau.py | 8 +- 2 files changed, 84 insertions(+), 54 deletions(-) diff --git a/src/sage/combinat/core.py b/src/sage/combinat/core.py index a4e8370451a..3e699ee4295 100644 --- a/src/sage/combinat/core.py +++ b/src/sage/combinat/core.py @@ -32,7 +32,6 @@ from sage.combinat.partition import Partitions, Partition from sage.combinat.combinat import CombinatorialElement from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets -from sage.functions.other import floor from sage.combinat.combinatorial_map import combinatorial_map @@ -53,7 +52,7 @@ class Core(CombinatorialElement): @staticmethod def __classcall_private__(cls, part, k): r""" - Implements the shortcut ``Core(part, k)`` to ``Cores(k,l)(part)`` + Implement the shortcut ``Core(part, k)`` to ``Cores(k,l)(part)`` where `l` is the length of the core. TESTS:: @@ -74,7 +73,7 @@ def __classcall_private__(cls, part, k): return part part = Partition(part) if not part.is_core(k): - raise ValueError("%s is not a %s-core"%(part, k)) + raise ValueError("%s is not a %s-core" % (part, k)) l = sum(part.k_boundary(k).row_lengths()) return Cores(k, l)(part) @@ -100,11 +99,13 @@ def __init__(self, parent, core): k = parent.k part = Partition(core) if not part.is_core(k): - raise ValueError("%s is not a %s-core"%(part, k)) + raise ValueError("%s is not a %s-core" % (part, k)) CombinatorialElement.__init__(self, parent, core) def __eq__(self, other): """ + Test for equality. + EXAMPLES:: sage: c = Core([4,2,1,1],5) @@ -118,14 +119,33 @@ def __eq__(self, other): False """ if isinstance(other, Core): - return self._list == other._list and self.parent().k == other.parent().k - else: - return False + return (self._list == other._list and + self.parent().k == other.parent().k) + return False + + def __ne__(self, other): + """ + Test for un-equality. + + EXAMPLES:: + + sage: c = Core([4,2,1,1],5) + sage: d = Core([4,2,1,1],5) + sage: e = Core([4,2,1,1],6) + sage: c != [4,2,1,1] + True + sage: c != d + False + sage: c != e + True + """ + return not (self == other) def __hash__(self): """ - Computes the hash of ``self`` by computing the hash of the + Compute the hash of ``self`` by computing the hash of the underlying list and of the additional parameter. + The hash is cached and stored in ``self._hash``. EXAMPLES:: @@ -170,7 +190,7 @@ def _latex_(self): def k(self): r""" - Returns `k` of the `k`-core ``self``. + Return `k` of the `k`-core ``self``. EXAMPLES:: @@ -183,7 +203,7 @@ def k(self): @combinatorial_map(name="to partition") def to_partition(self): r""" - Turns the core ``self`` into the partition identical to ``self``. + Turn the core ``self`` into the partition identical to ``self``. EXAMPLES:: @@ -198,7 +218,7 @@ def to_bounded_partition(self): r""" Bijection between `k`-cores and `(k-1)`-bounded partitions. - Maps the `k`-core ``self`` to the corresponding `(k-1)`-bounded partition. + This maps the `k`-core ``self`` to the corresponding `(k-1)`-bounded partition. This bijection is achieved by deleting all cells in ``self`` of hook length greater than `k`. @@ -213,7 +233,7 @@ def to_bounded_partition(self): def size(self): r""" - Returns the size of ``self`` as a partition. + Return the size of ``self`` as a partition. EXAMPLES:: @@ -226,7 +246,7 @@ def size(self): def length(self): r""" - Returns the length of ``self``. + Return the length of ``self``. The length of a `k`-core is the size of the corresponding `(k-1)`-bounded partition which agrees with the length of the corresponding Grassmannian element, @@ -270,11 +290,12 @@ def to_grassmannian(self): [0 1 0] [0 0 1] """ - return self.to_bounded_partition().from_kbounded_to_grassmannian(self.k()-1) + bp = self.to_bounded_partition() + return bp.from_kbounded_to_grassmannian(self.k() - 1) def affine_symmetric_group_simple_action(self, i): r""" - Returns the action of the simple transposition `s_i` of the affine symmetric group on ``self``. + Return the action of the simple transposition `s_i` of the affine symmetric group on ``self``. This gives the action of the affine symmetric group of type `A_k^{(1)}` on the `k`-core ``self``. If ``self`` has outside (resp. inside) corners of content `i` modulo `k`, then @@ -304,11 +325,13 @@ def affine_symmetric_group_simple_action(self, i): """ mu = self.to_partition() corners = mu.outside_corners() - corners = [ p for p in corners if mu.content(p[0],p[1])%self.k()==i ] - if corners == []: + corners = [p for p in corners + if mu.content(p[0], p[1]) % self.k() == i] + if not corners: corners = mu.corners() - corners = [ p for p in corners if mu.content(p[0],p[1])%self.k()==i ] - if corners == []: + corners = [p for p in corners + if mu.content(p[0], p[1]) % self.k() == i] + if not corners: return self for p in corners: mu = mu.remove_cell(p[0]) @@ -317,7 +340,7 @@ def affine_symmetric_group_simple_action(self, i): mu = mu.add_cell(p[0]) return Core(mu, self.k()) - def affine_symmetric_group_action(self, w, transposition = False): + def affine_symmetric_group_action(self, w, transposition=False): r""" Return the (left) action of the affine symmetric group on ``self``. @@ -384,13 +407,15 @@ def _transposition_to_reduced_word(self, t): [1, 2, 0, 1, 2, 0, 2, 1, 0, 2, 1] """ k = self.k() - if (t[0]-t[1])%k == 0: + if (t[0] - t[1]) % k == 0: raise ValueError("t_0 and t_1 cannot be equal mod k") if t[0] > t[1]: - return self._transposition_to_reduced_word([t[1],t[0]]) + return self._transposition_to_reduced_word([t[1], t[0]]) else: - return [i%k for i in range(t[0],t[1]-floor((t[1]-t[0])/k))] + [(t[1]-floor((t[1]-t[0])/k)-2-i)%(k) for i in - range(t[1]-floor((t[1]-t[0])/k)-t[0]-1)] + resu = [i % k for i in range(t[0], t[1] - (t[1] - t[0]) // k)] + resu += [(t[1] - (t[1] - t[0]) // k - 2 - i) % k + for i in range(t[1] - (t[1] - t[0]) // k - t[0] - 1)] + return resu def weak_le(self, other): r""" @@ -402,7 +427,7 @@ def weak_le(self, other): OUTPUT: a boolean - Returns whether ``self`` <= ``other`` in weak order. + This returns whether ``self`` <= ``other`` in weak order. EXAMPLES:: @@ -434,7 +459,7 @@ def weak_le(self, other): def weak_covers(self): r""" - Returns a list of all elements that cover ``self`` in weak order. + Return a list of all elements that cover ``self`` in weak order. EXAMPLES:: @@ -448,8 +473,8 @@ def weak_covers(self): """ w = self.to_grassmannian() S = w.upper_covers(side='left') - S = [x for x in S if x.is_affine_grassmannian()] - return [ x.affine_grassmannian_to_core() for x in set(S) ] + S = (x for x in S if x.is_affine_grassmannian()) + return [x.affine_grassmannian_to_core() for x in set(S)] def strong_le(self, other): r""" @@ -461,7 +486,7 @@ def strong_le(self, other): OUTPUT: a boolean - Returns whether ``self`` <= ``other`` in Bruhat (or strong) order. + This returns whether ``self`` <= ``other`` in Bruhat (or strong) order. EXAMPLES:: @@ -479,7 +504,7 @@ def strong_le(self, other): ValueError: The two cores do not have the same k """ if type(self) is type(other): - if self.k()!=other.k(): + if self.k() != other.k(): raise ValueError("The two cores do not have the same k") else: other = Core(other, self.k()) @@ -495,8 +520,8 @@ def contains(self, other): OUTPUT: a boolean - Returns ``True`` if the Ferrers diagram of ``self`` contains the - Ferrers diagram of other. + This returns ``True`` if the Ferrers diagram of ``self`` contains the + Ferrers diagram of ``other``. EXAMPLES:: @@ -513,7 +538,7 @@ def contains(self, other): def strong_covers(self): r""" - Returns a list of all elements that cover ``self`` in strong order. + Return a list of all elements that cover ``self`` in strong order. EXAMPLES:: @@ -524,12 +549,12 @@ def strong_covers(self): sage: c.strong_covers() [[5, 3, 1], [4, 2, 1, 1]] """ - S = Cores(self.k(), length=self.length()+1) - return [ ga for ga in S if ga.contains(self) ] + S = Cores(self.k(), length=self.length() + 1) + return [ga for ga in S if ga.contains(self)] def strong_down_list(self): r""" - Returns a list of all elements that are covered by ``self`` in strong order. + Return a list of all elements that are covered by ``self`` in strong order. EXAMPLES:: @@ -540,11 +565,13 @@ def strong_down_list(self): sage: c.strong_down_list() [[4, 2], [3, 1, 1]] """ - if self==[]: + if not self: return [] - return [ga for ga in Cores(self.k(), length=self.length()-1) if self.contains(ga)] + return [ga for ga in Cores(self.k(), length=self.length() - 1) + if self.contains(ga)] + -def Cores(k, length = None, **kwargs): +def Cores(k, length=None, **kwargs): r""" A `k`-core is a partition from which no rim hook of size `k` can be removed. Alternatively, a `k`-core is an integer partition such that the Ferrers @@ -586,12 +613,13 @@ def Cores(k, length = None, **kwargs): [4, 1, 1] """ if length is None and 'size' in kwargs: - return Cores_size(k,kwargs['size']) + return Cores_size(k, kwargs['size']) elif length is not None: - return Cores_length(k,length) + return Cores_length(k, length) else: raise ValueError("You need to either specify the length or size of the cores considered!") + class Cores_length(UniqueRepresentation, Parent): r""" The class of `k`-cores of length `n`. @@ -607,7 +635,7 @@ def __init__(self, k, n): """ self.k = k self.n = n - Parent.__init__(self, category = FiniteEnumeratedSets()) + Parent.__init__(self, category=FiniteEnumeratedSets()) def _repr_(self): """ @@ -616,11 +644,11 @@ def _repr_(self): sage: repr(Cores(4, 3)) #indirect doctest '4-Cores of length 3' """ - return "%s-Cores of length %s"%(self.k,self.n) + return "%s-Cores of length %s" % (self.k, self.n) def list(self): r""" - Returns the list of all `k`-cores of length `n`. + Return the list of all `k`-cores of length `n`. EXAMPLES:: @@ -628,7 +656,8 @@ def list(self): sage: C.list() [[4, 2], [3, 1, 1], [2, 2, 1, 1]] """ - return [la.to_core(self.k-1) for la in Partitions(self.n, max_part=self.k-1)] + return [la.to_core(self.k - 1) + for la in Partitions(self.n, max_part=self.k - 1)] def from_partition(self, part): r""" @@ -671,7 +700,7 @@ def __init__(self, k, n): """ self.k = k self.n = n - Parent.__init__(self, category = FiniteEnumeratedSets()) + Parent.__init__(self, category=FiniteEnumeratedSets()) def _repr_(self): """ @@ -680,11 +709,11 @@ def _repr_(self): sage: repr(Cores(4, size = 3)) #indirect doctest '4-Cores of size 3' """ - return "%s-Cores of size %s"%(self.k,self.n) + return "%s-Cores of size %s" % (self.k, self.n) def list(self): r""" - Returns the list of all `k`-cores of size `n`. + Return the list of all `k`-cores of size `n`. EXAMPLES:: @@ -692,11 +721,12 @@ def list(self): sage: C.list() [[3, 1], [2, 1, 1]] """ - return [ Core(x, self.k) for x in Partitions(self.n) if x.is_core(self.k) ] + return [Core(x, self.k) for x in Partitions(self.n) + if x.is_core(self.k)] def from_partition(self, part): r""" - Converts the partition ``part`` into a core (as the identity map). + Convert the partition ``part`` into a core (as the identity map). This is the inverse method to :meth:`to_partition`. diff --git a/src/sage/combinat/k_tableau.py b/src/sage/combinat/k_tableau.py index 8770fb9c464..ac6cd85bd84 100644 --- a/src/sage/combinat/k_tableau.py +++ b/src/sage/combinat/k_tableau.py @@ -1277,7 +1277,7 @@ def __init__(self, k, shape, weight): sage: TestSuite(T).run() """ self.k = k - self._skew = shape[1]!=[] + self._skew = bool(shape[1]) self._outer_shape = shape[0] self._inner_shape = shape[1] self._shape = (self._outer_shape, self._inner_shape) @@ -1743,7 +1743,7 @@ def __init__(self, k, shape, weight): sage: TestSuite(T).run() """ self.k = k - self._skew = shape[1]!=[] + self._skew = bool(shape[1]) self._outer_shape = Partition(shape[0]) self._inner_shape = Partition(shape[1]) self._shape = (self._outer_shape, self._inner_shape) @@ -2164,7 +2164,7 @@ def __init__(self, k, shape, weight): sage: TestSuite(T).run() # long time """ self.k = k - self._skew = shape[1]!=[] + self._skew = bool(shape[1]) self._outer_shape = Core(shape[0], k+1) self._inner_shape = Core(shape[1], k+1) self._shape = (self._outer_shape, self._inner_shape) @@ -4056,7 +4056,7 @@ def shape(self): sage: StrongTableaux( 4, [[2,1], [1]] ).shape() ([2, 1], [1]) """ - if self._inner_shape != []: + if bool(self._inner_shape): return (self._outer_shape, self._inner_shape) return self._outer_shape From 08c4b577de5697e8188d68e0c31cf853d92a4a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Thu, 21 May 2020 10:32:52 +0200 Subject: [PATCH 205/301] fix detail --- src/sage/combinat/k_tableau.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/combinat/k_tableau.py b/src/sage/combinat/k_tableau.py index ac6cd85bd84..fd90898eaab 100644 --- a/src/sage/combinat/k_tableau.py +++ b/src/sage/combinat/k_tableau.py @@ -4056,7 +4056,7 @@ def shape(self): sage: StrongTableaux( 4, [[2,1], [1]] ).shape() ([2, 1], [1]) """ - if bool(self._inner_shape): + if self._inner_shape: return (self._outer_shape, self._inner_shape) return self._outer_shape From 99eaaabbe8bcf5c53783c8a00d84b35685271c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Thu, 21 May 2020 19:05:33 +0200 Subject: [PATCH 206/301] some care for Coxeter and Reflection groups (with optional gap3) --- .../finite_complex_reflection_groups.py | 16 +++++++++++++- .../root_system/reflection_group_complex.py | 22 +++++++++---------- .../root_system/reflection_group_element.pyx | 8 +++---- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/sage/categories/finite_complex_reflection_groups.py b/src/sage/categories/finite_complex_reflection_groups.py index 60fbb8d97be..82f3800aa62 100644 --- a/src/sage/categories/finite_complex_reflection_groups.py +++ b/src/sage/categories/finite_complex_reflection_groups.py @@ -860,6 +860,8 @@ def noncrossing_partition_lattice(self, c=None, L=None, L = list(self.absolute_order_ideal(gens=c, in_unitary_group=in_unitary_group, return_lengths=True)) + else: + L = [(pi, pi.reflection_length()) for pi in L] rels = [] ref_lens = {pi:l for (pi, l) in L} for (pi, l) in L: @@ -980,8 +982,20 @@ def absolute_poset(self, in_unitary_group=False): Irreducible complex reflection group of rank 2 and type ST4 sage: W.absolute_poset() # optional - gap3 Finite poset containing 24 elements + + TESTS:: + + sage: W1 = CoxeterGroup(['A',2]) + sage: W2 = WeylGroup(['A',2]) + sage: W3 = SymmetricGroup(3) + sage: W1.absolute_poset() + Finite poset containing 6 elements + sage: W2.absolute_poset() + Finite poset containing 6 elements + sage: W3.absolute_poset() + Finite poset containing 6 elements """ - return self.noncrossing_partition_lattice(L=self, in_unitary_group=in_unitary_group) + return self.noncrossing_partition_lattice(L=tuple(self), in_unitary_group=in_unitary_group) class WellGenerated(CategoryWithAxiom): diff --git a/src/sage/combinat/root_system/reflection_group_complex.py b/src/sage/combinat/root_system/reflection_group_complex.py index 0567f8bf304..82d6f83744e 100644 --- a/src/sage/combinat/root_system/reflection_group_complex.py +++ b/src/sage/combinat/root_system/reflection_group_complex.py @@ -216,10 +216,9 @@ from sage.modules.free_module_element import vector from sage.combinat.root_system.cartan_matrix import CartanMatrix from sage.rings.universal_cyclotomic_field import UniversalCyclotomicField - - from sage.misc.sage_eval import sage_eval + class ComplexReflectionGroup(UniqueRepresentation, PermutationGroup_generic): """ A complex reflection group given as a permutation group. @@ -478,7 +477,7 @@ def distinguished_reflections(self): sage: W = ReflectionGroup((1,1,3),hyperplane_index_set=['a','b','c']) # optional - gap3 sage: W.distinguished_reflections() # optional - gap3 - Finite family {'a': (1,4)(2,3)(5,6), 'c': (1,5)(2,4)(3,6), 'b': (1,3)(2,5)(4,6)} + Finite family {'a': (1,4)(2,3)(5,6), 'b': (1,3)(2,5)(4,6), 'c': (1,5)(2,4)(3,6)} sage: W = ReflectionGroup((3,1,1)) # optional - gap3 sage: W.distinguished_reflections() # optional - gap3 @@ -675,7 +674,7 @@ def reflections(self): sage: W = ReflectionGroup((1,1,3),reflection_index_set=['a','b','c']) # optional - gap3 sage: W.reflections() # optional - gap3 - Finite family {'a': (1,4)(2,3)(5,6), 'c': (1,5)(2,4)(3,6), 'b': (1,3)(2,5)(4,6)} + Finite family {'a': (1,4)(2,3)(5,6), 'b': (1,3)(2,5)(4,6), 'c': (1,5)(2,4)(3,6)} sage: W = ReflectionGroup((3,1,1)) # optional - gap3 sage: W.reflections() # optional - gap3 @@ -967,9 +966,8 @@ def conjugacy_classes_representatives(self): [1, 2, 1, 2, 1, 3, 2, 1, 2, 1, 3, 2, 1, 2, 3]] """ # This can be converted to usual GAP - S = str(gap3('List(ConjugacyClasses(%s),Representative)'%self._gap_group._name)) - exec('_conjugacy_classes_representatives=' + _gap_return(S)) - return _conjugacy_classes_representatives + S = str(gap3('List(ConjugacyClasses(%s),Representative)' % self._gap_group._name)) + return sage_eval(_gap_return(S), {'self': self}) def conjugacy_classes(self): r""" @@ -1318,7 +1316,7 @@ def independent_roots(self): basis = {} for ind in self._index_set: vec = Delta[ind] - if Matrix(basis.values()+[vec]).rank() == len(basis) + 1: + if Matrix(list(basis.values()) + [vec]).rank() == len(basis) + 1: basis[ind] = vec return Family(basis) @@ -1367,7 +1365,7 @@ def roots(self): (0, 0, 0, -E(3), E(3)^2), (0, 0, 0, E(3)^2, -E(3)^2), (0, 0, 0, -E(3)^2, E(3)^2)] """ - roots = [vector(sage_eval(str(root).replace("^","**"))) + roots = [vector(sage_eval(str(root).replace("^", "**"))) for root in self._gap_group.roots] for v in roots: v.set_immutable() @@ -1382,15 +1380,15 @@ def braid_relations(self): sage: W = ReflectionGroup((1,1,3)) # optional - gap3 sage: W.braid_relations() # optional - gap3 - [[[2, 1, 2], [1, 2, 1]]] + [[[1, 2, 1], [2, 1, 2]]] sage: W = ReflectionGroup((2,1,3)) # optional - gap3 sage: W.braid_relations() # optional - gap3 - [[[2, 1, 2, 1], [1, 2, 1, 2]], [[3, 1], [1, 3]], [[3, 2, 3], [2, 3, 2]]] + [[[1, 2, 1, 2], [2, 1, 2, 1]], [[1, 3], [3, 1]], [[2, 3, 2], [3, 2, 3]]] sage: W = ReflectionGroup((2,2,3)) # optional - gap3 sage: W.braid_relations() # optional - gap3 - [[[2, 1, 2], [1, 2, 1]], [[3, 1], [1, 3]], [[3, 2, 3], [2, 3, 2]]] + [[[1, 2, 1], [2, 1, 2]], [[1, 3], [3, 1]], [[2, 3, 2], [3, 2, 3]]] """ if self.is_real(): return super(ComplexReflectionGroup,self).braid_relations() diff --git a/src/sage/combinat/root_system/reflection_group_element.pyx b/src/sage/combinat/root_system/reflection_group_element.pyx index ed552674922..fc7977e0335 100644 --- a/src/sage/combinat/root_system/reflection_group_element.pyx +++ b/src/sage/combinat/root_system/reflection_group_element.pyx @@ -423,7 +423,8 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): (1,2,6)(3,4,5) True (1,5)(2,4)(3,6) True """ - return PermutationGroupElement(self) + W = self._parent + return PermutationGroupElement(self, W) #@cached_in_parent_method def fix_space(self): @@ -465,8 +466,8 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): Basis matrix: [ 1 -1] - sage: W = ReflectionGroup(23) # optional - gap3 - sage: W.an_element().fix_space() # optional - gap3 + sage: W = ReflectionGroup(23) # optional - gap3 + sage: W.gen(0).fix_space() # optional - gap3 Vector space of degree 3 and dimension 2 over Universal Cyclotomic Field Basis matrix: [0 1 0] @@ -1175,4 +1176,3 @@ def _gap_return(S, coerce_obj='self'): S = S.replace(' ','').replace('\n','') S = S.replace(',(','\',check=False),%s(\'('%coerce_obj).replace('[','[%s(\''%coerce_obj).replace(']','\',check=False)]') return S - From bb7e259951c508c3279ee02756e12914a911b7fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Bissey?= Date: Fri, 22 May 2020 11:03:46 +1200 Subject: [PATCH 207/301] Add matplotlib upstream patch to deal with memory leaks on OS X. The patch should probably removed in the next matplotlib upgrade. --- build/pkgs/matplotlib/patches/15104.patch | 689 ++++++++++++++++++++++ 1 file changed, 689 insertions(+) create mode 100644 build/pkgs/matplotlib/patches/15104.patch diff --git a/build/pkgs/matplotlib/patches/15104.patch b/build/pkgs/matplotlib/patches/15104.patch new file mode 100644 index 00000000000..d9c08172c98 --- /dev/null +++ b/build/pkgs/matplotlib/patches/15104.patch @@ -0,0 +1,689 @@ +From 97477d7214b400f5b2b69f2cf5ffb0784cf8237d Mon Sep 17 00:00:00 2001 +From: Antony Lee +Date: Wed, 21 Aug 2019 17:51:16 +0200 +Subject: [PATCH 1/3] Simplify file handling in ft2font. + +Just call the Python-level seek(), read() and close() instead of trying +to play with C-level FILE*. + +Note that unlike the png case, we can't just pass restrict ourselves to +passing in file-like objects because FT2Font is public API. +--- + src/file_compat.h | 220 ---------------------------------------- + src/ft2font_wrapper.cpp | 141 +++++++++---------------- + 2 files changed, 49 insertions(+), 312 deletions(-) + delete mode 100644 src/file_compat.h + +diff --git a/src/file_compat.h b/src/file_compat.h +deleted file mode 100644 +index 4115d23e63f..00000000000 +--- a/src/file_compat.h ++++ /dev/null +@@ -1,220 +0,0 @@ +-#ifndef MPL_FILE_COMPAT_H +-#define MPL_FILE_COMPAT_H +-#define PY_SSIZE_T_CLEAN +-#include +-#include +-#include "numpy/npy_common.h" +-#include "numpy/ndarrayobject.h" +-#include "mplutils.h" +- +-#ifdef __cplusplus +-extern "C" { +-#endif +-#if defined(_MSC_VER) && defined(_WIN64) && (_MSC_VER > 1400) +- #include +- #define mpl_fseek _fseeki64 +- #define mpl_ftell _ftelli64 +- #define mpl_lseek _lseeki64 +- #define mpl_off_t npy_int64 +- +- #if NPY_SIZEOF_INT == 8 +- #define MPL_OFF_T_PYFMT "i" +- #elif NPY_SIZEOF_LONG == 8 +- #define MPL_OFF_T_PYFMT "l" +- #elif NPY_SIZEOF_LONGLONG == 8 +- #define MPL_OFF_T_PYFMT "L" +- #else +- #error Unsupported size for type off_t +- #endif +-#else +- #define mpl_fseek fseek +- #define mpl_ftell ftell +- #define mpl_lseek lseek +- #define mpl_off_t off_t +- +- #if NPY_SIZEOF_INT == NPY_SIZEOF_SHORT +- #define MPL_OFF_T_PYFMT "h" +- #elif NPY_SIZEOF_INT == NPY_SIZEOF_INT +- #define MPL_OFF_T_PYFMT "i" +- #elif NPY_SIZEOF_INT == NPY_SIZEOF_LONG +- #define MPL_OFF_T_PYFMT "l" +- #elif NPY_SIZEOF_INT == NPY_SIZEOF_LONGLONG +- #define MPL_OFF_T_PYFMT "L" +- #else +- #error Unsupported size for type off_t +- #endif +-#endif +- +-/* +- * PyFile_* compatibility +- */ +- +-/* +- * Get a FILE* handle to the file represented by the Python object +- */ +-static NPY_INLINE FILE *mpl_PyFile_Dup(PyObject *file, char *mode, mpl_off_t *orig_pos) +-{ +- int fd, fd2; +- PyObject *ret, *os; +- mpl_off_t pos; +- FILE *handle; +- +- if (mode[0] != 'r') { +- /* Flush first to ensure things end up in the file in the correct order */ +- ret = PyObject_CallMethod(file, (char *)"flush", (char *)""); +- if (ret == NULL) { +- return NULL; +- } +- Py_DECREF(ret); +- } +- +- fd = PyObject_AsFileDescriptor(file); +- if (fd == -1) { +- return NULL; +- } +- +- /* The handle needs to be dup'd because we have to call fclose +- at the end */ +- os = PyImport_ImportModule("os"); +- if (os == NULL) { +- return NULL; +- } +- ret = PyObject_CallMethod(os, (char *)"dup", (char *)"i", fd); +- Py_DECREF(os); +- if (ret == NULL) { +- return NULL; +- } +- fd2 = (int)PyNumber_AsSsize_t(ret, NULL); +- Py_DECREF(ret); +- +-/* Convert to FILE* handle */ +-#ifdef _WIN32 +- handle = _fdopen(fd2, mode); +-#else +- handle = fdopen(fd2, mode); +-#endif +- if (handle == NULL) { +- PyErr_SetString(PyExc_IOError, "Getting a FILE* from a Python file object failed"); +- return NULL; +- } +- +- /* Record the original raw file handle position */ +- *orig_pos = mpl_ftell(handle); +- if (*orig_pos == -1) { +- // handle is a stream, so we don't have to worry about this +- return handle; +- } +- +- /* Seek raw handle to the Python-side position */ +- ret = PyObject_CallMethod(file, (char *)"tell", (char *)""); +- if (ret == NULL) { +- fclose(handle); +- return NULL; +- } +- pos = PyNumber_AsSsize_t(ret, PyExc_OverflowError); +- Py_DECREF(ret); +- if (PyErr_Occurred()) { +- fclose(handle); +- return NULL; +- } +- if (mpl_fseek(handle, pos, SEEK_SET) == -1) { +- PyErr_SetString(PyExc_IOError, "seeking file failed"); +- return NULL; +- } +- return handle; +-} +- +-/* +- * Close the dup-ed file handle, and seek the Python one to the current position +- */ +-static NPY_INLINE int mpl_PyFile_DupClose(PyObject *file, FILE *handle, mpl_off_t orig_pos) +-{ +- PyObject *exc_type = NULL, *exc_value = NULL, *exc_tb = NULL; +- PyErr_Fetch(&exc_type, &exc_value, &exc_tb); +- +- int fd; +- PyObject *ret; +- mpl_off_t position; +- +- position = mpl_ftell(handle); +- +- /* Close the FILE* handle */ +- fclose(handle); +- +- /* Restore original file handle position, in order to not confuse +- Python-side data structures. Note that this would fail if an exception +- is currently set, which can happen as this function is called in cleanup +- code, so we need to carefully fetch and restore the exception state. */ +- fd = PyObject_AsFileDescriptor(file); +- if (fd == -1) { +- goto fail; +- } +- if (mpl_lseek(fd, orig_pos, SEEK_SET) != -1) { +- if (position == -1) { +- PyErr_SetString(PyExc_IOError, "obtaining file position failed"); +- goto fail; +- } +- +- /* Seek Python-side handle to the FILE* handle position */ +- ret = PyObject_CallMethod(file, (char *)"seek", (char *)(MPL_OFF_T_PYFMT "i"), position, 0); +- if (ret == NULL) { +- goto fail; +- } +- Py_DECREF(ret); +- } +- PyErr_Restore(exc_type, exc_value, exc_tb); +- return 0; +-fail: +- Py_XDECREF(exc_type); +- Py_XDECREF(exc_value); +- Py_XDECREF(exc_tb); +- return -1; +-} +- +-static NPY_INLINE int mpl_PyFile_Check(PyObject *file) +-{ +- int fd; +- fd = PyObject_AsFileDescriptor(file); +- if (fd == -1) { +- PyErr_Clear(); +- return 0; +- } +- return 1; +-} +- +-static NPY_INLINE PyObject *mpl_PyFile_OpenFile(PyObject *filename, const char *mode) +-{ +- PyObject *open; +- open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); +- if (open == NULL) { +- return NULL; +- } +- return PyObject_CallFunction(open, (char *)"Os", filename, mode); +-} +- +-static NPY_INLINE int mpl_PyFile_CloseFile(PyObject *file) +-{ +- PyObject *type, *value, *tb; +- PyErr_Fetch(&type, &value, &tb); +- +- PyObject *ret; +- +- ret = PyObject_CallMethod(file, (char *)"close", NULL); +- if (ret == NULL) { +- goto fail; +- } +- Py_DECREF(ret); +- PyErr_Restore(type, value, tb); +- return 0; +-fail: +- Py_XDECREF(type); +- Py_XDECREF(value); +- Py_XDECREF(tb); +- return -1; +-} +- +-#ifdef __cplusplus +-} +-#endif +- +-#endif /* ifndef MPL_FILE_COMPAT_H */ +diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp +index e4a12d9eee2..0f5b1edcbb0 100644 +--- a/src/ft2font_wrapper.cpp ++++ b/src/ft2font_wrapper.cpp +@@ -1,6 +1,5 @@ + #include "mplutils.h" + #include "ft2font.h" +-#include "file_compat.h" + #include "py_converters.h" + #include "py_exceptions.h" + #include "numpy_cpp.h" +@@ -365,12 +364,8 @@ typedef struct + FT2Font *x; + PyObject *fname; + PyObject *py_file; +- FILE *fp; + int close_file; +- mpl_off_t offset; + FT_StreamRec stream; +- FT_Byte *mem; +- size_t mem_size; + Py_ssize_t shape[2]; + Py_ssize_t strides[2]; + Py_ssize_t suboffsets[2]; +@@ -381,115 +376,84 @@ static unsigned long read_from_file_callback(FT_Stream stream, + unsigned char *buffer, + unsigned long count) + { +- +- PyFT2Font *def = (PyFT2Font *)stream->descriptor.pointer; +- +- if (fseek(def->fp, offset, SEEK_SET) == -1) { +- return 0; ++ PyObject *py_file = ((PyFT2Font *)stream->descriptor.pointer)->py_file; ++ PyObject *seek_result = NULL, *read_result = NULL; ++ Py_ssize_t n_read = 0; ++ if (!(seek_result = PyObject_CallMethod(py_file, "seek", "k", offset)) ++ || !(read_result = PyObject_CallMethod(py_file, "read", "k", count))) { ++ goto exit; + } +- +- if (count > 0) { +- return fread(buffer, 1, count, def->fp); ++ char *tmpbuf; ++ if (PyBytes_AsStringAndSize(read_result, &tmpbuf, &n_read) == -1) { ++ goto exit; + } +- +- return 0; ++ memcpy(buffer, tmpbuf, n_read); ++exit: ++ Py_XDECREF(seek_result); ++ Py_XDECREF(read_result); ++ if (PyErr_Occurred()) { ++ PyErr_WriteUnraisable(py_file); ++ if (!count) { ++ return 1; // Non-zero signals error, when count == 0. ++ } ++ } ++ return n_read; + } + + static void close_file_callback(FT_Stream stream) + { +- PyFT2Font *def = (PyFT2Font *)stream->descriptor.pointer; +- +- if (mpl_PyFile_DupClose(def->py_file, def->fp, def->offset)) { +- throw std::runtime_error("Couldn't close file"); ++ PyObject *py_file = ((PyFT2Font *)stream->descriptor.pointer)->py_file; ++ PyObject *close_result = NULL; ++ if (!(close_result = PyObject_CallMethod(py_file, "close", ""))) { ++ goto exit; + } +- +- if (def->close_file) { +- mpl_PyFile_CloseFile(def->py_file); ++exit: ++ Py_XDECREF(close_result); ++ Py_DECREF(py_file); ++ if (PyErr_Occurred()) { ++ PyErr_WriteUnraisable(py_file); + } +- +- Py_DECREF(def->py_file); +- def->py_file = NULL; + } + + static int convert_open_args(PyFT2Font *self, PyObject *py_file_arg, FT_Open_Args *open_args) + { +- PyObject *py_file = NULL; +- int close_file = 0; +- FILE *fp; ++ PyObject *open = NULL; + PyObject *data = NULL; +- char *data_ptr; +- Py_ssize_t data_len; +- long file_size; +- FT_Byte *new_memory; +- mpl_off_t offset = 0; + + int result = 0; + + memset((void *)open_args, 0, sizeof(FT_Open_Args)); + + if (PyBytes_Check(py_file_arg) || PyUnicode_Check(py_file_arg)) { +- if ((py_file = mpl_PyFile_OpenFile(py_file_arg, (char *)"rb")) == NULL) { ++ if (!(open = PyDict_GetItemString(PyEval_GetBuiltins(), "open")) // Borrowed reference. ++ || !(self->py_file = PyObject_CallFunction(open, "Os", py_file_arg, "rb"))) { + goto exit; + } +- close_file = 1; ++ self->close_file = 1; ++ } else if (!PyObject_HasAttrString(py_file_arg, "read") ++ || !(data = PyObject_CallMethod(py_file_arg, "read", "i", 0)) ++ || !PyBytes_Check(data)) { ++ PyErr_SetString(PyExc_TypeError, ++ "First argument must be a path or binary-mode file object"); ++ goto exit; + } else { ++ self->py_file = py_file_arg; + Py_INCREF(py_file_arg); +- py_file = py_file_arg; +- } +- +- if ((fp = mpl_PyFile_Dup(py_file, (char *)"rb", &offset))) { +- Py_INCREF(py_file); +- self->py_file = py_file; +- self->close_file = close_file; +- self->fp = fp; +- self->offset = offset; +- fseek(fp, 0, SEEK_END); +- file_size = ftell(fp); +- fseek(fp, 0, SEEK_SET); +- +- self->stream.base = NULL; +- self->stream.size = (unsigned long)file_size; +- self->stream.pos = 0; +- self->stream.descriptor.pointer = self; +- self->stream.read = &read_from_file_callback; +- self->stream.close = &close_file_callback; +- +- open_args->flags = FT_OPEN_STREAM; +- open_args->stream = &self->stream; +- } else { +- if (PyObject_HasAttrString(py_file_arg, "read") && +- (data = PyObject_CallMethod(py_file_arg, (char *)"read", (char *)""))) { +- if (PyBytes_AsStringAndSize(data, &data_ptr, &data_len)) { +- goto exit; +- } +- +- if (self->mem) { +- free(self->mem); +- } +- self->mem = (FT_Byte *)malloc((self->mem_size + data_len) * sizeof(FT_Byte)); +- if (self->mem == NULL) { +- goto exit; +- } +- new_memory = self->mem + self->mem_size; +- self->mem_size += data_len; +- +- memcpy(new_memory, data_ptr, data_len); +- open_args->flags = FT_OPEN_MEMORY; +- open_args->memory_base = new_memory; +- open_args->memory_size = data_len; +- open_args->stream = NULL; +- } else { +- PyErr_SetString(PyExc_TypeError, +- "First argument must be a path or file object reading bytes"); +- goto exit; +- } + } + ++ self->stream.base = NULL; ++ self->stream.size = 0x7fffffff; // Unknown size. ++ self->stream.pos = 0; ++ self->stream.descriptor.pointer = self; ++ self->stream.read = &read_from_file_callback; ++ self->stream.close = &close_file_callback; ++ open_args->flags = FT_OPEN_STREAM; ++ open_args->stream = &self->stream; ++ + result = 1; + + exit: + +- Py_XDECREF(py_file); + Py_XDECREF(data); + + return result; +@@ -504,12 +468,8 @@ static PyObject *PyFT2Font_new(PyTypeObject *type, PyObject *args, PyObject *kwd + self->x = NULL; + self->fname = NULL; + self->py_file = NULL; +- self->fp = NULL; + self->close_file = 0; +- self->offset = 0; + memset(&self->stream, 0, sizeof(FT_StreamRec)); +- self->mem = 0; +- self->mem_size = 0; + return (PyObject *)self; + } + +@@ -542,8 +502,6 @@ const char *PyFT2Font_init__doc__ = + + static void PyFT2Font_fail(PyFT2Font *self) + { +- free(self->mem); +- self->mem = NULL; + Py_XDECREF(self->py_file); + self->py_file = NULL; + } +@@ -580,7 +538,6 @@ static int PyFT2Font_init(PyFT2Font *self, PyObject *args, PyObject *kwds) + static void PyFT2Font_dealloc(PyFT2Font *self) + { + delete self->x; +- free(self->mem); + Py_XDECREF(self->py_file); + Py_XDECREF(self->fname); + Py_TYPE(self)->tp_free((PyObject *)self); + +From 505cbed6a859a3fdf8455da0a339b0d09f7a6f17 Mon Sep 17 00:00:00 2001 +From: Antony Lee +Date: Mon, 11 May 2020 22:27:56 +0200 +Subject: [PATCH 2/3] Handle review comments. + +--- + src/ft2font_wrapper.cpp | 24 +++++++++--------------- + 1 file changed, 9 insertions(+), 15 deletions(-) + +diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp +index 0f5b1edcbb0..3882e03eae5 100644 +--- a/src/ft2font_wrapper.cpp ++++ b/src/ft2font_wrapper.cpp +@@ -364,7 +364,6 @@ typedef struct + FT2Font *x; + PyObject *fname; + PyObject *py_file; +- int close_file; + FT_StreamRec stream; + Py_ssize_t shape[2]; + Py_ssize_t strides[2]; +@@ -402,16 +401,16 @@ static unsigned long read_from_file_callback(FT_Stream stream, + + static void close_file_callback(FT_Stream stream) + { +- PyObject *py_file = ((PyFT2Font *)stream->descriptor.pointer)->py_file; ++ PyFT2Font *self = (PyFT2Font *)stream->descriptor.pointer; + PyObject *close_result = NULL; +- if (!(close_result = PyObject_CallMethod(py_file, "close", ""))) { ++ if (!(close_result = PyObject_CallMethod(self->py_file, "close", ""))) { + goto exit; + } + exit: + Py_XDECREF(close_result); +- Py_DECREF(py_file); ++ Py_CLEAR(self->py_file); + if (PyErr_Occurred()) { +- PyErr_WriteUnraisable(py_file); ++ PyErr_WriteUnraisable((PyObject*)self); + } + } + +@@ -421,6 +420,7 @@ static int convert_open_args(PyFT2Font *self, PyObject *py_file_arg, FT_Open_Arg + PyObject *data = NULL; + + int result = 0; ++ bool close_file = false; + + memset((void *)open_args, 0, sizeof(FT_Open_Args)); + +@@ -429,7 +429,7 @@ static int convert_open_args(PyFT2Font *self, PyObject *py_file_arg, FT_Open_Arg + || !(self->py_file = PyObject_CallFunction(open, "Os", py_file_arg, "rb"))) { + goto exit; + } +- self->close_file = 1; ++ close_file = true; + } else if (!PyObject_HasAttrString(py_file_arg, "read") + || !(data = PyObject_CallMethod(py_file_arg, "read", "i", 0)) + || !PyBytes_Check(data)) { +@@ -446,7 +446,7 @@ static int convert_open_args(PyFT2Font *self, PyObject *py_file_arg, FT_Open_Arg + self->stream.pos = 0; + self->stream.descriptor.pointer = self; + self->stream.read = &read_from_file_callback; +- self->stream.close = &close_file_callback; ++ self->stream.close = close_file ? &close_file_callback : NULL; + open_args->flags = FT_OPEN_STREAM; + open_args->stream = &self->stream; + +@@ -468,7 +468,6 @@ static PyObject *PyFT2Font_new(PyTypeObject *type, PyObject *args, PyObject *kwd + self->x = NULL; + self->fname = NULL; + self->py_file = NULL; +- self->close_file = 0; + memset(&self->stream, 0, sizeof(FT_StreamRec)); + return (PyObject *)self; + } +@@ -500,12 +499,6 @@ const char *PyFT2Font_init__doc__ = + " underline_thickness vertical thickness of the underline\n" + " postscript_name PostScript name of the font\n"; + +-static void PyFT2Font_fail(PyFT2Font *self) +-{ +- Py_XDECREF(self->py_file); +- self->py_file = NULL; +-} +- + static int PyFT2Font_init(PyFT2Font *self, PyObject *args, PyObject *kwds) + { + PyObject *fname; +@@ -525,7 +518,8 @@ static int PyFT2Font_init(PyFT2Font *self, PyObject *args, PyObject *kwds) + } + + CALL_CPP_FULL( +- "FT2Font", (self->x = new FT2Font(open_args, hinting_factor)), PyFT2Font_fail(self), -1); ++ "FT2Font", (self->x = new FT2Font(open_args, hinting_factor)), ++ Py_CLEAR(self->py_file), -1); + + CALL_CPP_INIT("FT2Font->set_kerning_factor", (self->x->set_kerning_factor(kerning_factor))); + + +From 23d36d9d39a5b41f54346fda66ba0207ffef7c28 Mon Sep 17 00:00:00 2001 +From: Antony Lee +Date: Mon, 11 May 2020 23:35:53 +0200 +Subject: [PATCH 3/3] Inline convert_open_args. + +--- + src/ft2font_wrapper.cpp | 83 ++++++++++++++++------------------------- + 1 file changed, 32 insertions(+), 51 deletions(-) + +diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp +index 3882e03eae5..c5b4cbb5fdf 100644 +--- a/src/ft2font_wrapper.cpp ++++ b/src/ft2font_wrapper.cpp +@@ -414,51 +414,6 @@ static void close_file_callback(FT_Stream stream) + } + } + +-static int convert_open_args(PyFT2Font *self, PyObject *py_file_arg, FT_Open_Args *open_args) +-{ +- PyObject *open = NULL; +- PyObject *data = NULL; +- +- int result = 0; +- bool close_file = false; +- +- memset((void *)open_args, 0, sizeof(FT_Open_Args)); +- +- if (PyBytes_Check(py_file_arg) || PyUnicode_Check(py_file_arg)) { +- if (!(open = PyDict_GetItemString(PyEval_GetBuiltins(), "open")) // Borrowed reference. +- || !(self->py_file = PyObject_CallFunction(open, "Os", py_file_arg, "rb"))) { +- goto exit; +- } +- close_file = true; +- } else if (!PyObject_HasAttrString(py_file_arg, "read") +- || !(data = PyObject_CallMethod(py_file_arg, "read", "i", 0)) +- || !PyBytes_Check(data)) { +- PyErr_SetString(PyExc_TypeError, +- "First argument must be a path or binary-mode file object"); +- goto exit; +- } else { +- self->py_file = py_file_arg; +- Py_INCREF(py_file_arg); +- } +- +- self->stream.base = NULL; +- self->stream.size = 0x7fffffff; // Unknown size. +- self->stream.pos = 0; +- self->stream.descriptor.pointer = self; +- self->stream.read = &read_from_file_callback; +- self->stream.close = close_file ? &close_file_callback : NULL; +- open_args->flags = FT_OPEN_STREAM; +- open_args->stream = &self->stream; +- +- result = 1; +- +-exit: +- +- Py_XDECREF(data); +- +- return result; +-} +- + static PyTypeObject PyFT2FontType; + + static PyObject *PyFT2Font_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +@@ -501,20 +456,43 @@ const char *PyFT2Font_init__doc__ = + + static int PyFT2Font_init(PyFT2Font *self, PyObject *args, PyObject *kwds) + { +- PyObject *fname; ++ PyObject *filename = NULL, *open = NULL, *data = NULL; + FT_Open_Args open_args; + long hinting_factor = 8; + int kerning_factor = 0; + const char *names[] = { "filename", "hinting_factor", "_kerning_factor", NULL }; + + if (!PyArg_ParseTupleAndKeywords( +- args, kwds, "O|l$i:FT2Font", (char **)names, &fname, ++ args, kwds, "O|l$i:FT2Font", (char **)names, &filename, + &hinting_factor, &kerning_factor)) { + return -1; + } + +- if (!convert_open_args(self, fname, &open_args)) { +- return -1; ++ self->stream.base = NULL; ++ self->stream.size = 0x7fffffff; // Unknown size. ++ self->stream.pos = 0; ++ self->stream.descriptor.pointer = self; ++ self->stream.read = &read_from_file_callback; ++ memset((void *)&open_args, 0, sizeof(FT_Open_Args)); ++ open_args.flags = FT_OPEN_STREAM; ++ open_args.stream = &self->stream; ++ ++ if (PyBytes_Check(filename) || PyUnicode_Check(filename)) { ++ if (!(open = PyDict_GetItemString(PyEval_GetBuiltins(), "open")) // Borrowed reference. ++ || !(self->py_file = PyObject_CallFunction(open, "Os", filename, "rb"))) { ++ goto exit; ++ } ++ self->stream.close = &close_file_callback; ++ } else if (!PyObject_HasAttrString(filename, "read") ++ || !(data = PyObject_CallMethod(filename, "read", "i", 0)) ++ || !PyBytes_Check(data)) { ++ PyErr_SetString(PyExc_TypeError, ++ "First argument must be a path or binary-mode file object"); ++ goto exit; ++ } else { ++ self->py_file = filename; ++ self->stream.close = NULL; ++ Py_INCREF(filename); + } + + CALL_CPP_FULL( +@@ -523,8 +501,11 @@ static int PyFT2Font_init(PyFT2Font *self, PyObject *args, PyObject *kwds) + + CALL_CPP_INIT("FT2Font->set_kerning_factor", (self->x->set_kerning_factor(kerning_factor))); + +- Py_INCREF(fname); +- self->fname = fname; ++ Py_INCREF(filename); ++ self->fname = filename; ++ ++exit: ++ Py_XDECREF(data); + + return 0; + } From e1a9413b72a001482f3e7775e053853f3cd75f96 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 14 May 2020 18:42:08 -0700 Subject: [PATCH 208/301] Merge build/make/deps into build/make/Makefile.in --- Makefile | 2 +- build/make/Makefile.in | 291 +++++++++++++++++++++++++++++++++++++++- build/make/deps | 294 ----------------------------------------- configure.ac | 4 - 4 files changed, 291 insertions(+), 300 deletions(-) delete mode 100644 build/make/deps diff --git a/Makefile b/Makefile index 822d1d316ff..f99ccfcdd7e 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ SPKG_COLLECT_FILES = build/pkgs/*/type build/pkgs/*/package-version.txt build/pk # If configure was run before, rerun it with the old arguments. # Otherwise, run configure with argument $PREREQ_OPTIONS. -build/make/Makefile: configure build/make/deps $(SPKG_COLLECT_FILES) $(CONFIG_FILES:%=%.in) +build/make/Makefile: configure $(SPKG_COLLECT_FILES) $(CONFIG_FILES:%=%.in) rm -f config.log mkdir -p logs/pkgs ln -s logs/pkgs/config.log config.log diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 13936ff9923..da88e97fd84 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -140,7 +140,296 @@ $(INST)/.dummy: touch $@ -@SAGE_MAKE_DEPS@ +############################################################################### + +# Silent rules +# https://www.gnu.org/software/automake/manual/html_node/Automake-Silent-Rules.html +ifeq ($(V), 0) +AM_V_at = @ +else +AM_V_at = +endif + +# List of targets that can be run using `sage -i` or `sage -f` +# These should generally have an associated -clean target for `sage -f` to +# work correctly +SAGE_I_TARGETS = sagelib doc + +STARTED = $(SAGE_LOCAL)/etc/sage-started.txt + + +# Tell make not to look for files with these names: +.PHONY: all all-sage all-toolchain all-build all-sageruntime \ + all-start build-start base toolchain toolchain-deps base-toolchain \ + sagelib \ + doc doc-html doc-html-jsmath doc-html-mathjax doc-pdf \ + doc-clean doc-src-clean doc-output-clean \ + clean sagelib-clean build-clean python3_venv _clean-broken-gcc + +ifneq ($(PYTHON_FOR_VENV),) +# Special rule for making the Python virtualenv from the system Python (Python +# 3 only). $(PYTHON) is set in Makefile to python3_venv. +# Thus $(inst_python3_venv) will be the dependency of every Python package. +# +# TODO: If we reconfigure to build our own Python after having used the system +# Python, files installed to create the virtualenv should be *removed*. That +# could either be done here by the makefile, or in an spkg-preinst for python3 +ifeq ($(PYTHON),python3) +PYTHON = python3_venv +endif +inst_python3_venv = $(SAGE_LOCAL)/pyvenv.cfg + +$(inst_python3_venv): + $(PYTHON_FOR_VENV) $(SAGE_ROOT)/build/bin/sage-venv "$(SAGE_LOCAL)" +endif + +# Build everything and start Sage. +# Note that we put the "doc" target first in the rule below because +# the doc build takes the most time and should be started as soon as +# possible. +all-start: toolchain-deps + $(MAKE) doc all-sage + $(MAKE) '$(STARTED)' + +# Build everything except the documentation +all-build: toolchain-deps + $(MAKE) all-sage + + +# The 2 preliminary build phases: base and toolchain. +base-toolchain: _clean-broken-gcc base + $(MAKE) toolchain + +# All targets except for the base packages +all-sage: \ + sagelib \ + $(STANDARD_PACKAGE_INSTS) \ + $(OPTIONAL_INSTALLED_PACKAGE_INSTS) \ + $(OPTIONAL_CLEANED_PACKAGES_CLEANS) \ + $(SCRIPTS) + +# Download all packages which should be inside an sdist tarball (the -B +# option to make forces all targets to be built unconditionally) +download-for-sdist: + env SAGE_INSTALL_FETCH_ONLY=yes $(MAKE) -B SAGERUNTIME= \ + $(SDIST_PACKAGES) + +# TOOLCHAIN consists of dependencies determined by configure. +# These are built after the "base" target but before anything else. +toolchain: $(foreach pkgname,$(TOOLCHAIN),$(inst_$(pkgname))) $(PCFILES) + +# Build all packages that GCC links against serially, otherwise this +# leads to race conditions where some library which is used by GCC gets +# reinstalled. Since system GCCs might use Sage's libraries, we do this +# unconditionally. We still use the dependency checking from $(MAKE), +# so this will not trigger useless rebuilds. +# See #14168 and #14232. +# +# Note: This list consists of only the *runtime* dependencies of the toolchain. +TOOLCHAIN_DEPS = zlib $(MP_LIBRARY) mpfr mpc +TOOLCHAIN_DEP_INSTS = \ + $(foreach pkgname,$(TOOLCHAIN_DEPS),$(inst_$(pkgname))) + +toolchain-deps: + for target in $(TOOLCHAIN_DEP_INSTS); do \ + $(MAKE) $$target; \ + done + +all-toolchain: base-toolchain + $(MAKE) toolchain-deps + +# All packages needed as a prerequisite to install other Python packages with +# pip or which are otherwise used by the Python build tools; these should be +# given as a prerequisite to any pip-installed packages +PYTHON_TOOLCHAIN = setuptools pip setuptools_scm future + +# Everything needed to start up Sage using "./sage". Of course, not +# every part of Sage will work. It does not include Maxima for example. +SAGERUNTIME = sagelib $(SCRIPTS) $(inst_ipython) $(inst_pexpect) \ + $(inst_psutil) $(inst_future) + +all-sageruntime: toolchain-deps + $(MAKE) $(SAGERUNTIME) + + +# Start Sage at least once to check that it works +# (i.e. when we just installed Sage for the first time). +build-start: all-build + $(MAKE) '$(STARTED)' + +# We make this depend on all standard packages because running +# sage-starts runs sage-location, which should be run after installing +# any package. +$(STARTED): $(STANDARD_PACKAGE_INSTS) + $(AM_V_at)"$(SAGE_ROOT)/build/bin/sage-starts" + + +############################################################################### +# Building the base system +# +# This consists of packages which are required for the Sage build system. +############################################################################### +base: $(inst_patch) $(inst_pkgconf) + +############################################################################### +# Building normal packages +############################################################################### + +# List all *build-time* dependencies of the Sage library. These are, +# on the one hand, programs needed for the build/install process of the +# Sage library (e.g. CYTHON, JINJA2), and on the other hand all +# dependencies for Cython files (e.g. PARI, NTL, MP_LIBRARY). +sagelib-build-deps: \ + $(SCRIPTS) \ + $(inst_arb) \ + $(inst_boost_cropped) \ + $(inst_$(BLAS)) \ + $(inst_brial) \ + $(inst_cliquer) \ + $(inst_cypari) \ + $(inst_cysignals) \ + $(inst_cython) \ + $(inst_ecl) \ + $(inst_eclib) \ + $(inst_ecm) \ + $(inst_flint) \ + $(inst_libgd) \ + $(inst_gap) \ + $(inst_givaro) \ + $(inst_glpk) \ + $(inst_gmpy2) \ + $(inst_gsl) \ + $(inst_iml) \ + $(inst_jinja2) \ + $(inst_jupyter_core) \ + $(inst_lcalc) \ + $(inst_lrcalc) \ + $(inst_libbraiding) \ + $(inst_libhomfly) \ + $(inst_libpng) \ + $(inst_linbox) \ + $(inst_m4ri) \ + $(inst_m4rie) \ + $(inst_mpc) \ + $(inst_mpfi) \ + $(inst_mpfr) \ + $(inst_$(MP_LIBRARY)) \ + $(inst_ntl) \ + $(inst_numpy) \ + $(inst_pari) \ + $(inst_pip) \ + $(inst_pkgconfig) \ + $(inst_planarity) \ + $(inst_ppl) \ + $(inst_pplpy) \ + $(inst_pycygwin) \ + $(inst_pynac) \ + $(inst_$(PYTHON)) \ + $(inst_ratpoints) \ + $(inst_readline) \ + $(inst_rw) \ + $(inst_sage_brial) \ + $(inst_sage_conf) \ + $(inst_singular) \ + $(inst_symmetrica) \ + $(inst_zn_poly) \ + $(PCFILES) + +sagelib: sagelib-build-deps + $(AM_V_at)if [ -z "$$SAGE_INSTALL_FETCH_ONLY" ]; then \ + cd $(SAGE_SRC) && source bin/sage-env && source $(SAGE_ROOT)/build/bin/sage-build-env-config && \ + sage-logger -p 'time $(MAKE) sage' '$(SAGE_LOGS)/sagelib-$(SAGE_VERSION).log'; \ + fi + + +############################################################################### +# Building scripts +############################################################################### + +# Don't just use "install" since we don't want to change permissions +$(SAGE_LOCAL)/bin/%: $(SAGE_SRC)/bin/% + $(AM_V_at)cp $< $@ + +############################################################################### +# Building the documentation +############################################################################### + +# You can choose to have the built HTML version of the documentation link to +# the PDF version. To do so, you need to build both the HTML and PDF versions. +# To have the HTML version link to the PDF version, do +# +# $ ./sage --docbuild all html +# $ ./sage --docbuild all pdf +# +# For more information on the docbuild utility, do +# +# $ ./sage --docbuild -H + +# Building the documentation has many dependencies, because all +# documented modules are imported and because we use matplotlib to +# produce plots. +DOC_DEPENDENCIES = sagelib $(inst_sphinx) \ + | $(SAGERUNTIME) $(inst_maxima) $(inst_networkx) $(inst_scipy) $(inst_sympy) \ + $(inst_matplotlib) $(inst_pillow) $(inst_mathjax) $(inst_mpmath) \ + $(inst_ipykernel) $(inst_jupyter_client) $(inst_conway_polynomials) \ + $(inst_tachyon) $(inst_jmol) $(inst_thebe) $(inst_ipywidgets) $(inst_typing) + +doc: doc-html + +doc-html: $(DOC_DEPENDENCIES) + $(AM_V_at)cd ../.. && sage-logger -p './sage --docbuild --no-pdf-links all html $(SAGE_DOCBUILD_OPTS)' logs/dochtml.log + +# 'doc-html-no-plot': build docs without building the graphics coming +# from the '.. plot' directive, in case you want to save a few +# megabytes of disk space. 'doc-clean' is a prerequisite because the +# presence of graphics is cached in src/doc/output. +doc-html-no-plot: doc-clean $(DOC_DEPENDENCIES) + $(AM_V_at)cd ../.. && sage-logger -p './sage --docbuild --no-pdf-links --no-plot all html $(SAGE_DOCBUILD_OPTS)' logs/dochtml.log + +doc-html-mathjax: $(DOC_DEPENDENCIES) + $(AM_V_at)cd ../.. && sage-logger -p './sage --docbuild --no-pdf-links all html -j $(SAGE_DOCBUILD_OPTS)' logs/dochtml.log + +# Keep target 'doc-html-jsmath' for backwards compatibility. +doc-html-jsmath: doc-html-mathjax + +doc-pdf: $(DOC_DEPENDENCIES) + $(AM_V_at)cd ../.. && sage-logger -p './sage --docbuild all pdf $(SAGE_DOCBUILD_OPTS)' logs/docpdf.log + +doc-clean: doc-src-clean doc-output-clean + +doc-src-clean: + cd "$(SAGE_SRC)/doc" && $(MAKE) clean + +doc-output-clean: + rm -rf "$(SAGE_SHARE)/doc/sage" + + +############################################################################### +# Cleaning up +############################################################################### + +clean: + @echo "Deleting package build directories..." + rm -rf "$(SAGE_LOCAL)/var/tmp/sage/build" + +sagelib-clean: + cd "$(SAGE_SRC)" && $(MAKE) clean + +build-clean: clean doc-clean sagelib-clean + +# Special target for cleaning up a broken GCC install detected by configure +# This should check for the .clean-broken-gcc stamp, and if found clean +# everything up along with the stamp file itself. This target is then run +# as a prerequisite to installing any other packages. +_clean-broken-gcc: + @if [ -f "$(SAGE_ROOT)/build/make/.clean-broken-gcc" ]; then \ + rm -f "$(SAGE_LOCAL)/bin/gcc"; \ + rm -f "$(SAGE_LOCAL)/gcc-"*; \ + rm -f "$(SAGE_LOCAL)/bin/g++"; \ + rm -f "$(SAGE_SPKG_INST)/gcc-"*; \ + rm -f "$(SAGE_ROOT)/build/make/.clean-broken-gcc"; \ + echo "Cleaned up old broken GCC install"; \ + fi #============================================================================== diff --git a/build/make/deps b/build/make/deps deleted file mode 100644 index 9455d8d625e..00000000000 --- a/build/make/deps +++ /dev/null @@ -1,294 +0,0 @@ -# -*- Makefile -*- ########################################################### -# vim: noexpandtab filetype=make -# This file ($SAGE_ROOT/build/make/deps) will be copied into -# $SAGE_ROOT/build/make/Makefile by config.status -############################################################################### - -# Silent rules -# https://www.gnu.org/software/automake/manual/html_node/Automake-Silent-Rules.html -ifeq ($(V), 0) -AM_V_at = @ -else -AM_V_at = -endif - -# List of targets that can be run using `sage -i` or `sage -f` -# These should generally have an associated -clean target for `sage -f` to -# work correctly -SAGE_I_TARGETS = sagelib doc - -STARTED = $(SAGE_LOCAL)/etc/sage-started.txt - - -# Tell make not to look for files with these names: -.PHONY: all all-sage all-toolchain all-build all-sageruntime \ - all-start build-start base toolchain toolchain-deps base-toolchain \ - sagelib \ - doc doc-html doc-html-jsmath doc-html-mathjax doc-pdf \ - doc-clean doc-src-clean doc-output-clean \ - clean sagelib-clean build-clean python3_venv _clean-broken-gcc - -ifneq ($(PYTHON_FOR_VENV),) -# Special rule for making the Python virtualenv from the system Python (Python -# 3 only). $(PYTHON) is set in Makefile to python3_venv. -# Thus $(inst_python3_venv) will be the dependency of every Python package. -# -# TODO: If we reconfigure to build our own Python after having used the system -# Python, files installed to create the virtualenv should be *removed*. That -# could either be done here by the makefile, or in an spkg-preinst for python3 -ifeq ($(PYTHON),python3) -PYTHON = python3_venv -endif -inst_python3_venv = $(SAGE_LOCAL)/pyvenv.cfg - -$(inst_python3_venv): - $(PYTHON_FOR_VENV) $(SAGE_ROOT)/build/bin/sage-venv "$(SAGE_LOCAL)" -endif - -# Build everything and start Sage. -# Note that we put the "doc" target first in the rule below because -# the doc build takes the most time and should be started as soon as -# possible. -all-start: toolchain-deps - $(MAKE) doc all-sage - $(MAKE) '$(STARTED)' - -# Build everything except the documentation -all-build: toolchain-deps - $(MAKE) all-sage - - -# The 2 preliminary build phases: base and toolchain. -base-toolchain: _clean-broken-gcc base - $(MAKE) toolchain - -# All targets except for the base packages -all-sage: \ - sagelib \ - $(STANDARD_PACKAGE_INSTS) \ - $(OPTIONAL_INSTALLED_PACKAGE_INSTS) \ - $(OPTIONAL_CLEANED_PACKAGES_CLEANS) \ - $(SCRIPTS) - -# Download all packages which should be inside an sdist tarball (the -B -# option to make forces all targets to be built unconditionally) -download-for-sdist: - env SAGE_INSTALL_FETCH_ONLY=yes $(MAKE) -B SAGERUNTIME= \ - $(SDIST_PACKAGES) - -# TOOLCHAIN consists of dependencies determined by configure. -# These are built after the "base" target but before anything else. -toolchain: $(foreach pkgname,$(TOOLCHAIN),$(inst_$(pkgname))) $(PCFILES) - -# Build all packages that GCC links against serially, otherwise this -# leads to race conditions where some library which is used by GCC gets -# reinstalled. Since system GCCs might use Sage's libraries, we do this -# unconditionally. We still use the dependency checking from $(MAKE), -# so this will not trigger useless rebuilds. -# See #14168 and #14232. -# -# Note: This list consists of only the *runtime* dependencies of the toolchain. -TOOLCHAIN_DEPS = zlib $(MP_LIBRARY) mpfr mpc -TOOLCHAIN_DEP_INSTS = \ - $(foreach pkgname,$(TOOLCHAIN_DEPS),$(inst_$(pkgname))) - -toolchain-deps: - for target in $(TOOLCHAIN_DEP_INSTS); do \ - $(MAKE) $$target; \ - done - -all-toolchain: base-toolchain - $(MAKE) toolchain-deps - -# All packages needed as a prerequisite to install other Python packages with -# pip or which are otherwise used by the Python build tools; these should be -# given as a prerequisite to any pip-installed packages -PYTHON_TOOLCHAIN = setuptools pip setuptools_scm future - -# Everything needed to start up Sage using "./sage". Of course, not -# every part of Sage will work. It does not include Maxima for example. -SAGERUNTIME = sagelib $(SCRIPTS) $(inst_ipython) $(inst_pexpect) \ - $(inst_psutil) $(inst_future) - -all-sageruntime: toolchain-deps - $(MAKE) $(SAGERUNTIME) - - -# Start Sage at least once to check that it works -# (i.e. when we just installed Sage for the first time). -build-start: all-build - $(MAKE) '$(STARTED)' - -# We make this depend on all standard packages because running -# sage-starts runs sage-location, which should be run after installing -# any package. -$(STARTED): $(STANDARD_PACKAGE_INSTS) - $(AM_V_at)"$(SAGE_ROOT)/build/bin/sage-starts" - - -############################################################################### -# Building the base system -# -# This consists of packages which are required for the Sage build system. -############################################################################### -base: $(inst_patch) $(inst_pkgconf) - -############################################################################### -# Building normal packages -############################################################################### - -# List all *build-time* dependencies of the Sage library. These are, -# on the one hand, programs needed for the build/install process of the -# Sage library (e.g. CYTHON, JINJA2), and on the other hand all -# dependencies for Cython files (e.g. PARI, NTL, MP_LIBRARY). -sagelib-build-deps: \ - $(SCRIPTS) \ - $(inst_arb) \ - $(inst_boost_cropped) \ - $(inst_$(BLAS)) \ - $(inst_brial) \ - $(inst_cliquer) \ - $(inst_cypari) \ - $(inst_cysignals) \ - $(inst_cython) \ - $(inst_ecl) \ - $(inst_eclib) \ - $(inst_ecm) \ - $(inst_flint) \ - $(inst_libgd) \ - $(inst_gap) \ - $(inst_givaro) \ - $(inst_glpk) \ - $(inst_gmpy2) \ - $(inst_gsl) \ - $(inst_iml) \ - $(inst_jinja2) \ - $(inst_jupyter_core) \ - $(inst_lcalc) \ - $(inst_lrcalc) \ - $(inst_libbraiding) \ - $(inst_libhomfly) \ - $(inst_libpng) \ - $(inst_linbox) \ - $(inst_m4ri) \ - $(inst_m4rie) \ - $(inst_mpc) \ - $(inst_mpfi) \ - $(inst_mpfr) \ - $(inst_$(MP_LIBRARY)) \ - $(inst_ntl) \ - $(inst_numpy) \ - $(inst_pari) \ - $(inst_pip) \ - $(inst_pkgconfig) \ - $(inst_planarity) \ - $(inst_ppl) \ - $(inst_pplpy) \ - $(inst_pycygwin) \ - $(inst_pynac) \ - $(inst_$(PYTHON)) \ - $(inst_ratpoints) \ - $(inst_readline) \ - $(inst_rw) \ - $(inst_sage_brial) \ - $(inst_sage_conf) \ - $(inst_singular) \ - $(inst_symmetrica) \ - $(inst_zn_poly) \ - $(PCFILES) - -sagelib: sagelib-build-deps - $(AM_V_at)if [ -z "$$SAGE_INSTALL_FETCH_ONLY" ]; then \ - cd $(SAGE_SRC) && source bin/sage-env && source $(SAGE_ROOT)/build/bin/sage-build-env-config && \ - sage-logger -p 'time $(MAKE) sage' '$(SAGE_LOGS)/sagelib-$(SAGE_VERSION).log'; \ - fi - - -############################################################################### -# Building scripts -############################################################################### - -# Don't just use "install" since we don't want to change permissions -$(SAGE_LOCAL)/bin/%: $(SAGE_SRC)/bin/% - $(AM_V_at)cp $< $@ - -############################################################################### -# Building the documentation -############################################################################### - -# You can choose to have the built HTML version of the documentation link to -# the PDF version. To do so, you need to build both the HTML and PDF versions. -# To have the HTML version link to the PDF version, do -# -# $ ./sage --docbuild all html -# $ ./sage --docbuild all pdf -# -# For more information on the docbuild utility, do -# -# $ ./sage --docbuild -H - -# Building the documentation has many dependencies, because all -# documented modules are imported and because we use matplotlib to -# produce plots. -DOC_DEPENDENCIES = sagelib $(inst_sphinx) \ - | $(SAGERUNTIME) $(inst_maxima) $(inst_networkx) $(inst_scipy) $(inst_sympy) \ - $(inst_matplotlib) $(inst_pillow) $(inst_mathjax) $(inst_mpmath) \ - $(inst_ipykernel) $(inst_jupyter_client) $(inst_conway_polynomials) \ - $(inst_tachyon) $(inst_jmol) $(inst_thebe) $(inst_ipywidgets) $(inst_typing) - -doc: doc-html - -doc-html: $(DOC_DEPENDENCIES) - $(AM_V_at)cd ../.. && sage-logger -p './sage --docbuild --no-pdf-links all html $(SAGE_DOCBUILD_OPTS)' logs/dochtml.log - -# 'doc-html-no-plot': build docs without building the graphics coming -# from the '.. plot' directive, in case you want to save a few -# megabytes of disk space. 'doc-clean' is a prerequisite because the -# presence of graphics is cached in src/doc/output. -doc-html-no-plot: doc-clean $(DOC_DEPENDENCIES) - $(AM_V_at)cd ../.. && sage-logger -p './sage --docbuild --no-pdf-links --no-plot all html $(SAGE_DOCBUILD_OPTS)' logs/dochtml.log - -doc-html-mathjax: $(DOC_DEPENDENCIES) - $(AM_V_at)cd ../.. && sage-logger -p './sage --docbuild --no-pdf-links all html -j $(SAGE_DOCBUILD_OPTS)' logs/dochtml.log - -# Keep target 'doc-html-jsmath' for backwards compatibility. -doc-html-jsmath: doc-html-mathjax - -doc-pdf: $(DOC_DEPENDENCIES) - $(AM_V_at)cd ../.. && sage-logger -p './sage --docbuild all pdf $(SAGE_DOCBUILD_OPTS)' logs/docpdf.log - -doc-clean: doc-src-clean doc-output-clean - -doc-src-clean: - cd "$(SAGE_SRC)/doc" && $(MAKE) clean - -doc-output-clean: - rm -rf "$(SAGE_SHARE)/doc/sage" - - -############################################################################### -# Cleaning up -############################################################################### - -clean: - @echo "Deleting package build directories..." - rm -rf "$(SAGE_LOCAL)/var/tmp/sage/build" - -sagelib-clean: - cd "$(SAGE_SRC)" && $(MAKE) clean - -build-clean: clean doc-clean sagelib-clean - -# Special target for cleaning up a broken GCC install detected by configure -# This should check for the .clean-broken-gcc stamp, and if found clean -# everything up along with the stamp file itself. This target is then run -# as a prerequisite to installing any other packages. -_clean-broken-gcc: - @if [ -f "$(SAGE_ROOT)/build/make/.clean-broken-gcc" ]; then \ - rm -f "$(SAGE_LOCAL)/bin/gcc"; \ - rm -f "$(SAGE_LOCAL)/gcc-"*; \ - rm -f "$(SAGE_LOCAL)/bin/g++"; \ - rm -f "$(SAGE_SPKG_INST)/gcc-"*; \ - rm -f "$(SAGE_ROOT)/build/make/.clean-broken-gcc"; \ - echo "Cleaned up old broken GCC install"; \ - fi diff --git a/configure.ac b/configure.ac index 64a29d5728b..0d09c6fbc74 100644 --- a/configure.ac +++ b/configure.ac @@ -459,10 +459,6 @@ done AC_SUBST([SAGE_SCRIPTS]) -SAGE_MAKE_DEPS="$SAGE_ROOT/build/make/deps" -AC_SUBST_FILE([SAGE_MAKE_DEPS]) - - dnl AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([build/make/Makefile-auto build/make/Makefile src/Makefile]) AC_CONFIG_FILES([src/bin/sage-env-config build/bin/sage-build-env-config]) From 2750aa2dea0a9d54eec7b8710c06e73424be8507 Mon Sep 17 00:00:00 2001 From: Christian Stump Date: Fri, 22 May 2020 15:21:40 +0200 Subject: [PATCH 209/301] added hash for reflection group element that is not only the abstract group --- src/sage/combinat/root_system/reflection_group_element.pyx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sage/combinat/root_system/reflection_group_element.pyx b/src/sage/combinat/root_system/reflection_group_element.pyx index ed552674922..fa3227b04b3 100644 --- a/src/sage/combinat/root_system/reflection_group_element.pyx +++ b/src/sage/combinat/root_system/reflection_group_element.pyx @@ -39,6 +39,9 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): """ An element in a complex reflection group. """ + def __hash__(self): + return hash(self.parent()) + hash(tuple(self.reduced_word())) + def reduced_word(self): r""" Return a word in the simple reflections to obtain ``self``. From 837b1aabbc03d8634f16a269e11be5ac32db5693 Mon Sep 17 00:00:00 2001 From: Christian Stump Date: Fri, 22 May 2020 15:29:29 +0200 Subject: [PATCH 210/301] added hash docstring --- .../root_system/reflection_group_element.pyx | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/sage/combinat/root_system/reflection_group_element.pyx b/src/sage/combinat/root_system/reflection_group_element.pyx index fa3227b04b3..4e73f2fcee8 100644 --- a/src/sage/combinat/root_system/reflection_group_element.pyx +++ b/src/sage/combinat/root_system/reflection_group_element.pyx @@ -40,6 +40,42 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): An element in a complex reflection group. """ def __hash__(self): + r""" + Return a hash for this reflection group element. + This hash stores both the element as a reduced word and the parent group. + + EXAMPLES:: + + sage: W = ReflectionGroup(['A',5]) # optional - gap3 + sage: w = W.from_reduced_word([1,2,3,4,5]) # optional - gap3 + sage: hash(w) # optional - gap3 + -1527414595000039889 # 64-bit + + TESTS: + + Check that types B and C are hashed differently, see #29726:: + + sage: WB = ReflectionGroup(['B',2]) + sage: WC = ReflectionGroup(['C',2]) + sage: sorted(map(hash,WB)) + [-9223363287990922543, + -9223359857975062524, + -9223359857974062521, + -8737669435968786273, + -6694860314014793569, + -5510281656060039426, + -5510280573528544276, + -5433655748006305484] + sage: sorted(map(hash,WC)) + [-9223363287990922588, + -9223359857975062569, + -9223359857974062566, + -8737669435968786318, + -6694860314014793614, + -5510281656060039471, + -5510280573528544321, + -5433655748006305529] + """ return hash(self.parent()) + hash(tuple(self.reduced_word())) def reduced_word(self): From e811e33b20142ba33fb396207f94db9ca3c6387d Mon Sep 17 00:00:00 2001 From: Christian Stump Date: Fri, 22 May 2020 15:30:40 +0200 Subject: [PATCH 211/301] added hash docstring --- .../combinat/root_system/reflection_group_element.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sage/combinat/root_system/reflection_group_element.pyx b/src/sage/combinat/root_system/reflection_group_element.pyx index 4e73f2fcee8..68a397b9bdf 100644 --- a/src/sage/combinat/root_system/reflection_group_element.pyx +++ b/src/sage/combinat/root_system/reflection_group_element.pyx @@ -55,9 +55,9 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): Check that types B and C are hashed differently, see #29726:: - sage: WB = ReflectionGroup(['B',2]) - sage: WC = ReflectionGroup(['C',2]) - sage: sorted(map(hash,WB)) + sage: WB = ReflectionGroup(['B',2]) # optional - gap3 + sage: WC = ReflectionGroup(['C',2]) # optional - gap3 + sage: sorted(map(hash,WB)) # optional - gap3 [-9223363287990922543, -9223359857975062524, -9223359857974062521, @@ -66,7 +66,7 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): -5510281656060039426, -5510280573528544276, -5433655748006305484] - sage: sorted(map(hash,WC)) + sage: sorted(map(hash,WC)) # optional - gap3 [-9223363287990922588, -9223359857975062569, -9223359857974062566, From 7234f424efa49a85b47be97b50b852446f9202a8 Mon Sep 17 00:00:00 2001 From: Christian Stump Date: Fri, 22 May 2020 15:38:56 +0200 Subject: [PATCH 212/301] fixed bug when creating dihedral type reflection groups --- .../root_system/reflection_group_real.py | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/root_system/reflection_group_real.py b/src/sage/combinat/root_system/reflection_group_real.py index 96cbbcd9431..b43eb190086 100644 --- a/src/sage/combinat/root_system/reflection_group_real.py +++ b/src/sage/combinat/root_system/reflection_group_real.py @@ -407,11 +407,27 @@ def cartan_type(self): sage: W = ReflectionGroup(['A',3], ['B',3]) # optional - gap3 sage: W.cartan_type() # optional - gap3 - A3xB3 relabelled by {1: 3, 2: 2, 3: 1} + A3xB3 relabelled by {1: 3, 2: 2, 3: 1} + + TESTS: + + Check that dihedral types are handled properly:: + + sage: W = ReflectionGroup(['I',3]); W # optional - gap3 + Irreducible real reflection group of rank 2 and type A2 + + sage: W = ReflectionGroup(['I',4]); W # optional - gap3 + Irreducible real reflection group of rank 2 and type C2 + + sage: W = ReflectionGroup(['I',5]); W # optional - gap3 + Irreducible real reflection group of rank 2 and type I2(5) """ if len(self._type) == 1: ct = self._type[0] - C = CartanType([ct['series'], ct['rank']]) + if ct['series'] == "I": + C = CartanType([ct['series'], ct['bond']]) + else: + C = CartanType([ct['series'], ct['rank']]) CG = C.coxeter_diagram() G = self.coxeter_diagram() return C.relabel(CG.is_isomorphic(G, edge_labels=True, certificate=True)[1]) From 8b3cee5ca2f39a996651ca80f2830ce36f98d934 Mon Sep 17 00:00:00 2001 From: Christian Stump Date: Fri, 22 May 2020 15:52:59 +0200 Subject: [PATCH 213/301] updated doctests according to Frederic's suggestions --- .../root_system/reflection_group_element.pyx | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/src/sage/combinat/root_system/reflection_group_element.pyx b/src/sage/combinat/root_system/reflection_group_element.pyx index 68a397b9bdf..329ff38a3d6 100644 --- a/src/sage/combinat/root_system/reflection_group_element.pyx +++ b/src/sage/combinat/root_system/reflection_group_element.pyx @@ -42,39 +42,37 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): def __hash__(self): r""" Return a hash for this reflection group element. + This hash stores both the element as a reduced word and the parent group. EXAMPLES:: sage: W = ReflectionGroup(['A',5]) # optional - gap3 - sage: w = W.from_reduced_word([1,2,3,4,5]) # optional - gap3 - sage: hash(w) # optional - gap3 - -1527414595000039889 # 64-bit + sage: W_hash = set(hash(w) for w in W) # optional - gap3 + sage: len(W_hash) == W.cardinality() # optional - gap3 + True TESTS: Check that types B and C are hashed differently, see #29726:: - sage: WB = ReflectionGroup(['B',2]) # optional - gap3 - sage: WC = ReflectionGroup(['C',2]) # optional - gap3 - sage: sorted(map(hash,WB)) # optional - gap3 - [-9223363287990922543, - -9223359857975062524, - -9223359857974062521, - -8737669435968786273, - -6694860314014793569, - -5510281656060039426, - -5510280573528544276, - -5433655748006305484] - sage: sorted(map(hash,WC)) # optional - gap3 - [-9223363287990922588, - -9223359857975062569, - -9223359857974062566, - -8737669435968786318, - -6694860314014793614, - -5510281656060039471, - -5510280573528544321, - -5433655748006305529] + sage: WB = ReflectionGroup(['B',5]) # optional - gap3 + sage: WC = ReflectionGroup(['C',5]) # optional - gap3 + + sage: WB_hash = set(hash(w) for w in WB) # optional - gap3 + sage: WC_hash = set(hash(w) for w in WC) # optional - gap3 + + sage: len(WB_hash) == WB.cardinality() # optional - gap3 + True + + sage: len(WB_hash) == WB.cardinality() # optional - gap3 + True + + sage: len(WC_hash) == WC.cardinality() # optional - gap3 + True + + sage: WB_hash.intersection(WC_hash) # optional - gap3 + set() """ return hash(self.parent()) + hash(tuple(self.reduced_word())) From d9a58666bfb4030f7bd4c2d9135d18657f74662c Mon Sep 17 00:00:00 2001 From: Christian Stump Date: Fri, 22 May 2020 15:54:09 +0200 Subject: [PATCH 214/301] updated doctests according to Frederic's suggestions --- src/sage/combinat/root_system/reflection_group_element.pyx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/sage/combinat/root_system/reflection_group_element.pyx b/src/sage/combinat/root_system/reflection_group_element.pyx index 329ff38a3d6..e3c61ae3c85 100644 --- a/src/sage/combinat/root_system/reflection_group_element.pyx +++ b/src/sage/combinat/root_system/reflection_group_element.pyx @@ -65,9 +65,6 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): sage: len(WB_hash) == WB.cardinality() # optional - gap3 True - sage: len(WB_hash) == WB.cardinality() # optional - gap3 - True - sage: len(WC_hash) == WC.cardinality() # optional - gap3 True From 2c9d4f06655bdd6c241887fe4597df8f77b1fc56 Mon Sep 17 00:00:00 2001 From: Christian Stump Date: Fri, 22 May 2020 17:17:19 +0200 Subject: [PATCH 215/301] used proper trac link --- src/sage/combinat/root_system/reflection_group_element.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/combinat/root_system/reflection_group_element.pyx b/src/sage/combinat/root_system/reflection_group_element.pyx index e3c61ae3c85..2ba35debfed 100644 --- a/src/sage/combinat/root_system/reflection_group_element.pyx +++ b/src/sage/combinat/root_system/reflection_group_element.pyx @@ -54,7 +54,7 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): TESTS: - Check that types B and C are hashed differently, see #29726:: + Check that types B and C are hashed differently, see :trac:`29726`:: sage: WB = ReflectionGroup(['B',5]) # optional - gap3 sage: WC = ReflectionGroup(['C',5]) # optional - gap3 From 530737a5fc4c9eacffb917da1299fb8ebf4ad534 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Sun, 24 May 2020 00:52:40 +0200 Subject: [PATCH 216/301] Added examples and fixed minor style --- src/sage/rings/polynomial/multi_polynomial.pyx | 2 +- src/sage/rings/polynomial/multi_polynomial_element.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx index 76693fd472f..703a0b23d78 100644 --- a/src/sage/rings/polynomial/multi_polynomial.pyx +++ b/src/sage/rings/polynomial/multi_polynomial.pyx @@ -1465,7 +1465,7 @@ cdef class MPolynomial(CommutativeRingElement): an = self.coefficient(variable**n)**(n - k - 2) return self.parent()(u * self.resultant(d, variable) * an) - def subresultants(self, other, variable= None): + def subresultants(self, other, variable=None): r""" Return the nonzero subresultant polynomials of ``self`` and ``other``. diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py index a92376a8c1b..4981bf0520b 100644 --- a/src/sage/rings/polynomial/multi_polynomial_element.py +++ b/src/sage/rings/polynomial/multi_polynomial_element.py @@ -2027,7 +2027,7 @@ def resultant(self, other, variable=None): @coerce_binop @handle_AA_and_QQbar - def subresultants(self, other, variable= None): + def subresultants(self, other, variable=None): r""" Return the nonzero subresultant polynomials of ``self`` and ``other``. @@ -2037,6 +2037,8 @@ def subresultants(self, other, variable= None): OUTPUT: a list of polynomials in the same ring as ``self`` + EXAMPLES:: + sage: R. = QQbar[] sage: p = (y^2 + 6)*(x - 1) - y*(x^2 + 1) sage: q = (x^2 + 6)*(y - 1) - x*(y^2 + 1) From ddc80b725b6de595b5d804938ad44da123ebfa5f Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Sun, 24 May 2020 02:47:57 +0200 Subject: [PATCH 217/301] Fixed coefficient signs in doctest --- src/sage/rings/polynomial/multi_polynomial_element.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py index 4981bf0520b..bddeedf9948 100644 --- a/src/sage/rings/polynomial/multi_polynomial_element.py +++ b/src/sage/rings/polynomial/multi_polynomial_element.py @@ -2043,11 +2043,11 @@ def subresultants(self, other, variable=None): sage: p = (y^2 + 6)*(x - 1) - y*(x^2 + 1) sage: q = (x^2 + 6)*(y - 1) - x*(y^2 + 1) sage: p.subresultants(q, y) - [2*x^6 - 22*x^5 + 102*x^4 - 274*x^3 + 488*x^2 - 552*x + 288, - -x^3 - x^2*y + 6*x^2 + 5*x*y - 11*x - 6*y + 6] + [2*x^6 + (-22)*x^5 + 102*x^4 + (-274)*x^3 + 488*x^2 + (-552)*x + 288, + -x^3 - x^2*y + 6*x^2 + 5*x*y + (-11)*x + (-6)*y + 6] sage: p.subresultants(q, x) - [2*y^6 - 22*y^5 + 102*y^4 - 274*y^3 + 488*y^2 - 552*y + 288, - x*y^2 + y^3 - 5*x*y - 6*y^2 + 6*x + 11*y - 6] + [2*y^6 + (-22)*y^5 + 102*y^4 + (-274)*y^3 + 488*y^2 + (-552)*y + 288, + x*y^2 + y^3 + (-5)*x*y + (-6)*y^2 + 6*x + 11*y - 6] """ R = self.parent() From 4d87fe557d66678bc90db176a88e21d1a0c3d38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 25 May 2020 13:51:14 +0200 Subject: [PATCH 218/301] some little enhancements for STL 3D export --- src/sage/plot/plot3d/shapes2.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/sage/plot/plot3d/shapes2.py b/src/sage/plot/plot3d/shapes2.py index 7a8c4cebd79..07e00c048da 100644 --- a/src/sage/plot/plot3d/shapes2.py +++ b/src/sage/plot/plot3d/shapes2.py @@ -848,6 +848,18 @@ def threejs_repr(self, render_params): point = dict(point=center, size=size, color=color, opacity=opacity) return [('point', point)] + def stl_binary_repr(self, render_params): + """ + Return an empty list, as this is not useful for STL export. + + EXAMPLES:: + + sage: P = point3d((1,2,3)).translate(-1, -2, -3) + sage: P.stl_binary_repr(P.default_render_params()) + [] + """ + return [] + class Line(PrimitiveObject): r""" @@ -1215,6 +1227,18 @@ def threejs_repr(self, render_params): reprs.append(('line', line)) return reprs + def stl_binary_repr(self, render_params): + """ + Return an empty list, as this is not useful for STL export. + + EXAMPLES:: + + sage: L = line3d([(1,2,3), (4,5,6)]).translate(-1, -2, -3) + sage: L.stl_binary_repr(L.default_render_params()) + [] + """ + return [] + @rename_keyword(alpha='opacity') def point3d(v, size=5, **kwds): From 556f496f993f3d949d47fb20b7da83d1af0fbd60 Mon Sep 17 00:00:00 2001 From: vipul79321 Date: Mon, 25 May 2020 21:41:01 +0530 Subject: [PATCH 219/301] FIXED --- src/sage/graphs/generic_graph.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py index e00570bc2cc..4381364b4fe 100644 --- a/src/sage/graphs/generic_graph.py +++ b/src/sage/graphs/generic_graph.py @@ -16958,7 +16958,6 @@ def weight_function(e): return networkx.single_source_dijkstra_path_length(G, u) elif algorithm in ['Dijkstra_Boost', 'Bellman-Ford_Boost', None]: - self.weighted(True) from sage.graphs.base.boost_graph import shortest_paths return shortest_paths(self, u, weight_function, algorithm)[0] From 7de03008dc6315bf93919e784697f112a493cd76 Mon Sep 17 00:00:00 2001 From: Xavier Caruso Date: Mon, 25 May 2020 18:47:55 +0200 Subject: [PATCH 220/301] another proposal --- src/sage/rings/fraction_field.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/sage/rings/fraction_field.py b/src/sage/rings/fraction_field.py index 15328d7bbe8..2342dc64237 100644 --- a/src/sage/rings/fraction_field.py +++ b/src/sage/rings/fraction_field.py @@ -698,12 +698,8 @@ def resolve_fractions(x, y): try: return self._element_class(self, x, y, coerce=coerce) except TypeError: - if not x != x0: - # Make one last attempt to convert x into ``self`` - x = self(x) - y *= x.denominator() - x = x.numerator() - return self._element_class(self, x, y, coerce=coerce) + if parent(x) is parent(x0): + raise def construction(self): """ From 8a32e38008a93e14d6199826224423318f244809 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Tue, 26 May 2020 13:44:10 +0900 Subject: [PATCH 221/301] Add L-polynomial to curves --- src/sage/schemes/curves/projective_curve.py | 75 ++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/src/sage/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py index 592bb68dc65..f031ed25efb 100644 --- a/src/sage/schemes/curves/projective_curve.py +++ b/src/sage/schemes/curves/projective_curve.py @@ -115,7 +115,7 @@ from sage.matrix.all import matrix from sage.misc.all import add, sage_eval -from sage.rings.all import degree_lowest_rational_function +from sage.rings.all import degree_lowest_rational_function, IntegerRing from sage.rings.number_field.number_field import NumberField from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.rings.qqbar import (number_field_elements_from_algebraics, @@ -2562,6 +2562,79 @@ def closed_points(self, degree=1): return points + @cached_method + def L_polynomial(self, name='t'): + """ + Return the L-polynomial of this possibly singular curve. + + INPUT: + + - ``name`` -- (default: ``t``) name of the variable of the polynomial + + EXAMPLES:: + + sage; A. = AffineSpace(GF(3), 2) + sage: C = Curve(y^2 - x^5 - x^4 - 2*x^3 - 2*x - 2) + sage: Cbar = C.projective_closure() + sage: Cbar.L_polynomial() + 9*t^4 - 3*t^3 + t^2 - t + 1 + + """ + F = self.function_field() + L = F.L_polynomial() + + R = L.parent() + T = R.gen() + + f = R.one() + for p, places in self._singularities: + for place in places: + f = f * (1 - T**place.degree()) + f = f // (1 - T**p.degree()) + + return L * f + + def number_of_rational_points(self, r=1): + """ + Return the number of rational points of the curve with + constant field extended by degree ``r``. + + INPUT: + + - ``r`` -- positive integer (default: `1`) + + EXAMPLES:: + + sage; A. = AffineSpace(GF(3), 2) + sage: C = Curve(y^2 - x^5 - x^4 - 2*x^3 - 2*x - 2) + sage: Cbar = C.projective_closure() + sage: Cbar.number_of_rational_points(3) + 21 + sage: D = Cbar.change_ring(Cbar.base_ring().extension(3)) + sage: D.base_ring() + Finite Field in z3 of size 3^3 + sage: len(D.closed_points()) + 21 + + """ + q = self.base_ring().order() + L = self.L_polynomial() + Lp = L.derivative() + + R = IntegerRing()[[L.parent().gen()]] # power series ring + L = R(L) + Lp = R(Lp) + + previous_prec = R.default_prec() + R.set_default_prec(r) + + f = Lp / L + n = f[r-1] + q**r + 1 + + R.set_default_prec(previous_prec) + + return n + class IntegralProjectivePlaneCurve_finite_field(ProjectivePlaneCurve_finite_field, IntegralProjectiveCurve_finite_field): """ From 966ae578679fad8bbd25c12816537b3f21a8c310 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Tue, 26 May 2020 16:58:56 +1000 Subject: [PATCH 222/301] Fixing pyflakes warnings. --- src/sage/groups/raag.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/sage/groups/raag.py b/src/sage/groups/raag.py index 70438999c93..a4f210377d5 100644 --- a/src/sage/groups/raag.py +++ b/src/sage/groups/raag.py @@ -38,12 +38,9 @@ from sage.combinat.root_system.coxeter_matrix import CoxeterMatrix from sage.combinat.root_system.coxeter_group import CoxeterGroup -from sage.structure.parent import Parent -from sage.structure.unique_representation import UniqueRepresentation from sage.combinat.free_module import CombinatorialFreeModule from sage.categories.fields import Fields from sage.categories.algebras_with_basis import AlgebrasWithBasis -from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets from sage.algebras.clifford_algebra import CliffordAlgebraElement from sage.typeset.ascii_art import ascii_art from sage.typeset.unicode_art import unicode_art @@ -704,7 +701,6 @@ def _repr_term(self, m): if len(m) == 0: return '1' term = '' - V = self for i in m: if len(term) != 0: term += '*' From 12def0bb92bc69247cb6362d91a9ca6d3d768e47 Mon Sep 17 00:00:00 2001 From: Christian Stump Date: Tue, 26 May 2020 19:38:00 +0200 Subject: [PATCH 223/301] updated hash according to Travis' suggesion, speed factor 2 --- src/sage/combinat/root_system/reflection_group_element.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/combinat/root_system/reflection_group_element.pyx b/src/sage/combinat/root_system/reflection_group_element.pyx index 2ba35debfed..ca3138e1fb0 100644 --- a/src/sage/combinat/root_system/reflection_group_element.pyx +++ b/src/sage/combinat/root_system/reflection_group_element.pyx @@ -71,7 +71,7 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): sage: WB_hash.intersection(WC_hash) # optional - gap3 set() """ - return hash(self.parent()) + hash(tuple(self.reduced_word())) + return hash(self._parent) | hash(tuple(self._reduced_word)) def reduced_word(self): r""" From 4672d559510fd15d73eb7948d819f69b74dd4320 Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Mon, 4 May 2020 12:49:06 -0700 Subject: [PATCH 224/301] trac 29633: fixes for PDF docbuilding --- build/pkgs/database_jones_numfield/SPKG.rst | 2 +- build/pkgs/mpir/SPKG.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/pkgs/database_jones_numfield/SPKG.rst b/build/pkgs/database_jones_numfield/SPKG.rst index 9d6854d8dd2..b19f9a99235 100644 --- a/build/pkgs/database_jones_numfield/SPKG.rst +++ b/build/pkgs/database_jones_numfield/SPKG.rst @@ -5,7 +5,7 @@ Description ----------- This is a table of number fields with bounded ramification and degree -≤6. +at most 6. License ------- diff --git a/build/pkgs/mpir/SPKG.rst b/build/pkgs/mpir/SPKG.rst index 7ea2a173059..2c15c2eb66e 100644 --- a/build/pkgs/mpir/SPKG.rst +++ b/build/pkgs/mpir/SPKG.rst @@ -37,7 +37,7 @@ Special Update/Build Instructions - We currently don't use anything of GMP's/MPIR's CC setting, and matching - with the current compiler (`$CC`) is perhaps suboptimal. + with the current compiler (``$CC``) is perhaps suboptimal. - Remove some files / directories not needed for Sage from upstream: - build.vc\* directories (Microsoft Visual C build files) From 9c7ea5f302a375d654b923d8617b70320d910660 Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Tue, 26 May 2020 21:28:02 -0700 Subject: [PATCH 225/301] trac 29633: fix SQLite doctests in cmdline.py --- src/sage/tests/cmdline.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py index 0e367a57419..475173b42a8 100644 --- a/src/sage/tests/cmdline.py +++ b/src/sage/tests/cmdline.py @@ -218,7 +218,8 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False sage: out, err, ret = test_executable(["sage", "--info", "sqlite"]) # optional - build sage: print(out) # optional - build Found local metadata for sqlite-... - = SQLite = + SQLite + ====== ... SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. @@ -231,7 +232,8 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False sage: out, err, ret = test_executable(["sage", "-p", "--info", "--info", "sqlite"]) # optional - build sage: print(out) # optional - build Found local metadata for sqlite-... - = SQLite = + SQLite + ====== ... SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. From 26f2f05ddd75d25fafb08bd97401dc22c3350772 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Wed, 27 May 2020 20:24:36 +0900 Subject: [PATCH 226/301] Fix typos --- src/sage/schemes/curves/projective_curve.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py index f031ed25efb..b8932805386 100644 --- a/src/sage/schemes/curves/projective_curve.py +++ b/src/sage/schemes/curves/projective_curve.py @@ -2573,7 +2573,7 @@ def L_polynomial(self, name='t'): EXAMPLES:: - sage; A. = AffineSpace(GF(3), 2) + sage: A. = AffineSpace(GF(3), 2) sage: C = Curve(y^2 - x^5 - x^4 - 2*x^3 - 2*x - 2) sage: Cbar = C.projective_closure() sage: Cbar.L_polynomial() @@ -2605,7 +2605,7 @@ def number_of_rational_points(self, r=1): EXAMPLES:: - sage; A. = AffineSpace(GF(3), 2) + sage: A. = AffineSpace(GF(3), 2) sage: C = Curve(y^2 - x^5 - x^4 - 2*x^3 - 2*x - 2) sage: Cbar = C.projective_closure() sage: Cbar.number_of_rational_points(3) From caa93b15cc0f7975b33f4972c76433a8f5a1487c Mon Sep 17 00:00:00 2001 From: Bruce Westbury Date: Wed, 27 May 2020 13:23:49 +0100 Subject: [PATCH 227/301] Initial commit --- src/sage/combinat/gelfand_tsetlin_patterns.py | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/sage/combinat/gelfand_tsetlin_patterns.py b/src/sage/combinat/gelfand_tsetlin_patterns.py index 52d39ddb8c2..66bf0b3d322 100644 --- a/src/sage/combinat/gelfand_tsetlin_patterns.py +++ b/src/sage/combinat/gelfand_tsetlin_patterns.py @@ -509,6 +509,67 @@ def Tokuyama_coefficient(self, name='t'): return R.zero() return (t+1)**(self.number_of_special_entries()) * t**(self.number_of_boxes()) + + def bender_knuth_involution(self,i): + r""" + Return the image of ''self'' under the 'i'-th Bender-Knuth involution. + + If the triangle 'G' has size 'n' then this is defined for '0 < i < n'. + + This implements the construction of the Bender-Knuth involution using toggling + due to Berenstein-Kirillov. + + This agrees with the Bender-Knuth involution on semistandard tableaux. + + EXAMPLES:: + + sage: G = GelfandTsetlinPattern([[5,3,2,1,0],[4,3,2,0],[4,2,1],[3,2],[3]]) + sage: bender_knuth_involution(G,2) + [[5, 3, 2, 1, 0], [4, 3, 2, 0], [4, 2, 1], [3, 2], [3]] + + TESTS:: + + sage: all(all( bender_knuth_involution(G,i).to_tableau() == G.to_tableau().bender_knuth_involution(i) + for i in range(1,len(G)) ) for G in GelfandTsetlinPatterns(top_row=[3,3,3,0,0])) + True + + sage: G = GelfandTsetlinPattern([[2,1,0],[1,0],[0]]) + sage: bender_knuth_involution(G,0) + Traceback (most recent call last): + ... + ValueError: must have 0 < 0 < 3 + sage: bender_knuth_involution(G,3) + Traceback (most recent call last): + ... + ValueError: must have 0 < 3 < 3 + + """ + n = len(self) + + def toggle(i,j): + """ + Return the toggle of entry 'G[i][j]' in a Gelfand-Tsetlin pattern, 'G'. + """ + if i == n-1: + return self[n-2][0]+self[n-2][1]-self[n-1][0] + + if j == 0: + left = self[i-1][0] + else: + left = min(self[i-1][j], self[i+1][j-1]) + if j == n-i-1: + right = self[i-1][j+1] + else: + right = max(self[i-1][j+1], self[i+1][j]) + + return left + right - self[i][j] + + if not 0 < i < n: + raise ValueError(f"must have 0 < {i} < {n}") + r = n-i + result = copy(self) + result[r] = [toggle(r,s) for s in range(i)] + return result class GelfandTsetlinPatterns(UniqueRepresentation, Parent): """ From 348b838bf57912553c38b092b7000976d0c50474 Mon Sep 17 00:00:00 2001 From: Bruce Westbury Date: Wed, 27 May 2020 13:36:01 +0100 Subject: [PATCH 228/301] All tests passed! --- src/sage/combinat/gelfand_tsetlin_patterns.py | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/sage/combinat/gelfand_tsetlin_patterns.py b/src/sage/combinat/gelfand_tsetlin_patterns.py index 66bf0b3d322..ae1de2faa15 100644 --- a/src/sage/combinat/gelfand_tsetlin_patterns.py +++ b/src/sage/combinat/gelfand_tsetlin_patterns.py @@ -509,50 +509,50 @@ def Tokuyama_coefficient(self, name='t'): return R.zero() return (t+1)**(self.number_of_special_entries()) * t**(self.number_of_boxes()) - def bender_knuth_involution(self,i): r""" Return the image of ''self'' under the 'i'-th Bender-Knuth involution. - + If the triangle 'G' has size 'n' then this is defined for '0 < i < n'. - + This implements the construction of the Bender-Knuth involution using toggling due to Berenstein-Kirillov. - + This agrees with the Bender-Knuth involution on semistandard tableaux. - + EXAMPLES:: - + sage: G = GelfandTsetlinPattern([[5,3,2,1,0],[4,3,2,0],[4,2,1],[3,2],[3]]) - sage: bender_knuth_involution(G,2) - [[5, 3, 2, 1, 0], [4, 3, 2, 0], [4, 2, 1], [3, 2], [3]] - + sage: G.bender_knuth_involution(2) + [[5, 3, 2, 1, 0], [4, 3, 2, 0], [4, 2, 1], [4, 1], [3]] + TESTS:: - - sage: all(all( bender_knuth_involution(G,i).to_tableau() == G.to_tableau().bender_knuth_involution(i) + + sage: all(all( G.bender_knuth_involution(i).to_tableau() == G.to_tableau().bender_knuth_involution(i) \ for i in range(1,len(G)) ) for G in GelfandTsetlinPatterns(top_row=[3,3,3,0,0])) True - + sage: G = GelfandTsetlinPattern([[2,1,0],[1,0],[0]]) - sage: bender_knuth_involution(G,0) + sage: G.bender_knuth_involution(0) Traceback (most recent call last): ... ValueError: must have 0 < 0 < 3 - sage: bender_knuth_involution(G,3) + sage: G.bender_knuth_involution(3) Traceback (most recent call last): ... ValueError: must have 0 < 3 < 3 - + """ + from copy import copy n = len(self) - + def toggle(i,j): """ Return the toggle of entry 'G[i][j]' in a Gelfand-Tsetlin pattern, 'G'. - """ + """ if i == n-1: return self[n-2][0]+self[n-2][1]-self[n-1][0] - + if j == 0: left = self[i-1][0] else: @@ -561,9 +561,9 @@ def toggle(i,j): right = self[i-1][j+1] else: right = max(self[i-1][j+1], self[i+1][j]) - + return left + right - self[i][j] - + if not 0 < i < n: raise ValueError(f"must have 0 < {i} < {n}") r = n-i From 8baef1135af86bb4a7b27d11e767bd719ab1d459 Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Wed, 27 May 2020 11:11:26 -0700 Subject: [PATCH 229/301] trac 29745: clean up various SPKG.rst files --- build/pkgs/4ti2/SPKG.rst | 3 +- build/pkgs/atlas/SPKG.rst | 9 --- build/pkgs/awali/SPKG.rst | 2 +- build/pkgs/benzene/SPKG.rst | 4 +- build/pkgs/bzip2/SPKG.rst | 5 +- build/pkgs/combinatorial_designs/SPKG.rst | 4 +- build/pkgs/compilerwrapper/SPKG.rst | 4 +- build/pkgs/coxeter3/SPKG.rst | 9 +-- build/pkgs/csdp/SPKG.rst | 3 +- build/pkgs/cvxopt/SPKG.rst | 3 - build/pkgs/d3js/SPKG.rst | 4 +- build/pkgs/database_cremona_ellcurve/SPKG.rst | 4 +- build/pkgs/database_mutation_class/SPKG.rst | 19 +++--- build/pkgs/database_stein_watkins/SPKG.rst | 2 +- .../pkgs/database_stein_watkins_mini/SPKG.rst | 2 +- build/pkgs/database_symbolic_data/SPKG.rst | 1 - build/pkgs/ecl/SPKG.rst | 7 +-- build/pkgs/ecm/SPKG.rst | 6 +- build/pkgs/elliptic_curves/SPKG.rst | 1 - build/pkgs/freetype/SPKG.rst | 31 +++++----- build/pkgs/future/SPKG.rst | 16 ++--- build/pkgs/gap/SPKG.rst | 6 +- build/pkgs/gap3/SPKG.rst | 2 - build/pkgs/gap_packages/SPKG.rst | 2 +- build/pkgs/gf2x/SPKG.rst | 12 +--- build/pkgs/giac/SPKG.rst | 2 +- build/pkgs/git/SPKG.rst | 2 +- build/pkgs/git_trac/SPKG.rst | 4 +- build/pkgs/glpk/SPKG.rst | 13 ++-- build/pkgs/gsl/SPKG.rst | 4 -- build/pkgs/iconv/SPKG.rst | 1 - build/pkgs/igraph/SPKG.rst | 1 - build/pkgs/iml/SPKG.rst | 1 - build/pkgs/ipython/SPKG.rst | 3 - build/pkgs/isl/SPKG.rst | 30 +++++----- build/pkgs/jmol/SPKG.rst | 4 +- build/pkgs/lcalc/SPKG.rst | 60 +++++++++---------- build/pkgs/libatomic_ops/SPKG.rst | 4 +- build/pkgs/libffi/SPKG.rst | 7 ++- build/pkgs/libogg/SPKG.rst | 37 ++++++------ build/pkgs/libpng/SPKG.rst | 14 ++--- build/pkgs/libtheora/SPKG.rst | 37 ++++++------ build/pkgs/linbox/SPKG.rst | 4 +- build/pkgs/mathjax/SPKG.rst | 1 - build/pkgs/mpc/SPKG.rst | 3 +- build/pkgs/mpfr/SPKG.rst | 13 ++-- build/pkgs/mpir/SPKG.rst | 6 +- build/pkgs/normaliz/SPKG.rst | 1 - build/pkgs/p_group_cohomology/SPKG.rst | 4 +- build/pkgs/palp/SPKG.rst | 2 - build/pkgs/pandoc_attributes/SPKG.rst | 6 +- build/pkgs/pexpect/SPKG.rst | 4 +- build/pkgs/pillow/SPKG.rst | 4 +- build/pkgs/pip/SPKG.rst | 12 ++-- build/pkgs/plantri/SPKG.rst | 8 +-- build/pkgs/polymake/SPKG.rst | 6 +- build/pkgs/ppl/SPKG.rst | 11 ++-- build/pkgs/pycosat/SPKG.rst | 4 +- build/pkgs/pygments/SPKG.rst | 7 +-- build/pkgs/pyparsing/SPKG.rst | 3 +- build/pkgs/python2/SPKG.rst | 9 --- build/pkgs/ratpoints/SPKG.rst | 1 - build/pkgs/readline/SPKG.rst | 1 - build/pkgs/rubiks/SPKG.rst | 12 ++-- build/pkgs/sagetex/SPKG.rst | 6 +- build/pkgs/setuptools/SPKG.rst | 1 - build/pkgs/singular/SPKG.rst | 1 - build/pkgs/sip/SPKG.rst | 14 ++--- build/pkgs/six/SPKG.rst | 3 +- build/pkgs/snowballstemmer/SPKG.rst | 30 +++++----- build/pkgs/sphinx/SPKG.rst | 7 +-- build/pkgs/suitesparse/SPKG.rst | 3 +- build/pkgs/sympow/SPKG.rst | 13 ++-- build/pkgs/tachyon/SPKG.rst | 45 +++++++------- build/pkgs/tdlib/SPKG.rst | 4 +- build/pkgs/testpath/SPKG.rst | 2 - build/pkgs/thebe/SPKG.rst | 4 +- build/pkgs/topcom/SPKG.rst | 14 +++-- build/pkgs/zn_poly/SPKG.rst | 27 ++++----- 79 files changed, 295 insertions(+), 386 deletions(-) diff --git a/build/pkgs/4ti2/SPKG.rst b/build/pkgs/4ti2/SPKG.rst index 528f5db4fc5..c847e765542 100644 --- a/build/pkgs/4ti2/SPKG.rst +++ b/build/pkgs/4ti2/SPKG.rst @@ -16,7 +16,8 @@ License Upstream Contact ---------------- -Raymond Hemmecke, TU Munich, Germany Matthias Köppe, UC Davis, CA, USA +- Raymond Hemmecke, TU Munich, Germany +- Matthias Köppe, UC Davis, CA, USA Dependencies ------------ diff --git a/build/pkgs/atlas/SPKG.rst b/build/pkgs/atlas/SPKG.rst index 62901240a3d..b2c086c83ba 100644 --- a/build/pkgs/atlas/SPKG.rst +++ b/build/pkgs/atlas/SPKG.rst @@ -28,17 +28,14 @@ Special Update/Build Instructions --------------------------------- - src/lapack-x.y.z.tgz: The netlib lapack tarball. If you update this, - make sure you also update the LAPACK_TARBALL variable in spkg-install. - src/ATLAS-lib: We are using a dummy autotools/libtools project - to repack the static ATLAS libraries into shared libraries. - src/ARCHS: We ship some archdef tarballs to speed ATLAS build. - spkg-install: If you update atlas to a new version make sure that the - ATLAS_OSTYPE, ATLAS_MACHTYPE, and ATLAS_ISAEXT variables in spkg-install remain in sync with atlas' CONFIG/include/atlconf.h @@ -49,7 +46,6 @@ Patches ~~~~~~~ - patches/detect.patch: Fix Itanium2 support on modern - RHEL 5 and SLES 10 systems, work around -m64 issue on Itanium2, and correctly detect number and speed of CPUs on a bunch of systems. @@ -57,12 +53,10 @@ Patches on ARM. - patches/Makefile.patch: fix clean target. - patches/do_not_force_mutex.patch: always use assembly over mutex - since the mutex version fails to build a shared library. See #15045 for details. - patches/glibc_scanf_workaround.patch: Workaround for the scanf bug - in glibc-2.18 that breaks the atlas auto-tuning system. Configuration @@ -97,11 +91,9 @@ The package can be configured via three environment variables: In addition, you can also set - SAGE_ATLAS_ARCH=fast picks defaults for a modern (2-3 year old) - CPU of your processor line, and - SAGE_ATLAS_ARCH=base picks defaults that should work for a ~10 - year old CPU. For example, @@ -111,5 +103,4 @@ The package can be configured via three environment variables: would be appropriate for a Core i7 CPU. - If SAGE_ATLAS_SAVE_ARCHDEF = is given, then a new archdef - file is created and saved to the given path. diff --git a/build/pkgs/awali/SPKG.rst b/build/pkgs/awali/SPKG.rst index 6e5b3fe5d63..11142d87cee 100644 --- a/build/pkgs/awali/SPKG.rst +++ b/build/pkgs/awali/SPKG.rst @@ -9,7 +9,7 @@ finite state machines. Here finite state machines is to be understood in the broadest possible sense: finite automata with output — often called transducers then — or even more generally finite automata with multiplicity, that is, automata that not only accept, or recognize, -sequences of symbols but compute for every such sequence a \`value' that +sequences of symbols but compute for every such sequence a 'value' that is associated with it and which can be taken in any semiring. Hence the variety of situations that can thus be modellized. diff --git a/build/pkgs/benzene/SPKG.rst b/build/pkgs/benzene/SPKG.rst index dce503de516..cfec92c289a 100644 --- a/build/pkgs/benzene/SPKG.rst +++ b/build/pkgs/benzene/SPKG.rst @@ -12,8 +12,8 @@ fusenes that are subgraphs of the hexagonal lattice. License ------- -Benzene is licensed under the GNU General Public License v2 or later ( -June 2007 ) +Benzene is licensed under the GNU General Public License v2 or later +(June 2007) Upstream Contact diff --git a/build/pkgs/bzip2/SPKG.rst b/build/pkgs/bzip2/SPKG.rst index 8639e28d8ce..b6aeb3c0d61 100644 --- a/build/pkgs/bzip2/SPKG.rst +++ b/build/pkgs/bzip2/SPKG.rst @@ -31,8 +31,9 @@ None Special Update/Build Instructions --------------------------------- -This package must not be bzip2 compressed, so create it using tar c -bzip2-1.0.6 \| gzip --best >bzip2-1.0.6.spkg +This package must not be bzip2 compressed, so create it using :: + + tar c bzip2-1.0.6 | gzip --best >bzip2-1.0.6.spkg The build system has been autotoolized based on a patch by the Suse folk at diff --git a/build/pkgs/combinatorial_designs/SPKG.rst b/build/pkgs/combinatorial_designs/SPKG.rst index 327573dd863..59ad44d893b 100644 --- a/build/pkgs/combinatorial_designs/SPKG.rst +++ b/build/pkgs/combinatorial_designs/SPKG.rst @@ -8,9 +8,7 @@ Description Data for Combinatorial Designs. Current content: - The table of MOLS (10 000 integers) from the Handbook of - Combinatorial - - Designs, 2ed. + Combinatorial Designs, 2ed. License ------- diff --git a/build/pkgs/compilerwrapper/SPKG.rst b/build/pkgs/compilerwrapper/SPKG.rst index 9e9690b020a..0f702b4f423 100644 --- a/build/pkgs/compilerwrapper/SPKG.rst +++ b/build/pkgs/compilerwrapper/SPKG.rst @@ -18,8 +18,8 @@ GPL v2+ Upstream Contact ---------------- -https://bitbucket.org/vbraun/compilerwrapper Volker Braun - +- https://bitbucket.org/vbraun/compilerwrapper +- Volker Braun Dependencies ------------ diff --git a/build/pkgs/coxeter3/SPKG.rst b/build/pkgs/coxeter3/SPKG.rst index 79111787f29..fc198fa9814 100644 --- a/build/pkgs/coxeter3/SPKG.rst +++ b/build/pkgs/coxeter3/SPKG.rst @@ -46,8 +46,9 @@ None Special Update/Build Instructions --------------------------------- -The source package was created by running +The source package was created by running :: -commit=8ac9c71723c8ca57a836d6381aed125261e44e9e git clone -https://github.com/tscrim/coxeter.git cd coxeter git archive $commit -\|bzip2 --best >coxeter-$commit.tar.bz2 + commit=8ac9c71723c8ca57a836d6381aed125261e44e9e + git clone https://github.com/tscrim/coxeter.git + cd coxeter + git archive $commit | bzip2 --best >coxeter-$commit.tar.bz2 diff --git a/build/pkgs/csdp/SPKG.rst b/build/pkgs/csdp/SPKG.rst index 15a1c3df3ee..88b87acaa88 100644 --- a/build/pkgs/csdp/SPKG.rst +++ b/build/pkgs/csdp/SPKG.rst @@ -48,6 +48,5 @@ Detailed steps to build the spkg are as follows. You need With these ready: - ./spkg-src -- copy the resulting csdp-.tar.gz to SAGE_ROOT/upstream, - +- copy the resulting csdp-.tar.gz to SAGE_ROOT/upstream, or somewhere else appropriate diff --git a/build/pkgs/cvxopt/SPKG.rst b/build/pkgs/cvxopt/SPKG.rst index 698ef1888ac..6ab03adb886 100644 --- a/build/pkgs/cvxopt/SPKG.rst +++ b/build/pkgs/cvxopt/SPKG.rst @@ -42,18 +42,15 @@ Special Update/Build Instructions - cvxopt.h.patch: Fix building with GCC on Solaris. - setup.py.patch: look for libraries and includes in $SAGE_LOCAL - instead of /usr. Add fortran, blas,... libraries if needed. Build with GSL and GLPK support. - remove doc/html/, as it can be rebuild by invoking 'sage -sh' and - running 'make html' in doc/ - TODO: Add more tests in spkg-check - TODO: one might want to enhance the code to allow other Sage - random sources, at the moment only GSL is used in CVXOPT-1.1.3 spkg, apparently it will need an unclear to me "with seed(..)" construct. diff --git a/build/pkgs/d3js/SPKG.rst b/build/pkgs/d3js/SPKG.rst index 1b24b48ccb8..739f46f8f28 100644 --- a/build/pkgs/d3js/SPKG.rst +++ b/build/pkgs/d3js/SPKG.rst @@ -17,8 +17,8 @@ BSD 3-Clause License Upstream Contact ---------------- -Author: Mike Bostock (http://bost.ocks.org/mike/) Home page: -http://d3js.org/ +- Author: Mike Bostock (http://bost.ocks.org/mike/) +- Home page: http://d3js.org/ Dependencies ------------ diff --git a/build/pkgs/database_cremona_ellcurve/SPKG.rst b/build/pkgs/database_cremona_ellcurve/SPKG.rst index 02fd4f4d89b..6a2a75ecfbf 100644 --- a/build/pkgs/database_cremona_ellcurve/SPKG.rst +++ b/build/pkgs/database_cremona_ellcurve/SPKG.rst @@ -41,11 +41,11 @@ Get an up-to-date copy of the git repository ecdata from https://github.com/JohnCremona/ecdata. If the cremona database has already been installed, remove -\`SAGE_DATA/cremona/cremona.db`. Then run +``SAGE_DATA/cremona/cremona.db``. Then run The build script expects to find the files in subfolders allcurves, allgens, degphi and allbsd of the ecdata folder. It extracts them and builds the new cremona.db file from the contents. -Finally, copy \`SAGE_DATA/cremona/cremona.db\` to the src directory of +Finally, copy ``SAGE_DATA/cremona/cremona.db`` to the src directory of the spkg. diff --git a/build/pkgs/database_mutation_class/SPKG.rst b/build/pkgs/database_mutation_class/SPKG.rst index dd07544bb64..fbf5ff84fc8 100644 --- a/build/pkgs/database_mutation_class/SPKG.rst +++ b/build/pkgs/database_mutation_class/SPKG.rst @@ -5,22 +5,21 @@ Mutation class database Description ----------- - Contains a database of all exceptional mutation classes of quivers. +Contains a database of all exceptional mutation classes of quivers. - Every file in the database is of the form - \``mutation_classes_n.dig6`\` for some \``n`\` and +Every file in the database is of the form +``mutation_classes_n.dig6`` for some ``n`` and -- contains a \``cPickle.dump`\` of a dictionary where +- contains a ``cPickle.dump`` of a dictionary where - the keys are tuples representing irreducible exceptional quiver - mutation types of rank \``n``, and + mutation types of rank ``n``, and - the values are all quivers in the given mutation class stored in - canonical form as \``(dig6,edges)`\` where -- \``dig6`\` is the dig6 data of the given \``DiGraph``, and -- \``edges`\` are the non-simply-laced edges thereof. + canonical form as ``(dig6,edges)`` where +- ``dig6`` is the dig6 data of the given ``DiGraph``, and +- ``edges`` are the non-simply-laced edges thereof. - is obtained by running the function - \``sage.combinat.cluster_algebra_quiver.quiver_mutation_type._save_data_dig6(n, - types='Exceptional', verbose=False)`\` + ``sage.combinat.cluster_algebra_quiver.quiver_mutation_type._save_data_dig6(n, types='Exceptional', verbose=False)`` SPKG Maintainers diff --git a/build/pkgs/database_stein_watkins/SPKG.rst b/build/pkgs/database_stein_watkins/SPKG.rst index 735c9d2da5f..6cc091b8ec8 100644 --- a/build/pkgs/database_stein_watkins/SPKG.rst +++ b/build/pkgs/database_stein_watkins/SPKG.rst @@ -23,4 +23,4 @@ None Patches ~~~~~~~ -- None +None diff --git a/build/pkgs/database_stein_watkins_mini/SPKG.rst b/build/pkgs/database_stein_watkins_mini/SPKG.rst index c6563440103..0147cca7e59 100644 --- a/build/pkgs/database_stein_watkins_mini/SPKG.rst +++ b/build/pkgs/database_stein_watkins_mini/SPKG.rst @@ -23,4 +23,4 @@ None Patches ~~~~~~~ -- None +None diff --git a/build/pkgs/database_symbolic_data/SPKG.rst b/build/pkgs/database_symbolic_data/SPKG.rst index 67c72efad12..ba21d67d5f2 100644 --- a/build/pkgs/database_symbolic_data/SPKG.rst +++ b/build/pkgs/database_symbolic_data/SPKG.rst @@ -8,7 +8,6 @@ The SymbolicData project is set out - to develop concepts and tools for profiling, testing and benchmarking Computer Algebra Software - (CAS) and - to collect and interlink relevant data and activities from different diff --git a/build/pkgs/ecl/SPKG.rst b/build/pkgs/ecl/SPKG.rst index b7b191129d6..646abfc6ecf 100644 --- a/build/pkgs/ecl/SPKG.rst +++ b/build/pkgs/ecl/SPKG.rst @@ -45,31 +45,26 @@ Special Update/Build Instructions --------------------------------- - As autotools need to be run after most of the patches are applied, - we do all the patching in spkg-source. - Deleting the following directories saves space: without doing - this, the tarball can grow from under 3 megabytes to more than 7 megabytes. Deleting these files is done automatically by the - \`spkg-src\` script. + ``spkg-src`` script. - The directory msvc - The directory src/gc-unstable - The directory src/gmp - The directory src/libffi - Note: for the time being, ECL is built single threaded library as it - seems to interact badly with the pexpect interface and Sage's signal handling when built multithreaded. - Do NOT quote SAGE_LOCAL when setting CPPFLAGS and/or LDFLAGS, - in spkg-install as this caused the build to break. See http://trac.sagemath.org/sage_trac/ticket/10187#comment:117 - TODO: Add the ECL test suite, and an spkg-check file to run it. - TODO: Make ECL use Sage's Boehm GC on MacOS X as well (but perhaps - put some changes from ECL's into Sage's Boehm GC), then remove the src/src/gc directory, too. diff --git a/build/pkgs/ecm/SPKG.rst b/build/pkgs/ecm/SPKG.rst index fbbae582bb5..e1c84ba21d9 100644 --- a/build/pkgs/ecm/SPKG.rst +++ b/build/pkgs/ecm/SPKG.rst @@ -30,11 +30,9 @@ Special Update/Build Instructions --------------------------------- - GMP-ECM comes with a self-tuning feature; we could support - that as an option ($SAGE_TUNE_*=yes) in the future. - ECM currently does not (by itself) use the CC and CFLAGS settings - from 'gmp.h' since we pass (other) options in CFLAGS, and CC is set by Sage and might got set by the user. We now at least partially fix that @@ -56,13 +54,11 @@ Special Update/Build Instructions option isn't used on anything other than x86 / x86_64.) - We currently work around a linker bug on MacOS X 10.5 PPC (with - GCC 4.2.1) which breaks 'configure' if debug symbols are enabled. This \*might\* get fixed in later upstream releases. -- We could save some space by removing the \`src/build.vc10/\` +- We could save some space by removing the ``src/build.vc10/`` directory which - isn't used in Sage. (It gets probably more worth in case also directories / files for later versions of Microsoft Visual C get added.) diff --git a/build/pkgs/elliptic_curves/SPKG.rst b/build/pkgs/elliptic_curves/SPKG.rst index cb22e9ccb42..dc0064037e0 100644 --- a/build/pkgs/elliptic_curves/SPKG.rst +++ b/build/pkgs/elliptic_curves/SPKG.rst @@ -7,7 +7,6 @@ Description Includes two databases: - A small subset of John Cremona's database of elliptic curves up - to conductor 10000. - William Stein's database of interesting curves diff --git a/build/pkgs/freetype/SPKG.rst b/build/pkgs/freetype/SPKG.rst index 7b516572480..9314b7047b1 100644 --- a/build/pkgs/freetype/SPKG.rst +++ b/build/pkgs/freetype/SPKG.rst @@ -6,20 +6,20 @@ Description From the documentation: -> FreeType is a software font engine that is designed to be small, > -efficient, highly customizable, and portable while capable of > -producing high-quality output (glyph images). It can be used in > -graphics libraries, display servers, font conversion tools, > text image +FreeType is a software font engine that is designed to be small, +efficient, highly customizable, and portable while capable of +producing high-quality output (glyph images). It can be used in +graphics libraries, display servers, font conversion tools, text image generation tools, and many other products as well. -> Note that FreeType is a font service and doesn't provide APIs to > -perform higher-level features like text layout or graphics processing > -(e.g., colored text rendering, ‘hollowing’, etc.). However, it greatly > -simplifies these tasks by providing a simple, easy to use, and uniform > +Note that FreeType is a font service and doesn't provide APIs to +perform higher-level features like text layout or graphics processing +(e.g., colored text rendering, ‘hollowing’, etc.). However, it greatly +simplifies these tasks by providing a simple, easy to use, and uniform interface to access the content of font files. -> Please note that ‘FreeType’ is also called ‘FreeType 2’, to > -distinguish it from the old, deprecated ‘FreeType 1’ library, > a +Please note that ‘FreeType’ is also called ‘FreeType 2’, to +distinguish it from the old, deprecated ‘FreeType 1’ library, a predecessor no longer maintained and supported. The package in Sage is called freetype (in lowercase). @@ -32,8 +32,8 @@ License From the documentation: -> FreeType is released under two open-source licenses: our own BSD-like -> FreeType License and the GNU Public License, Version 2. It can thus > +FreeType is released under two open-source licenses: our own BSD-like +FreeType License and the GNU Public License, Version 2. It can thus be used by any kind of projects, be they proprietary or not. @@ -42,10 +42,11 @@ Upstream Contact - home: https://www.freetype.org - repo: -- official: http://git.savannah.gnu.org/cgit/freetype -- mirror: https://github.com/aseprite/freetype2/ + + - official: http://git.savannah.gnu.org/cgit/freetype + - mirror: https://github.com/aseprite/freetype2/ Dependencies ------------ -See the \`dependencies\` file. +See the ``dependencies`` file. diff --git a/build/pkgs/future/SPKG.rst b/build/pkgs/future/SPKG.rst index 92c1254f8e1..9bab6bba252 100644 --- a/build/pkgs/future/SPKG.rst +++ b/build/pkgs/future/SPKG.rst @@ -12,16 +12,16 @@ support both Python 2 and Python 3 with minimal overhead. It is designed to be used as follows: -from \__future_\_ import (absolute_import, division, +.. CODE-BLOCK:: python - print_function, unicode_literals) + from __future__ import (absolute_import, division, + print_function, unicode_literals) -from builtins import ( - - bytes, dict, int, list, object, range, str, - ascii, chr, hex, input, next, oct, open, - pow, round, super, - filter, map, zip) + from builtins import ( + bytes, dict, int, list, object, range, str, + ascii, chr, hex, input, next, oct, open, + pow, round, super, + filter, map, zip) followed by predominantly standard, idiomatic Python 3 code that then runs similarly on Python 2.6/2.7 and Python 3.3+. diff --git a/build/pkgs/gap/SPKG.rst b/build/pkgs/gap/SPKG.rst index 54886af1642..6ecef93ba91 100644 --- a/build/pkgs/gap/SPKG.rst +++ b/build/pkgs/gap/SPKG.rst @@ -43,19 +43,17 @@ update GAP, please also update and use the spkg-src script. You need the full GAP tree to compile/install many GAP packages. -- There's apparently a command missing (in \`spkg-install`) building +- There's apparently a command missing (in ``spkg-install``) building the - (HTML?) documentation. Earlier changelog entries as well as the description above state the documentation was removed from the upstream sources... Since the (pre-)built HTML documentation is currently included, I've - commented out some lines in that part of \`spkg-install`. -leif + commented out some lines in that part of ``spkg-install``. -leif Patches ~~~~~~~ - writeandcheck.patch: fix infinite loop in writeandcheck() when - writing an error message fails. diff --git a/build/pkgs/gap3/SPKG.rst b/build/pkgs/gap3/SPKG.rst index 05093945717..929b89867c2 100644 --- a/build/pkgs/gap3/SPKG.rst +++ b/build/pkgs/gap3/SPKG.rst @@ -83,6 +83,4 @@ None Dependencies ------------ -= - None diff --git a/build/pkgs/gap_packages/SPKG.rst b/build/pkgs/gap_packages/SPKG.rst index e89072b90c9..780d0823563 100644 --- a/build/pkgs/gap_packages/SPKG.rst +++ b/build/pkgs/gap_packages/SPKG.rst @@ -32,7 +32,7 @@ Notes A brief description of each package follows: -cohomolo - The cohomolo package is a GAP interface to some \`C' programs +cohomolo - The cohomolo package is a GAP interface to some ``C`` programs for computing Schur multipliers and covering groups of finite groups and first and second cohomology groups of finite groups acting on finite modules. (Author: Max Horn, Markus Pfeiffer) diff --git a/build/pkgs/gf2x/SPKG.rst b/build/pkgs/gf2x/SPKG.rst index 141fd49ff9a..cee64e7ff1f 100644 --- a/build/pkgs/gf2x/SPKG.rst +++ b/build/pkgs/gf2x/SPKG.rst @@ -35,7 +35,6 @@ Special Update/Build Instructions - As some patches touch config/acinclude.m4, we have to touch aclocal.m4, - configure, Makefile.in and gf2x/gf2x-config.h.in to prevent autotools to try to regenerate these files. @@ -43,26 +42,21 @@ Patches ~~~~~~~ - 0001-Trac-15014-Let-gf2x-build-a-shared-library-on-Cygwin.patch: pass -- no-undefined flag to libtool. + -no-undefined flag to libtool. - 0002-tr-portability.patch: backport upstream fix for non-portable tr use - 0003-Improve-detection-of-sse2-support.patch: backport upstream - improved - - check for sse2 + improved check for sse2 - 0004-Add-disable-hardware-specific-code.patch: add option -- -disable-hardware-specific-code to build system. This is partly - + -disable-hardware-specific-code to build system. This is partly backported from upstream. - 0005-Update-autotooled-files.patch: the above patches make changes to - code used by autotools for generation of the build system. This patches those files, so that autotools need not be installed. - 0006-Fix_make_check_not_failing_on_errors.patch: (upstream patch) - Fix bug in shell script such that 'make check' always fails upon errors. diff --git a/build/pkgs/giac/SPKG.rst b/build/pkgs/giac/SPKG.rst index 62563c0fe05..2bfa3918dec 100644 --- a/build/pkgs/giac/SPKG.rst +++ b/build/pkgs/giac/SPKG.rst @@ -15,7 +15,7 @@ Description $SAGE_LOCAL/share/giac/doc/en/cascmd_en/index.html -- -Author's website with debian, ubuntu, macosx, windows package: +- Author's website with debian, ubuntu, macosx, windows package: http://www-fourier.ujf-grenoble.fr/~parisse/giac.html diff --git a/build/pkgs/git/SPKG.rst b/build/pkgs/git/SPKG.rst index 9ade00c58c9..408192996a7 100644 --- a/build/pkgs/git/SPKG.rst +++ b/build/pkgs/git/SPKG.rst @@ -9,7 +9,7 @@ Description unusually rich command set that provides both high-operations and full access to internals. -- - \`man git\` +- ``man git`` Upstream Contact diff --git a/build/pkgs/git_trac/SPKG.rst b/build/pkgs/git_trac/SPKG.rst index 8691c8bc2fb..d11ec626fbe 100644 --- a/build/pkgs/git_trac/SPKG.rst +++ b/build/pkgs/git_trac/SPKG.rst @@ -17,8 +17,8 @@ GPLv3+ Upstream Contact ---------------- -https://github.com/sagemath/git-trac-command Volker Braun - +- https://github.com/sagemath/git-trac-command +- Volker Braun Dependencies ------------ diff --git a/build/pkgs/glpk/SPKG.rst b/build/pkgs/glpk/SPKG.rst index a25136f27fd..5dfc404acd5 100644 --- a/build/pkgs/glpk/SPKG.rst +++ b/build/pkgs/glpk/SPKG.rst @@ -46,18 +46,16 @@ Dependencies Special Update/Build Instructions --------------------------------- -- \`configure\` doesn't support specifying the location of the GMP - - library to use; only \`--with-gmp[=yes]\` or \`--with-gmp=no\` +- ``configure`` doesn't support specifying the location of the GMP + library to use; only ``--with-gmp[=yes]`` or ``--with-gmp=no`` are valid options. (So we \*have to\* add Sage's include and - library directories to \`CPPFLAGS\` and \`LDFLAGS`, respectively.) - -- Do we need the \`--disable-static`? The stand-alone solver presumably + library directories to ``CPPFLAGS`` and ``LDFLAGS``, respectively.) +- Do we need the ``--disable-static``? The stand-alone solver presumably runs faster when built with a static library; also other (stand-alone) programs using it would. - (Instead, we should perhaps use \`--enable-static --enable-shared\` + (Instead, we should perhaps use ``--enable-static --enable-shared`` to go safe.) @@ -68,7 +66,6 @@ Patches - src/01-zlib.patch: don't build the included zlib library. - src/02-cygwin_sharedlib.patch: Let a shared library be built on Cygwin by - passing the -no-undefined flag to libtool. The numbering reflect the order in which they have been created from diff --git a/build/pkgs/gsl/SPKG.rst b/build/pkgs/gsl/SPKG.rst index b89f7e6fdf5..851294e080a 100644 --- a/build/pkgs/gsl/SPKG.rst +++ b/build/pkgs/gsl/SPKG.rst @@ -30,24 +30,20 @@ Upstream Contact GSL mailing lists: - Bug-gsl mailing list -- bug reports for the GNU - Scientific Library should be sent to bug-gsl@gnu.org - Help-gsl users mailing list -- for questions about - installation, how GSL works and how it is used, or general questions concerning GSL. - Info-gsl mailing list -- announcements of new releases - are made there. Dependencies ------------ - None - GSL does not depend on any other Sage package to compile, link - and pass all of GSL's self-tests. Despite that fact, BLAS is listed as a dependency. (It comes with its own CBLAS implementation that is diff --git a/build/pkgs/iconv/SPKG.rst b/build/pkgs/iconv/SPKG.rst index 298f1a7b722..85e009c0c85 100644 --- a/build/pkgs/iconv/SPKG.rst +++ b/build/pkgs/iconv/SPKG.rst @@ -30,5 +30,4 @@ Special Update/Build Instructions - None, other than anyone updating this package should be familiar with how - to write shell scripts. diff --git a/build/pkgs/igraph/SPKG.rst b/build/pkgs/igraph/SPKG.rst index 32e3cb9bf8d..1ba18e70031 100644 --- a/build/pkgs/igraph/SPKG.rst +++ b/build/pkgs/igraph/SPKG.rst @@ -25,7 +25,6 @@ Dependencies - GMP/MPIR - libxml2, but this is not shipped with Sage, so the user has to install - libxml2-dev from her distro. diff --git a/build/pkgs/iml/SPKG.rst b/build/pkgs/iml/SPKG.rst index 15a6d129b02..1981fced5d8 100644 --- a/build/pkgs/iml/SPKG.rst +++ b/build/pkgs/iml/SPKG.rst @@ -37,7 +37,6 @@ Special Update/Build Instructions --------------------------------- - As of version 1.0.4, you need to repackage the upstream tarball - using the spkg-src script because there was a bugfix version of 1.0.4 reposted upstream without version number bump. diff --git a/build/pkgs/ipython/SPKG.rst b/build/pkgs/ipython/SPKG.rst index 2790729df4a..ad92a49fcab 100644 --- a/build/pkgs/ipython/SPKG.rst +++ b/build/pkgs/ipython/SPKG.rst @@ -10,18 +10,15 @@ IPython is a multiplatform, Free Software project (BSD licensed) that offers: - An enhanced Python shell designed for efficient interactive - work. It includes many enhancements over the default Python shell, including the ability for controlling interactively all major GUI toolkits in a non-blocking manner. - A library to build customized interactive environments using Python - as the basic language (but with the possibility of having extended or alternate syntaxes). - A system for interactive distributed and parallel computing (this is - part of IPython's new development). License diff --git a/build/pkgs/isl/SPKG.rst b/build/pkgs/isl/SPKG.rst index e4bf84f2079..edf794be2ce 100644 --- a/build/pkgs/isl/SPKG.rst +++ b/build/pkgs/isl/SPKG.rst @@ -25,18 +25,18 @@ Upstream Contact Citation -------- -@incollection{Verdoolaege2010isl, - - author = {Verdoolaege, Sven}, - title = {isl: An Integer Set Library for the Polyhedral Model}, - booktitle = {Mathematical Software - ICMS 2010}, - series = {Lecture Notes in Computer Science}, - editor = {Fukuda, Komei and Hoeven, Joris and Joswig, Michael and - Takayama, Nobuki}, - publisher = {Springer}, - isbn = {978-3-642-15581-9}, - pages = {299-302}, - volume = {6327}, - year = {2010} - -} +:: + + @incollection{Verdoolaege2010isl, + author = {Verdoolaege, Sven}, + title = {isl: An Integer Set Library for the Polyhedral Model}, + booktitle = {Mathematical Software - ICMS 2010}, + series = {Lecture Notes in Computer Science}, + editor = {Fukuda, Komei and Hoeven, Joris and Joswig, Michael and + Takayama, Nobuki}, + publisher = {Springer}, + isbn = {978-3-642-15581-9}, + pages = {299-302}, + volume = {6327}, + year = {2010} + } diff --git a/build/pkgs/jmol/SPKG.rst b/build/pkgs/jmol/SPKG.rst index c24b54cf82c..8c021b6fe8e 100644 --- a/build/pkgs/jmol/SPKG.rst +++ b/build/pkgs/jmol/SPKG.rst @@ -36,7 +36,7 @@ The commandline jmol requires java at runtime. Special Build Instructions -------------------------- -To avoid depending on \`unzip\` at build time, we have to repack the -tarball, see \`spkg-src`. We take the opportunity to remove some +To avoid depending on ``unzip`` at build time, we have to repack the +tarball, see ``spkg-src``. We take the opportunity to remove some unnecessary subdirectories, see http://wiki.jmol.org/index.php/Jmol_JavaScript_Object#In_detail diff --git a/build/pkgs/lcalc/SPKG.rst b/build/pkgs/lcalc/SPKG.rst index 2bc6a6ce554..3dd99db88fe 100644 --- a/build/pkgs/lcalc/SPKG.rst +++ b/build/pkgs/lcalc/SPKG.rst @@ -35,29 +35,27 @@ Special Update/Build Instructions --------------------------------- - There is some garbage in the upstream sources which should be - removed: - - src/include/.Lexplicit_formula.h.swp - src/include/.Lvalue.h.swp - src/include/._.DS_Store - src/include/.DS_Store - src/include/Lexplicit_formula.h.swap.crap - src/include/Lvalue.h.bak - src/src/Makefile.old - src/src/.Makefile.old.swp - src/src/._.DS_Store - src/src/.DS_Store - src/src/.Lcommandline.ggo.swp - src/src/libLfunction.a + removed:: + + src/include/.Lexplicit_formula.h.swp + src/include/.Lvalue.h.swp + src/include/._.DS_Store + src/include/.DS_Store + src/include/Lexplicit_formula.h.swap.crap + src/include/Lvalue.h.bak + src/src/Makefile.old + src/src/.Makefile.old.swp + src/src/._.DS_Store + src/src/.DS_Store + src/src/.Lcommandline.ggo.swp + src/src/libLfunction.a - We (and apparently also upstream) currently don't build Lcalc's tests - (see Makefile), hence there's no spkg-check. This might change in newer upstream versions. - The original Makefile uses $(CC) to compile C++ (also using $(CCFLAGS)), - which it defines to 'g++', and hardcodes 'g++' when linking the shared library. (It should use $(CXX) instead, which might \*default\* to @@ -80,22 +78,19 @@ Patches options, locations of headers and libraries etc.). Besides that, we -- put CXXFLAGS into Lcalc's "CCFLAGS" used for compiling C++, -- remove some stuff involving LDFLAGS1 and LDFLAGS2, setting just - LDFLAGS, -- use $(MAKE) instead of 'make' in the crude build receipts, -- use CXXFLAG64 when linking the shared library, -- now use $(CXX) for compiling and linking C++, which \*defaults\* to - 'g++', - - but can be overridden by setting the environment variable of the same - name. ($(CC) now \*defaults\* to 'gcc', although currently not really - used as far as I can see.) - -- $(INSTALL_DIR) can now be overridden by simply setting the - environment - - variable of the same name. + - put CXXFLAGS into Lcalc's "CCFLAGS" used for compiling C++, + - remove some stuff involving LDFLAGS1 and LDFLAGS2, setting just + LDFLAGS, + - use $(MAKE) instead of 'make' in the crude build receipts, + - use CXXFLAG64 when linking the shared library, + - now use $(CXX) for compiling and linking C++, which \*defaults\* to + 'g++', + but can be overridden by setting the environment variable of the same + name. ($(CC) now \*defaults\* to 'gcc', although currently not really + used as far as I can see.) + - $(INSTALL_DIR) can now be overridden by simply setting the + environment + variable of the same name. - Lcommon.h.patch: @@ -124,5 +119,4 @@ Patches This should get reported upstream. - lcalc-1.23_default_parameters_1.patch: Make Lcalc (1.23) build with - GCC 4.9 diff --git a/build/pkgs/libatomic_ops/SPKG.rst b/build/pkgs/libatomic_ops/SPKG.rst index dc743ee01af..131e2629409 100644 --- a/build/pkgs/libatomic_ops/SPKG.rst +++ b/build/pkgs/libatomic_ops/SPKG.rst @@ -15,8 +15,8 @@ License Upstream Contact ---------------- -Webpage: http://www.hboehm.info/gc/ Email List: -bdwgc@lists.opendylan.org +- Webpage: http://www.hboehm.info/gc/ +- Email List: bdwgc@lists.opendylan.org Dependencies ------------ diff --git a/build/pkgs/libffi/SPKG.rst b/build/pkgs/libffi/SPKG.rst index 3b7730a1dc2..33e4e17f4b5 100644 --- a/build/pkgs/libffi/SPKG.rst +++ b/build/pkgs/libffi/SPKG.rst @@ -35,7 +35,7 @@ License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the -\``Software''), to deal in the Software without restriction, including +"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to @@ -44,7 +44,7 @@ the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED \``AS IS'', WITHOUT WARRANTY OF ANY KIND, +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY @@ -56,4 +56,5 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Upstream Contact ---------------- -https://sourceware.org/libffi/ https://github.com/libffi/libffi +- https://sourceware.org/libffi/ +- https://github.com/libffi/libffi diff --git a/build/pkgs/libogg/SPKG.rst b/build/pkgs/libogg/SPKG.rst index db511888876..8c0da263050 100644 --- a/build/pkgs/libogg/SPKG.rst +++ b/build/pkgs/libogg/SPKG.rst @@ -21,30 +21,27 @@ modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright - -notice, this list of conditions and the following disclaimer. + notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright - -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - Neither the name of the Xiph.org Foundation nor the names of its - -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -\``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Upstream Contact diff --git a/build/pkgs/libpng/SPKG.rst b/build/pkgs/libpng/SPKG.rst index f562451f78e..583872b5a50 100644 --- a/build/pkgs/libpng/SPKG.rst +++ b/build/pkgs/libpng/SPKG.rst @@ -39,10 +39,9 @@ Special Update/Build Instructions - On old versions of Darwin, the symbolic links libpng.\* created by libpng16 may - interfere with a system-wide libPng.dylib. -- -- the following is very likely to be obsolete in 2014 --- + -- the following is very likely to be obsolete in 2014 --- This system-wide library is likely to be a different version and on top of that, the symbols exported there are prefixed with "_cg" @@ -57,14 +56,13 @@ Special Update/Build Instructions looked for when Sage is being built or run, but that's not the case either; it is at least looked for by the "ImageIO" framework: -- when Python is built with Mac OS extensions, fixed in #4008; -- when Mercurial is built because it uses $EDITOR, cf. #4678; -- when R is built and it finds -lpng, cf. #4409 and #11696. + - when Python is built with Mac OS extensions, fixed in #4008; + - when Mercurial is built because it uses $EDITOR, cf. #4678; + - when R is built and it finds ``-lpng``, cf. #4409 and #11696. -- -- this is no longer done, as of #27186 --- + -- this is no longer done, as of #27186 --- As not all of these problems are easily dealt with and new ones may arise, we chose to delete the $SAGE_LOCAL/lib/libpng.\* symlinks. Therefore, some packages like Tachyon, which by default look for - -- lpng are patched to look for -lpng16 instead. + ``-lpng`` are patched to look for ``-lpng16`` instead. diff --git a/build/pkgs/libtheora/SPKG.rst b/build/pkgs/libtheora/SPKG.rst index 7acecc62466..b964288c8e2 100644 --- a/build/pkgs/libtheora/SPKG.rst +++ b/build/pkgs/libtheora/SPKG.rst @@ -20,30 +20,27 @@ modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright - -notice, this list of conditions and the following disclaimer. + notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright - -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - Neither the name of the Xiph.org Foundation nor the names of its - -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -\``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Upstream Contact diff --git a/build/pkgs/linbox/SPKG.rst b/build/pkgs/linbox/SPKG.rst index 5f4ff029748..93c854986ed 100644 --- a/build/pkgs/linbox/SPKG.rst +++ b/build/pkgs/linbox/SPKG.rst @@ -50,10 +50,8 @@ Special Update/Build Instructions TODO: - spkg-check is disabled for now, should work in the next release - after 1.3.2. -- Check whether \`make fullcheck\` works/builds, is worth running, and +- Check whether ``make fullcheck`` works/builds, is worth running, and doesn't - take ages. (Version 1.1.6 doesn't seem to have such a target.) diff --git a/build/pkgs/mathjax/SPKG.rst b/build/pkgs/mathjax/SPKG.rst index 1200613ec38..94b165256d2 100644 --- a/build/pkgs/mathjax/SPKG.rst +++ b/build/pkgs/mathjax/SPKG.rst @@ -33,6 +33,5 @@ Patches ------- - nopng_config.patch: prevent font warning messages since png files are - removed. See section "Trimming II -- not strictly necessary" of https://github.com/mathjax/MathJax-docs/wiki/Guide%3A-reducing-size-of-a-mathjax-installation diff --git a/build/pkgs/mpc/SPKG.rst b/build/pkgs/mpc/SPKG.rst index 81b3cef4f7e..78039c62d3e 100644 --- a/build/pkgs/mpc/SPKG.rst +++ b/build/pkgs/mpc/SPKG.rst @@ -24,7 +24,7 @@ Upstream Contact The MPC website is located at http://www.multiprecision.org/mpc . -The MPC team can be contact via the MPC mailing list: +The MPC team can be contacted via the MPC mailing list: mpc-discuss@lists.gforge.inria.fr @@ -39,6 +39,5 @@ Special Update/Build Instructions --------------------------------- - mpc_mul_faster.patch: Patch from Paul Zimmermann to speed up MPC - multiplication (for small precisions) by reducing overhead in MPFR operations. diff --git a/build/pkgs/mpfr/SPKG.rst b/build/pkgs/mpfr/SPKG.rst index d5a098228da..c2ce702f222 100644 --- a/build/pkgs/mpfr/SPKG.rst +++ b/build/pkgs/mpfr/SPKG.rst @@ -49,20 +49,17 @@ Dependencies Special Update/Build Instructions --------------------------------- -- Make sure MPFR's settings of \`CC\` and \`CFLAGS\` still get properly +- Make sure MPFR's settings of ``CC`` and ``CFLAGS`` still get properly extracted, + currently from its ``config.log`` in the ``src/`` directory. - currently from its \`config.log\` in the \`src/\` directory. - -- We should remove the \`configure\` option \`--disable-thread-safe\` +- We should remove the ``configure`` option ``--disable-thread-safe`` in case - the issues without that have meanwhile been fixed. (Then we should - actually pass \`--enable-thread-safe`.) + actually pass ``--enable-thread-safe``.) TODO ---- -- --disable-thread-safe should be switched to --enable-thread-safe, - +- ``--disable-thread-safe`` should be switched to ``--enable-thread-safe``, need to check that this works on the buildbot machines diff --git a/build/pkgs/mpir/SPKG.rst b/build/pkgs/mpir/SPKG.rst index 2c15c2eb66e..02d897ef779 100644 --- a/build/pkgs/mpir/SPKG.rst +++ b/build/pkgs/mpir/SPKG.rst @@ -35,12 +35,8 @@ Special Update/Build Instructions - TODO: - Perhaps also modify CXXFLAGS (and/or CPPFLAGS). - We currently don't use anything of GMP's/MPIR's CC setting, and - matching - - with the current compiler (``$CC``) is perhaps suboptimal. - + matching with the current compiler (``$CC``) is perhaps suboptimal. - Remove some files / directories not needed for Sage from upstream: - build.vc\* directories (Microsoft Visual C build files) - 3.0.0-644faf502c56f97d9accd301965fc57d6ec70868 - was created by running the spkg-src script. diff --git a/build/pkgs/normaliz/SPKG.rst b/build/pkgs/normaliz/SPKG.rst index 8e33fabb953..10d945bf913 100644 --- a/build/pkgs/normaliz/SPKG.rst +++ b/build/pkgs/normaliz/SPKG.rst @@ -36,5 +36,4 @@ Special Update/Build Instructions --------------------------------- - The spkg currently disables features that require packages SCIP and - CoCoA, for which we don't have packages (yet). diff --git a/build/pkgs/p_group_cohomology/SPKG.rst b/build/pkgs/p_group_cohomology/SPKG.rst index 5de6d676797..0351bbe752b 100644 --- a/build/pkgs/p_group_cohomology/SPKG.rst +++ b/build/pkgs/p_group_cohomology/SPKG.rst @@ -102,8 +102,8 @@ Note that internet access is required for these tests, as it is attempted to download cohomology rings from a public data base in the web. -The script \``spkg-check`\` calls \`sage -t --force_lib\` on the files -in \`pGroupCohomology`. +The script ``spkg-check`` calls ``sage -t --force_lib`` on the files +in ``pGroupCohomology``. Documentation ------------- diff --git a/build/pkgs/palp/SPKG.rst b/build/pkgs/palp/SPKG.rst index 820646a7be3..d9304000e3b 100644 --- a/build/pkgs/palp/SPKG.rst +++ b/build/pkgs/palp/SPKG.rst @@ -29,11 +29,9 @@ License - When released, GPL 2 was in force. - There is a link to a web page, which now points to GPL 3, but would - have pointed to GPL 2 at the time the package was released. - Therefore one can deduce the authors were happy for this to be - released under GPL 2 or a later version. diff --git a/build/pkgs/pandoc_attributes/SPKG.rst b/build/pkgs/pandoc_attributes/SPKG.rst index 44380586414..a7922004186 100644 --- a/build/pkgs/pandoc_attributes/SPKG.rst +++ b/build/pkgs/pandoc_attributes/SPKG.rst @@ -16,8 +16,8 @@ BSD 2-Clause License Upstream Contact ---------------- -Author: Aaron O'Leary Home page: -https://github.com/aaren/pandoc-attributes +- Author: Aaron O'Leary +- Home page: https://github.com/aaren/pandoc-attributes Dependencies ------------ @@ -31,5 +31,5 @@ Special Update/Build Instructions --------------------------------- There are no release numbers, hence find the latest commit, download -https://github.com/aaren/pandoc-attributes/archive/$%7BCOMMIT%7D.zip and +https://github.com/aaren/pandoc-attributes/archive/${COMMIT}.zip and rename it pandoc_attributes-${COMMIT:0:8}.zip diff --git a/build/pkgs/pexpect/SPKG.rst b/build/pkgs/pexpect/SPKG.rst index 114739b5e1f..85be49569b1 100644 --- a/build/pkgs/pexpect/SPKG.rst +++ b/build/pkgs/pexpect/SPKG.rst @@ -17,8 +17,8 @@ is approved by the OSI and FSF as GPL-compatible. Upstream Contact ---------------- -http://pexpect.readthedocs.org/en/stable/ -https://github.com/pexpect/pexpect +- http://pexpect.readthedocs.org/en/stable/ +- https://github.com/pexpect/pexpect Dependencies ------------ diff --git a/build/pkgs/pillow/SPKG.rst b/build/pkgs/pillow/SPKG.rst index 2ff825c3cb7..a3c2fbac3ca 100644 --- a/build/pkgs/pillow/SPKG.rst +++ b/build/pkgs/pillow/SPKG.rst @@ -18,8 +18,8 @@ Standard PIL License Upstream Contact ---------------- -Author: Alex Clark Homepage: -http://python-imaging.github.io/ +- Author: Alex Clark +- Homepage: http://python-imaging.github.io/ Dependencies ------------ diff --git a/build/pkgs/pip/SPKG.rst b/build/pkgs/pip/SPKG.rst index 7df8cff59fc..92ded395cc5 100644 --- a/build/pkgs/pip/SPKG.rst +++ b/build/pkgs/pip/SPKG.rst @@ -17,12 +17,12 @@ MIT Upstream Contact ---------------- -Project Page: https://github.com/pypa/pip Install howto: -https://pip.pypa.io/en/latest/installing.html Changelog: -https://pip.pypa.io/en/latest/news.html Bug Tracking: -https://github.com/pypa/pip/issues Mailing list: -http://groups.google.com/group/python-virtualenv Docs: -https://pip.pypa.io/ +- Project Page: https://github.com/pypa/pip +- Install howto: https://pip.pypa.io/en/latest/installing.html +- Changelog: https://pip.pypa.io/en/latest/news.html +- Bug Tracking: https://github.com/pypa/pip/issues +- Mailing list: http://groups.google.com/group/python-virtualenv +- Docs: https://pip.pypa.io/ Dependencies ------------ diff --git a/build/pkgs/plantri/SPKG.rst b/build/pkgs/plantri/SPKG.rst index 566ee96bb20..3ae1cc2e1e0 100644 --- a/build/pkgs/plantri/SPKG.rst +++ b/build/pkgs/plantri/SPKG.rst @@ -26,13 +26,13 @@ Upstream Contact Gunnar Brinkmann - University of Ghent - Gunnar.Brinkmann@ugent.be +- University of Ghent +- Gunnar.Brinkmann@ugent.be Brendan McKay - Australian National University - bdm@cs.anu.edu.au +- Australian National University +- bdm@cs.anu.edu.au See http://cs.anu.edu.au/~bdm/plantri diff --git a/build/pkgs/polymake/SPKG.rst b/build/pkgs/polymake/SPKG.rst index adbc9004aad..8bb67899526 100644 --- a/build/pkgs/polymake/SPKG.rst +++ b/build/pkgs/polymake/SPKG.rst @@ -69,6 +69,8 @@ Information on missing Polymake prerequisites after installing polymake:: Debugging polymake install problems ----------------------------------- -#. apt-get install libdevel-trace-perl +:: -$ cd src $ perl -d:Trace support/configure.pl + # apt-get install libdevel-trace-perl + $ cd src + $ perl -d:Trace support/configure.pl diff --git a/build/pkgs/ppl/SPKG.rst b/build/pkgs/ppl/SPKG.rst index cab77c8b0be..e62faa3b989 100644 --- a/build/pkgs/ppl/SPKG.rst +++ b/build/pkgs/ppl/SPKG.rst @@ -35,10 +35,14 @@ GPL v3+ Upstream Contact ---------------- -http://www.cs.unipr.it/ppl/ BUGSENG srl (http://bugseng.com) +- http://www.cs.unipr.it/ppl/ +- BUGSENG srl (http://bugseng.com) -Core Development Team Roberto Bagnara (University of Parma) Patricia M. -Hill (University of Parma) Enea Zaffanella (University of Parma) +Core Development Team + +- Roberto Bagnara (University of Parma) +- Patricia M. Hill (University of Parma) +- Enea Zaffanella (University of Parma) Dependencies ------------ @@ -53,7 +57,6 @@ Patches ~~~~~~~ - ptrdiff_t-ppl-1.1.patch: Fixes to compile with gcc 4.9; C++ name - lookup issue. - weak.patch: disable use of weak symbols on Cygwin64. diff --git a/build/pkgs/pycosat/SPKG.rst b/build/pkgs/pycosat/SPKG.rst index 40181d0c198..d88c7a52998 100644 --- a/build/pkgs/pycosat/SPKG.rst +++ b/build/pkgs/pycosat/SPKG.rst @@ -20,8 +20,8 @@ MIT Upstream Contact ---------------- -PicoSAT: http://fmv.jku.at/picosat/ pycosat: -https://github.com/ContinuumIO/pycosat +- PicoSAT: http://fmv.jku.at/picosat/ +- pycosat: https://github.com/ContinuumIO/pycosat Dependencies ------------ diff --git a/build/pkgs/pygments/SPKG.rst b/build/pkgs/pygments/SPKG.rst index 09c0ce57057..9bf68e5326a 100644 --- a/build/pkgs/pygments/SPKG.rst +++ b/build/pkgs/pygments/SPKG.rst @@ -11,17 +11,14 @@ forums, wikis or other applications that need to prettify source code. Highlights are: - a wide range of over 300 languages and other text formats is - supported - special attention is paid to details, increasing quality by a fair - amount - support for new languages and formats are added easily - a number of output formats, presently HTML, LaTeX, RTF, SVG, all image - formats that PIL supports and ANSI sequences - it is usable as a command-line tool and as a library @@ -35,7 +32,8 @@ Modified BSD Upstream Contact ---------------- -Author: Georg Brandl Home Page: http://pygments.org +- Author: Georg Brandl +- Home Page: http://pygments.org Dependencies ------------ @@ -49,6 +47,5 @@ Special Update/Build Instructions Patches included: - sage_prompt.patch: patch pygments/lexers/agile.py to treat the - "sage:" prompt like Python's ">>>" prompt. This allows a very kludgy patch to be removed from the Sphinx package (see #10118). diff --git a/build/pkgs/pyparsing/SPKG.rst b/build/pkgs/pyparsing/SPKG.rst index a7f497229c9..dcdcae68b90 100644 --- a/build/pkgs/pyparsing/SPKG.rst +++ b/build/pkgs/pyparsing/SPKG.rst @@ -15,7 +15,8 @@ MIT License Upstream Contact ---------------- -Author: Paul McGuire Home page: http://pyparsing.wikispaces.com +- Author: Paul McGuire +- Home page: http://pyparsing.wikispaces.com Dependencies ------------ diff --git a/build/pkgs/python2/SPKG.rst b/build/pkgs/python2/SPKG.rst index 75411f544c0..abd093a5cd3 100644 --- a/build/pkgs/python2/SPKG.rst +++ b/build/pkgs/python2/SPKG.rst @@ -44,7 +44,6 @@ Special Update/Build Instructions --------------------------------- - We keep a copy of the stdlib 'random' module in - src/sage/cpython/_py2_random.py. Normally it shouldn't be necessary to update this, but when upgrading Python make sure to bring over any security updates from the upstream 'random' module in the @@ -54,7 +53,6 @@ Special Update/Build Instructions that depend on the implementation details of the random module. - Spaces in SAGE_ROOT aren't yet fully supported by this package, - since we put $SAGE_LOCAL/... into CPPFLAGS and LDFLAGS, which wouldn't work then. @@ -63,27 +61,22 @@ Patches - socket.patch: Work around an SSL issue. - permissions.patch: Changes the permission of installed libraries - to 0755 (like any other library) instead of 0555. - sys_path_security-issue_16202.patch: ensure that the current working - directory or the script directory is prepended to sys.path only if there is no security risk in doing so. - ncurses-issue_9665.patch: Fixes Python issue #9665 (by patching configure - and configure.in after running autotools). - ncurses-issue_14438.patch: Fixes Python issue #14438 (ncurses) - disable_print_refs_debug.patch: Remove some unused debug output - that breaks doctests. - no_strict_proto-issue_5755.patch: don't add -Wstrict-prototypes compiler - flag, which isn't valid for C++ (but Python uses the same compiler flags for C and C++). See http://bugs.python.org/issue5755. @@ -92,10 +85,8 @@ Patches - tinfo.patch: make sure tinfo is correctly linked in when needed on Cygwin. - uuid-issue_11063.patch: patch from Python issue 11063; reduce uuid - module import side effects and fix thread related issues. - getcallargs-issue_20108.patch: fix inspect.getcallargs() when the - function has a "func" keyword argument. Needed for @interact from ipywidgets. diff --git a/build/pkgs/ratpoints/SPKG.rst b/build/pkgs/ratpoints/SPKG.rst index 6e6029f0c80..20ff846959f 100644 --- a/build/pkgs/ratpoints/SPKG.rst +++ b/build/pkgs/ratpoints/SPKG.rst @@ -35,6 +35,5 @@ Note on SSE2 instructions - On several architectures, the SSE2 instructions used by ratpoints cause - compiler errors. In the case that ratpoints fails to build with SSE2 instructions enabled, the build is repeated with SSE2 disabled. diff --git a/build/pkgs/readline/SPKG.rst b/build/pkgs/readline/SPKG.rst index d33180ec0b9..8553446ae64 100644 --- a/build/pkgs/readline/SPKG.rst +++ b/build/pkgs/readline/SPKG.rst @@ -45,7 +45,6 @@ Patches https://trac.macports.org/browser/trunk/dports/devel/readline/files/patch-shobj-conf.diff - 0002-ltinfo.patch: We build readline using ncurses, and for that it - needs to be told to link with libtinfo (part of ncurses). - sigsetjmp.patch: Correctly define sigsetjmp and friends on Cygwin. diff --git a/build/pkgs/rubiks/SPKG.rst b/build/pkgs/rubiks/SPKG.rst index 998429217de..b73e508cdb2 100644 --- a/build/pkgs/rubiks/SPKG.rst +++ b/build/pkgs/rubiks/SPKG.rst @@ -11,17 +11,17 @@ info and licensing. In summary the three contributers are: Michael Reid (GPL) http://www.math.ucf.edu/~reid/Rubik/optimal_solver.html - optimal - uses many pre-computed tables to find an optimal +- optimal - uses many pre-computed tables to find an optimal solution to the 3x3x3 Rubik's cube Dik T. Winter (MIT License) - cube - uses Kociemba's algorithm to iteratively find a short +- cube - uses Kociemba's algorithm to iteratively find a short solution to the 3x3x3 Rubik's cube - size222 - solves a 2x2x2 Rubik's cube +- size222 - solves a 2x2x2 Rubik's cube Eric Dietz (GPL) http://www.wrongway.org/?rubiksource - cu2 - A fast, non-optimal 2x2x2 solver - cubex - A fast, non-optimal 3x3x3 solver - mcube - A fast, non-optimal 4x4x4 solver +- cu2 - A fast, non-optimal 2x2x2 solver +- cubex - A fast, non-optimal 3x3x3 solver +- mcube - A fast, non-optimal 4x4x4 solver diff --git a/build/pkgs/sagetex/SPKG.rst b/build/pkgs/sagetex/SPKG.rst index f0d2466e938..c0e9d9ef8e1 100644 --- a/build/pkgs/sagetex/SPKG.rst +++ b/build/pkgs/sagetex/SPKG.rst @@ -41,7 +41,7 @@ Dependencies ------------ To install, nothing more than a standard Sage install. The -\`spkg-check\` script will exit without actually testing anything if it +``spkg-check`` script will exit without actually testing anything if it cannot find "latex" in your path. Notes @@ -53,9 +53,9 @@ needs. Full details are in the Sage installation guide at http://doc.sagemath.org/html/en/installation/ and http://doc.sagemath.org/html/en/tutorial/sagetex.html . -The directory \`$SAGE_ROOT/local/share/doc/sagetex\` contains +The directory ``$SAGE_ROOT/local/share/doc/sagetex`` contains documentation and an example file. See -\`$SAGE_ROOT/local/share/texmf/tex/latex/sagetex\` for the source code +``$SAGE_ROOT/local/share/texmf/tex/latex/sagetex`` for the source code and some possibly useful scripts. If you have problems or suggestions see `the sage-support group `__. diff --git a/build/pkgs/setuptools/SPKG.rst b/build/pkgs/setuptools/SPKG.rst index 78c67111416..182ce736f0d 100644 --- a/build/pkgs/setuptools/SPKG.rst +++ b/build/pkgs/setuptools/SPKG.rst @@ -38,5 +38,4 @@ applied during the build process. - pkg_resources.py.patch: silence warning about permissions. - easy_install_lock.patch: lock the easy_install.pth file to allow - simultaneous installation diff --git a/build/pkgs/singular/SPKG.rst b/build/pkgs/singular/SPKG.rst index 9a33f6781c4..af9574e0afd 100644 --- a/build/pkgs/singular/SPKG.rst +++ b/build/pkgs/singular/SPKG.rst @@ -40,7 +40,6 @@ See spkg-src to create the source tarball. Other notes: - If the environment variable SAGE_DEBUG is set to "yes", then - omalloc will be replaced by xalloc. The resulting Singular executable and libsingular library will be slower than with omalloc, but allow for easier debugging of memory corruptions. diff --git a/build/pkgs/sip/SPKG.rst b/build/pkgs/sip/SPKG.rst index edff1e3649e..d84fbc5cbf6 100644 --- a/build/pkgs/sip/SPKG.rst +++ b/build/pkgs/sip/SPKG.rst @@ -10,15 +10,15 @@ Python extension module generator for C and C++ libraries Upstream contact ---------------- - https://www.riverbankcomputing.com/software/sip/ - https://pypi.python.org/pypi/SIP +- https://www.riverbankcomputing.com/software/sip/ +- https://pypi.python.org/pypi/SIP License ------- - SIP is released under the GPL v2, GPL v3 licenses, and under a - license - similar to the BSD license. +SIP is released under the GPL v2, GPL v3 licenses, and under a +license +similar to the BSD license. - SIP is copyright (c) Riverbank Computing Limited. Its homepage is - https://www.riverbankcomputing.com/software/sip/. +SIP is copyright (c) Riverbank Computing Limited. Its homepage is +https://www.riverbankcomputing.com/software/sip/. diff --git a/build/pkgs/six/SPKG.rst b/build/pkgs/six/SPKG.rst index 2254c78eb8f..8176852b344 100644 --- a/build/pkgs/six/SPKG.rst +++ b/build/pkgs/six/SPKG.rst @@ -15,7 +15,8 @@ MIT License Upstream Contact ---------------- -Author: Benjamin Peterson Home page: http://pypi.python.org/pypi/six/ +- Author: Benjamin Peterson +- Home page: http://pypi.python.org/pypi/six/ Dependencies ------------ diff --git a/build/pkgs/snowballstemmer/SPKG.rst b/build/pkgs/snowballstemmer/SPKG.rst index 33e199a1b26..e1da7151279 100644 --- a/build/pkgs/snowballstemmer/SPKG.rst +++ b/build/pkgs/snowballstemmer/SPKG.rst @@ -9,21 +9,21 @@ stemmer) generated from Snowball algorithms. It includes following language algorithms: - Danish - Dutch - English (Standard, Porter) - Finnish - French - German - Hungarian - Italian - Norwegian - Portuguese - Romanian - Russian - Spanish - Swedish - Turkish +- Danish +- Dutch +- English (Standard, Porter) +- Finnish +- French +- German +- Hungarian +- Italian +- Norwegian +- Portuguese +- Romanian +- Russian +- Spanish +- Swedish +- Turkish This is a pure Python stemming library. If PyStemmer is available, this module uses it to accelerate. diff --git a/build/pkgs/sphinx/SPKG.rst b/build/pkgs/sphinx/SPKG.rst index 2e056b72a12..43f741e9441 100644 --- a/build/pkgs/sphinx/SPKG.rst +++ b/build/pkgs/sphinx/SPKG.rst @@ -20,9 +20,9 @@ Modified BSD; see e.g. its egg-info file for other options Upstream Contact ---------------- -Author: Georg Brandl Home Page: http://sphinx.pocoo.org, - - see also http://pypi.python.org/pypi/Sphinx +- Author: Georg Brandl +- Home Page: http://sphinx.pocoo.org, + see also http://pypi.python.org/pypi/Sphinx Dependencies ------------ @@ -42,7 +42,6 @@ Special Update/Build Instructions --------------------------------- - The script create_grammar_pickle.py creates the file - Grammar2.7.pickle in site-packages/Sphinx-.../sphinx/pycode/. This helps to avoid race conditions when building the documentation in parallel. diff --git a/build/pkgs/suitesparse/SPKG.rst b/build/pkgs/suitesparse/SPKG.rst index 465c76124b3..773d8aebfb4 100644 --- a/build/pkgs/suitesparse/SPKG.rst +++ b/build/pkgs/suitesparse/SPKG.rst @@ -17,8 +17,7 @@ Patches: - The first patch disable the building of package using cmake. - The second patch make sure we use sage's blas/lapack on OS X. By default - -suitesparse discard any configurations to use the accelerate framework. + suitesparse discard any configurations to use the accelerate framework. The building of metis is diabled by passing MY_METIS_LIB=none to make (any value would have done) We also configure cholmod so it doesn't diff --git a/build/pkgs/sympow/SPKG.rst b/build/pkgs/sympow/SPKG.rst index e448e8c66fc..4b3dd774afe 100644 --- a/build/pkgs/sympow/SPKG.rst +++ b/build/pkgs/sympow/SPKG.rst @@ -17,10 +17,10 @@ License Upstream Contact ---------------- - SYMPOW does not appear to be maintained any longer, so there is no - upstream web site. - Mark Watkins, the package author, now works at Magma. - Previous (possibly still usable) email is watkins@maths.usyd.edu.au +SYMPOW does not appear to be maintained any longer, so there is no +upstream web site. +Mark Watkins, the package author, now works at Magma. +Previous (possibly still usable) email is watkins@maths.usyd.edu.au Dependencies ------------ @@ -32,7 +32,6 @@ Special Update/Build Instructions --------------------------------- - Some of the code is very dubious, and it is anyones guess really what - the compiler does with it. For example, the following line exists in src/eulerfactors.c: @@ -45,7 +44,6 @@ Special Update/Build Instructions - This is a difficult package to maintain. A trac ticket (#9758) has been - opened to implement Watkins-Delaunay's algorithm for computing modular degrees in Sage. Once implemented, it should be possible to remove @@ -53,13 +51,12 @@ Special Update/Build Instructions package. - The package is configured such that the data files are in a directory - below where 'sympow' is installed. If Sage is installed globally, then it will be impossible to create the data files without being root. This has been fixed in the Gentoo Linux distribution. Some information - from Christopher can be see on + from Christopher can be seen on http://trac.sagemath.org/sage_trac/ticket/9703 This package will generate binary versions of all shipped datafiles, so these will work. However, creating totally new datafiles from diff --git a/build/pkgs/tachyon/SPKG.rst b/build/pkgs/tachyon/SPKG.rst index e913f921fa9..702a8d92a7d 100644 --- a/build/pkgs/tachyon/SPKG.rst +++ b/build/pkgs/tachyon/SPKG.rst @@ -17,27 +17,31 @@ interface. License ------- -- Copyright (c) 1994-2010 John E. Stone -- All rights reserved. -- - -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- 2. Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- 3. The name of the author may not be used to endorse or promote +Copyright (c) 1994-2010 John E. Stone +All rights reserved. + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. The name of the author may not be used to endorse or promote products -- derived from this software without specific prior written permission. + derived from this software without specific prior written permission. Upstream Contact ---------------- -http://jedi.ks.uiuc.edu/~johns/raytracer/ John Stone +- http://jedi.ks.uiuc.edu/~johns/raytracer/ +- John Stone Dependencies ------------ @@ -54,23 +58,18 @@ Special Update/Build Instructions - Delete the msvc directory, which is also large and not used within Sage. - The CVS subdirectories are currently (almost) empty, but should - otherwise be deleted. - The upstream files had strange permissions, i.e. some source files - were executable, while almost all files weren't world-readable. -- There's seems to be some crap like \`tachyon.html.tar.gz\` and a few - - \`.#*\` files I haven't [yet] deleted, since they're not that large. +- There's seems to be some crap like ``tachyon.html.tar.gz`` and a few + ``.#*`` files I haven't [yet] deleted, since they're not that large. - TODO: Check whether building multi-threaded versions on MacOS X - meanwhile works. (This was said to fail with an old beta.) -- TODO: Use \`patch\` instead of copying over pre-patched files. +- TODO: Use ``patch`` instead of copying over pre-patched files. - TODO: [Optionally] also install some of the documentation. - TODO: I doubt the CFLAGS set for AIX and HP-UX won't get overridden - by the created Makefile, but that's a minor issue. -leif diff --git a/build/pkgs/tdlib/SPKG.rst b/build/pkgs/tdlib/SPKG.rst index e70d559a272..84034a66e59 100644 --- a/build/pkgs/tdlib/SPKG.rst +++ b/build/pkgs/tdlib/SPKG.rst @@ -23,8 +23,8 @@ Lukas Larisch (larisch@informatik.uni-frankfurt.de) Upstream Contact ---------------- -Lukas Larisch (larisch@informatik.uni-frankfurt.de) git-repo: -git://pholia.tdi.cs.uni-frankfurt.de/git/tdlib +- Lukas Larisch (larisch@informatik.uni-frankfurt.de) +- git-repo: git://pholia.tdi.cs.uni-frankfurt.de/git/tdlib Dependencies ------------ diff --git a/build/pkgs/testpath/SPKG.rst b/build/pkgs/testpath/SPKG.rst index 520b92b07d7..3a0a44b070d 100644 --- a/build/pkgs/testpath/SPKG.rst +++ b/build/pkgs/testpath/SPKG.rst @@ -4,7 +4,5 @@ testpath Description ----------- -Testpath - Testpath is a collection of utilities for testing code which uses and manipulates the filesystem and system commands diff --git a/build/pkgs/thebe/SPKG.rst b/build/pkgs/thebe/SPKG.rst index 2888032505d..39a07327e9f 100644 --- a/build/pkgs/thebe/SPKG.rst +++ b/build/pkgs/thebe/SPKG.rst @@ -20,8 +20,8 @@ MIT Upstream Contact ---------------- -Home page: https://oreillymedia.github.io/thebe/ Source: -https://github.com/oreillymedia/thebe/ +- Home page: https://oreillymedia.github.io/thebe/ +- Source: https://github.com/oreillymedia/thebe/ Dependencies ------------ diff --git a/build/pkgs/topcom/SPKG.rst b/build/pkgs/topcom/SPKG.rst index 6d16dbc37c4..60d53f2f8aa 100644 --- a/build/pkgs/topcom/SPKG.rst +++ b/build/pkgs/topcom/SPKG.rst @@ -24,10 +24,16 @@ GPL v2 Upstream Contact ---------------- -Prof. Dr. Jörg Rambau Lehrstuhl für -Wirtschaftsmathematik Raum FAN-D.1.29 (Sekretariat: FAN-D.1.30) -Universität Bayreuth D-95440 Bayreuth Germany Tel: +49-921-55-7350, Fax: -+49-921-55-7352 http://www.rambau.wm.uni-bayreuth.de +:: + + Prof. Dr. Jörg Rambau + Lehrstuhl für Wirtschaftsmathematik + Raum FAN-D.1.29 (Sekretariat: FAN-D.1.30) + Universität Bayreuth + D-95440 Bayreuth + Germany + Tel: +49-921-55-7350, Fax: +49-921-55-7352 + http://www.rambau.wm.uni-bayreuth.de Dependencies ------------ diff --git a/build/pkgs/zn_poly/SPKG.rst b/build/pkgs/zn_poly/SPKG.rst index 4fd3f655c10..5448fa62620 100644 --- a/build/pkgs/zn_poly/SPKG.rst +++ b/build/pkgs/zn_poly/SPKG.rst @@ -24,7 +24,7 @@ Upstream Contact ---------------- - David Harvey -- E. M. Bray +- \E. M. Bray Dependencies ------------ @@ -41,32 +41,26 @@ Special Update/Build Instructions - Make sure the patches still apply. - Especially changes in \`makemakefile.py\` may also require changes to - \`spkg-install\` (and perhaps also \`spkg-check`). + Especially changes in ``makemakefile.py`` may also require changes to + ``spkg-install`` (and perhaps also ``spkg-check``). -- There's also a \`--use-flint\` option to \`configure`; no idea what +- There's also a ``--use-flint`` option to ``configure``; no idea what it does, - and we currently don't use it either. - TODO: -- Use \`make install\` instead of manually "installing" (copying and - sym- - - linking) the [shared] libraries and header files. This requires +- Use ``make install`` instead of manually "installing" (copying and + symlinking) the [shared] libraries and header files. This requires further - tweaking of \`makemakefile.py`, since it currently only installs a + tweaking of ``makemakefile.py``, since it currently only installs a static library and the headers. - If everything's fine, i.e., no problems arise, some comments and - especial- - - ly some code I currently just commented out can certainly be removed. + especially some code I currently just commented out can certainly be removed. (-leif, 04/2012) - The version number "0.9.p11" is used as a doctest in the function - package_versions in sage/misc/packages.py, so if this package gets upgraded, that doctest needs to be changed. @@ -82,7 +76,7 @@ Patches - profiler.c.patch, zn_poly.h.patch: - Fix potential redefinition of \`ulong\` (in combination with other + Fix potential redefinition of ``ulong`` (in combination with other headers). - mpn_mulmid-tune.c.patch, mulmid-tune.c.patch, mul-tune.c.patch: @@ -99,5 +93,4 @@ Patches - fix_fudge_factor_in_nuss-test.c.patch: As the name says; fix provided by upstream (David Harvey); see - - #. 13947. + #13947. From eee78435a27f2921acc4bd062592ffee9fc17deb Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Wed, 27 May 2020 15:18:19 -0700 Subject: [PATCH 230/301] trac 29547: use sage-python23 instead of sage-system-python to install --- build/pkgs/matplotlib/spkg-install.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/matplotlib/spkg-install.in b/build/pkgs/matplotlib/spkg-install.in index 6b68b46ad5c..a427dadccd5 100644 --- a/build/pkgs/matplotlib/spkg-install.in +++ b/build/pkgs/matplotlib/spkg-install.in @@ -1,5 +1,5 @@ # Write a configuration file to src/setup.cfg -sage-system-python make-setup-config.py +sage-python23 make-setup-config.py cd src From fb14d9e0177defdc6e0f0615e7d70f2ac7b1dc6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Cuevas-Rozo?= Date: Wed, 29 May 2019 13:16:43 +0200 Subject: [PATCH 231/301] Methods for computing on finite simplicial sets and chain coimplexes were added. Computation of homotopy groups added. --- src/sage/interfaces/kenzo.py | 413 ++++++++++++++++++++++++++++++++++- 1 file changed, 410 insertions(+), 3 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 976983a06f8..a38215e4e38 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -31,8 +31,14 @@ from sage.rings.integer_ring import ZZ from sage.categories.commutative_additive_groups import CommutativeAdditiveGroups +from sage.matrix.all import matrix +from sage.homology.chain_complex import ChainComplex +from sage.homology.simplicial_set import AbstractSimplex, SimplicialSet + from sage.libs.ecl import EclObject, ecl_eval, EclListIterator +from sage.env import SAGE_LOCAL +from sys import version # Redirection of ECL and Maxima stdout to /dev/null # This is also done in the Maxima library, but we @@ -57,12 +63,37 @@ moore = EclObject("moore") k_z = EclObject("k-z") k_z2 = EclObject("k-z2") +k_zp = EclObject("k-zp") echcm = EclObject("echcm") loop_space = EclObject("loop-space") tnsr_prdc = EclObject("tnsr-prdc") typep = EclObject("typep") classifying_space = EclObject("classifying-space") suspension = EclObject("suspension") +homotopy_list = EclObject("homotopy-list") +nth = EclObject("nth") +entry = EclObject("entry") +nlig = EclObject("nlig") +ncol = EclObject("ncol") +array_dimensions = EclObject("array-dimensions") +convertmatrice = EclObject("convertmatrice") +make_array_to_lists = EclObject("make-array-to-lists") +make_array_from_lists = EclObject("make-array-from-lists") +chcm_mat2 = EclObject("chcm-mat2") +build_finite_ss2 = EclObject("build-finite-ss2") +gmsm = EclObject("gmsm") +dgop = EclObject("dgop") +dgop_ext_int = EclObject("dgop-ext-int") +dgop_int_ext = EclObject("dgop-int-ext") +basis_aux1 = EclObject("basis_aux1") +orgn_aux1 = EclObject("orgn_aux1") +dffr_aux1 = EclObject("dffr_aux1") +kabstractsimplex_aux1 = EclObject("kabstractsimplex_aux1") +kchaincomplex_aux1 = EclObject("kchaincomplex_aux1") +sfinitesimplicialset_aux1 = EclObject("sfinitesimplicialset_aux1") + + +#----------------------------------------------------------------# def Sphere(n): @@ -151,14 +182,17 @@ def EilenbergMacLaneSpace(G, n): sage: [f3.homology(i) for i in range(8)] # optional - kenzo [Z, 0, 0, C2, 0, C2, C2, C2] """ - if G is ZZ: + if G == ZZ: kenzospace = k_z(n) return KenzoSimplicialGroup(kenzospace) - elif G in CommutativeAdditiveGroups() and G.cardinality() == 2: + elif G == AdditiveAbelianGroup([2]): kenzospace = k_z2(n) return KenzoSimplicialGroup(kenzospace) + elif G in CommutativeAdditiveGroups() and G.is_cyclic(): + kenzospace = k_zp(G.cardinality(), n) + return KenzoSimplicialGroup(kenzospace) else: - raise NotImplementedError("Eilenberg-MacLane spaces are only supported over ZZ and ZZ_2") + raise NotImplementedError("Eilenberg-MacLane spaces are only supported over ZZ and ZZ_n") class KenzoObject(SageObject): @@ -244,6 +278,7 @@ def homology(self, n): res.append(pair[0].python()) return HomologyGroup(len(res), ZZ, res) + def tensor_product(self, other): r""" Return the tensor product of ``self`` and ``other``. @@ -268,6 +303,79 @@ def tensor_product(self, other): return KenzoChainComplex(tnsr_prdc(self._kenzo, other._kenzo)) + def basis(self, dim): + r""" + Return the list of generators of the Kenzo chain complex ``self`` in dimension ``dim``. + + INPUT: + + - ``dim``- An integer number + + OUTPUT: + + - A list of the form ['G"dim"G0', 'G"dim"G1', 'G"dim"G2', ...]. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + [K1 Chain-Complex] + sage: for i in range(6): # optional - kenzo + print("Basis in dimension %i: %s" % (i, kenzo_chcm.basis(i))) # optional - kenzo + Basis in dimension 0: ['G0G0', 'G0G1', 'G0G2'] + Basis in dimension 1: ['G1G0', 'G1G1'] + Basis in dimension 2: None + Basis in dimension 3: ['G3G0', 'G3G1'] + Basis in dimension 4: ['G4G0', 'G4G1'] + Basis in dimension 5: ['G5G0', 'G5G1', 'G5G2'] + + """ + return basis_aux1(self._kenzo, dim).python() + + + def dffr(self, dim, comb): + r""" + Return the differential of a combination. + + INPUT: + - ``dim``- An integer number + - ``comb``- A list representing a formal sum of generators in the module of dimension ``dim``. For example, to represent G7G12 + 3*G7G0 - 5*G7G3 we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. Note that the generators must be in ascending order respect to the number after the second G in their representation; the parameter ``comb`` = [1, 'G7G12', 3, 'G7G0', -5, 'G7G3'] will produce an error in Kenzo. + + OUTPUT: + + - A Kenzo combination representing the differential of the formal combination represented by ``comb`` in the chain complex ``self`` in dimension ``dim``. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + [K1 Chain-Complex] + sage: kenzo_chcm.basis(4) # optional - kenzo + ['G4G0', 'G4G1'] + sage: kenzo_chcm.dffr(4, [1, 'G4G0']) # optional - kenzo + {CMBN 3} <1 * G3G0> <3 * G3G1> + sage: kenzo_chcm.basis(5) # optional - kenzo + ['G5G0', 'G5G1', 'G5G2'] + sage: kenzo_chcm.dffr(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + {CMBN 4} <6 * G4G0> <-3 * G4G1> + + """ + cmbn_list = pairing(comb) + return KenzoObject(dffr_aux1(self._kenzo, dim, cmbn_list)) + + + def orgn(self): + return str(orgn_aux1(self._kenzo)) + + class KenzoSimplicialSet(KenzoChainComplex): r""" Wrapper to Kenzo simplicial sets. @@ -346,6 +454,28 @@ def suspension(self): return KenzoSimplicialSet(suspension(self._kenzo)) + def homotopy_group(self, n): + """ + Return the n'th homotopy group of ``self`` + INPUT: + - ``n`` - the dimension of the homotopy group to be computed + EXAMPLES:: + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: p = s2.cartesian_product(s2) # optional - kenzo + sage: p.homotopy_group(3) # optional - kenzo + Multiplicative Abelian group isomorphic to Z x Z + """ + if not n in ZZ or n < 2: + raise ValueError("homotopy groups can only be computed for dimensions greater than 1") + lgens = homotopy_list(self._kenzo, n).python() + if lgens != None : + trgens = [0 if i == 1 else i for i in sorted(lgens)] + return AbelianGroup(trgens) + else: + return AbelianGroup([]) + + class KenzoSimplicialGroup(KenzoSimplicialSet): r""" Wrapper around Kenzo simplicial groups. @@ -371,3 +501,280 @@ def classifying_space(self): [Z, 0, 0, 0, C2, 0, 0, 0] """ return KenzoSimplicialGroup(classifying_space(self._kenzo)) + + +#----------------------------------------------------------------# + + +def k2s_matrix(kmatrix): + r"""Convert an array of ECL to a matrix of Sage. + """ + dimensions = array_dimensions(kmatrix).python() + kmatrix_list = make_array_to_lists(kmatrix).python() + return matrix(dimensions[0], dimensions[1], kmatrix_list) + + +def s2k_matrix(smatrix): + r"""Convert a matrix of Sage to an array of ECL. + """ + initcontents = [] + dimensions = smatrix.dimensions() + for i in smatrix.rows(): + initcontents.append(i.list()) + return make_array_from_lists(dimensions[0], dimensions[1], initcontents) + + +def s2k_dictmat(sdictmat): + r"""Convert a dictionary in Sage, whose values are matrices, to an assoc list in ECL. + """ + rslt = EclObject([]) + for k in sdictmat.keys(): + rslt = EclObject(k).cons(s2k_matrix(sdictmat[k])).cons(rslt) + return rslt + + +def pairing(slist): + r"""Convert a list of Sage (which has an even length) to an assoc list in ECL. + """ + rslt = EclObject([]) + for k in range(len(slist) - 1, 0, -2): + rslt = EclObject(slist[k - 1]).cons(EclObject(slist[k])).cons(rslt) + return rslt + + +def KChainComplex(schcm): + r"""Construct a KenzoChainComplex from a ChainComplex of degree = -1 in Sage. + + INPUT: + + - ``schcm`` - A ChainComplex of degree = -1 + + OUTPUT: + + - A KenzoChainComplex + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + [K1 Chain-Complex] + sage: kenzo_chcm.homology(5) # optional - kenzo + Z x Z + + """ + + chcm = s2k_dictmat(schcm.differential()) + str_orgn = str(schcm.differential())[1:-1].replace(":"," ").replace(" ",".").replace("\n","").replace(",","") + return KenzoChainComplex(kchaincomplex_aux1(chcm, str_orgn)) + + +def SChainComplex (kchcm, start = 0, end = 15): + r""" + Convert the KenzoChainComplex ``kchcm`` (between dimensions ``start`` and ``end``) to a ChainComplex. + + INPUT: + + - ``kchcm``- A KenzoChainComplex + - ``start``- An integer number (optional, default 0) + - ``end``- An integer number greater than or equal to ``start`` (optional, default 15) + OUTPUT: + + - A ChainComplex + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KChainComplex, SChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: SChainComplex(KChainComplex(sage_chcm)) == sage_chcm # optional - kenzo + True + """ + + matrices = {} + for i in range(start, end): + dffr_i = chcm_mat2(kchcm._kenzo, i) + if ((nlig(dffr_i).python() != 0) and (ncol(dffr_i).python() != 0)) == True: + matrices[i] = k2s_matrix(convertmatrice(dffr_i)) + return ChainComplex(matrices, degree = -1) + + +#----------------------------------------------------------------# + + +def SAbstractSimplex(KAbSm, dim): + r"""Convert an abstract simplex of Kenzo to an AbstractSimplex. + INPUT: + + - ``KAbSm``- An abstract simplex of Kenzo. + - ``dim``- The dimension of ``KAbSm``. + OUTPUT: + + - An AbstractSimplex. + EXAMPLES:: + + sage: from sage.interfaces.kenzo import SAbstractSimplex # optional - kenzo + sage: KAbSm = KenzoObject(ecl_eval("(ABSM 15 'K)")) # optional - kenzo + sage: SAbSm1 = SAbstractSimplex(KAbSm, 2) # optional - kenzo + sage: SAbSm2 = SAbstractSimplex(KAbSm, 7) # optional - kenzo + sage: SAbSm1.degeneracies() + [3, 2, 1, 0] + sage: SAbSm1.dimension() + 6 + sage: SAbSm2.dimension() + 11 + """ + degeneracies = dgop_int_ext(dgop(KAbSm._kenzo)).python() + if degeneracies == None: + degeneracies = [] + else: + degeneracies = tuple(degeneracies) + name = gmsm(KAbSm._kenzo).python() + return AbstractSimplex(dim, degeneracies, name = name) + + +def KAbstractSimplex(SAbSm): + r"""Convert an AbstractSimplex in Sage to an abstract simplex of Kenzo. + INPUT: + + - ``SAbSm``- An AbstractSimplex. + OUTPUT: + + - An abstract simplex of Kenzo. + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KAbstractSimplex, SAbstractSimplex # optional - kenzo + sage: SAbSm = AbstractSimplex(1, (2,0,3,2,1), name = 'SAbSm') + sage: KAbSm = KAbstractSimplex(SAbSm) # optional - kenzo + sage: SAbSm2 = SAbstractSimplex(KAbSm, 1) # optional - kenzo + sage: SAbSm.degeneracies() == SAbSm2.degeneracies() + True + sage: SAbSm.dimension() == SAbSm2.dimension() + True + """ + return KenzoObject(kabstractsimplex_aux1(SAbSm.degeneracies(), str(SAbSm))) + + +def KFiniteSimplicialSet(ssimpset): + r"""Convert a finite SimplicialSet in Sage to a finite simplicial set of Kenzo. + INPUT: + + - ``ssimpset``- A finite SimplicialSet. + OUTPUT: + + - A finite simplicial set of Kenzo. + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KFiniteSimplicialSet # optional - kenzo + sage: s0 = AbstractSimplex(0, name='s0') + sage: s1 = AbstractSimplex(0, name='s1') + sage: s2 = AbstractSimplex(0, name='s2') + sage: s01 = AbstractSimplex(1, name='s01') + sage: s02 = AbstractSimplex(1, name='s02') + sage: s12 = AbstractSimplex(1, name='s12') + sage: s012 = AbstractSimplex(2, name='s012') + sage: Triangle = SimplicialSet({s01: (s1, s0), s02: (s2, s0), s12: (s2, s1)}, base_point = s0) + sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo + sage: KTriangle.homology(1) # optional - kenzo + Z + sage: S1 = simplicial_sets.Sphere(1) + sage: S3 = simplicial_sets.Sphere(3) + sage: KS1vS3 = KFiniteSimplicialSet(S1.wedge(S3)) # optional - kenzo + sage: KS1vS3.homology(3) # optional - kenzo + Z + """ + + if hasattr(ssimpset, 'factors') and str(ssimpset)[0:5] != 'Wedge': + return KFiniteSimplicialSet(ssimpset.factor(0)).cartesian_product(KFiniteSimplicialSet(ssimpset.factor(1))) + else: + dim = ssimpset.dimension() + list_rslt = [str(i) for i in ssimpset.n_cells(0)] + if (dim > 0): + for k in range(1, dim + 1): + k_cells = ssimpset.n_cells(k) + if (len(k_cells) > 0): + list_rslt.append(k) + for x in k_cells: + list_rslt.append(str(x)) + auxiliar_list = [] + for z in ssimpset.faces(x): + degen_z = z.degeneracies() + name = str(z.nondegenerate()) + degen_z.append(name) + auxiliar_list.append(degen_z) + list_rslt.append(auxiliar_list) + return KenzoSimplicialSet(build_finite_ss2(list_rslt)) + + +def SFiniteSimplicialSet(ksimpset, limit): + r"""Convert the ``limit``-skeleton of a finite simplicial set in Kenzo to a finite SimplicialSet in Sage. + INPUT: + + - ``ksimpset``- A finite simplicial set in Kenzo. + - ``limit``- A natural number. + OUTPUT: + + - A finite SimplicialSet. + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KFiniteSimplicialSet, SFiniteSimplicialSet, Sphere # optional - kenzo + sage: s0 = AbstractSimplex(0, name='s0') + sage: s1 = AbstractSimplex(0, name='s1') + sage: s2 = AbstractSimplex(0, name='s2') + sage: s01 = AbstractSimplex(1, name='s01') + sage: s02 = AbstractSimplex(1, name='s02') + sage: s12 = AbstractSimplex(1, name='s12') + sage: s012 = AbstractSimplex(2, name='s012') + sage: Triangle = SimplicialSet({s01: (s1, s0), s02: (s2, s0), s12: (s2, s1)}, base_point = s0) + sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo + sage: STriangle = SFiniteSimplicialSet(KTriangle, 1) # optional - kenzo + sage: STriangle.homology() + {0: 0, 1: Z} + sage: S1 = simplicial_sets.Sphere(1) + sage: S3 = simplicial_sets.Sphere(3) + sage: KS1vS3 = KFiniteSimplicialSet(S1.wedge(S3)) # optional - kenzo + sage: SS1vS3 = SFiniteSimplicialSet(KS1vS3, 3) # optional - kenzo + sage: SS1vS3.homology() + {0: 0, 1: Z, 2: 0, 3: Z} + """ + + list_orgn = orgn_aux1(ksimpset._kenzo).python() + if nth(0, list_orgn).python()[0] == 'CRTS-PRDC': + return SFiniteSimplicialSet(KenzoSimplicialSet(nth(1, list_orgn)), limit).cartesian_product(SFiniteSimplicialSet(KenzoSimplicialSet(nth(2, list_orgn)), limit)) + rslt = {} + simplices = [] + faces = [] + bases = [] + names = [] + for k in range(limit + 1): + basis_k = basis_aux1(ksimpset._kenzo, k) + names_k = ksimpset.basis(k) + lbasis_k = [AbstractSimplex(k, name = i) for i in EclListIterator(basis_k)] + bases.append(lbasis_k) + names.append(names_k) + all_simplices = sfinitesimplicialset_aux1(ksimpset._kenzo, limit) + lall_simplices = [i for i in EclListIterator(all_simplices)] + dim = 1 + for Kdim in lall_simplices: + for simp in Kdim: + index1 = names[dim].index(str(simp.car())) + lKdim_cdr = [] + for i in EclListIterator(simp.cdr()): + degenop = dgop_int_ext(dgop(i)).python() + if degenop == None: + degenop = [] + index2 = names[dim - len(degenop) - 1].index(str(gmsm(i))) + lKdim_cdr.append(bases[dim - len(degenop) - 1][index2].apply_degeneracies(*degenop)) + simplices.append(bases[dim][index1]) + faces.append(tuple(lKdim_cdr)) + dim += 1 + for i in range(len(simplices)): + rslt[simplices[i]] = faces[i] + return SimplicialSet(rslt) + + + From e1daeb1e157b7ba205aff4c296d8f6a24066229b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Cuevas-Rozo?= Date: Wed, 29 May 2019 14:22:18 +0200 Subject: [PATCH 232/301] Methods for computing on finite simplicial sets and chain complexes added. Homotopy added. --- src/sage/interfaces/kenzo.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index a38215e4e38..05bb2b3de04 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -584,6 +584,7 @@ def SChainComplex (kchcm, start = 0, end = 15): OUTPUT: - A ChainComplex + EXAMPLES:: sage: from sage.interfaces.kenzo import KChainComplex, SChainComplex # optional - kenzo @@ -615,6 +616,7 @@ def SAbstractSimplex(KAbSm, dim): OUTPUT: - An AbstractSimplex. + EXAMPLES:: sage: from sage.interfaces.kenzo import SAbstractSimplex # optional - kenzo @@ -645,6 +647,7 @@ def KAbstractSimplex(SAbSm): OUTPUT: - An abstract simplex of Kenzo. + EXAMPLES:: sage: from sage.interfaces.kenzo import KAbstractSimplex, SAbstractSimplex # optional - kenzo @@ -667,6 +670,7 @@ def KFiniteSimplicialSet(ssimpset): OUTPUT: - A finite simplicial set of Kenzo. + EXAMPLES:: sage: from sage.interfaces.kenzo import KFiniteSimplicialSet # optional - kenzo @@ -719,6 +723,7 @@ def SFiniteSimplicialSet(ksimpset, limit): OUTPUT: - A finite SimplicialSet. + EXAMPLES:: sage: from sage.interfaces.kenzo import KFiniteSimplicialSet, SFiniteSimplicialSet, Sphere # optional - kenzo From 88fc95d8c2708ff7beff13a954f2ee5fca1922ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Cuevas-Rozo?= Date: Fri, 31 May 2019 12:30:49 +0200 Subject: [PATCH 233/301] Homotopy added. Simplicial sets and chain complexes added. --- src/sage/interfaces/kenzo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 05bb2b3de04..3fdb2a60fa0 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -783,3 +783,5 @@ def SFiniteSimplicialSet(ksimpset, limit): + + From 259834476ef99c656abf6a068178fbd324094ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Cuevas-Rozo?= Date: Mon, 3 Jun 2019 16:32:57 +0200 Subject: [PATCH 234/301] Homotopy groups added. Chain complexes and simplicial sets functions added. --- src/sage/interfaces/kenzo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 3fdb2a60fa0..bfec873c3c8 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -785,3 +785,6 @@ def SFiniteSimplicialSet(ksimpset, limit): + + + From d8f814c4551160b6877f859e269312e36e4dc195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Cuevas-Rozo?= Date: Tue, 4 Jun 2019 23:14:18 +0200 Subject: [PATCH 235/301] Auxiliary functions for Homotopy groups, Chain complexes and Simplicial sets added. --- src/sage/interfaces/kenzo.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index bfec873c3c8..3fdb2a60fa0 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -785,6 +785,3 @@ def SFiniteSimplicialSet(ksimpset, limit): - - - From be3f5202f38cc3d0766705ab8e4b2165b0e21b8a Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Fri, 7 Jun 2019 15:03:19 +0200 Subject: [PATCH 236/301] Fixed style, and some failing doctests --- src/sage/interfaces/kenzo.py | 261 +++++++++++++++++++---------------- 1 file changed, 145 insertions(+), 116 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 3fdb2a60fa0..68ba2412f27 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -29,6 +29,8 @@ from sage.structure.sage_object import SageObject from sage.homology.homology_group import HomologyGroup from sage.rings.integer_ring import ZZ +from sage.groups.additive_abelian.additive_abelian_group import AdditiveAbelianGroup +from sage.groups.abelian_gps.abelian_group import AbelianGroup from sage.categories.commutative_additive_groups import CommutativeAdditiveGroups from sage.matrix.all import matrix @@ -93,9 +95,6 @@ sfinitesimplicialset_aux1 = EclObject("sfinitesimplicialset_aux1") -#----------------------------------------------------------------# - - def Sphere(n): r""" Return the ``n`` dimensional sphere as a Kenzo simplicial set. @@ -278,7 +277,6 @@ def homology(self, n): res.append(pair[0].python()) return HomologyGroup(len(res), ZZ, res) - def tensor_product(self, other): r""" Return the tensor product of ``self`` and ``other``. @@ -302,76 +300,92 @@ def tensor_product(self, other): """ return KenzoChainComplex(tnsr_prdc(self._kenzo, other._kenzo)) - def basis(self, dim): r""" Return the list of generators of the Kenzo chain complex ``self`` in dimension ``dim``. - + INPUT: - + - ``dim``- An integer number - + OUTPUT: - + - A list of the form ['G"dim"G0', 'G"dim"G1', 'G"dim"G2', ...]. - + EXAMPLES:: - + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - [K1 Chain-Complex] + sage: kenzo_chcm # optional - kenzo + [K589 Chain-Complex] sage: for i in range(6): # optional - kenzo - print("Basis in dimension %i: %s" % (i, kenzo_chcm.basis(i))) # optional - kenzo + ....: print("Basis in dimension %i: %s" % (i, kenzo_chcm.basis(i))) # optional - kenzo Basis in dimension 0: ['G0G0', 'G0G1', 'G0G2'] Basis in dimension 1: ['G1G0', 'G1G1'] Basis in dimension 2: None Basis in dimension 3: ['G3G0', 'G3G1'] Basis in dimension 4: ['G4G0', 'G4G1'] - Basis in dimension 5: ['G5G0', 'G5G1', 'G5G2'] - + Basis in dimension 5: ['G5G0', 'G5G1', 'G5G2'] + """ return basis_aux1(self._kenzo, dim).python() - - + def dffr(self, dim, comb): r""" Return the differential of a combination. - + INPUT: + - ``dim``- An integer number - - ``comb``- A list representing a formal sum of generators in the module of dimension ``dim``. For example, to represent G7G12 + 3*G7G0 - 5*G7G3 we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. Note that the generators must be in ascending order respect to the number after the second G in their representation; the parameter ``comb`` = [1, 'G7G12', 3, 'G7G0', -5, 'G7G3'] will produce an error in Kenzo. - + + - ``comb``- A list representing a formal sum of generators in the module + of dimension ``dim``. For example, to represent G7G12 + 3*G7G0 - 5*G7G3 + we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. Note that the + generators must be in ascending order respect to the number after the + second G in their representation; the parameter + ``comb`` = [1, 'G7G12', 3, 'G7G0', -5, 'G7G3'] will produce an error in + Kenzo. + OUTPUT: - + - A Kenzo combination representing the differential of the formal combination represented by ``comb`` in the chain complex ``self`` in dimension ``dim``. - + EXAMPLES:: - + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - [K1 Chain-Complex] + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] sage: kenzo_chcm.dffr(4, [1, 'G4G0']) # optional - kenzo - {CMBN 3} <1 * G3G0> <3 * G3G1> + + ----------------------------------------------------------------------{CMBN 3} + <1 * G3G0> + <3 * G3G1> + ------------------------------------------------------------------------------ + sage: kenzo_chcm.basis(5) # optional - kenzo ['G5G0', 'G5G1', 'G5G2'] sage: kenzo_chcm.dffr(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo - {CMBN 4} <6 * G4G0> <-3 * G4G1> - + + ----------------------------------------------------------------------{CMBN 4} + <6 * G4G0> + <-3 * G4G1> + ------------------------------------------------------------------------------ + """ cmbn_list = pairing(comb) return KenzoObject(dffr_aux1(self._kenzo, dim, cmbn_list)) - def orgn(self): return str(orgn_aux1(self._kenzo)) @@ -453,7 +467,6 @@ def suspension(self): """ return KenzoSimplicialSet(suspension(self._kenzo)) - def homotopy_group(self, n): """ Return the n'th homotopy group of ``self`` @@ -466,13 +479,13 @@ def homotopy_group(self, n): sage: p.homotopy_group(3) # optional - kenzo Multiplicative Abelian group isomorphic to Z x Z """ - if not n in ZZ or n < 2: + if n not in ZZ or n < 2: raise ValueError("homotopy groups can only be computed for dimensions greater than 1") lgens = homotopy_list(self._kenzo, n).python() - if lgens != None : + if lgens is not None: trgens = [0 if i == 1 else i for i in sorted(lgens)] return AbelianGroup(trgens) - else: + else: return AbelianGroup([]) @@ -503,11 +516,9 @@ def classifying_space(self): return KenzoSimplicialGroup(classifying_space(self._kenzo)) -#----------------------------------------------------------------# - - def k2s_matrix(kmatrix): - r"""Convert an array of ECL to a matrix of Sage. + r""" + Convert an array of ECL to a matrix of Sage. """ dimensions = array_dimensions(kmatrix).python() kmatrix_list = make_array_to_lists(kmatrix).python() @@ -515,7 +526,8 @@ def k2s_matrix(kmatrix): def s2k_matrix(smatrix): - r"""Convert a matrix of Sage to an array of ECL. + r""" + Convert a matrix of Sage to an array of ECL. """ initcontents = [] dimensions = smatrix.dimensions() @@ -525,7 +537,9 @@ def s2k_matrix(smatrix): def s2k_dictmat(sdictmat): - r"""Convert a dictionary in Sage, whose values are matrices, to an assoc list in ECL. + r""" + Convert a dictionary in Sage, whose values are matrices, to an assoc list + in ECL. """ rslt = EclObject([]) for k in sdictmat.keys(): @@ -534,7 +548,8 @@ def s2k_dictmat(sdictmat): def pairing(slist): - r"""Convert a list of Sage (which has an even length) to an assoc list in ECL. + r""" + Convert a list of Sage (which has an even length) to an assoc list in ECL. """ rslt = EclObject([]) for k in range(len(slist) - 1, 0, -2): @@ -543,50 +558,55 @@ def pairing(slist): def KChainComplex(schcm): - r"""Construct a KenzoChainComplex from a ChainComplex of degree = -1 in Sage. - + r""" + Construct a KenzoChainComplex from a ChainComplex of degree = -1 in + Sage. + INPUT: - - - ``schcm`` - A ChainComplex of degree = -1 - + + - ``schcm`` - A ChainComplex of degree = -1 + OUTPUT: - + - A KenzoChainComplex - + EXAMPLES:: - + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - [K1 Chain-Complex] + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] sage: kenzo_chcm.homology(5) # optional - kenzo Z x Z - """ - chcm = s2k_dictmat(schcm.differential()) - str_orgn = str(schcm.differential())[1:-1].replace(":"," ").replace(" ",".").replace("\n","").replace(",","") + str_orgn = str(schcm.differential())[1:-1].replace(":", " ").replace(" ", ".").replace("\n", "").replace(",", "") return KenzoChainComplex(kchaincomplex_aux1(chcm, str_orgn)) -def SChainComplex (kchcm, start = 0, end = 15): +def SChainComplex(kchcm, start=0, end=15): r""" - Convert the KenzoChainComplex ``kchcm`` (between dimensions ``start`` and ``end``) to a ChainComplex. - + Convert the KenzoChainComplex ``kchcm`` (between dimensions ``start`` and + ``end``) to a ChainComplex. + INPUT: - + - ``kchcm``- A KenzoChainComplex + - ``start``- An integer number (optional, default 0) + - ``end``- An integer number greater than or equal to ``start`` (optional, default 15) + OUTPUT: - - - A ChainComplex + + - A ChainComplex EXAMPLES:: - + sage: from sage.interfaces.kenzo import KChainComplex, SChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) @@ -599,80 +619,87 @@ def SChainComplex (kchcm, start = 0, end = 15): matrices = {} for i in range(start, end): dffr_i = chcm_mat2(kchcm._kenzo, i) - if ((nlig(dffr_i).python() != 0) and (ncol(dffr_i).python() != 0)) == True: + if ((nlig(dffr_i).python() != 0) and (ncol(dffr_i).python() != 0)): matrices[i] = k2s_matrix(convertmatrice(dffr_i)) - return ChainComplex(matrices, degree = -1) - - -#----------------------------------------------------------------# + return ChainComplex(matrices, degree=-1) def SAbstractSimplex(KAbSm, dim): - r"""Convert an abstract simplex of Kenzo to an AbstractSimplex. + r""" + Convert an abstract simplex of Kenzo to an AbstractSimplex. INPUT: - + - ``KAbSm``- An abstract simplex of Kenzo. + - ``dim``- The dimension of ``KAbSm``. + OUTPUT: - + - An AbstractSimplex. EXAMPLES:: - - sage: from sage.interfaces.kenzo import SAbstractSimplex # optional - kenzo - sage: KAbSm = KenzoObject(ecl_eval("(ABSM 15 'K)")) # optional - kenzo - sage: SAbSm1 = SAbstractSimplex(KAbSm, 2) # optional - kenzo - sage: SAbSm2 = SAbstractSimplex(KAbSm, 7) # optional - kenzo - sage: SAbSm1.degeneracies() + + sage: from sage.libs.ecl import EclObject, ecl_eval + sage: from sage.interfaces.kenzo import KenzoObject, SAbstractSimplex # optional - kenzo + sage: KAbSm = KenzoObject(ecl_eval("(ABSM 15 'K)")) # optional - kenzo + sage: SAbSm1 = SAbstractSimplex(KAbSm, 2) # optional - kenzo + sage: SAbSm2 = SAbstractSimplex(KAbSm, 7) # optional - kenzo + sage: SAbSm1.degeneracies() # optional - kenzo [3, 2, 1, 0] - sage: SAbSm1.dimension() + sage: SAbSm1.dimension() # optional - kenzo 6 - sage: SAbSm2.dimension() + sage: SAbSm2.dimension() # optional - kenzo 11 """ degeneracies = dgop_int_ext(dgop(KAbSm._kenzo)).python() - if degeneracies == None: + if degeneracies is None: degeneracies = [] else: degeneracies = tuple(degeneracies) name = gmsm(KAbSm._kenzo).python() - return AbstractSimplex(dim, degeneracies, name = name) + return AbstractSimplex(dim, degeneracies, name=name) def KAbstractSimplex(SAbSm): - r"""Convert an AbstractSimplex in Sage to an abstract simplex of Kenzo. + r""" + Convert an AbstractSimplex in Sage to an abstract simplex of Kenzo. INPUT: - + - ``SAbSm``- An AbstractSimplex. + OUTPUT: - + - An abstract simplex of Kenzo. EXAMPLES:: - - sage: from sage.interfaces.kenzo import KAbstractSimplex, SAbstractSimplex # optional - kenzo - sage: SAbSm = AbstractSimplex(1, (2,0,3,2,1), name = 'SAbSm') - sage: KAbSm = KAbstractSimplex(SAbSm) # optional - kenzo - sage: SAbSm2 = SAbstractSimplex(KAbSm, 1) # optional - kenzo - sage: SAbSm.degeneracies() == SAbSm2.degeneracies() + + sage: from sage.interfaces.kenzo import AbstractSimplex, KAbstractSimplex, SAbstractSimplex # optional - kenzo + sage: SAbSm = AbstractSimplex(1, (2,0,3,2,1), name = 'SAbSm') # optional - kenzo + sage: KAbSm = KAbstractSimplex(SAbSm) # optional - kenzo + sage: SAbSm2 = SAbstractSimplex(KAbSm, 1) # optional - kenzo + sage: SAbSm.degeneracies() == SAbSm2.degeneracies() # optional - kenzo True - sage: SAbSm.dimension() == SAbSm2.dimension() + sage: SAbSm.dimension() == SAbSm2.dimension() # optional - kenzo True """ return KenzoObject(kabstractsimplex_aux1(SAbSm.degeneracies(), str(SAbSm))) def KFiniteSimplicialSet(ssimpset): - r"""Convert a finite SimplicialSet in Sage to a finite simplicial set of Kenzo. + r""" + Convert a finite SimplicialSet in Sage to a finite simplicial set of Kenzo. + INPUT: - + - ``ssimpset``- A finite SimplicialSet. + OUTPUT: - + - A finite simplicial set of Kenzo. EXAMPLES:: - + + sage: from sage.homology.simplicial_set import AbstractSimplex, SimplicialSet sage: from sage.interfaces.kenzo import KFiniteSimplicialSet # optional - kenzo sage: s0 = AbstractSimplex(0, name='s0') sage: s1 = AbstractSimplex(0, name='s1') @@ -715,41 +742,48 @@ def KFiniteSimplicialSet(ssimpset): def SFiniteSimplicialSet(ksimpset, limit): - r"""Convert the ``limit``-skeleton of a finite simplicial set in Kenzo to a finite SimplicialSet in Sage. + r"""Convert the ``limit``-skeleton of a finite simplicial set in Kenzo to a + finite SimplicialSet in Sage. + INPUT: - + - ``ksimpset``- A finite simplicial set in Kenzo. + - ``limit``- A natural number. + OUTPUT: - + - A finite SimplicialSet. EXAMPLES:: - - sage: from sage.interfaces.kenzo import KFiniteSimplicialSet, SFiniteSimplicialSet, Sphere # optional - kenzo - sage: s0 = AbstractSimplex(0, name='s0') - sage: s1 = AbstractSimplex(0, name='s1') - sage: s2 = AbstractSimplex(0, name='s2') - sage: s01 = AbstractSimplex(1, name='s01') - sage: s02 = AbstractSimplex(1, name='s02') - sage: s12 = AbstractSimplex(1, name='s12') - sage: s012 = AbstractSimplex(2, name='s012') + + sage: from sage.homology.simplicial_set import SimplicialSet + sage: from sage.interfaces.kenzo import AbstractSimplex, \ + ....: KFiniteSimplicialSet, SFiniteSimplicialSet, Sphere # optional - kenzo + sage: s0 = AbstractSimplex(0, name='s0') # optional - kenzo + sage: s1 = AbstractSimplex(0, name='s1') # optional - kenzo + sage: s2 = AbstractSimplex(0, name='s2') # optional - kenzo + sage: s01 = AbstractSimplex(1, name='s01') # optional - kenzo + sage: s02 = AbstractSimplex(1, name='s02') # optional - kenzo + sage: s12 = AbstractSimplex(1, name='s12') # optional - kenzo + sage: s012 = AbstractSimplex(2, name='s012') # optional - kenzo sage: Triangle = SimplicialSet({s01: (s1, s0), s02: (s2, s0), s12: (s2, s1)}, base_point = s0) - sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo - sage: STriangle = SFiniteSimplicialSet(KTriangle, 1) # optional - kenzo - sage: STriangle.homology() + sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo + sage: STriangle = SFiniteSimplicialSet(KTriangle, 1) # optional - kenzo + sage: STriangle.homology() # optional - kenzo {0: 0, 1: Z} sage: S1 = simplicial_sets.Sphere(1) sage: S3 = simplicial_sets.Sphere(3) - sage: KS1vS3 = KFiniteSimplicialSet(S1.wedge(S3)) # optional - kenzo - sage: SS1vS3 = SFiniteSimplicialSet(KS1vS3, 3) # optional - kenzo - sage: SS1vS3.homology() + sage: KS1vS3 = KFiniteSimplicialSet(S1.wedge(S3)) # optional - kenzo + sage: SS1vS3 = SFiniteSimplicialSet(KS1vS3, 3) # optional - kenzo + sage: SS1vS3.homology() # optional - kenzo {0: 0, 1: Z, 2: 0, 3: Z} """ list_orgn = orgn_aux1(ksimpset._kenzo).python() if nth(0, list_orgn).python()[0] == 'CRTS-PRDC': - return SFiniteSimplicialSet(KenzoSimplicialSet(nth(1, list_orgn)), limit).cartesian_product(SFiniteSimplicialSet(KenzoSimplicialSet(nth(2, list_orgn)), limit)) + return SFiniteSimplicialSet(KenzoSimplicialSet(nth(1, list_orgn)), + limit).cartesian_product(SFiniteSimplicialSet(KenzoSimplicialSet(nth(2, list_orgn)), limit)) rslt = {} simplices = [] faces = [] @@ -758,7 +792,7 @@ def SFiniteSimplicialSet(ksimpset, limit): for k in range(limit + 1): basis_k = basis_aux1(ksimpset._kenzo, k) names_k = ksimpset.basis(k) - lbasis_k = [AbstractSimplex(k, name = i) for i in EclListIterator(basis_k)] + lbasis_k = [AbstractSimplex(k, name=i) for i in EclListIterator(basis_k)] bases.append(lbasis_k) names.append(names_k) all_simplices = sfinitesimplicialset_aux1(ksimpset._kenzo, limit) @@ -770,7 +804,7 @@ def SFiniteSimplicialSet(ksimpset, limit): lKdim_cdr = [] for i in EclListIterator(simp.cdr()): degenop = dgop_int_ext(dgop(i)).python() - if degenop == None: + if degenop is None: degenop = [] index2 = names[dim - len(degenop) - 1].index(str(gmsm(i))) lKdim_cdr.append(bases[dim - len(degenop) - 1][index2].apply_degeneracies(*degenop)) @@ -780,8 +814,3 @@ def SFiniteSimplicialSet(ksimpset, limit): for i in range(len(simplices)): rslt[simplices[i]] = faces[i] return SimplicialSet(rslt) - - - - - From 31385be3a71e292d182c86180fb782f3718b83c5 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Mon, 24 Jun 2019 14:12:57 +0200 Subject: [PATCH 237/301] some style improvements, and identify simplicies by hash --- src/sage/interfaces/kenzo.py | 71 ++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 68ba2412f27..1e105dd11be 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -334,7 +334,7 @@ def basis(self, dim): """ return basis_aux1(self._kenzo, dim).python() - def dffr(self, dim, comb): + def differential(self, dim, comb): r""" Return the differential of a combination. @@ -352,7 +352,9 @@ def dffr(self, dim, comb): OUTPUT: - - A Kenzo combination representing the differential of the formal combination represented by ``comb`` in the chain complex ``self`` in dimension ``dim``. + - A Kenzo combination representing the differential of the formal + combination represented by ``comb`` in the chain complex ``self`` in + dimension ``dim``. EXAMPLES:: @@ -366,7 +368,7 @@ def dffr(self, dim, comb): [K... Chain-Complex] sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] - sage: kenzo_chcm.dffr(4, [1, 'G4G0']) # optional - kenzo + sage: kenzo_chcm.differential(4, [1, 'G4G0']) # optional - kenzo ----------------------------------------------------------------------{CMBN 3} <1 * G3G0> @@ -375,7 +377,7 @@ def dffr(self, dim, comb): sage: kenzo_chcm.basis(5) # optional - kenzo ['G5G0', 'G5G1', 'G5G2'] - sage: kenzo_chcm.dffr(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + sage: kenzo_chcm.differential(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo ----------------------------------------------------------------------{CMBN 4} <6 * G4G0> @@ -557,14 +559,14 @@ def pairing(slist): return rslt -def KChainComplex(schcm): +def KChainComplex(chain_complex): r""" Construct a KenzoChainComplex from a ChainComplex of degree = -1 in Sage. INPUT: - - ``schcm`` - A ChainComplex of degree = -1 + - ``chain_complex`` - A ChainComplex of degree = -1 OUTPUT: @@ -583,19 +585,20 @@ def KChainComplex(schcm): sage: kenzo_chcm.homology(5) # optional - kenzo Z x Z """ - chcm = s2k_dictmat(schcm.differential()) - str_orgn = str(schcm.differential())[1:-1].replace(":", " ").replace(" ", ".").replace("\n", "").replace(",", "") + d = chain_complex.differential() + chcm = s2k_dictmat(d) + str_orgn = str(d)[1:-1].replace(":", " ").replace(" ", ".").replace("\n", "").replace(",", "") return KenzoChainComplex(kchaincomplex_aux1(chcm, str_orgn)) -def SChainComplex(kchcm, start=0, end=15): +def SChainComplex(kchaincomplex, start=0, end=15): r""" Convert the KenzoChainComplex ``kchcm`` (between dimensions ``start`` and ``end``) to a ChainComplex. INPUT: - - ``kchcm``- A KenzoChainComplex + - ``kchaincomplex``- A KenzoChainComplex - ``start``- An integer number (optional, default 0) @@ -618,20 +621,20 @@ def SChainComplex(kchcm, start=0, end=15): matrices = {} for i in range(start, end): - dffr_i = chcm_mat2(kchcm._kenzo, i) + dffr_i = chcm_mat2(kchaincomplex._kenzo, i) if ((nlig(dffr_i).python() != 0) and (ncol(dffr_i).python() != 0)): matrices[i] = k2s_matrix(convertmatrice(dffr_i)) return ChainComplex(matrices, degree=-1) -def SAbstractSimplex(KAbSm, dim): +def SAbstractSimplex(simplex, dim): r""" Convert an abstract simplex of Kenzo to an AbstractSimplex. INPUT: - - ``KAbSm``- An abstract simplex of Kenzo. + - ``simplex``- An abstract simplex of Kenzo. - - ``dim``- The dimension of ``KAbSm``. + - ``dim``- The dimension of ``simplex``. OUTPUT: @@ -651,21 +654,21 @@ def SAbstractSimplex(KAbSm, dim): sage: SAbSm2.dimension() # optional - kenzo 11 """ - degeneracies = dgop_int_ext(dgop(KAbSm._kenzo)).python() + degeneracies = dgop_int_ext(dgop(simplex._kenzo)).python() if degeneracies is None: degeneracies = [] else: degeneracies = tuple(degeneracies) - name = gmsm(KAbSm._kenzo).python() + name = gmsm(simplex._kenzo).python() return AbstractSimplex(dim, degeneracies, name=name) -def KAbstractSimplex(SAbSm): +def KAbstractSimplex(simplex): r""" Convert an AbstractSimplex in Sage to an abstract simplex of Kenzo. INPUT: - - ``SAbSm``- An AbstractSimplex. + - ``simplex``- An AbstractSimplex. OUTPUT: @@ -673,16 +676,17 @@ def KAbstractSimplex(SAbSm): EXAMPLES:: - sage: from sage.interfaces.kenzo import AbstractSimplex, KAbstractSimplex, SAbstractSimplex # optional - kenzo - sage: SAbSm = AbstractSimplex(1, (2,0,3,2,1), name = 'SAbSm') # optional - kenzo - sage: KAbSm = KAbstractSimplex(SAbSm) # optional - kenzo - sage: SAbSm2 = SAbstractSimplex(KAbSm, 1) # optional - kenzo - sage: SAbSm.degeneracies() == SAbSm2.degeneracies() # optional - kenzo + sage: from sage.homology.simplicial_set import AbstractSimplex + sage: from sage.interfaces.kenzo import KAbstractSimplex, SAbstractSimplex # optional - kenzo + sage: SAbSm = AbstractSimplex(1, (2,0,3,2,1), name = 'SAbSm') # optional - kenzo + sage: KAbSm = KAbstractSimplex(SAbSm) # optional - kenzo + sage: SAbSm2 = SAbstractSimplex(KAbSm, 1) # optional - kenzo + sage: SAbSm.degeneracies() == SAbSm2.degeneracies() # optional - kenzo True - sage: SAbSm.dimension() == SAbSm2.dimension() # optional - kenzo + sage: SAbSm.dimension() == SAbSm2.dimension() # optional - kenzo True """ - return KenzoObject(kabstractsimplex_aux1(SAbSm.degeneracies(), str(SAbSm))) + return KenzoObject(kabstractsimplex_aux1(simplex.degeneracies(), 's'+str(hash(simplex)))) def KFiniteSimplicialSet(ssimpset): @@ -718,23 +722,26 @@ def KFiniteSimplicialSet(ssimpset): sage: KS1vS3.homology(3) # optional - kenzo Z """ - - if hasattr(ssimpset, 'factors') and str(ssimpset)[0:5] != 'Wedge': - return KFiniteSimplicialSet(ssimpset.factor(0)).cartesian_product(KFiniteSimplicialSet(ssimpset.factor(1))) + from sage.homology.simplicial_set_constructions import ProductOfSimplicialSets + if isinstance(ssimpset, ProductOfSimplicialSets): + f0 = KFiniteSimplicialSet(ssimpset.factor(0)) + for f1 in ssimpset.factors()[1:]: + f0 = f0.cartesian_product(KFiniteSimplicialSet(f1)) + return f0 else: dim = ssimpset.dimension() - list_rslt = [str(i) for i in ssimpset.n_cells(0)] + list_rslt = ['s'+str(hash(i)) for i in ssimpset.n_cells(0)] if (dim > 0): for k in range(1, dim + 1): k_cells = ssimpset.n_cells(k) - if (len(k_cells) > 0): + if k_cells: list_rslt.append(k) for x in k_cells: - list_rslt.append(str(x)) + list_rslt.append('s'+str(hash(x))) auxiliar_list = [] for z in ssimpset.faces(x): degen_z = z.degeneracies() - name = str(z.nondegenerate()) + name = 's'+str(hash(z.nondegenerate())) degen_z.append(name) auxiliar_list.append(degen_z) list_rslt.append(auxiliar_list) From c987078808a2e50cac62b80aa5a6a986eab34bef Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Wed, 3 Jul 2019 14:01:27 +0200 Subject: [PATCH 238/301] Use unique meaningul names for cells in KFiniteSimplicialSet --- src/sage/interfaces/kenzo.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 1e105dd11be..b25c67638db 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -618,7 +618,6 @@ def SChainComplex(kchaincomplex, start=0, end=15): sage: SChainComplex(KChainComplex(sage_chcm)) == sage_chcm # optional - kenzo True """ - matrices = {} for i in range(start, end): dffr_i = chcm_mat2(kchaincomplex._kenzo, i) @@ -689,13 +688,13 @@ def KAbstractSimplex(simplex): return KenzoObject(kabstractsimplex_aux1(simplex.degeneracies(), 's'+str(hash(simplex)))) -def KFiniteSimplicialSet(ssimpset): +def KFiniteSimplicialSet(sset): r""" Convert a finite SimplicialSet in Sage to a finite simplicial set of Kenzo. INPUT: - - ``ssimpset``- A finite SimplicialSet. + - ``sset``- A finite SimplicialSet. OUTPUT: @@ -716,6 +715,8 @@ def KFiniteSimplicialSet(ssimpset): sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo sage: KTriangle.homology(1) # optional - kenzo Z + sage: KTriangle.basis(1) # optional - kenzo + ['CELL_1_0', 'CELL_1_1', 'CELL_1_2'] sage: S1 = simplicial_sets.Sphere(1) sage: S3 = simplicial_sets.Sphere(3) sage: KS1vS3 = KFiniteSimplicialSet(S1.wedge(S3)) # optional - kenzo @@ -723,25 +724,27 @@ def KFiniteSimplicialSet(ssimpset): Z """ from sage.homology.simplicial_set_constructions import ProductOfSimplicialSets - if isinstance(ssimpset, ProductOfSimplicialSets): - f0 = KFiniteSimplicialSet(ssimpset.factor(0)) - for f1 in ssimpset.factors()[1:]: + if isinstance(sset, ProductOfSimplicialSets): + f0 = KFiniteSimplicialSet(sset.factor(0)) + for f1 in sset.factors()[1:]: f0 = f0.cartesian_product(KFiniteSimplicialSet(f1)) return f0 else: - dim = ssimpset.dimension() - list_rslt = ['s'+str(hash(i)) for i in ssimpset.n_cells(0)] + allcells = sset.cells() + namecells = {c:'cell_{}_{}'.format(d, allcells[d].index(c)) for d in allcells for c in allcells[d]} + dim = sset.dimension() + list_rslt = [namecells[i] for i in sset.n_cells(0)] if (dim > 0): for k in range(1, dim + 1): - k_cells = ssimpset.n_cells(k) + k_cells = sset.n_cells(k) if k_cells: list_rslt.append(k) for x in k_cells: - list_rslt.append('s'+str(hash(x))) + list_rslt.append(namecells[x]) auxiliar_list = [] - for z in ssimpset.faces(x): + for z in sset.faces(x): degen_z = z.degeneracies() - name = 's'+str(hash(z.nondegenerate())) + name = namecells[z.nondegenerate()] degen_z.append(name) auxiliar_list.append(degen_z) list_rslt.append(auxiliar_list) From d425fb5d9f612a08fa48c9cbfc014d83b5b248e2 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Thu, 4 Jul 2019 22:20:29 +0200 Subject: [PATCH 239/301] First implementation of spectral sequences --- src/sage/interfaces/kenzo.py | 95 ++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index b25c67638db..b8afb57a2b3 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -93,6 +93,9 @@ kabstractsimplex_aux1 = EclObject("kabstractsimplex_aux1") kchaincomplex_aux1 = EclObject("kchaincomplex_aux1") sfinitesimplicialset_aux1 = EclObject("sfinitesimplicialset_aux1") +spectral_sequence_group = EclObject("spectral-sequence-group") +spectral_sequence_differential_matrix = EclObject("spectral-sequence-differential-matrix") +eilenberg_moore_spectral_sequence = EclObject("eilenberg-moore-spectral-sequence") def Sphere(n): @@ -240,6 +243,91 @@ def _repr_(self): kenzo_string = repr(self._kenzo) return kenzo_string[6:-1] +class KenzoSpectralSequence(KenzoObject): + r""" + Wrapper around Kenzo spectral sequences + """ + def group(self, p, i, j): + r""" + Return the ``i,j``'th group of the ``p`` page. + + INPUT: + + - ``p`` -- the page to take the group from. + + - ``i`` -- the column where the group is taken from. + + - ``j`` -- the row where the group is taken from. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere + sage: S2 = Sphere(2) + sage: EMS = S2.em_spectral_sequence() + sage: EMS.group(0, -1, 2) + Additive abelian group isomorphic to Z + sage: EMS.group(0, -1, 3) + Trivial group + """ + invs = spectral_sequence_group(self._kenzo, p, i ,j).python() + if not invs: + invs = [] + return AdditiveAbelianGroup(invs) + def matrix(self, p, i, j): + r""" + Return the matrix that determines the differential from the + ``i,j``'th group of the ``p``'th page. + + INPUT: + + - ``p`` -- the page. + + - ``i`` -- the column of the differential domain. + + - ``j`` -- the row of the differential domain. + """ + return spectral_sequence_differential_matrix(self._kenzo, p, j, j) + def table(self, p, i1, i2, j1, j2): + r""" + Return a table printing the groups in the ``p`` page. + + INPUT: + + - ``p`` -- the page to print. + + -- ``i1`` -- the first column to print. + + -- ``i2`` -- the last column to print. + + -- ``j1`` -- the first row to print. + + -- ``j2`` -- the last row to print. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere + sage: S2 = Sphere(2) + sage: EMS = S2.em_spectral_sequence() + sage: EMS.table(0, -2, 2, -2, 2) + 0 Z 0 0 0 + 0 0 0 0 0 + 0 0 Z 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + """ + from sage.misc.table import table + groups = [] + for j in range(j2-j1+1): + row = [] + for i in range(i1, i2+1): + group = self.group(p,i,j2-j) + if group.invariants(): + row.append(group.short_name()) + else: + row.append('0') + groups.append(row) + return table(groups) + class KenzoChainComplex(KenzoObject): r""" @@ -489,6 +577,13 @@ def homotopy_group(self, n): return AbelianGroup(trgens) else: return AbelianGroup([]) + def em_spectral_sequence(self): + r""" + Return the Eilenberg-Moore spectral sequence of self + """ + if self.homology(1).invariants(): + raise ValueError("Eilenberg-Moore spectral sequence can only be computed from 1-reduced simplicial sets") + return KenzoSpectralSequence(eilenberg_moore_spectral_sequence(self._kenzo)) class KenzoSimplicialGroup(KenzoSimplicialSet): From 1d801e2515d16dca5c58eb3986783a0aaddfad9e Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Fri, 5 Jul 2019 19:33:18 +0200 Subject: [PATCH 240/301] Implemented spectral sequences --- src/sage/interfaces/kenzo.py | 106 +++++++++++++++++++++++++++++------ 1 file changed, 90 insertions(+), 16 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index b8afb57a2b3..f1000099c12 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -32,6 +32,7 @@ from sage.groups.additive_abelian.additive_abelian_group import AdditiveAbelianGroup from sage.groups.abelian_gps.abelian_group import AbelianGroup from sage.categories.commutative_additive_groups import CommutativeAdditiveGroups +from sage.groups.additive_abelian.additive_abelian_group import AdditiveAbelianGroup from sage.matrix.all import matrix from sage.homology.chain_complex import ChainComplex @@ -247,6 +248,7 @@ class KenzoSpectralSequence(KenzoObject): r""" Wrapper around Kenzo spectral sequences """ + def group(self, p, i, j): r""" Return the ``i,j``'th group of the ``p`` page. @@ -261,18 +263,19 @@ def group(self, p, i, j): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere - sage: S2 = Sphere(2) - sage: EMS = S2.em_spectral_sequence() - sage: EMS.group(0, -1, 2) + sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo + sage: S2 = Sphere(2) # optional -- kenzo + sage: EMS = S2.em_spectral_sequence() # optional -- kenzo + sage: EMS.group(0, -1, 2) # optional -- kenzo Additive abelian group isomorphic to Z - sage: EMS.group(0, -1, 3) + sage: EMS.group(0, -1, 3) # optional -- kenzo Trivial group """ invs = spectral_sequence_group(self._kenzo, p, i ,j).python() if not invs: invs = [] return AdditiveAbelianGroup(invs) + def matrix(self, p, i, j): r""" Return the matrix that determines the differential from the @@ -285,8 +288,67 @@ def matrix(self, p, i, j): - ``i`` -- the column of the differential domain. - ``j`` -- the row of the differential domain. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo + sage: S3 = Sphere(3) # optional -- kenzo + sage: L = S3.loop_space() # optional -- kenzo + sage: EMS = L.em_spectral_sequence() # optional -- kenzo + sage: EMS.table(1, -5, -2, 5, 8) # optional -- kenzo + 0 Z Z + Z + Z Z + Z + Z + 0 0 0 0 + 0 0 Z Z + Z + 0 0 0 0 + sage: EMS.matrix(1, -2 ,8) # optional -- kenzo + [ 3 3 0] + [-2 0 2] + [ 0 -3 -3] + """ + klist = spectral_sequence_differential_matrix(self._kenzo, p, i, j) + plist = klist.python() + if plist is None or plist==[None]: + i = len(self.group(p, i, j).invariants()) + j = len(self.group(p, i-p, j+p-1).invariants()) + return matrix(i,j) + return matrix(plist) + + def differential(self, p, i, j): + r""" + Return the ``(p, i, j)`` differential morphism of the spectral sequence. + + INPUT: + + - ``p`` -- the page. + + - ``i`` -- the column of the differential domain. + + - ``j`` -- the row of the differential domain. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo + sage: S3 = Sphere(3) # optional -- kenzo + sage: L = S3.loop_space() # optional -- kenzo + sage: EMS = L.em_spectral_sequence() # optional -- kenzo + sage: EMS.table(1,-5,-2,5,8) # optional -- kenzo + 0 Z Z + Z + Z Z + Z + Z + 0 0 0 0 + 0 0 Z Z + Z + 0 0 0 0 + sage: EMS.matrix(1, -3, 8) # optional -- kenzo + [ 2] + [-2] + [ 2] + sage: EMS.differential(1, -3, 8) # optional -- kenzo + Morphism from module over Integer Ring with invariants (0, 0, 0) to module with invariants (0,) that sends the generators to [(2), (-2), (2)] """ - return spectral_sequence_differential_matrix(self._kenzo, p, j, j) + domain = self.group(p, i, j) + codomain = self.group(p, i-p, j+p-1) + M = self.matrix(p, i, j) + images = [codomain(r) for r in M.rows()] + return domain.hom(images, codomain=codomain) + def table(self, p, i1, i2, j1, j2): r""" Return a table printing the groups in the ``p`` page. @@ -305,10 +367,10 @@ def table(self, p, i1, i2, j1, j2): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere - sage: S2 = Sphere(2) - sage: EMS = S2.em_spectral_sequence() - sage: EMS.table(0, -2, 2, -2, 2) + sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo + sage: S2 = Sphere(2) # optional -- kenzo + sage: EMS = S2.em_spectral_sequence() # optional -- kenzo + sage: EMS.table(0, -2, 2, -2, 2) # optional -- kenzo 0 Z 0 0 0 0 0 0 0 0 0 0 Z 0 0 @@ -577,12 +639,25 @@ def homotopy_group(self, n): return AbelianGroup(trgens) else: return AbelianGroup([]) + def em_spectral_sequence(self): r""" Return the Eilenberg-Moore spectral sequence of self + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo + sage: S2 = Sphere(2) # optional -- kenzo + sage: EMS = S2.em_spectral_sequence() # optional -- kenzo + sage: EMS.table(0, -2, 2, -2, 2) # optional -- kenzo + 0 Z 0 0 0 + 0 0 0 0 0 + 0 0 Z 0 0 + 0 0 0 0 0 + 0 0 0 0 0 """ if self.homology(1).invariants(): - raise ValueError("Eilenberg-Moore spectral sequence can only be computed from 1-reduced simplicial sets") + raise ValueError("Eilenberg-Moore spectral sequence implemented only for 1-reduced simplicial sets") return KenzoSpectralSequence(eilenberg_moore_spectral_sequence(self._kenzo)) @@ -863,8 +938,7 @@ def SFiniteSimplicialSet(ksimpset, limit): EXAMPLES:: sage: from sage.homology.simplicial_set import SimplicialSet - sage: from sage.interfaces.kenzo import AbstractSimplex, \ - ....: KFiniteSimplicialSet, SFiniteSimplicialSet, Sphere # optional - kenzo + sage: from sage.interfaces.kenzo import AbstractSimplex, KFiniteSimplicialSet, SFiniteSimplicialSet, Sphere # optional - kenzo sage: s0 = AbstractSimplex(0, name='s0') # optional - kenzo sage: s1 = AbstractSimplex(0, name='s1') # optional - kenzo sage: s2 = AbstractSimplex(0, name='s2') # optional - kenzo @@ -872,13 +946,13 @@ def SFiniteSimplicialSet(ksimpset, limit): sage: s02 = AbstractSimplex(1, name='s02') # optional - kenzo sage: s12 = AbstractSimplex(1, name='s12') # optional - kenzo sage: s012 = AbstractSimplex(2, name='s012') # optional - kenzo - sage: Triangle = SimplicialSet({s01: (s1, s0), s02: (s2, s0), s12: (s2, s1)}, base_point = s0) + sage: Triangle = SimplicialSet({s01: (s1, s0), s02: (s2, s0), s12: (s2, s1)}, base_point = s0) # optional - kenzo sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo sage: STriangle = SFiniteSimplicialSet(KTriangle, 1) # optional - kenzo sage: STriangle.homology() # optional - kenzo {0: 0, 1: Z} - sage: S1 = simplicial_sets.Sphere(1) - sage: S3 = simplicial_sets.Sphere(3) + sage: S1 = simplicial_sets.Sphere(1) # optional - kenzo + sage: S3 = simplicial_sets.Sphere(3) # optional - kenzo sage: KS1vS3 = KFiniteSimplicialSet(S1.wedge(S3)) # optional - kenzo sage: SS1vS3 = SFiniteSimplicialSet(KS1vS3, 3) # optional - kenzo sage: SS1vS3.homology() # optional - kenzo From 76beca07c8de9306b4a1174eac10b68240ad5724 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Fri, 12 Jul 2019 13:23:04 +0200 Subject: [PATCH 241/301] Implement serre-whitehead spectral sequence --- src/sage/interfaces/kenzo.py | 38 +++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index f1000099c12..0df350934d2 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -97,6 +97,7 @@ spectral_sequence_group = EclObject("spectral-sequence-group") spectral_sequence_differential_matrix = EclObject("spectral-sequence-differential-matrix") eilenberg_moore_spectral_sequence = EclObject("eilenberg-moore-spectral-sequence") +serre_whitehead_spectral_sequence = EclObject("serre-whitehead-spectral-sequence") def Sphere(n): @@ -288,9 +289,9 @@ def matrix(self, p, i, j): - ``i`` -- the column of the differential domain. - ``j`` -- the row of the differential domain. - + EXAMPLES:: - + sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo sage: S3 = Sphere(3) # optional -- kenzo sage: L = S3.loop_space() # optional -- kenzo @@ -303,7 +304,7 @@ def matrix(self, p, i, j): sage: EMS.matrix(1, -2 ,8) # optional -- kenzo [ 3 3 0] [-2 0 2] - [ 0 -3 -3] + [ 0 -3 -3] """ klist = spectral_sequence_differential_matrix(self._kenzo, p, i, j) plist = klist.python() @@ -312,7 +313,7 @@ def matrix(self, p, i, j): j = len(self.group(p, i-p, j+p-1).invariants()) return matrix(i,j) return matrix(plist) - + def differential(self, p, i, j): r""" Return the ``(p, i, j)`` differential morphism of the spectral sequence. @@ -324,9 +325,9 @@ def differential(self, p, i, j): - ``i`` -- the column of the differential domain. - ``j`` -- the row of the differential domain. - + EXAMPLES:: - + sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo sage: S3 = Sphere(3) # optional -- kenzo sage: L = S3.loop_space() # optional -- kenzo @@ -471,7 +472,7 @@ def basis(self, dim): sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo - [K589 Chain-Complex] + [K... Chain-Complex] sage: for i in range(6): # optional - kenzo ....: print("Basis in dimension %i: %s" % (i, kenzo_chcm.basis(i))) # optional - kenzo Basis in dimension 0: ['G0G0', 'G0G1', 'G0G2'] @@ -639,11 +640,11 @@ def homotopy_group(self, n): return AbelianGroup(trgens) else: return AbelianGroup([]) - + def em_spectral_sequence(self): r""" Return the Eilenberg-Moore spectral sequence of self - + EXAMPLES:: sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo @@ -660,6 +661,25 @@ def em_spectral_sequence(self): raise ValueError("Eilenberg-Moore spectral sequence implemented only for 1-reduced simplicial sets") return KenzoSpectralSequence(eilenberg_moore_spectral_sequence(self._kenzo)) + def sw_spectral_sequence(self): + r""" + Return the Serre sequence of the first step of the Whitehead tower. + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere + sage: S3 = Sphere(3) # optional -- kenzo + sage: E = S3.sw_spectral_sequence() # optional -- kenzo + sage: T = E.table(0,0,4,0,4) # optional -- kenzo + sage: T # optional -- kenzo + Z 0 0 Z 0 + 0 0 0 0 0 + Z 0 0 Z 0 + 0 0 0 0 0 + Z 0 0 Z 0 + """ + return KenzoSpectralSequence(serre_whitehead_spectral_sequence(self._kenzo)) + class KenzoSimplicialGroup(KenzoSimplicialSet): r""" From d0016d4ac7afed40fdaaff2ccfc21abd6707ee70 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Fri, 12 Jul 2019 13:33:50 +0200 Subject: [PATCH 242/301] implement serre spectral sequence of products --- src/sage/interfaces/kenzo.py | 38 +++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 0df350934d2..5f5882d8215 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -98,6 +98,7 @@ spectral_sequence_differential_matrix = EclObject("spectral-sequence-differential-matrix") eilenberg_moore_spectral_sequence = EclObject("eilenberg-moore-spectral-sequence") serre_whitehead_spectral_sequence = EclObject("serre-whitehead-spectral-sequence") +serre_spectral_sequence_product = EclObject("serre-spectral-sequence-product") def Sphere(n): @@ -668,18 +669,37 @@ def sw_spectral_sequence(self): EXAMPLES:: sage: from sage.interfaces.kenzo import Sphere - sage: S3 = Sphere(3) # optional -- kenzo - sage: E = S3.sw_spectral_sequence() # optional -- kenzo - sage: T = E.table(0,0,4,0,4) # optional -- kenzo - sage: T # optional -- kenzo - Z 0 0 Z 0 - 0 0 0 0 0 - Z 0 0 Z 0 - 0 0 0 0 0 - Z 0 0 Z 0 + sage: S3 = Sphere(3) # optional -- kenzo + sage: E = S3.sw_spectral_sequence() # optional -- kenzo + sage: T = E.table(0, 0, 4, 0, 4) # optional -- kenzo + sage: T # optional -- kenzo + Z 0 0 Z 0 + 0 0 0 0 0 + Z 0 0 Z 0 + 0 0 0 0 0 + Z 0 0 Z 0 """ return KenzoSpectralSequence(serre_whitehead_spectral_sequence(self._kenzo)) + def serre_spectral_sequence(self): + r""" + Return the spectral sequence of self. + + The object self must be created as a cartesian product (twisted or not). + + sage: from sage.interfaces.kenzo import Sphere + sage: S2 = Sphere(2) # optional -- kenzo + sage: S3 = Sphere(3) # optional -- kenzo + sage: P = S2.cartesian_product(S3) # optional -- kenzo + sage: E = P.serre_spectral_sequence() # optional -- kenzo + sage: E.table(0, 0, 2, 0, 3) # optional -- kenzo + Z 0 Z + 0 0 0 + 0 0 0 + Z 0 Z + """ + return KenzoSpectralSequence(serre_spectral_sequence_product(self._kenzo)) + class KenzoSimplicialGroup(KenzoSimplicialSet): r""" From 4e9e11f06da5f853aa28caaf8d2a1571fb402a68 Mon Sep 17 00:00:00 2001 From: jodivaso Date: Tue, 17 Sep 2019 12:03:22 +0200 Subject: [PATCH 243/301] added wedge and join --- src/sage/interfaces/kenzo.py | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 5f5882d8215..bf887516105 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -99,6 +99,8 @@ eilenberg_moore_spectral_sequence = EclObject("eilenberg-moore-spectral-sequence") serre_whitehead_spectral_sequence = EclObject("serre-whitehead-spectral-sequence") serre_spectral_sequence_product = EclObject("serre-spectral-sequence-product") +wedge = EclObject("wedge") +join = EclObject("join") def Sphere(n): @@ -700,6 +702,58 @@ def serre_spectral_sequence(self): """ return KenzoSpectralSequence(serre_spectral_sequence_product(self._kenzo)) + def wedge(self, other): + r""" + Return the wedge of ``self`` and ``other``. + + INPUT: + + - ``other`` -- the Kenzo simplicial set with which the wedge is made + + OUTPUT: + + - A :class:`KenzoSimplicialSet` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: w = s2.wedge(s3) # optional - kenzo + sage: type(w) # optional - kenzo + + sage: [w.homology(i) for i in range(6)] # optional - kenzo + [Z, 0, Z, Z, 0, 0] + """ + wedge_kenzo = wedge(self._kenzo, other._kenzo) + return KenzoSimplicialSet(wedge_kenzo) + + def join(self, other): + r""" + Return the join of ``self`` and ``other``. + + INPUT: + + - ``other`` -- the Kenzo simplicial set with which the join is made + + OUTPUT: + + - A :class:`KenzoSimplicialSet` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: j = s2.join(s3) # optional - kenzo + sage: type(j) # optional - kenzo + + sage: [j.homology(i) for i in range(6)] # optional - kenzo + [Z, 0, 0, 0, 0, 0] + """ + join_kenzo = join(self._kenzo, other._kenzo) + return KenzoSimplicialSet(join_kenzo) + class KenzoSimplicialGroup(KenzoSimplicialSet): r""" From e5e318d7fe4c09362794c625fd918dd3bdeb1b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Wed, 25 Sep 2019 17:18:06 +0200 Subject: [PATCH 244/301] trac 27880 cleanup of kenzo file --- src/sage/interfaces/kenzo.py | 97 ++++++++++++++++++++---------------- 1 file changed, 54 insertions(+), 43 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index bf887516105..56f4057efed 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -40,8 +40,6 @@ from sage.libs.ecl import EclObject, ecl_eval, EclListIterator -from sage.env import SAGE_LOCAL -from sys import version # Redirection of ECL and Maxima stdout to /dev/null # This is also done in the Maxima library, but we @@ -138,10 +136,9 @@ def MooreSpace(m, n): INPUT: - - ``m`` - A positive integer. The order of the nontrivial homology group. - - - ``n`` - The dimension in which the homology is not trivial + - ``m`` -- A positive integer. The order of the nontrivial homology group. + - ``n`` -- The dimension in which the homology is not trivial OUTPUT: @@ -174,7 +171,6 @@ def EilenbergMacLaneSpace(G, n): - ``n`` -- the dimension in which the homotopy is not trivial - OUTPUT: - A :class:`KenzoSimplicialGroup` @@ -248,6 +244,7 @@ def _repr_(self): kenzo_string = repr(self._kenzo) return kenzo_string[6:-1] + class KenzoSpectralSequence(KenzoObject): r""" Wrapper around Kenzo spectral sequences @@ -275,7 +272,7 @@ def group(self, p, i, j): sage: EMS.group(0, -1, 3) # optional -- kenzo Trivial group """ - invs = spectral_sequence_group(self._kenzo, p, i ,j).python() + invs = spectral_sequence_group(self._kenzo, p, i, j).python() if not invs: invs = [] return AdditiveAbelianGroup(invs) @@ -311,10 +308,10 @@ def matrix(self, p, i, j): """ klist = spectral_sequence_differential_matrix(self._kenzo, p, i, j) plist = klist.python() - if plist is None or plist==[None]: + if plist is None or plist == [None]: i = len(self.group(p, i, j).invariants()) - j = len(self.group(p, i-p, j+p-1).invariants()) - return matrix(i,j) + j = len(self.group(p, i - p, j + p - 1).invariants()) + return matrix(i, j) return matrix(plist) def differential(self, p, i, j): @@ -348,7 +345,7 @@ def differential(self, p, i, j): Morphism from module over Integer Ring with invariants (0, 0, 0) to module with invariants (0,) that sends the generators to [(2), (-2), (2)] """ domain = self.group(p, i, j) - codomain = self.group(p, i-p, j+p-1) + codomain = self.group(p, i - p, j + p - 1) M = self.matrix(p, i, j) images = [codomain(r) for r in M.rows()] return domain.hom(images, codomain=codomain) @@ -383,10 +380,10 @@ def table(self, p, i1, i2, j1, j2): """ from sage.misc.table import table groups = [] - for j in range(j2-j1+1): + for j in range(j2 - j1 + 1): row = [] - for i in range(i1, i2+1): - group = self.group(p,i,j2-j) + for i in range(i1, i2 + 1): + group = self.group(p, i, j2 - j) if group.invariants(): row.append(group.short_name()) else: @@ -413,16 +410,16 @@ def homology(self, n): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere # optional - kenzo - sage: s2 = Sphere(2) # optional - kenzo - sage: s2 # optional - kenzo - [K1 Simplicial-Set] - sage: s2.homology(2) # optional - kenzo - Z + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s2 # optional - kenzo + [K1 Simplicial-Set] + sage: s2.homology(2) # optional - kenzo + Z """ echcm1 = echcm(self._kenzo) m1 = chcm_mat(echcm1, n) - m2 = chcm_mat(echcm1, n+1) + m2 = chcm_mat(echcm1, n + 1) homology = homologie(m1, m2) lhomomology = [i for i in EclListIterator(homology)] res = [] @@ -443,14 +440,16 @@ def tensor_product(self, other): - A :class:`KenzoChainComplex` - sage: from sage.interfaces.kenzo import Sphere # optional - kenzo - sage: s2 = Sphere(2) # optional - kenzo - sage: s3 = Sphere(3) # optional - kenzo - sage: p = s2.tensor_product(s3) # optional - kenzo - sage: type(p) # optional - kenzo - - sage: [p.homology(i) for i in range(8)] # optional - kenzo - [Z, 0, Z, Z, 0, Z, 0, 0] + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: p = s2.tensor_product(s3) # optional - kenzo + sage: type(p) # optional - kenzo + + sage: [p.homology(i) for i in range(8)] # optional - kenzo + [Z, 0, Z, Z, 0, Z, 0, 0] """ return KenzoChainComplex(tnsr_prdc(self._kenzo, other._kenzo)) @@ -468,7 +467,7 @@ def basis(self, dim): EXAMPLES:: - sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) @@ -494,10 +493,12 @@ def differential(self, dim, comb): INPUT: - - ``dim``- An integer number + - ``dim``-- An integer number - - ``comb``- A list representing a formal sum of generators in the module - of dimension ``dim``. For example, to represent G7G12 + 3*G7G0 - 5*G7G3 + - ``comb``-- A list representing a formal sum of generators in + the module of dimension ``dim``. + + For example, to represent G7G12 + 3*G7G0 - 5*G7G3 we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. Note that the generators must be in ascending order respect to the number after the second G in their representation; the parameter @@ -626,9 +627,13 @@ def suspension(self): def homotopy_group(self, n): """ Return the n'th homotopy group of ``self`` + INPUT: + - ``n`` - the dimension of the homotopy group to be computed + EXAMPLES:: + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: p = s2.cartesian_product(s2) # optional - kenzo @@ -646,7 +651,7 @@ def homotopy_group(self, n): def em_spectral_sequence(self): r""" - Return the Eilenberg-Moore spectral sequence of self + Return the Eilenberg-Moore spectral sequence of ``self``. EXAMPLES:: @@ -685,10 +690,12 @@ def sw_spectral_sequence(self): def serre_spectral_sequence(self): r""" - Return the spectral sequence of self. + Return the spectral sequence of ``self``. The object self must be created as a cartesian product (twisted or not). + EXAMPLES:: + sage: from sage.interfaces.kenzo import Sphere sage: S2 = Sphere(2) # optional -- kenzo sage: S3 = Sphere(3) # optional -- kenzo @@ -893,11 +900,12 @@ def SChainComplex(kchaincomplex, start=0, end=15): def SAbstractSimplex(simplex, dim): r""" Convert an abstract simplex of Kenzo to an AbstractSimplex. + INPUT: - - ``simplex``- An abstract simplex of Kenzo. + - ``simplex`` -- An abstract simplex of Kenzo. - - ``dim``- The dimension of ``simplex``. + - ``dim``-- The dimension of ``simplex``. OUTPUT: @@ -929,9 +937,10 @@ def SAbstractSimplex(simplex, dim): def KAbstractSimplex(simplex): r""" Convert an AbstractSimplex in Sage to an abstract simplex of Kenzo. + INPUT: - - ``simplex``- An AbstractSimplex. + - ``simplex`` -- An AbstractSimplex. OUTPUT: @@ -949,7 +958,8 @@ def KAbstractSimplex(simplex): sage: SAbSm.dimension() == SAbSm2.dimension() # optional - kenzo True """ - return KenzoObject(kabstractsimplex_aux1(simplex.degeneracies(), 's'+str(hash(simplex)))) + return KenzoObject(kabstractsimplex_aux1(simplex.degeneracies(), + 's' + str(hash(simplex)))) def KFiniteSimplicialSet(sset): @@ -958,7 +968,7 @@ def KFiniteSimplicialSet(sset): INPUT: - - ``sset``- A finite SimplicialSet. + - ``sset`` -- A finite SimplicialSet. OUTPUT: @@ -995,7 +1005,8 @@ def KFiniteSimplicialSet(sset): return f0 else: allcells = sset.cells() - namecells = {c:'cell_{}_{}'.format(d, allcells[d].index(c)) for d in allcells for c in allcells[d]} + namecells = {c: 'cell_{}_{}'.format(d, allcells[d].index(c)) + for d in allcells for c in allcells[d]} dim = sset.dimension() list_rslt = [namecells[i] for i in sset.n_cells(0)] if (dim > 0): @@ -1016,7 +1027,8 @@ def KFiniteSimplicialSet(sset): def SFiniteSimplicialSet(ksimpset, limit): - r"""Convert the ``limit``-skeleton of a finite simplicial set in Kenzo to a + r""" + Convert the ``limit``-skeleton of a finite simplicial set in Kenzo to a finite SimplicialSet in Sage. INPUT: @@ -1052,7 +1064,6 @@ def SFiniteSimplicialSet(ksimpset, limit): sage: SS1vS3.homology() # optional - kenzo {0: 0, 1: Z, 2: 0, 3: Z} """ - list_orgn = orgn_aux1(ksimpset._kenzo).python() if nth(0, list_orgn).python()[0] == 'CRTS-PRDC': return SFiniteSimplicialSet(KenzoSimplicialSet(nth(1, list_orgn)), From b092e999c8cbeec19e2ed616f769c13f27d351c5 Mon Sep 17 00:00:00 2001 From: Ana Romero Date: Mon, 30 Sep 2019 11:09:04 +0200 Subject: [PATCH 245/301] Interface for morphisms of chain complexes added Spectral sequence of a bicomplex added --- src/sage/interfaces/kenzo.py | 492 ++++++++++++++++++++++++++++++++++- 1 file changed, 491 insertions(+), 1 deletion(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 56f4057efed..38123a709af 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -99,7 +99,9 @@ serre_spectral_sequence_product = EclObject("serre-spectral-sequence-product") wedge = EclObject("wedge") join = EclObject("join") - +kmorphismchaincomplex_aux1 = EclObject("kmorphismchaincomplex_aux1") +bicomplex_spectral_sequence = EclObject("bicomplex-spectral-sequence") +nreverse = EclObject("nreverse") def Sphere(n): r""" @@ -1098,3 +1100,491 @@ def SFiniteSimplicialSet(ksimpset, limit): for i in range(len(simplices)): rslt[simplices[i]] = faces[i] return SimplicialSet(rslt) + + +class KenzoChainComplexMorphism(KenzoObject): + r""" + Wrapper to Kenzo morphisms between chain complexes. + """ + + def source_complex(self): + r""" + Return the source chain complex of the morphism. + OUTPUT: + - A :class:`KenzoChainComplex` + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K1 Chain-Complex] + sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo + sage: differential_morphism # optional - kenzo + [K2 Morphism (degree -1): K1 -> K1] + sage: differential_morphism.source_complex() # optional - kenzo + [K1 Chain-Complex] + """ + return KenzoChainComplex(sorc_aux(self._kenzo)) + + def target_complex(self): + r""" + Return the target chain complex of the morphism. + OUTPUT: + - A :class:`KenzoChainComplex` + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K1 Chain-Complex] + sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo + sage: differential_morphism # optional - kenzo + [K2 Morphism (degree -1): K1 -> K1] + sage: differential_morphism.target_complex() # optional - kenzo + [K1 Chain-Complex] + """ + return KenzoChainComplex(trgt_aux(self._kenzo)) + + def degree(self): + r""" + Return the degree of the morphism. + OUTPUT: + - An integer number, the degree of the morphism. + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K1 Chain-Complex] + sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo + sage: differential_morphism # optional - kenzo + [K2 Morphism (degree -1): K1 -> K1] + sage: differential_morphism.degree() # optional - kenzo + -1 + sage: differential_morphism.composite(differential_morphism).degree() # optional - kenzo + -2 + sage: kenzo_chcm.null_morphism().degree() # optional - kenzo + 0 + """ + return degr_aux(self._kenzo).python() + + def orgn(self): + return str(orgn_aux1(self._kenzo)) + + def evaluation(self, dim, comb): + r""" + Apply the morphism on a combination ``comb`` of dimension ``dim``. + INPUT: + - ``dim``- An integer number + - ``comb``- A list representing a formal sum of generators in the module + of dimension ``dim``. For example, to represent G7G12 + 3*G7G0 - 5*G7G3 + we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. Note that the + generators must be in ascending order respect to the number after the + second G in their representation; the parameter + ``comb`` = [1, 'G7G12', 3, 'G7G0', -5, 'G7G3'] will produce an error in + Kenzo. + OUTPUT: + - A Kenzo combination representing the result of applying the morphism on the formal + combination represented by ``comb`` in the chain complex ``self`` in + dimension ``dim``. + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K1 Chain-Complex] + sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo + sage: differential_morphism # optional - kenzo + [K2 Morphism (degree -1): K1 -> K1] + sage: dif_squared = differential_morphism.composite(differential_morphism) # optional - kenzo + sage: dif_squared # optional - kenzo + [K3 Morphism (degree -2): K1 -> K1] + sage: kenzo_chcm.basis(5) # optional - kenzo + ['G5G0', 'G5G1', 'G5G2'] + sage: kenzo_chcm.differential(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <6 * G4G0> + <-3 * G4G1> + ------------------------------------------------------------------------------ + + sage: differential_morphism.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <6 * G4G0> + <-3 * G4G1> + ------------------------------------------------------------------------------ + + sage: dif_squared.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 3} + ------------------------------------------------------------------------------ + + sage: id = kenzo_chcm.identity_morphism() # optional - kenzo + sage: idx2 = id.sum(id) # optional - kenzo + sage: id.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 5} + <1 * G5G0> + <2 * G5G2> + ------------------------------------------------------------------------------ + + sage: idx2.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 5} + <2 * G5G0> + <4 * G5G2> + ------------------------------------------------------------------------------ + + """ + if isinstance(dim, Integer): + if isinstance(comb, list): + cmbn_list = pairing(comb) + return KenzoObject(evaluation_aux1(self._kenzo, dim, cmbn_list)) + else: + raise ValueError("'comb' parameter must be a list") + else: + raise ValueError("'dim' parameter must be an integer number") + + def opposite(self): + r""" + Return the opposite morphism of ``self``, i.e., -1 x ``self``. + OUTPUT: + - A :class:`KenzoChainComplexMorphism` + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K1 Chain-Complex] + sage: id = kenzo_chcm.identity_morphism() # optional - kenzo + sage: id # optional - kenzo + [K3 Morphism (degree 0): K1 -> K1] + sage: opps_id = id.opposite() # optional - kenzo + sage: opps_id # optional - kenzo + [K4 Morphism (degree 0): K1 -> K1] + sage: kenzo_chcm.basis(4) # optional - kenzo + ['G4G0', 'G4G1'] + sage: id.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <2 * G4G0> + <-5 * G4G1> + ------------------------------------------------------------------------------ + + sage: opps_id.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <-2 * G4G0> + <5 * G4G1> + ------------------------------------------------------------------------------ + + """ + return KenzoChainComplexMorphism(opps(self._kenzo)) + + def composite(self, object=None): + r""" + Return the composite of ``self`` and the morphism(s) given by the parameter ``object``. + INPUT: + - ``object``- A KenzoChainComplexMorphism instance, a KenzoChainComplex instance, a tuple + of KenzoChainComplexMorphism and KenzoChainComplex instances, or None (default). + OUTPUT: + - A :class:`KenzoChainComplexMorphism`: if ``object`` is a KenzoChainComplexMorphism, the + composite of ``self`` and ``object`` is returned; if ``object`` is a KenzoChainComplex, + the composite of ``self`` and the differential morphism of ``object`` is returned; if + ``object`` is a tuple, the composite of ``self`` and the morphisms or the differential + morphisms of the given chain complexes in ``object`` is returned (if ``object``==None, + ``self`` morphism is returned). + EXAMPLES:: + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: tp22 = s2.tensor_product(s2) # optional - kenzo + sage: tp23 = s2.tensor_product(s3) # optional - kenzo + sage: id = tp22.identity_morphism() # optional - kenzo + sage: id # optional - kenzo + [K13 Morphism (degree 0): K3 -> K3] + sage: null = tp23.null_morphism(target = tp22, degree = 4) # optional - kenzo + sage: null # optional - kenzo + [K14 Morphism (degree 4): K11 -> K3] + sage: id.composite((tp22, null)) # optional - kenzo + [K15 Morphism (degree 3): K11 -> K3] + """ + if object==None: + return self + if isinstance(object, KenzoChainComplexMorphism): + return KenzoChainComplexMorphism(cmps(self._kenzo, object._kenzo)) + elif isinstance(object, KenzoChainComplex): + return KenzoChainComplexMorphism(cmps(self._kenzo, dffr_aux(object._kenzo))) + elif isinstance(object, tuple): + rslt = self._kenzo + for mrph in object: + rslt = cmps(rslt, mrph._kenzo) + return KenzoChainComplexMorphism(rslt) + + def sum(self, object=None): + r""" + Return a morphism, sum of the morphism ``self`` and the morphism(s) given by the parameter ``object``. + INPUT: + - ``object``- A KenzoChainComplexMorphism instance, a tuple of KenzoChainComplexMorphism instances or None (default). + OUTPUT: + - A :class:`KenzoChainComplexMorphism`, sum of the morphism ``self`` and the morphism(s) given by ``object`` (if ``object``==None, ``self`` morphism is returned). + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K1 Chain-Complex] + sage: id = kenzo_chcm.identity_morphism() # optional - kenzo + sage: id # optional - kenzo + [K3 Morphism (degree 0): K1 -> K1] + sage: opps_id = id.opposite() # optional - kenzo + sage: opps_id # optional - kenzo + [K4 Morphism (degree 0): K1 -> K1] + sage: null = kenzo_chcm.null_morphism() # optional - kenzo + sage: null # optional - kenzo + [K5 Morphism (degree 0): K1 -> K1] + sage: idx2 = id.sum(id) # optional - kenzo + sage: idx5 = idx2.sum((opps_id, id, id, null, idx2.sum(id), opps_id)) # optional - kenzo + sage: kenzo_chcm.basis(4) # optional - kenzo + ['G4G0', 'G4G1'] + sage: idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <4 * G4G0> + <-10 * G4G1> + ------------------------------------------------------------------------------ + + sage: idx5.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <10 * G4G0> + <-25 * G4G1> + ------------------------------------------------------------------------------ + + """ + if object==None: + return self + if isinstance(object, KenzoChainComplexMorphism): + return KenzoChainComplexMorphism(add(self._kenzo, object._kenzo)) + elif isinstance(object, tuple): + rslt = self._kenzo + for mrph in object: + rslt = add(rslt, mrph._kenzo) + return KenzoChainComplexMorphism(rslt) + + def substract(self, object=None): + r""" + Return a morphism, difference of the morphism ``self`` and the morphism(s) given by the parameter ``object``. + INPUT: + - ``object``- A KenzoChainComplexMorphism instance, a tuple of KenzoChainComplexMorphism instances or None (default). + OUTPUT: + - A :class:`KenzoChainComplexMorphism`, difference of the morphism ``self`` and the morphism(s) given by ``object`` (if ``object``==None, ``self`` morphism is returned). For example, if ``object`` = (mrph1, mrph2, mrph3) the result is ``self`` - mrph1 - mrph2 - mrph3. + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo + sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) + sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) + sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) + sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo + sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo + sage: kenzo_chcm # optional - kenzo + [K1 Chain-Complex] + sage: id = kenzo_chcm.identity_morphism() # optional - kenzo + sage: id # optional - kenzo + [K3 Morphism (degree 0): K1 -> K1] + sage: opps_id = id.opposite() # optional - kenzo + sage: opps_id # optional - kenzo + [K4 Morphism (degree 0): K1 -> K1] + sage: null = kenzo_chcm.null_morphism() # optional - kenzo + sage: null # optional - kenzo + [K5 Morphism (degree 0): K1 -> K1] + sage: idx2 = id.substract(opps_id) # optional - kenzo + sage: opps_idx2 = idx2.substract((opps_id, id, id, null, idx2.substract(opps_id))) # optional - kenzo + sage: kenzo_chcm.basis(4) # optional - kenzo + ['G4G0', 'G4G1'] + sage: idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <4 * G4G0> + <-10 * G4G1> + ------------------------------------------------------------------------------ + + sage: opps_idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + + ----------------------------------------------------------------------{CMBN 4} + <-4 * G4G0> + <10 * G4G1> + ------------------------------------------------------------------------------ + + """ + if object==None: + return self + if isinstance(object, KenzoChainComplexMorphism): + return KenzoChainComplexMorphism(sbtr(self._kenzo, object._kenzo)) + elif isinstance(object, tuple): + rslt = self._kenzo + for mrph in object: + rslt = sbtr(rslt, mrph._kenzo) + return KenzoChainComplexMorphism(rslt) + + def change_source_target_complex(self, source=None, target=None): + r""" + Build, from the morphism ``self``, a new morphism with ``source`` and ``target`` as source and target Kenzo chain complexes, respectively. + INPUT: + - ``source``- A KenzoChainComplex instance or None (default). + - ``target``- A KenzoChainComplex instance or None (default). + OUTPUT: + - A :class:`KenzoChainComplexMorphism` inheriting from ``self`` the degree (:degr slot in Kenzo), the algorithm (:intr slot in Kenzo) and the strategy (:strt slot in Kenzo). The source and target slots of this new morphism are given by the parameters ``source`` and ``target`` respectively; if any parameter is ommited, the corresponding slot is inherited from ``self``. + EXAMPLES:: + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo + sage: ZCC # optional - kenzo + [K1 Chain-Complex] + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: tp = s2.tensor_product(s3) # optional - kenzo + sage: tp # optional - kenzo + [K13 Chain-Complex] + sage: null = ZCC.null_morphism(tp) # optional - kenzo + sage: null # optional - kenzo + [K15 Morphism (degree 0): K1 -> K13] + sage: null.source_complex() # optional - kenzo + [K1 Chain-Complex] + sage: null2 = null.change_source_target_complex(source = tp) # optional - kenzo + sage: null2 # optional - kenzo + [K16 Morphism (degree 0): K13 -> K13] + sage: null2.source_complex() # optional - kenzo + [K13 Chain-Complex] + """ + source = source or self.source_complex() + target = target or self.target_complex() + return KenzoChainComplexMorphism(change_sorc_trgt_aux(self._kenzo, source._kenzo, target._kenzo)) + + def destructive_change_source_target_complex(self, source=None, target=None): + r""" + Modify destructively the morphism ``self`` taking ``source`` and ``target`` as source and target Kenzo chain complexes of ``self``, respectively. + INPUT: + - ``source``- A KenzoChainComplex instance or None (default). + - ``target``- A KenzoChainComplex instance or None (default). + OUTPUT: + - A :class:`KenzoChainComplexMorphism`. The source and target slots of ``self`` are replaced respectively by the parameters ``source`` and ``target``; if any parameter is ommited, the corresponding slot is inherited from ``self``. + EXAMPLES:: + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo + sage: ZCC # optional - kenzo + [K1 Chain-Complex] + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: tp = s2.tensor_product(s3) # optional - kenzo + sage: tp # optional - kenzo + [K13 Chain-Complex] + sage: null = ZCC.null_morphism(tp) # optional - kenzo + sage: null # optional - kenzo + [K15 Morphism (degree 0): K1 -> K13] + sage: null.target_complex() # optional - kenzo + [K13 Chain-Complex] + sage: null.destructive_change_source_target_complex(target = ZCC) # optional - kenzo + [K15 Cohomology-Class on K1 of degree 0] + sage: null.target_complex() # optional - kenzo + [K1 Chain-Complex] + """ + source = source or self.source_complex() + target = target or self.target_complex() + return KenzoChainComplexMorphism(dstr_change_sorc_trgt_aux(self._kenzo, source._kenzo, target._kenzo)) + + +def build_morphism(source_complex, target_complex, degree, algorithm, strategy, orgn): + return KenzoChainComplexMorphism(build_mrph_aux(source_complex._kenzo, target_complex._kenzo, degree, algorithm, ":"+strategy, orgn)) + +def morphism_dictmat(morphism): + r""" + Computes a list of matrices in ECL associated to a morphism in Sage. + """ + rslt = EclObject([]) + source = morphism.domain() + d = source.differential() + for k in d.keys(): + rslt = EclObject(k).cons(s2k_matrix(morphism.in_degree(k))).cons(rslt) + return rslt + +def KChainComplexMorphism(morphism): + r""" + Construct a KenzoChainComplexMorphism from a ChainComplexMorphism in Sage. + INPUT: + - ``morphism`` - A morphism of chain complexes + OUTPUT: + - A :class:`KenzoChainComplexMorphism` + EXAMPLES:: + sage: C = ChainComplex({0: identity_matrix(ZZ, 1)}) + sage: D = ChainComplex({0: zero_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) + sage: f = Hom(C,D)({0: identity_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) + sage: g = KChainComplexMorphism(f) # optional - kenzo + sage: g + [K5 Morphism (degree 0): K1 -> K3] + sage: g.source_complex() # optional - kenzo + [K1 Chain-Complex] + sage: g.target_complex() # optional - kenzo + [K3 Chain-Complex] + """ + source = KChainComplex(morphism.domain()) + target = KChainComplex(morphism.codomain()) + matrix_list = morphism_dictmat(morphism) + return KenzoChainComplexMorphism(kmorphismchaincomplex_aux1(matrix_list, source._kenzo, target._kenzo)) + + +def s2k_listofmorphisms (l): + r""" + Computes a list of morphisms of chain complexes in Kenzo from a list of morphisms in Sage. + """ + rslt = EclObject([]) + for m in l: + rslt = EclObject(KChainComplexMorphism(m)._kenzo).cons(rslt) + return nreverse(rslt) + + +def BicomplexSpectralSequence(l): + r""" + Construct the spectral sequence associated to the bicomplex given by a list of morphisms. + INPUT: + - ``l`` - A list of morphisms of chain complexes + OUTPUT: + - A :class:`KenzoChainComplexMorphism` + EXAMPLES:: + sage: C1 = ChainComplex({1: matrix(ZZ, 0, 2, [])}, degree_of_differential=-1) + sage: C2 = ChainComplex({1: matrix(ZZ, 1, 2, [1, 0])},degree_of_differential=-1) + sage: C3 = ChainComplex({0: matrix(ZZ, 0,2 , [])},degree_of_differential=-1) + sage: M1 = Hom(C2,C1)({1: matrix(ZZ, 2, 2, [2, 0, 0, 2])}) + sage: M2 = Hom(C3,C2)({0: matrix(ZZ, 1, 2, [2, 0])}) + sage: l = [M1, M2] + sage: E = BicomplexSpectralSequence(l) + sage: E.group(2,0,1) + Additive abelian group isomorphic to Z/2 + Z + sage: E.table(3,0,2,0,2) + 0 0 0 + Z/2 + Z/4 0 0 + 0 0 Z + sage: E.matrix(2,2,0) + [ 0 -4] + [ 0 0] + """ + return KenzoSpectralSequence(bicomplex_spectral_sequence(s2k_listofmorphisms(l))) + + From 1bc57d3e5539e27cb1dc9ac0569b85e4a043a3fb Mon Sep 17 00:00:00 2001 From: jodivaso Date: Wed, 4 Dec 2019 10:25:04 +0100 Subject: [PATCH 246/301] added smash product --- src/sage/interfaces/kenzo.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 38123a709af..0ed69942e99 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -102,6 +102,7 @@ kmorphismchaincomplex_aux1 = EclObject("kmorphismchaincomplex_aux1") bicomplex_spectral_sequence = EclObject("bicomplex-spectral-sequence") nreverse = EclObject("nreverse") +smash_product = EclObject("smash-product") def Sphere(n): r""" @@ -763,6 +764,32 @@ def join(self, other): join_kenzo = join(self._kenzo, other._kenzo) return KenzoSimplicialSet(join_kenzo) + def smash_product(self, other): + r""" + Return the smash product of ``self`` and ``other``. + + INPUT: + + - ``other`` -- the Kenzo simplicial set with which the smash product is made + + OUTPUT: + + - A :class:`KenzoSimplicialSet` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: s = s2.smash_product(s3) # optional - kenzo + sage: type(s) # optional - kenzo + + sage: [s.homology(i) for i in range(6)] # optional - kenzo + [Z, 0, 0, 0, 0, Z] + """ + smash_kenzo = smash_product(self._kenzo, other._kenzo) + return KenzoSimplicialSet(smash_kenzo) + class KenzoSimplicialGroup(KenzoSimplicialSet): r""" From d62645d51da1d8d2ee2034b053982565d72c64ef Mon Sep 17 00:00:00 2001 From: jodivaso Date: Wed, 4 Dec 2019 12:37:55 +0100 Subject: [PATCH 247/301] some doc cleanup --- src/sage/interfaces/kenzo.py | 180 +++++++++++++++++++++++++---------- 1 file changed, 130 insertions(+), 50 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 0ed69942e99..cb52e3b55ff 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -104,6 +104,7 @@ nreverse = EclObject("nreverse") smash_product = EclObject("smash-product") + def Sphere(n): r""" Return the ``n`` dimensional sphere as a Kenzo simplicial set. @@ -462,7 +463,7 @@ def basis(self, dim): INPUT: - - ``dim``- An integer number + - ``dim`` -- An integer number OUTPUT: @@ -526,7 +527,7 @@ def differential(self, dim, comb): [K... Chain-Complex] sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] - sage: kenzo_chcm.differential(4, [1, 'G4G0']) # optional - kenzo + sage: kenzo_chcm.differential(4, [1, 'G4G0']) # optional - kenzo ----------------------------------------------------------------------{CMBN 3} <1 * G3G0> @@ -535,7 +536,7 @@ def differential(self, dim, comb): sage: kenzo_chcm.basis(5) # optional - kenzo ['G5G0', 'G5G1', 'G5G2'] - sage: kenzo_chcm.differential(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + sage: kenzo_chcm.differential(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo ----------------------------------------------------------------------{CMBN 4} <6 * G4G0> @@ -866,7 +867,7 @@ def KChainComplex(chain_complex): INPUT: - - ``chain_complex`` - A ChainComplex of degree = -1 + - ``chain_complex`` -- A ChainComplex of degree = -1 OUTPUT: @@ -898,11 +899,11 @@ def SChainComplex(kchaincomplex, start=0, end=15): INPUT: - - ``kchaincomplex``- A KenzoChainComplex + - ``kchaincomplex`` -- A KenzoChainComplex - - ``start``- An integer number (optional, default 0) + - ``start`` -- An integer number (optional, default 0) - - ``end``- An integer number greater than or equal to ``start`` (optional, default 15) + - ``end`` -- An integer number greater than or equal to ``start`` (optional, default 15) OUTPUT: @@ -1062,9 +1063,9 @@ def SFiniteSimplicialSet(ksimpset, limit): INPUT: - - ``ksimpset``- A finite simplicial set in Kenzo. + - ``ksimpset`` -- A finite simplicial set in Kenzo. - - ``limit``- A natural number. + - ``limit`` -- A natural number. OUTPUT: @@ -1137,9 +1138,13 @@ class KenzoChainComplexMorphism(KenzoObject): def source_complex(self): r""" Return the source chain complex of the morphism. + OUTPUT: + - A :class:`KenzoChainComplex` + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) @@ -1154,14 +1159,18 @@ def source_complex(self): sage: differential_morphism.source_complex() # optional - kenzo [K1 Chain-Complex] """ - return KenzoChainComplex(sorc_aux(self._kenzo)) - + return KenzoChainComplex(sorc_aux(self._kenzo)) + def target_complex(self): r""" Return the target chain complex of the morphism. + OUTPUT: + - A :class:`KenzoChainComplex` + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) @@ -1176,14 +1185,18 @@ def target_complex(self): sage: differential_morphism.target_complex() # optional - kenzo [K1 Chain-Complex] """ - return KenzoChainComplex(trgt_aux(self._kenzo)) + return KenzoChainComplex(trgt_aux(self._kenzo)) def degree(self): r""" Return the degree of the morphism. + OUTPUT: + - An integer number, the degree of the morphism. + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) @@ -1206,24 +1219,30 @@ def degree(self): def orgn(self): return str(orgn_aux1(self._kenzo)) - + def evaluation(self, dim, comb): r""" Apply the morphism on a combination ``comb`` of dimension ``dim``. + INPUT: - - ``dim``- An integer number - - ``comb``- A list representing a formal sum of generators in the module - of dimension ``dim``. For example, to represent G7G12 + 3*G7G0 - 5*G7G3 - we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. Note that the - generators must be in ascending order respect to the number after the - second G in their representation; the parameter - ``comb`` = [1, 'G7G12', 3, 'G7G0', -5, 'G7G3'] will produce an error in - Kenzo. + + - ``dim`` -- An integer number + - ``comb`` -- A list representing a formal sum of generators in the module + of dimension ``dim``. For example, to represent G7G12 + 3*G7G0 - 5*G7G3 + we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. Note that the + generators must be in ascending order respect to the number after the + second G in their representation; the parameter + ``comb`` = [1, 'G7G12', 3, 'G7G0', -5, 'G7G3'] will produce an error in + Kenzo. + OUTPUT: + - A Kenzo combination representing the result of applying the morphism on the formal - combination represented by ``comb`` in the chain complex ``self`` in - dimension ``dim``. + combination represented by ``comb`` in the chain complex ``self`` in + dimension ``dim``. + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) @@ -1288,9 +1307,13 @@ def evaluation(self, dim, comb): def opposite(self): r""" Return the opposite morphism of ``self``, i.e., -1 x ``self``. + OUTPUT: + - A :class:`KenzoChainComplexMorphism` + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) @@ -1327,17 +1350,23 @@ def opposite(self): def composite(self, object=None): r""" Return the composite of ``self`` and the morphism(s) given by the parameter ``object``. + INPUT: - - ``object``- A KenzoChainComplexMorphism instance, a KenzoChainComplex instance, a tuple + + - ``object`` -- A KenzoChainComplexMorphism instance, a KenzoChainComplex instance, a tuple of KenzoChainComplexMorphism and KenzoChainComplex instances, or None (default). + OUTPUT: - - A :class:`KenzoChainComplexMorphism`: if ``object`` is a KenzoChainComplexMorphism, the - composite of ``self`` and ``object`` is returned; if ``object`` is a KenzoChainComplex, - the composite of ``self`` and the differential morphism of ``object`` is returned; if - ``object`` is a tuple, the composite of ``self`` and the morphisms or the differential - morphisms of the given chain complexes in ``object`` is returned (if ``object``==None, + + - A :class:`KenzoChainComplexMorphism`: if ``object`` is a KenzoChainComplexMorphism, the + composite of ``self`` and ``object`` is returned; if ``object`` is a KenzoChainComplex, + the composite of ``self`` and the differential morphism of ``object`` is returned; if + ``object`` is a tuple, the composite of ``self`` and the morphisms or the differential + morphisms of the given chain complexes in ``object`` is returned (if ``object``==None, ``self`` morphism is returned). + EXAMPLES:: + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo @@ -1352,7 +1381,7 @@ def composite(self, object=None): sage: id.composite((tp22, null)) # optional - kenzo [K15 Morphism (degree 3): K11 -> K3] """ - if object==None: + if object is None: return self if isinstance(object, KenzoChainComplexMorphism): return KenzoChainComplexMorphism(cmps(self._kenzo, object._kenzo)) @@ -1367,11 +1396,19 @@ def composite(self, object=None): def sum(self, object=None): r""" Return a morphism, sum of the morphism ``self`` and the morphism(s) given by the parameter ``object``. + INPUT: - - ``object``- A KenzoChainComplexMorphism instance, a tuple of KenzoChainComplexMorphism instances or None (default). + + - ``object`` -- A KenzoChainComplexMorphism instance, a tuple of KenzoChainComplexMorphism + instances or None (default). + OUTPUT: - - A :class:`KenzoChainComplexMorphism`, sum of the morphism ``self`` and the morphism(s) given by ``object`` (if ``object``==None, ``self`` morphism is returned). + + - A :class:`KenzoChainComplexMorphism`, sum of the morphism ``self`` and the morphism(s) + given by ``object`` (if ``object`` is None, ``self`` morphism is returned). + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) @@ -1408,7 +1445,7 @@ def sum(self, object=None): ------------------------------------------------------------------------------ """ - if object==None: + if object is None: return self if isinstance(object, KenzoChainComplexMorphism): return KenzoChainComplexMorphism(add(self._kenzo, object._kenzo)) @@ -1420,12 +1457,22 @@ def sum(self, object=None): def substract(self, object=None): r""" - Return a morphism, difference of the morphism ``self`` and the morphism(s) given by the parameter ``object``. + Return a morphism, difference of the morphism ``self`` and the morphism(s) given by the + parameter ``object``. + INPUT: - - ``object``- A KenzoChainComplexMorphism instance, a tuple of KenzoChainComplexMorphism instances or None (default). + + - ``object`` -- A KenzoChainComplexMorphism instance, a tuple of KenzoChainComplexMorphism + instances or None (default). + OUTPUT: - - A :class:`KenzoChainComplexMorphism`, difference of the morphism ``self`` and the morphism(s) given by ``object`` (if ``object``==None, ``self`` morphism is returned). For example, if ``object`` = (mrph1, mrph2, mrph3) the result is ``self`` - mrph1 - mrph2 - mrph3. + + - A :class:`KenzoChainComplexMorphism`, difference of the morphism ``self`` and the + morphism(s) given by ``object`` (if ``object`` is None, ``self`` morphism is returned). + For example, if ``object`` = (mrph1, mrph2, mrph3) the result is ``self`` - mrph1 - mrph2 - mrph3. + EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) @@ -1462,7 +1509,7 @@ def substract(self, object=None): ------------------------------------------------------------------------------ """ - if object==None: + if object is None: return self if isinstance(object, KenzoChainComplexMorphism): return KenzoChainComplexMorphism(sbtr(self._kenzo, object._kenzo)) @@ -1474,13 +1521,24 @@ def substract(self, object=None): def change_source_target_complex(self, source=None, target=None): r""" - Build, from the morphism ``self``, a new morphism with ``source`` and ``target`` as source and target Kenzo chain complexes, respectively. + Build, from the morphism ``self``, a new morphism with ``source`` and ``target`` as source + and target Kenzo chain complexes, respectively. + INPUT: - - ``source``- A KenzoChainComplex instance or None (default). - - ``target``- A KenzoChainComplex instance or None (default). + + - ``source`` -- A KenzoChainComplex instance or None (default). + + - ``target`` -- A KenzoChainComplex instance or None (default). + OUTPUT: - - A :class:`KenzoChainComplexMorphism` inheriting from ``self`` the degree (:degr slot in Kenzo), the algorithm (:intr slot in Kenzo) and the strategy (:strt slot in Kenzo). The source and target slots of this new morphism are given by the parameters ``source`` and ``target`` respectively; if any parameter is ommited, the corresponding slot is inherited from ``self``. + + - A :class:`KenzoChainComplexMorphism` inheriting from ``self`` the degree (:degr slot in Kenzo), + the algorithm (:intr slot in Kenzo) and the strategy (:strt slot in Kenzo). The source and + target slots of this new morphism are given by the parameters ``source`` and ``target`` + respectively; if any parameter is ommited, the corresponding slot is inherited from ``self``. + EXAMPLES:: + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo sage: ZCC # optional - kenzo @@ -1507,13 +1565,23 @@ def change_source_target_complex(self, source=None, target=None): def destructive_change_source_target_complex(self, source=None, target=None): r""" - Modify destructively the morphism ``self`` taking ``source`` and ``target`` as source and target Kenzo chain complexes of ``self``, respectively. + Modify destructively the morphism ``self`` taking ``source`` and ``target`` as source and + target Kenzo chain complexes of ``self``, respectively. + INPUT: - - ``source``- A KenzoChainComplex instance or None (default). - - ``target``- A KenzoChainComplex instance or None (default). + + - ``source`` -- A KenzoChainComplex instance or None (default). + + - ``target`` -- A KenzoChainComplex instance or None (default). + OUTPUT: - - A :class:`KenzoChainComplexMorphism`. The source and target slots of ``self`` are replaced respectively by the parameters ``source`` and ``target``; if any parameter is ommited, the corresponding slot is inherited from ``self``. + + - A :class:`KenzoChainComplexMorphism`. The source and target slots of ``self`` are replaced + respectively by the parameters ``source`` and ``target``; if any parameter is ommited, the + corresponding slot is inherited from ``self``. + EXAMPLES:: + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo sage: ZCC # optional - kenzo @@ -1541,6 +1609,7 @@ def destructive_change_source_target_complex(self, source=None, target=None): def build_morphism(source_complex, target_complex, degree, algorithm, strategy, orgn): return KenzoChainComplexMorphism(build_mrph_aux(source_complex._kenzo, target_complex._kenzo, degree, algorithm, ":"+strategy, orgn)) + def morphism_dictmat(morphism): r""" Computes a list of matrices in ECL associated to a morphism in Sage. @@ -1552,14 +1621,21 @@ def morphism_dictmat(morphism): rslt = EclObject(k).cons(s2k_matrix(morphism.in_degree(k))).cons(rslt) return rslt + def KChainComplexMorphism(morphism): r""" Construct a KenzoChainComplexMorphism from a ChainComplexMorphism in Sage. + INPUT: - - ``morphism`` - A morphism of chain complexes + + - ``morphism`` -- A morphism of chain complexes + OUTPUT: + - A :class:`KenzoChainComplexMorphism` + EXAMPLES:: + sage: C = ChainComplex({0: identity_matrix(ZZ, 1)}) sage: D = ChainComplex({0: zero_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) sage: f = Hom(C,D)({0: identity_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) @@ -1577,7 +1653,7 @@ def KChainComplexMorphism(morphism): return KenzoChainComplexMorphism(kmorphismchaincomplex_aux1(matrix_list, source._kenzo, target._kenzo)) -def s2k_listofmorphisms (l): +def s2k_listofmorphisms(l): r""" Computes a list of morphisms of chain complexes in Kenzo from a list of morphisms in Sage. """ @@ -1590,11 +1666,17 @@ def s2k_listofmorphisms (l): def BicomplexSpectralSequence(l): r""" Construct the spectral sequence associated to the bicomplex given by a list of morphisms. + INPUT: - - ``l`` - A list of morphisms of chain complexes + + - ``l`` -- A list of morphisms of chain complexes + OUTPUT: + - A :class:`KenzoChainComplexMorphism` + EXAMPLES:: + sage: C1 = ChainComplex({1: matrix(ZZ, 0, 2, [])}, degree_of_differential=-1) sage: C2 = ChainComplex({1: matrix(ZZ, 1, 2, [1, 0])},degree_of_differential=-1) sage: C3 = ChainComplex({0: matrix(ZZ, 0,2 , [])},degree_of_differential=-1) @@ -1613,5 +1695,3 @@ def BicomplexSpectralSequence(l): [ 0 0] """ return KenzoSpectralSequence(bicomplex_spectral_sequence(s2k_listofmorphisms(l))) - - From c0fa81ac8df03cb690f4bd7fe9d5d8975017e14a Mon Sep 17 00:00:00 2001 From: jodivaso Date: Fri, 6 Dec 2019 15:47:06 +0100 Subject: [PATCH 248/301] more doc cleanup --- src/sage/interfaces/kenzo.py | 65 ++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 11 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index cb52e3b55ff..1d16c8b02a7 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -670,7 +670,8 @@ def em_spectral_sequence(self): 0 0 0 0 0 """ if self.homology(1).invariants(): - raise ValueError("Eilenberg-Moore spectral sequence implemented only for 1-reduced simplicial sets") + raise ValueError("""Eilenberg-Moore spectral sequence implemented + only for 1-reduced simplicial sets""") return KenzoSpectralSequence(eilenberg_moore_spectral_sequence(self._kenzo)) def sw_spectral_sequence(self): @@ -1395,7 +1396,8 @@ def composite(self, object=None): def sum(self, object=None): r""" - Return a morphism, sum of the morphism ``self`` and the morphism(s) given by the parameter ``object``. + Return a morphism, sum of the morphism ``self`` and the morphism(s) given + by the parameter ``object``. INPUT: @@ -1469,7 +1471,8 @@ def substract(self, object=None): - A :class:`KenzoChainComplexMorphism`, difference of the morphism ``self`` and the morphism(s) given by ``object`` (if ``object`` is None, ``self`` morphism is returned). - For example, if ``object`` = (mrph1, mrph2, mrph3) the result is ``self`` - mrph1 - mrph2 - mrph3. + For example, if ``object`` = (mrph1, mrph2, mrph3) the result is + ``self`` - mrph1 - mrph2 - mrph3. EXAMPLES:: @@ -1603,16 +1606,36 @@ def destructive_change_source_target_complex(self, source=None, target=None): """ source = source or self.source_complex() target = target or self.target_complex() - return KenzoChainComplexMorphism(dstr_change_sorc_trgt_aux(self._kenzo, source._kenzo, target._kenzo)) + return KenzoChainComplexMorphism( + dstr_change_sorc_trgt_aux(self._kenzo, source._kenzo, target._kenzo)) def build_morphism(source_complex, target_complex, degree, algorithm, strategy, orgn): - return KenzoChainComplexMorphism(build_mrph_aux(source_complex._kenzo, target_complex._kenzo, degree, algorithm, ":"+strategy, orgn)) + return KenzoChainComplexMorphism( + build_mrph_aux(source_complex._kenzo, target_complex._kenzo, + degree, algorithm, ":"+strategy, orgn)) def morphism_dictmat(morphism): r""" Computes a list of matrices in ECL associated to a morphism in Sage. + + INPUT: + + - ``morphism`` -- A morphism of chain complexes + + OUTPUT: + + - A :class:`EclObject` + + EXAMPLES:: + + sage: X = simplicial_complexes.Simplex(1) + sage: Y = simplicial_complexes.Simplex(0) + sage: g = Hom(X,Y)({0:0, 1:0}) + sage: f = g.associated_chain_complex_morphism() + sage: morphism_dictmat(f) # optional - kenzo + """ rslt = EclObject([]) source = morphism.domain() @@ -1650,12 +1673,32 @@ def KChainComplexMorphism(morphism): source = KChainComplex(morphism.domain()) target = KChainComplex(morphism.codomain()) matrix_list = morphism_dictmat(morphism) - return KenzoChainComplexMorphism(kmorphismchaincomplex_aux1(matrix_list, source._kenzo, target._kenzo)) + return KenzoChainComplexMorphism( + kmorphismchaincomplex_aux1(matrix_list, source._kenzo, target._kenzo)) def s2k_listofmorphisms(l): r""" Computes a list of morphisms of chain complexes in Kenzo from a list of morphisms in Sage. + + INPUT: + + - ``l`` -- A list of morphisms of chain complexes + + OUTPUT: + + - A :class:`EclObject` + + EXAMPLES:: + + sage: C1 = ChainComplex({1: matrix(ZZ, 0, 2, [])}, degree_of_differential=-1) + sage: C2 = ChainComplex({1: matrix(ZZ, 1, 2, [1, 0])},degree_of_differential=-1) + sage: C3 = ChainComplex({0: matrix(ZZ, 0,2 , [])},degree_of_differential=-1) + sage: M1 = Hom(C2,C1)({1: matrix(ZZ, 2, 2, [2, 0, 0, 2])}) + sage: M2 = Hom(C3,C2)({0: matrix(ZZ, 1, 2, [2, 0])}) + sage: l = [M1, M2] + sage: s2k_listofmorphisms(l) # optional - kenzo + K3] [K17 Morphism (degree 0): K6 -> K1])> """ rslt = EclObject([]) for m in l: @@ -1673,7 +1716,7 @@ def BicomplexSpectralSequence(l): OUTPUT: - - A :class:`KenzoChainComplexMorphism` + - A :class:`KenzoSpectralSequence` EXAMPLES:: @@ -1683,14 +1726,14 @@ def BicomplexSpectralSequence(l): sage: M1 = Hom(C2,C1)({1: matrix(ZZ, 2, 2, [2, 0, 0, 2])}) sage: M2 = Hom(C3,C2)({0: matrix(ZZ, 1, 2, [2, 0])}) sage: l = [M1, M2] - sage: E = BicomplexSpectralSequence(l) - sage: E.group(2,0,1) + sage: E = BicomplexSpectralSequence(l) # optional - kenzo + sage: E.group(2,0,1) # optional - kenzo Additive abelian group isomorphic to Z/2 + Z - sage: E.table(3,0,2,0,2) + sage: E.table(3,0,2,0,2) # optional - kenzo 0 0 0 Z/2 + Z/4 0 0 0 0 Z - sage: E.matrix(2,2,0) + sage: E.matrix(2,2,0) # optional - kenzo [ 0 -4] [ 0 0] """ From b3a0ba01b1d49d8912ee7d2201b78d077647d70a Mon Sep 17 00:00:00 2001 From: jodivaso Date: Fri, 6 Dec 2019 16:31:47 +0100 Subject: [PATCH 249/301] added missing documentation and fixed syntax for optional package in the examples --- src/sage/interfaces/kenzo.py | 120 ++++++++++++++++++++++++----------- 1 file changed, 83 insertions(+), 37 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 1d16c8b02a7..5050638d450 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -268,12 +268,12 @@ def group(self, p, i, j): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo - sage: S2 = Sphere(2) # optional -- kenzo - sage: EMS = S2.em_spectral_sequence() # optional -- kenzo - sage: EMS.group(0, -1, 2) # optional -- kenzo + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: S2 = Sphere(2) # optional - kenzo + sage: EMS = S2.em_spectral_sequence() # optional - kenzo + sage: EMS.group(0, -1, 2) # optional - kenzo Additive abelian group isomorphic to Z - sage: EMS.group(0, -1, 3) # optional -- kenzo + sage: EMS.group(0, -1, 3) # optional - kenzo Trivial group """ invs = spectral_sequence_group(self._kenzo, p, i, j).python() @@ -296,16 +296,16 @@ def matrix(self, p, i, j): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo - sage: S3 = Sphere(3) # optional -- kenzo - sage: L = S3.loop_space() # optional -- kenzo - sage: EMS = L.em_spectral_sequence() # optional -- kenzo - sage: EMS.table(1, -5, -2, 5, 8) # optional -- kenzo + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: S3 = Sphere(3) # optional - kenzo + sage: L = S3.loop_space() # optional - kenzo + sage: EMS = L.em_spectral_sequence() # optional - kenzo + sage: EMS.table(1, -5, -2, 5, 8) # optional - kenzo 0 Z Z + Z + Z Z + Z + Z 0 0 0 0 0 0 Z Z + Z 0 0 0 0 - sage: EMS.matrix(1, -2 ,8) # optional -- kenzo + sage: EMS.matrix(1, -2 ,8) # optional - kenzo [ 3 3 0] [-2 0 2] [ 0 -3 -3] @@ -332,20 +332,20 @@ def differential(self, p, i, j): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo - sage: S3 = Sphere(3) # optional -- kenzo - sage: L = S3.loop_space() # optional -- kenzo - sage: EMS = L.em_spectral_sequence() # optional -- kenzo - sage: EMS.table(1,-5,-2,5,8) # optional -- kenzo + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: S3 = Sphere(3) # optional - kenzo + sage: L = S3.loop_space() # optional - kenzo + sage: EMS = L.em_spectral_sequence() # optional - kenzo + sage: EMS.table(1,-5,-2,5,8) # optional - kenzo 0 Z Z + Z + Z Z + Z + Z 0 0 0 0 0 0 Z Z + Z 0 0 0 0 - sage: EMS.matrix(1, -3, 8) # optional -- kenzo + sage: EMS.matrix(1, -3, 8) # optional - kenzo [ 2] [-2] [ 2] - sage: EMS.differential(1, -3, 8) # optional -- kenzo + sage: EMS.differential(1, -3, 8) # optional - kenzo Morphism from module over Integer Ring with invariants (0, 0, 0) to module with invariants (0,) that sends the generators to [(2), (-2), (2)] """ domain = self.group(p, i, j) @@ -372,10 +372,10 @@ def table(self, p, i1, i2, j1, j2): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo - sage: S2 = Sphere(2) # optional -- kenzo - sage: EMS = S2.em_spectral_sequence() # optional -- kenzo - sage: EMS.table(0, -2, 2, -2, 2) # optional -- kenzo + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: S2 = Sphere(2) # optional - kenzo + sage: EMS = S2.em_spectral_sequence() # optional - kenzo + sage: EMS.table(0, -2, 2, -2, 2) # optional - kenzo 0 Z 0 0 0 0 0 0 0 0 0 0 Z 0 0 @@ -659,10 +659,10 @@ def em_spectral_sequence(self): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere # optional -- kenzo - sage: S2 = Sphere(2) # optional -- kenzo - sage: EMS = S2.em_spectral_sequence() # optional -- kenzo - sage: EMS.table(0, -2, 2, -2, 2) # optional -- kenzo + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: S2 = Sphere(2) # optional - kenzo + sage: EMS = S2.em_spectral_sequence() # optional - kenzo + sage: EMS.table(0, -2, 2, -2, 2) # optional - kenzo 0 Z 0 0 0 0 0 0 0 0 0 0 Z 0 0 @@ -681,10 +681,10 @@ def sw_spectral_sequence(self): EXAMPLES:: sage: from sage.interfaces.kenzo import Sphere - sage: S3 = Sphere(3) # optional -- kenzo - sage: E = S3.sw_spectral_sequence() # optional -- kenzo - sage: T = E.table(0, 0, 4, 0, 4) # optional -- kenzo - sage: T # optional -- kenzo + sage: S3 = Sphere(3) # optional - kenzo + sage: E = S3.sw_spectral_sequence() # optional - kenzo + sage: T = E.table(0, 0, 4, 0, 4) # optional - kenzo + sage: T # optional - kenzo Z 0 0 Z 0 0 0 0 0 0 Z 0 0 Z 0 @@ -702,11 +702,11 @@ def serre_spectral_sequence(self): EXAMPLES:: sage: from sage.interfaces.kenzo import Sphere - sage: S2 = Sphere(2) # optional -- kenzo - sage: S3 = Sphere(3) # optional -- kenzo - sage: P = S2.cartesian_product(S3) # optional -- kenzo - sage: E = P.serre_spectral_sequence() # optional -- kenzo - sage: E.table(0, 0, 2, 0, 3) # optional -- kenzo + sage: S2 = Sphere(2) # optional - kenzo + sage: S3 = Sphere(3) # optional - kenzo + sage: P = S2.cartesian_product(S3) # optional - kenzo + sage: E = P.serre_spectral_sequence() # optional - kenzo + sage: E.table(0, 0, 2, 0, 3) # optional - kenzo Z 0 Z 0 0 0 0 0 0 @@ -832,6 +832,21 @@ def k2s_matrix(kmatrix): def s2k_matrix(smatrix): r""" Convert a matrix of Sage to an array of ECL. + + INPUT: + + - ``smatrix`` -- A matrix in Sage + + OUTPUT: + + - A :class:`EclObject` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import s2k_matrix # optional - kenzo + sage: A = Matrix([[1,2,3],[3,2,1],[1,1,1]]) + sage: s2k_matrix(A) # optional - kenzo + """ initcontents = [] dimensions = smatrix.dimensions() @@ -844,6 +859,23 @@ def s2k_dictmat(sdictmat): r""" Convert a dictionary in Sage, whose values are matrices, to an assoc list in ECL. + + INPUT: + + - ``sdictmat`` -- A dictionary in Sage + + OUTPUT: + + - A :class:`EclObject` + + EXAMPLES:: + sage: from sage.interfaces.kenzo import s2k_dictmat # optional - kenzo + sage: A = Matrix([[1,2,3],[3,2,1],[1,1,1]]) + sage: B = Matrix([[1,2],[2,1],[1,1]]) + sage: d = {1 : A, 2 : B} + sage: s2k_dictmat(d) # optional - kenzo + + """ rslt = EclObject([]) for k in sdictmat.keys(): @@ -854,6 +886,20 @@ def s2k_dictmat(sdictmat): def pairing(slist): r""" Convert a list of Sage (which has an even length) to an assoc list in ECL. + + INPUT: + + - ``slist`` -- A list in Sage + + OUTPUT: + + - A :class:`EclObject` + + EXAMPLES:: + sage: from sage.interfaces.kenzo import pairing # optional - kenzo + sage: l = [1,2,3] + sage: pairing(l) # optional - kenzo + """ rslt = EclObject([]) for k in range(len(slist) - 1, 0, -2): @@ -1363,8 +1409,8 @@ def composite(self, object=None): composite of ``self`` and ``object`` is returned; if ``object`` is a KenzoChainComplex, the composite of ``self`` and the differential morphism of ``object`` is returned; if ``object`` is a tuple, the composite of ``self`` and the morphisms or the differential - morphisms of the given chain complexes in ``object`` is returned (if ``object``==None, - ``self`` morphism is returned). + morphisms of the given chain complexes in ``object`` is returned (if ``object`` is + None, ``self`` morphism is returned). EXAMPLES:: From 65b47958718f30b62b4b1201b47d7bb5ebbe5e3f Mon Sep 17 00:00:00 2001 From: jodivaso Date: Mon, 9 Dec 2019 11:24:27 +0100 Subject: [PATCH 250/301] added missing functions, fixed tests and more work on doc --- src/sage/interfaces/kenzo.py | 244 +++++++++++++++++++++++------------ 1 file changed, 165 insertions(+), 79 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 5050638d450..b48a853aabe 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -103,6 +103,20 @@ bicomplex_spectral_sequence = EclObject("bicomplex-spectral-sequence") nreverse = EclObject("nreverse") smash_product = EclObject("smash-product") +build_mrph_aux = EclObject("build-mrph-aux") +zero_mrph = EclObject("zero-mrph") +idnt_mrph = EclObject("idnt-mrph") +dffr_aux = EclObject("dffr-aux") +sorc_aux = EclObject("sorc-aux") +trgt_aux = EclObject("trgt-aux") +degr_aux = EclObject("degr-aux") +evaluation_aux1 = EclObject("evaluation-aux1") +opps = EclObject("opps") +cmps = EclObject("cmps") +add = EclObject("add") +sbtr = EclObject("sbtr") +change_sorc_trgt_aux = EclObject("change-sorc-trgt-aux") +dstr_change_sorc_trgt_aux = EclObject("dstr-change-sorc-trgt-aux") def Sphere(n): @@ -306,9 +320,9 @@ def matrix(self, p, i, j): 0 0 Z Z + Z 0 0 0 0 sage: EMS.matrix(1, -2 ,8) # optional - kenzo - [ 3 3 0] - [-2 0 2] - [ 0 -3 -3] + [ 3 -2 0] + [ 3 0 -3] + [ 0 2 -3] """ klist = spectral_sequence_differential_matrix(self._kenzo, p, i, j) plist = klist.python() @@ -342,16 +356,14 @@ def differential(self, p, i, j): 0 0 Z Z + Z 0 0 0 0 sage: EMS.matrix(1, -3, 8) # optional - kenzo - [ 2] - [-2] - [ 2] + [ 2 -2 2] sage: EMS.differential(1, -3, 8) # optional - kenzo Morphism from module over Integer Ring with invariants (0, 0, 0) to module with invariants (0,) that sends the generators to [(2), (-2), (2)] """ domain = self.group(p, i, j) codomain = self.group(p, i - p, j + p - 1) M = self.matrix(p, i, j) - images = [codomain(r) for r in M.rows()] + images = [codomain(r) for r in M.columns()] return domain.hom(images, codomain=codomain) def table(self, p, i1, i2, j1, j2): @@ -491,29 +503,94 @@ def basis(self, dim): """ return basis_aux1(self._kenzo, dim).python() - def differential(self, dim, comb): + def identity_morphism(self): r""" - Return the differential of a combination. + Return the identity morphism (degree 0) between ``self`` and itself. + + OUTPUT: + + - A :class:`KenzoChainComplexMorphism` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: tp = s2.tensor_product(s2) # optional - kenzo + sage: id = tp.identity_morphism() # optional - kenzo + sage: type(id) # optional - kenzo + + """ + return KenzoChainComplexMorphism(idnt_mrph(self._kenzo)) + + def null_morphism(self, target=None, degree=None): + r""" + Return the null morphism between the chain complexes ``self`` and ``target`` + of degree ``degree``. INPUT: + + - ``target`` -- A KenzoChainComplex or None (default). + - ``degree`` -- An integer number or None (default). - - ``dim``-- An integer number + OUTPUT: + + - A :class:`KenzoChainComplexMorphism` representing the null morphism between + ``self`` and ``target`` of degree ``degree``. If ``target`` takes None value, + ``self`` is assumed as the target chain complex; if ``degree`` takes None value, + 0 is assumed as the degree of the null morphism. - - ``comb``-- A list representing a formal sum of generators in - the module of dimension ``dim``. + EXAMPLES:: - For example, to represent G7G12 + 3*G7G0 - 5*G7G3 - we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. Note that the - generators must be in ascending order respect to the number after the - second G in their representation; the parameter + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: tp22 = s2.tensor_product(s2) # optional - kenzo + sage: tp22 # optional - kenzo # random + [K8 Chain-Complex] + sage: tp23 = s2.tensor_product(s3) # optional - kenzo + sage: tp23 # optional - kenzo # random + [K11 Chain-Complex] + sage: null1 = tp22.null_morphism() # optional - kenzo + sage: null1 # optional - kenzo # random + [K13 Morphism (degree 0): K8 -> K8] + sage: null2 = tp22.null_morphism(target = tp23, degree = -3) # optional - kenzo + sage: null2 # optional - kenzo # random + [K14 Morphism (degree -3): K8 -> K11] + """ + if target is None: + target = self + if degree is None: + degree = 0 + if not isinstance(target, KenzoChainComplex): + raise ValueError("'target' parameter must be a KenzoChainComplex instance") + elif (not degree == 0) and (not degree.is_integer()): + raise ValueError("'degree' parameter must be an Integer number") + else: + return KenzoChainComplexMorphism(zero_mrph(self._kenzo, target._kenzo, degree)) + + def differential(self, dim=None, comb=None): + r""" + Return the differential of a combination. + + INPUT: + + - ``dim`` -- An integer number or None (default) + + - ``comb`` -- A list representing a formal sum of generators in the module + of dimension ``dim`` or None (default). For example, to represent + G7G12 + 3*G7G0 - 5*G7G3 we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. + Note that the generators must be in ascending order respect to the number + after the second G in their representation; the parameter ``comb`` = [1, 'G7G12', 3, 'G7G0', -5, 'G7G3'] will produce an error in Kenzo. OUTPUT: - - A Kenzo combination representing the differential of the formal - combination represented by ``comb`` in the chain complex ``self`` in - dimension ``dim``. + - If ``dim`` and ``comb`` are not None, it returns a Kenzo combination + representing the differential of the formal combination represented by + ``comb`` in the chain complex ``self`` in dimension ``dim``. On the other + hand, if `dim`` or ``comb`` (or both) take None value, the differential + :class:`KenzoMorphismChainComplex` of ``self`` is returned. EXAMPLES:: @@ -544,8 +621,11 @@ def differential(self, dim, comb): ------------------------------------------------------------------------------ """ - cmbn_list = pairing(comb) - return KenzoObject(dffr_aux1(self._kenzo, dim, cmbn_list)) + if dim!=None and comb!=None: + cmbn_list = pairing(comb) + return KenzoObject(dffr_aux1(self._kenzo, dim, cmbn_list)) + else: + return KenzoChainComplexMorphism(dffr_aux(self._kenzo)) def orgn(self): return str(orgn_aux1(self._kenzo)) @@ -1198,12 +1278,12 @@ def source_complex(self): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo + sage: kenzo_chcm # optional - kenzo # random [K1 Chain-Complex] sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo - sage: differential_morphism # optional - kenzo + sage: differential_morphism # optional - kenzo # random [K2 Morphism (degree -1): K1 -> K1] - sage: differential_morphism.source_complex() # optional - kenzo + sage: differential_morphism.source_complex() # optional - kenzo # random [K1 Chain-Complex] """ return KenzoChainComplex(sorc_aux(self._kenzo)) @@ -1224,12 +1304,12 @@ def target_complex(self): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo + sage: kenzo_chcm # optional - kenzo # random [K1 Chain-Complex] sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo - sage: differential_morphism # optional - kenzo + sage: differential_morphism # optional - kenzo # random [K2 Morphism (degree -1): K1 -> K1] - sage: differential_morphism.target_complex() # optional - kenzo + sage: differential_morphism.target_complex() # optional - kenzo # random [K1 Chain-Complex] """ return KenzoChainComplex(trgt_aux(self._kenzo)) @@ -1250,10 +1330,10 @@ def degree(self): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo + sage: kenzo_chcm # optional - kenzo # random [K1 Chain-Complex] sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo - sage: differential_morphism # optional - kenzo + sage: differential_morphism # optional - kenzo # random [K2 Morphism (degree -1): K1 -> K1] sage: differential_morphism.degree() # optional - kenzo -1 @@ -1296,13 +1376,13 @@ def evaluation(self, dim, comb): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo + sage: kenzo_chcm # optional - kenzo # random [K1 Chain-Complex] sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo - sage: differential_morphism # optional - kenzo + sage: differential_morphism # optional - kenzo # random [K2 Morphism (degree -1): K1 -> K1] sage: dif_squared = differential_morphism.composite(differential_morphism) # optional - kenzo - sage: dif_squared # optional - kenzo + sage: dif_squared # optional - kenzo # random [K3 Morphism (degree -2): K1 -> K1] sage: kenzo_chcm.basis(5) # optional - kenzo ['G5G0', 'G5G1', 'G5G2'] @@ -1342,7 +1422,7 @@ def evaluation(self, dim, comb): ------------------------------------------------------------------------------ """ - if isinstance(dim, Integer): + if dim.is_integer(): if isinstance(comb, list): cmbn_list = pairing(comb) return KenzoObject(evaluation_aux1(self._kenzo, dim, cmbn_list)) @@ -1367,13 +1447,13 @@ def opposite(self): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo + sage: kenzo_chcm # optional - kenzo # random [K1 Chain-Complex] sage: id = kenzo_chcm.identity_morphism() # optional - kenzo - sage: id # optional - kenzo + sage: id # optional - kenzo # random [K3 Morphism (degree 0): K1 -> K1] sage: opps_id = id.opposite() # optional - kenzo - sage: opps_id # optional - kenzo + sage: opps_id # optional - kenzo # random [K4 Morphism (degree 0): K1 -> K1] sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] @@ -1420,12 +1500,12 @@ def composite(self, object=None): sage: tp22 = s2.tensor_product(s2) # optional - kenzo sage: tp23 = s2.tensor_product(s3) # optional - kenzo sage: id = tp22.identity_morphism() # optional - kenzo - sage: id # optional - kenzo + sage: id # optional - kenzo # random [K13 Morphism (degree 0): K3 -> K3] sage: null = tp23.null_morphism(target = tp22, degree = 4) # optional - kenzo - sage: null # optional - kenzo + sage: null # optional - kenzo # random [K14 Morphism (degree 4): K11 -> K3] - sage: id.composite((tp22, null)) # optional - kenzo + sage: id.composite((tp22, null)) # optional - kenzo # random [K15 Morphism (degree 3): K11 -> K3] """ if object is None: @@ -1463,16 +1543,16 @@ def sum(self, object=None): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo + sage: kenzo_chcm # optional - kenzo # random [K1 Chain-Complex] sage: id = kenzo_chcm.identity_morphism() # optional - kenzo - sage: id # optional - kenzo + sage: id # optional - kenzo # random [K3 Morphism (degree 0): K1 -> K1] sage: opps_id = id.opposite() # optional - kenzo - sage: opps_id # optional - kenzo + sage: opps_id # optional - kenzo # random [K4 Morphism (degree 0): K1 -> K1] sage: null = kenzo_chcm.null_morphism() # optional - kenzo - sage: null # optional - kenzo + sage: null # optional - kenzo # random [K5 Morphism (degree 0): K1 -> K1] sage: idx2 = id.sum(id) # optional - kenzo sage: idx5 = idx2.sum((opps_id, id, id, null, idx2.sum(id), opps_id)) # optional - kenzo @@ -1528,16 +1608,16 @@ def substract(self, object=None): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo + sage: kenzo_chcm # optional - kenzo # random [K1 Chain-Complex] sage: id = kenzo_chcm.identity_morphism() # optional - kenzo - sage: id # optional - kenzo + sage: id # optional - kenzo # random [K3 Morphism (degree 0): K1 -> K1] sage: opps_id = id.opposite() # optional - kenzo - sage: opps_id # optional - kenzo + sage: opps_id # optional - kenzo # random [K4 Morphism (degree 0): K1 -> K1] sage: null = kenzo_chcm.null_morphism() # optional - kenzo - sage: null # optional - kenzo + sage: null # optional - kenzo # random [K5 Morphism (degree 0): K1 -> K1] sage: idx2 = id.substract(opps_id) # optional - kenzo sage: opps_idx2 = idx2.substract((opps_id, id, id, null, idx2.substract(opps_id))) # optional - kenzo @@ -1588,24 +1668,25 @@ def change_source_target_complex(self, source=None, target=None): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere # optional - kenzo - sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo - sage: ZCC # optional - kenzo + sage: from sage.interfaces.kenzo import Sphere, KenzoChainComplex # optional - kenzo + sage: from sage.libs.ecl import ecl_eval + sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo + sage: ZCC # optional - kenzo # random [K1 Chain-Complex] - sage: s2 = Sphere(2) # optional - kenzo - sage: s3 = Sphere(3) # optional - kenzo - sage: tp = s2.tensor_product(s3) # optional - kenzo - sage: tp # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: tp = s2.tensor_product(s3) # optional - kenzo + sage: tp # optional - kenzo # random [K13 Chain-Complex] - sage: null = ZCC.null_morphism(tp) # optional - kenzo - sage: null # optional - kenzo + sage: null = ZCC.null_morphism(tp) # optional - kenzo + sage: null # optional - kenzo # random [K15 Morphism (degree 0): K1 -> K13] - sage: null.source_complex() # optional - kenzo + sage: null.source_complex() # optional - kenzo # random [K1 Chain-Complex] - sage: null2 = null.change_source_target_complex(source = tp) # optional - kenzo - sage: null2 # optional - kenzo + sage: null2 = null.change_source_target_complex(source = tp) # optional - kenzo + sage: null2 # optional - kenzo # random [K16 Morphism (degree 0): K13 -> K13] - sage: null2.source_complex() # optional - kenzo + sage: null2.source_complex() # optional - kenzo # random [K13 Chain-Complex] """ source = source or self.source_complex() @@ -1631,23 +1712,24 @@ def destructive_change_source_target_complex(self, source=None, target=None): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere # optional - kenzo - sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo - sage: ZCC # optional - kenzo + sage: from sage.interfaces.kenzo import Sphere, KenzoChainComplex # optional - kenzo + sage: from sage.libs.ecl import ecl_eval + sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo + sage: ZCC # optional - kenzo # random [K1 Chain-Complex] - sage: s2 = Sphere(2) # optional - kenzo - sage: s3 = Sphere(3) # optional - kenzo - sage: tp = s2.tensor_product(s3) # optional - kenzo - sage: tp # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: s3 = Sphere(3) # optional - kenzo + sage: tp = s2.tensor_product(s3) # optional - kenzo + sage: tp # optional - kenzo # random [K13 Chain-Complex] - sage: null = ZCC.null_morphism(tp) # optional - kenzo - sage: null # optional - kenzo + sage: null = ZCC.null_morphism(tp) # optional - kenzo + sage: null # optional - kenzo # random [K15 Morphism (degree 0): K1 -> K13] - sage: null.target_complex() # optional - kenzo + sage: null.target_complex() # optional - kenzo # random [K13 Chain-Complex] - sage: null.destructive_change_source_target_complex(target = ZCC) # optional - kenzo + sage: null.destructive_change_source_target_complex(target = ZCC) # optional - kenzo # random [K15 Cohomology-Class on K1 of degree 0] - sage: null.target_complex() # optional - kenzo + sage: null.target_complex() # optional - kenzo # random [K1 Chain-Complex] """ source = source or self.source_complex() @@ -1676,11 +1758,12 @@ def morphism_dictmat(morphism): EXAMPLES:: + sage: from sage.interfaces.kenzo import morphism_dictmat # optional - kenzo sage: X = simplicial_complexes.Simplex(1) sage: Y = simplicial_complexes.Simplex(0) sage: g = Hom(X,Y)({0:0, 1:0}) sage: f = g.associated_chain_complex_morphism() - sage: morphism_dictmat(f) # optional - kenzo + sage: morphism_dictmat(f) # optional - kenzo """ rslt = EclObject([]) @@ -1705,15 +1788,16 @@ def KChainComplexMorphism(morphism): EXAMPLES:: + sage: from sage.interfaces.kenzo import KChainComplexMorphism # optional - kenzo sage: C = ChainComplex({0: identity_matrix(ZZ, 1)}) sage: D = ChainComplex({0: zero_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) sage: f = Hom(C,D)({0: identity_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) - sage: g = KChainComplexMorphism(f) # optional - kenzo - sage: g + sage: g = KChainComplexMorphism(f) # optional - kenzo + sage: g # optional - kenzo # random [K5 Morphism (degree 0): K1 -> K3] - sage: g.source_complex() # optional - kenzo + sage: g.source_complex() # optional - kenzo # random [K1 Chain-Complex] - sage: g.target_complex() # optional - kenzo + sage: g.target_complex() # optional - kenzo # random [K3 Chain-Complex] """ source = KChainComplex(morphism.domain()) @@ -1737,13 +1821,14 @@ def s2k_listofmorphisms(l): EXAMPLES:: + sage: from sage.interfaces.kenzo import s2k_listofmorphisms # optional - kenzo sage: C1 = ChainComplex({1: matrix(ZZ, 0, 2, [])}, degree_of_differential=-1) sage: C2 = ChainComplex({1: matrix(ZZ, 1, 2, [1, 0])},degree_of_differential=-1) sage: C3 = ChainComplex({0: matrix(ZZ, 0,2 , [])},degree_of_differential=-1) sage: M1 = Hom(C2,C1)({1: matrix(ZZ, 2, 2, [2, 0, 0, 2])}) sage: M2 = Hom(C3,C2)({0: matrix(ZZ, 1, 2, [2, 0])}) sage: l = [M1, M2] - sage: s2k_listofmorphisms(l) # optional - kenzo + sage: s2k_listofmorphisms(l) # optional - kenzo # random K3] [K17 Morphism (degree 0): K6 -> K1])> """ rslt = EclObject([]) @@ -1766,6 +1851,7 @@ def BicomplexSpectralSequence(l): EXAMPLES:: + sage: from sage.interfaces.kenzo import BicomplexSpectralSequence # optional - kenzo sage: C1 = ChainComplex({1: matrix(ZZ, 0, 2, [])}, degree_of_differential=-1) sage: C2 = ChainComplex({1: matrix(ZZ, 1, 2, [1, 0])},degree_of_differential=-1) sage: C3 = ChainComplex({0: matrix(ZZ, 0,2 , [])},degree_of_differential=-1) @@ -1780,7 +1866,7 @@ def BicomplexSpectralSequence(l): Z/2 + Z/4 0 0 0 0 Z sage: E.matrix(2,2,0) # optional - kenzo - [ 0 -4] [ 0 0] + [-4 0] """ return KenzoSpectralSequence(bicomplex_spectral_sequence(s2k_listofmorphisms(l))) From 811bd93f32ea5f2e1d50d9ac8793098fb1b250e5 Mon Sep 17 00:00:00 2001 From: jodivaso Date: Mon, 9 Dec 2019 11:36:06 +0100 Subject: [PATCH 251/301] doc cleanup --- src/sage/interfaces/kenzo.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index b48a853aabe..99dc692ce43 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -528,15 +528,15 @@ def null_morphism(self, target=None, degree=None): of degree ``degree``. INPUT: - + - ``target`` -- A KenzoChainComplex or None (default). - ``degree`` -- An integer number or None (default). OUTPUT: - A :class:`KenzoChainComplexMorphism` representing the null morphism between - ``self`` and ``target`` of degree ``degree``. If ``target`` takes None value, - ``self`` is assumed as the target chain complex; if ``degree`` takes None value, + ``self`` and ``target`` of degree ``degree``. If ``target`` takes None value, + ``self`` is assumed as the target chain complex; if ``degree`` takes None value, 0 is assumed as the degree of the null morphism. EXAMPLES:: @@ -621,7 +621,7 @@ def differential(self, dim=None, comb=None): ------------------------------------------------------------------------------ """ - if dim!=None and comb!=None: + if dim is not None and comb is not None: cmbn_list = pairing(comb) return KenzoObject(dffr_aux1(self._kenzo, dim, cmbn_list)) else: @@ -750,7 +750,7 @@ def em_spectral_sequence(self): 0 0 0 0 0 """ if self.homology(1).invariants(): - raise ValueError("""Eilenberg-Moore spectral sequence implemented + raise ValueError("""Eilenberg-Moore spectral sequence implemented only for 1-reduced simplicial sets""") return KenzoSpectralSequence(eilenberg_moore_spectral_sequence(self._kenzo)) @@ -1522,7 +1522,7 @@ def composite(self, object=None): def sum(self, object=None): r""" - Return a morphism, sum of the morphism ``self`` and the morphism(s) given + Return a morphism, sum of the morphism ``self`` and the morphism(s) given by the parameter ``object``. INPUT: @@ -1597,7 +1597,7 @@ def substract(self, object=None): - A :class:`KenzoChainComplexMorphism`, difference of the morphism ``self`` and the morphism(s) given by ``object`` (if ``object`` is None, ``self`` morphism is returned). - For example, if ``object`` = (mrph1, mrph2, mrph3) the result is + For example, if ``object`` = (mrph1, mrph2, mrph3) the result is ``self`` - mrph1 - mrph2 - mrph3. EXAMPLES:: From 89fc1dd71c6dcc2859ca3b19e6a6b59b33009a3e Mon Sep 17 00:00:00 2001 From: jodivaso Date: Mon, 9 Dec 2019 12:27:08 +0100 Subject: [PATCH 252/301] prefered ... instead of # random --- src/sage/interfaces/kenzo.py | 180 +++++++++++++++++------------------ 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 99dc692ce43..54b7fc361f1 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -545,17 +545,17 @@ def null_morphism(self, target=None, degree=None): sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo sage: tp22 = s2.tensor_product(s2) # optional - kenzo - sage: tp22 # optional - kenzo # random - [K8 Chain-Complex] + sage: tp22 # optional - kenzo + [K... Chain-Complex] sage: tp23 = s2.tensor_product(s3) # optional - kenzo - sage: tp23 # optional - kenzo # random - [K11 Chain-Complex] + sage: tp23 # optional - kenzo + [K... Chain-Complex] sage: null1 = tp22.null_morphism() # optional - kenzo - sage: null1 # optional - kenzo # random - [K13 Morphism (degree 0): K8 -> K8] + sage: null1 # optional - kenzo + [K... Morphism (degree 0): K... -> K...] sage: null2 = tp22.null_morphism(target = tp23, degree = -3) # optional - kenzo - sage: null2 # optional - kenzo # random - [K14 Morphism (degree -3): K8 -> K11] + sage: null2 # optional - kenzo + [K... Morphism (degree -3): K... -> K...] """ if target is None: target = self @@ -1278,13 +1278,13 @@ def source_complex(self): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo # random - [K1 Chain-Complex] + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo - sage: differential_morphism # optional - kenzo # random - [K2 Morphism (degree -1): K1 -> K1] - sage: differential_morphism.source_complex() # optional - kenzo # random - [K1 Chain-Complex] + sage: differential_morphism # optional - kenzo + [K... Morphism (degree -1): K... -> K...] + sage: differential_morphism.source_complex() # optional - kenzo + [K... Chain-Complex] """ return KenzoChainComplex(sorc_aux(self._kenzo)) @@ -1304,13 +1304,13 @@ def target_complex(self): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo # random - [K1 Chain-Complex] + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo - sage: differential_morphism # optional - kenzo # random - [K2 Morphism (degree -1): K1 -> K1] - sage: differential_morphism.target_complex() # optional - kenzo # random - [K1 Chain-Complex] + sage: differential_morphism # optional - kenzo + [K... Morphism (degree -1): K... -> K...] + sage: differential_morphism.target_complex() # optional - kenzo + [K... Chain-Complex] """ return KenzoChainComplex(trgt_aux(self._kenzo)) @@ -1330,11 +1330,11 @@ def degree(self): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo # random - [K1 Chain-Complex] + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo - sage: differential_morphism # optional - kenzo # random - [K2 Morphism (degree -1): K1 -> K1] + sage: differential_morphism # optional - kenzo + [K... Morphism (degree -1): K... -> K...] sage: differential_morphism.degree() # optional - kenzo -1 sage: differential_morphism.composite(differential_morphism).degree() # optional - kenzo @@ -1376,14 +1376,14 @@ def evaluation(self, dim, comb): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo # random - [K1 Chain-Complex] + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo - sage: differential_morphism # optional - kenzo # random - [K2 Morphism (degree -1): K1 -> K1] + sage: differential_morphism # optional - kenzo + [K... Morphism (degree -1): K... -> K...] sage: dif_squared = differential_morphism.composite(differential_morphism) # optional - kenzo - sage: dif_squared # optional - kenzo # random - [K3 Morphism (degree -2): K1 -> K1] + sage: dif_squared # optional - kenzo + [K... Morphism (degree -2): K... -> K...] sage: kenzo_chcm.basis(5) # optional - kenzo ['G5G0', 'G5G1', 'G5G2'] sage: kenzo_chcm.differential(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo @@ -1447,14 +1447,14 @@ def opposite(self): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo # random - [K1 Chain-Complex] + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] sage: id = kenzo_chcm.identity_morphism() # optional - kenzo - sage: id # optional - kenzo # random - [K3 Morphism (degree 0): K1 -> K1] + sage: id # optional - kenzo + [K... Morphism (degree 0): K... -> K...] sage: opps_id = id.opposite() # optional - kenzo - sage: opps_id # optional - kenzo # random - [K4 Morphism (degree 0): K1 -> K1] + sage: opps_id # optional - kenzo + [K... Morphism (degree 0): K... -> K...] sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] sage: id.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo @@ -1500,13 +1500,13 @@ def composite(self, object=None): sage: tp22 = s2.tensor_product(s2) # optional - kenzo sage: tp23 = s2.tensor_product(s3) # optional - kenzo sage: id = tp22.identity_morphism() # optional - kenzo - sage: id # optional - kenzo # random - [K13 Morphism (degree 0): K3 -> K3] + sage: id # optional - kenzo + [K... Morphism (degree 0): K... -> K...] sage: null = tp23.null_morphism(target = tp22, degree = 4) # optional - kenzo - sage: null # optional - kenzo # random - [K14 Morphism (degree 4): K11 -> K3] - sage: id.composite((tp22, null)) # optional - kenzo # random - [K15 Morphism (degree 3): K11 -> K3] + sage: null # optional - kenzo + [K... Morphism (degree 4): K... -> K...] + sage: id.composite((tp22, null)) # optional - kenzo + [K... Morphism (degree 3): K... -> K...] """ if object is None: return self @@ -1543,17 +1543,17 @@ def sum(self, object=None): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo # random - [K1 Chain-Complex] + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] sage: id = kenzo_chcm.identity_morphism() # optional - kenzo - sage: id # optional - kenzo # random - [K3 Morphism (degree 0): K1 -> K1] + sage: id # optional - kenzo + [K... Morphism (degree 0): K... -> K...] sage: opps_id = id.opposite() # optional - kenzo - sage: opps_id # optional - kenzo # random - [K4 Morphism (degree 0): K1 -> K1] + sage: opps_id # optional - kenzo + [K... Morphism (degree 0): K... -> K...] sage: null = kenzo_chcm.null_morphism() # optional - kenzo - sage: null # optional - kenzo # random - [K5 Morphism (degree 0): K1 -> K1] + sage: null # optional - kenzo + [K... Morphism (degree 0): K... -> K...] sage: idx2 = id.sum(id) # optional - kenzo sage: idx5 = idx2.sum((opps_id, id, id, null, idx2.sum(id), opps_id)) # optional - kenzo sage: kenzo_chcm.basis(4) # optional - kenzo @@ -1608,17 +1608,17 @@ def substract(self, object=None): sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo - sage: kenzo_chcm # optional - kenzo # random - [K1 Chain-Complex] + sage: kenzo_chcm # optional - kenzo + [K... Chain-Complex] sage: id = kenzo_chcm.identity_morphism() # optional - kenzo - sage: id # optional - kenzo # random - [K3 Morphism (degree 0): K1 -> K1] + sage: id # optional - kenzo + [K... Morphism (degree 0): K... -> K...] sage: opps_id = id.opposite() # optional - kenzo - sage: opps_id # optional - kenzo # random - [K4 Morphism (degree 0): K1 -> K1] + sage: opps_id # optional - kenzo + [K... Morphism (degree 0): K... -> K...] sage: null = kenzo_chcm.null_morphism() # optional - kenzo - sage: null # optional - kenzo # random - [K5 Morphism (degree 0): K1 -> K1] + sage: null # optional - kenzo + [K... Morphism (degree 0): K... -> K...] sage: idx2 = id.substract(opps_id) # optional - kenzo sage: opps_idx2 = idx2.substract((opps_id, id, id, null, idx2.substract(opps_id))) # optional - kenzo sage: kenzo_chcm.basis(4) # optional - kenzo @@ -1671,23 +1671,23 @@ def change_source_target_complex(self, source=None, target=None): sage: from sage.interfaces.kenzo import Sphere, KenzoChainComplex # optional - kenzo sage: from sage.libs.ecl import ecl_eval sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo - sage: ZCC # optional - kenzo # random - [K1 Chain-Complex] + sage: ZCC # optional - kenzo + [K... Chain-Complex] sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo sage: tp = s2.tensor_product(s3) # optional - kenzo - sage: tp # optional - kenzo # random - [K13 Chain-Complex] + sage: tp # optional - kenzo + [K... Filtered-Chain-Complex] sage: null = ZCC.null_morphism(tp) # optional - kenzo - sage: null # optional - kenzo # random - [K15 Morphism (degree 0): K1 -> K13] - sage: null.source_complex() # optional - kenzo # random - [K1 Chain-Complex] + sage: null # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: null.source_complex() # optional - kenzo + [K... Chain-Complex] sage: null2 = null.change_source_target_complex(source = tp) # optional - kenzo - sage: null2 # optional - kenzo # random - [K16 Morphism (degree 0): K13 -> K13] - sage: null2.source_complex() # optional - kenzo # random - [K13 Chain-Complex] + sage: null2 # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: null2.source_complex() # optional - kenzo + [K... Filtered-Chain-Complex] """ source = source or self.source_complex() target = target or self.target_complex() @@ -1715,22 +1715,22 @@ def destructive_change_source_target_complex(self, source=None, target=None): sage: from sage.interfaces.kenzo import Sphere, KenzoChainComplex # optional - kenzo sage: from sage.libs.ecl import ecl_eval sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo - sage: ZCC # optional - kenzo # random - [K1 Chain-Complex] + sage: ZCC # optional - kenzo + [K... Chain-Complex] sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo sage: tp = s2.tensor_product(s3) # optional - kenzo - sage: tp # optional - kenzo # random - [K13 Chain-Complex] + sage: tp # optional - kenzo + [K... Filtered-Chain-Complex] sage: null = ZCC.null_morphism(tp) # optional - kenzo - sage: null # optional - kenzo # random - [K15 Morphism (degree 0): K1 -> K13] - sage: null.target_complex() # optional - kenzo # random - [K13 Chain-Complex] - sage: null.destructive_change_source_target_complex(target = ZCC) # optional - kenzo # random - [K15 Cohomology-Class on K1 of degree 0] - sage: null.target_complex() # optional - kenzo # random - [K1 Chain-Complex] + sage: null # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: null.target_complex() # optional - kenzo + [K... Filtered-Chain-Complex] + sage: null.destructive_change_source_target_complex(target = ZCC) # optional - kenzo + [K... Cohomology-Class on K... of degree 0] + sage: null.target_complex() # optional - kenzo + [K... Chain-Complex] """ source = source or self.source_complex() target = target or self.target_complex() @@ -1793,12 +1793,12 @@ def KChainComplexMorphism(morphism): sage: D = ChainComplex({0: zero_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) sage: f = Hom(C,D)({0: identity_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) sage: g = KChainComplexMorphism(f) # optional - kenzo - sage: g # optional - kenzo # random - [K5 Morphism (degree 0): K1 -> K3] - sage: g.source_complex() # optional - kenzo # random - [K1 Chain-Complex] - sage: g.target_complex() # optional - kenzo # random - [K3 Chain-Complex] + sage: g # optional - kenzo + [K... Morphism (degree 0): K... -> K...] + sage: g.source_complex() # optional - kenzo + [K... Chain-Complex] + sage: g.target_complex() # optional - kenzo + [K... Chain-Complex] """ source = KChainComplex(morphism.domain()) target = KChainComplex(morphism.codomain()) @@ -1828,8 +1828,8 @@ def s2k_listofmorphisms(l): sage: M1 = Hom(C2,C1)({1: matrix(ZZ, 2, 2, [2, 0, 0, 2])}) sage: M2 = Hom(C3,C2)({0: matrix(ZZ, 1, 2, [2, 0])}) sage: l = [M1, M2] - sage: s2k_listofmorphisms(l) # optional - kenzo # random - K3] [K17 Morphism (degree 0): K6 -> K1])> + sage: s2k_listofmorphisms(l) # optional - kenzo + K...] [K... Morphism (degree 0): K... -> K...])> """ rslt = EclObject([]) for m in l: From 59e3d3a2daf62f4c5f83781315dbd7e382b22e46 Mon Sep 17 00:00:00 2001 From: jodivaso Date: Thu, 12 Dec 2019 18:51:53 +0100 Subject: [PATCH 253/301] tuned doc --- src/sage/interfaces/kenzo.py | 114 +++++++++++++++++++++++++---------- 1 file changed, 81 insertions(+), 33 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 54b7fc361f1..326683d160a 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -628,6 +628,19 @@ def differential(self, dim=None, comb=None): return KenzoChainComplexMorphism(dffr_aux(self._kenzo)) def orgn(self): + r""" + Return the :orgn slot of Kenzo, which stores as a list the origin of the object + + EXAMPLES:: + sage: from sage.interfaces.kenzo import Sphere, loop_space # optional - kenzo + sage: s2 = Sphere(2) # optional - kenzo + sage: l2 = s2.loop_space() # optional - kenzo + sage: l2.orgn() # optional - kenzo + '(LOOP-SPACE [K... Simplicial-Set])' + sage: A = l2.cartesian_product(s2) # optional - kenzo + sage: A.orgn() + '(CRTS-PRDC [K... Simplicial-Group] [K... Simplicial-Set])' + """ return str(orgn_aux1(self._kenzo)) @@ -714,7 +727,7 @@ def homotopy_group(self, n): INPUT: - - ``n`` - the dimension of the homotopy group to be computed + - ``n`` -- the dimension of the homotopy group to be computed EXAMPLES:: @@ -725,7 +738,8 @@ def homotopy_group(self, n): Multiplicative Abelian group isomorphic to Z x Z """ if n not in ZZ or n < 2: - raise ValueError("homotopy groups can only be computed for dimensions greater than 1") + raise ValueError("""homotopy groups can only be computed + for dimensions greater than 1""") lgens = homotopy_list(self._kenzo, n).python() if lgens is not None: trgens = [0 if i == 1 else i for i in sorted(lgens)] @@ -737,6 +751,10 @@ def em_spectral_sequence(self): r""" Return the Eilenberg-Moore spectral sequence of ``self``. + OUTPUT: + + - A :class:`KenzoSpectralSequence` + EXAMPLES:: sage: from sage.interfaces.kenzo import Sphere # optional - kenzo @@ -758,6 +776,10 @@ def sw_spectral_sequence(self): r""" Return the Serre sequence of the first step of the Whitehead tower. + OUTPUT: + + - A :class:`KenzoSpectralSequence` + EXAMPLES:: sage: from sage.interfaces.kenzo import Sphere @@ -779,6 +801,10 @@ def serre_spectral_sequence(self): The object self must be created as a cartesian product (twisted or not). + OUTPUT: + + - A :class:`KenzoSpectralSequence` + EXAMPLES:: sage: from sage.interfaces.kenzo import Sphere @@ -903,6 +929,19 @@ def classifying_space(self): def k2s_matrix(kmatrix): r""" Convert an array of ECL to a matrix of Sage. + + INPUT: + + - ``kmatrix`` -- An array in ECL + + EXAMPLES:: + sage: from sage.interfaces.kenzo import k2s_matrix # optional - kenzo + sage: from sage.libs.ecl import EclObject + sage: M = EclObject("#2A((1 2 3) (3 2 1) (1 1 1))") + sage: k2s_matrix(M) # optional - kenzo + [1 2 3] + [3 2 1] + [1 1 1] """ dimensions = array_dimensions(kmatrix).python() kmatrix_list = make_array_to_lists(kmatrix).python() @@ -1038,7 +1077,7 @@ def SChainComplex(kchaincomplex, start=0, end=15): EXAMPLES:: - sage: from sage.interfaces.kenzo import KChainComplex, SChainComplex # optional - kenzo + sage: from sage.interfaces.kenzo import KChainComplex, SChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) @@ -1071,15 +1110,16 @@ def SAbstractSimplex(simplex, dim): EXAMPLES:: sage: from sage.libs.ecl import EclObject, ecl_eval - sage: from sage.interfaces.kenzo import KenzoObject, SAbstractSimplex # optional - kenzo - sage: KAbSm = KenzoObject(ecl_eval("(ABSM 15 'K)")) # optional - kenzo - sage: SAbSm1 = SAbstractSimplex(KAbSm, 2) # optional - kenzo - sage: SAbSm2 = SAbstractSimplex(KAbSm, 7) # optional - kenzo - sage: SAbSm1.degeneracies() # optional - kenzo + sage: from sage.interfaces.kenzo import KenzoObject,\ + ....: SAbstractSimplex # optional - kenzo + sage: KAbSm = KenzoObject(ecl_eval("(ABSM 15 'K)")) # optional - kenzo + sage: SAbSm1 = SAbstractSimplex(KAbSm, 2) # optional - kenzo + sage: SAbSm2 = SAbstractSimplex(KAbSm, 7) # optional - kenzo + sage: SAbSm1.degeneracies() # optional - kenzo [3, 2, 1, 0] - sage: SAbSm1.dimension() # optional - kenzo + sage: SAbSm1.dimension() # optional - kenzo 6 - sage: SAbSm2.dimension() # optional - kenzo + sage: SAbSm2.dimension() # optional - kenzo 11 """ degeneracies = dgop_int_ext(dgop(simplex._kenzo)).python() @@ -1106,13 +1146,14 @@ def KAbstractSimplex(simplex): EXAMPLES:: sage: from sage.homology.simplicial_set import AbstractSimplex - sage: from sage.interfaces.kenzo import KAbstractSimplex, SAbstractSimplex # optional - kenzo - sage: SAbSm = AbstractSimplex(1, (2,0,3,2,1), name = 'SAbSm') # optional - kenzo - sage: KAbSm = KAbstractSimplex(SAbSm) # optional - kenzo - sage: SAbSm2 = SAbstractSimplex(KAbSm, 1) # optional - kenzo - sage: SAbSm.degeneracies() == SAbSm2.degeneracies() # optional - kenzo + sage: from sage.interfaces.kenzo import KAbstractSimplex,\ + ....: SAbstractSimplex # optional - kenzo + sage: SAbSm = AbstractSimplex(1, (2,0,3,2,1), name = 'SAbSm') # optional - kenzo + sage: KAbSm = KAbstractSimplex(SAbSm) # optional - kenzo + sage: SAbSm2 = SAbstractSimplex(KAbSm, 1) # optional - kenzo + sage: SAbSm.degeneracies() == SAbSm2.degeneracies() # optional - kenzo True - sage: SAbSm.dimension() == SAbSm2.dimension() # optional - kenzo + sage: SAbSm.dimension() == SAbSm2.dimension() # optional - kenzo True """ return KenzoObject(kabstractsimplex_aux1(simplex.degeneracies(), @@ -1142,7 +1183,8 @@ def KFiniteSimplicialSet(sset): sage: s02 = AbstractSimplex(1, name='s02') sage: s12 = AbstractSimplex(1, name='s12') sage: s012 = AbstractSimplex(2, name='s012') - sage: Triangle = SimplicialSet({s01: (s1, s0), s02: (s2, s0), s12: (s2, s1)}, base_point = s0) + sage: Triangle = SimplicialSet({s01: (s1, s0),\ + ....: s02: (s2, s0), s12: (s2, s1)}, base_point = s0) sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo sage: KTriangle.homology(1) # optional - kenzo Z @@ -1201,7 +1243,8 @@ def SFiniteSimplicialSet(ksimpset, limit): EXAMPLES:: sage: from sage.homology.simplicial_set import SimplicialSet - sage: from sage.interfaces.kenzo import AbstractSimplex, KFiniteSimplicialSet, SFiniteSimplicialSet, Sphere # optional - kenzo + sage: from sage.interfaces.kenzo import AbstractSimplex,\ + ....: KFiniteSimplicialSet, SFiniteSimplicialSet, Sphere # optional - kenzo sage: s0 = AbstractSimplex(0, name='s0') # optional - kenzo sage: s1 = AbstractSimplex(0, name='s1') # optional - kenzo sage: s2 = AbstractSimplex(0, name='s2') # optional - kenzo @@ -1209,7 +1252,8 @@ def SFiniteSimplicialSet(ksimpset, limit): sage: s02 = AbstractSimplex(1, name='s02') # optional - kenzo sage: s12 = AbstractSimplex(1, name='s12') # optional - kenzo sage: s012 = AbstractSimplex(2, name='s012') # optional - kenzo - sage: Triangle = SimplicialSet({s01: (s1, s0), s02: (s2, s0), s12: (s2, s1)}, base_point = s0) # optional - kenzo + sage: Triangle = SimplicialSet({s01: (s1, s0),\ + ....: s02: (s2, s0), s12: (s2, s1)}, base_point = s0) # optional - kenzo sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo sage: STriangle = SFiniteSimplicialSet(KTriangle, 1) # optional - kenzo sage: STriangle.homology() # optional - kenzo @@ -1223,8 +1267,9 @@ def SFiniteSimplicialSet(ksimpset, limit): """ list_orgn = orgn_aux1(ksimpset._kenzo).python() if nth(0, list_orgn).python()[0] == 'CRTS-PRDC': - return SFiniteSimplicialSet(KenzoSimplicialSet(nth(1, list_orgn)), - limit).cartesian_product(SFiniteSimplicialSet(KenzoSimplicialSet(nth(2, list_orgn)), limit)) + return SFiniteSimplicialSet( + KenzoSimplicialSet(nth(1, list_orgn)), limit).cartesian_product( + SFiniteSimplicialSet(KenzoSimplicialSet(nth(2, list_orgn)), limit)) rslt = {} simplices = [] faces = [] @@ -1344,9 +1389,6 @@ def degree(self): """ return degr_aux(self._kenzo).python() - def orgn(self): - return str(orgn_aux1(self._kenzo)) - def evaluation(self, dim, comb): r""" Apply the morphism on a combination ``comb`` of dimension ``dim``. @@ -1354,6 +1396,7 @@ def evaluation(self, dim, comb): INPUT: - ``dim`` -- An integer number + - ``comb`` -- A list representing a formal sum of generators in the module of dimension ``dim``. For example, to represent G7G12 + 3*G7G0 - 5*G7G3 we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. Note that the @@ -1555,7 +1598,8 @@ def sum(self, object=None): sage: null # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: idx2 = id.sum(id) # optional - kenzo - sage: idx5 = idx2.sum((opps_id, id, id, null, idx2.sum(id), opps_id)) # optional - kenzo + sage: idx5 = idx2.sum(\ + ....: (opps_id, id, id, null, idx2.sum(id), opps_id)) # optional - kenzo sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] sage: idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo @@ -1620,7 +1664,8 @@ def substract(self, object=None): sage: null # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: idx2 = id.substract(opps_id) # optional - kenzo - sage: opps_idx2 = idx2.substract((opps_id, id, id, null, idx2.substract(opps_id))) # optional - kenzo + sage: opps_idx2 = idx2.substract\ + ....: ((opps_id, id, id, null, idx2.substract(opps_id))) # optional - kenzo sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] sage: idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo @@ -1650,8 +1695,8 @@ def substract(self, object=None): def change_source_target_complex(self, source=None, target=None): r""" - Build, from the morphism ``self``, a new morphism with ``source`` and ``target`` as source - and target Kenzo chain complexes, respectively. + Build, from the morphism ``self``, a new morphism with ``source`` + and ``target`` as source and target Kenzo chain complexes, respectively. INPUT: @@ -1661,10 +1706,12 @@ def change_source_target_complex(self, source=None, target=None): OUTPUT: - - A :class:`KenzoChainComplexMorphism` inheriting from ``self`` the degree (:degr slot in Kenzo), - the algorithm (:intr slot in Kenzo) and the strategy (:strt slot in Kenzo). The source and - target slots of this new morphism are given by the parameters ``source`` and ``target`` - respectively; if any parameter is ommited, the corresponding slot is inherited from ``self``. + - A :class:`KenzoChainComplexMorphism` inheriting from ``self`` the + degree (:degr slot in Kenzo), the algorithm (:intr slot in Kenzo) + and the strategy (:strt slot in Kenzo). The source and target slots + of this new morphism are given by the parameters ``source`` and + ``target`` respectively; if any parameter is ommited, the corresponding + slot is inherited from ``self``. EXAMPLES:: @@ -1691,7 +1738,8 @@ def change_source_target_complex(self, source=None, target=None): """ source = source or self.source_complex() target = target or self.target_complex() - return KenzoChainComplexMorphism(change_sorc_trgt_aux(self._kenzo, source._kenzo, target._kenzo)) + return KenzoChainComplexMorphism( + change_sorc_trgt_aux(self._kenzo, source._kenzo, target._kenzo)) def destructive_change_source_target_complex(self, source=None, target=None): r""" From 8c3c3ed6ddeb26ee85313440b315682f862eb7c9 Mon Sep 17 00:00:00 2001 From: jodivaso Date: Sun, 15 Dec 2019 11:29:32 +0100 Subject: [PATCH 254/301] fixed missing empty lines after EXAMPLES:: and added doc for build_morphism function --- src/sage/interfaces/kenzo.py | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 326683d160a..063211aaed7 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -632,6 +632,7 @@ def orgn(self): Return the :orgn slot of Kenzo, which stores as a list the origin of the object EXAMPLES:: + sage: from sage.interfaces.kenzo import Sphere, loop_space # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: l2 = s2.loop_space() # optional - kenzo @@ -935,6 +936,7 @@ def k2s_matrix(kmatrix): - ``kmatrix`` -- An array in ECL EXAMPLES:: + sage: from sage.interfaces.kenzo import k2s_matrix # optional - kenzo sage: from sage.libs.ecl import EclObject sage: M = EclObject("#2A((1 2 3) (3 2 1) (1 1 1))") @@ -988,6 +990,7 @@ def s2k_dictmat(sdictmat): - A :class:`EclObject` EXAMPLES:: + sage: from sage.interfaces.kenzo import s2k_dictmat # optional - kenzo sage: A = Matrix([[1,2,3],[3,2,1],[1,1,1]]) sage: B = Matrix([[1,2],[2,1],[1,1]]) @@ -1015,6 +1018,7 @@ def pairing(slist): - A :class:`EclObject` EXAMPLES:: + sage: from sage.interfaces.kenzo import pairing # optional - kenzo sage: l = [1,2,3] sage: pairing(l) # optional - kenzo @@ -1787,6 +1791,47 @@ def destructive_change_source_target_complex(self, source=None, target=None): def build_morphism(source_complex, target_complex, degree, algorithm, strategy, orgn): + r""" + Build a morphism of chain complexes by means of the corresponding build-mrph Kenzo + function. + + INPUT: + + - ``source_complex`` -- The source object as a KenzoChainComplex instance + + - ``target_complex`` -- The target object as a KenzoChainComplex instance + + - ``degree`` -- An integer number representing the degree of the morphism + + - ``algorithm`` -- A Lisp function defining the mapping (:intr slot in Kenzo) + + - ``strategy`` -- The strategy (:strt slot in Kenzo), which must be one of + the two strings ``gnrt`` or ``cmbn``, depending if the ``algorithm`` (a Lisp + function) uses as arguments a degree and a generator or a combination, + respectively. + + - ``orgn`` -- A list containing a description about the origin of the morphism + + OUTPUT: + + - A :class:`KenzoChainComplexMorphism` + + EXAMPLES:: + + sage: from sage.interfaces.kenzo import KenzoChainComplex,\ + ....: build_morphism # optional - kenzo + sage: from sage.libs.ecl import ecl_eval + sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo + sage: A = build_morphism(ZCC, ZCC, -1,\ + ....: ecl_eval("#'(lambda (comb) (cmbn (1- (degr comb))))"),\ + ....: "cmbn", ["zero morphism on ZCC"]) # optional - kenzo + sage: A.target_complex() # optional - kenzo + [K... Chain-Complex] + sage: A.degree() # optional - kenzo + -1 + sage: type(A) # optional - kenzo + + """ return KenzoChainComplexMorphism( build_mrph_aux(source_complex._kenzo, target_complex._kenzo, degree, algorithm, ":"+strategy, orgn)) From 7dbf0ac85cbc0dff856c024ee889296ed33b36aa Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Tue, 17 Dec 2019 15:52:38 +0100 Subject: [PATCH 255/301] Fix optional doctest --- src/sage/interfaces/kenzo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 063211aaed7..7037684ff08 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -639,7 +639,7 @@ def orgn(self): sage: l2.orgn() # optional - kenzo '(LOOP-SPACE [K... Simplicial-Set])' sage: A = l2.cartesian_product(s2) # optional - kenzo - sage: A.orgn() + sage: A.orgn() # optional - kenzo '(CRTS-PRDC [K... Simplicial-Group] [K... Simplicial-Set])' """ return str(orgn_aux1(self._kenzo)) From c33f77f4f9598fee4c3fb62e969faebbcf92cc43 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Tue, 17 Dec 2019 16:02:52 +0100 Subject: [PATCH 256/301] New version of kenzo --- build/pkgs/kenzo/checksums.ini | 8 ++++---- build/pkgs/kenzo/package-version.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/pkgs/kenzo/checksums.ini b/build/pkgs/kenzo/checksums.ini index abd092f806f..f4068e4588d 100644 --- a/build/pkgs/kenzo/checksums.ini +++ b/build/pkgs/kenzo/checksums.ini @@ -1,4 +1,4 @@ -tarball=kenzo-1.1.7-r3.tar.gz -sha1=92433fee5f83d575483bbbd9730c2cb094c292a4 -md5=7dc2207eb8071a2710df825ac9409324 -cksum=3315029495 +tarball=kenzo-1.1.8.tar.gz +sha1=365185b1c3373060bd7124937aad13c3df82b4b7 +md5=7cd942e5c725327624266a4cf094113c +cksum=2540973636 diff --git a/build/pkgs/kenzo/package-version.txt b/build/pkgs/kenzo/package-version.txt index 6ba101eb19d..18efdb9ae67 100644 --- a/build/pkgs/kenzo/package-version.txt +++ b/build/pkgs/kenzo/package-version.txt @@ -1 +1 @@ -1.1.7-r3 +1.1.8 From 87c4242c67a8e0cb9407c662007afab247d6f8dd Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Wed, 18 Dec 2019 13:00:10 +0100 Subject: [PATCH 257/301] Some review changes --- src/doc/en/reference/interfaces/index.rst | 1 + src/sage/interfaces/kenzo.py | 335 +++++++++++----------- 2 files changed, 169 insertions(+), 167 deletions(-) diff --git a/src/doc/en/reference/interfaces/index.rst b/src/doc/en/reference/interfaces/index.rst index 8680b94deb8..95a8678b071 100644 --- a/src/doc/en/reference/interfaces/index.rst +++ b/src/doc/en/reference/interfaces/index.rst @@ -76,6 +76,7 @@ and testing to make sure nothing funny is going on). sage/interfaces/gp sage/interfaces/jmoldata sage/interfaces/kash + sage/interfaces/kenzo sage/interfaces/latte sage/interfaces/lie sage/interfaces/lisp diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 7037684ff08..05ae36a5176 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -39,8 +39,12 @@ from sage.homology.simplicial_set import AbstractSimplex, SimplicialSet from sage.libs.ecl import EclObject, ecl_eval, EclListIterator +from sage.misc.package import installed_packages, PackageNotFoundError +if not 'kenzo' in installed_packages(): + raise PackageNotFoundError('kenzo') + # Redirection of ECL and Maxima stdout to /dev/null # This is also done in the Maxima library, but we # also do it here for redundancy. @@ -57,66 +61,63 @@ # defining the auxiliary functions as wrappers over the kenzo ones -chcm_mat = EclObject("chcm-mat") -homologie = EclObject("homologie") -sphere = EclObject("sphere") -crts_prdc = EclObject("crts-prdc") -moore = EclObject("moore") -k_z = EclObject("k-z") -k_z2 = EclObject("k-z2") -k_zp = EclObject("k-zp") -echcm = EclObject("echcm") -loop_space = EclObject("loop-space") -tnsr_prdc = EclObject("tnsr-prdc") -typep = EclObject("typep") -classifying_space = EclObject("classifying-space") -suspension = EclObject("suspension") -homotopy_list = EclObject("homotopy-list") -nth = EclObject("nth") -entry = EclObject("entry") -nlig = EclObject("nlig") -ncol = EclObject("ncol") -array_dimensions = EclObject("array-dimensions") -convertmatrice = EclObject("convertmatrice") -make_array_to_lists = EclObject("make-array-to-lists") -make_array_from_lists = EclObject("make-array-from-lists") -chcm_mat2 = EclObject("chcm-mat2") -build_finite_ss2 = EclObject("build-finite-ss2") -gmsm = EclObject("gmsm") -dgop = EclObject("dgop") -dgop_ext_int = EclObject("dgop-ext-int") -dgop_int_ext = EclObject("dgop-int-ext") -basis_aux1 = EclObject("basis_aux1") -orgn_aux1 = EclObject("orgn_aux1") -dffr_aux1 = EclObject("dffr_aux1") -kabstractsimplex_aux1 = EclObject("kabstractsimplex_aux1") -kchaincomplex_aux1 = EclObject("kchaincomplex_aux1") -sfinitesimplicialset_aux1 = EclObject("sfinitesimplicialset_aux1") -spectral_sequence_group = EclObject("spectral-sequence-group") -spectral_sequence_differential_matrix = EclObject("spectral-sequence-differential-matrix") -eilenberg_moore_spectral_sequence = EclObject("eilenberg-moore-spectral-sequence") -serre_whitehead_spectral_sequence = EclObject("serre-whitehead-spectral-sequence") -serre_spectral_sequence_product = EclObject("serre-spectral-sequence-product") -wedge = EclObject("wedge") -join = EclObject("join") -kmorphismchaincomplex_aux1 = EclObject("kmorphismchaincomplex_aux1") -bicomplex_spectral_sequence = EclObject("bicomplex-spectral-sequence") -nreverse = EclObject("nreverse") -smash_product = EclObject("smash-product") -build_mrph_aux = EclObject("build-mrph-aux") -zero_mrph = EclObject("zero-mrph") -idnt_mrph = EclObject("idnt-mrph") -dffr_aux = EclObject("dffr-aux") -sorc_aux = EclObject("sorc-aux") -trgt_aux = EclObject("trgt-aux") -degr_aux = EclObject("degr-aux") -evaluation_aux1 = EclObject("evaluation-aux1") -opps = EclObject("opps") -cmps = EclObject("cmps") -add = EclObject("add") -sbtr = EclObject("sbtr") -change_sorc_trgt_aux = EclObject("change-sorc-trgt-aux") -dstr_change_sorc_trgt_aux = EclObject("dstr-change-sorc-trgt-aux") +_chcm_mat = EclObject("chcm-mat") +_homologie = EclObject("homologie") +_sphere = EclObject("sphere") +_crts_prdc = EclObject("crts-prdc") +_moore = EclObject("moore") +_k_z = EclObject("k-z") +_k_z2 = EclObject("k-z2") +_k_zp = EclObject("k-zp") +_echcm = EclObject("echcm") +_loop_space = EclObject("loop-space") +_tnsr_prdc = EclObject("tnsr-prdc") +_classifying_space = EclObject("classifying-space") +_suspension = EclObject("suspension") +_homotopy_list = EclObject("homotopy-list") +_nth = EclObject("nth") +_nlig = EclObject("nlig") +_ncol = EclObject("ncol") +_array_dimensions = EclObject("array-dimensions") +_convertmatrice = EclObject("convertmatrice") +_make_array_to_lists = EclObject("make-array-to-lists") +_make_array_from_lists = EclObject("make-array-from-lists") +_chcm_mat2 = EclObject("chcm-mat2") +_build_finite_ss2 = EclObject("build-finite-ss2") +_gmsm = EclObject("gmsm") +_dgop = EclObject("dgop") +_dgop_int_ext = EclObject("dgop-int-ext") +_basis_aux1 = EclObject("basis_aux1") +_orgn_aux1 = EclObject("orgn_aux1") +_dffr_aux1 = EclObject("dffr_aux1") +_kabstractsimplex_aux1 = EclObject("kabstractsimplex_aux1") +_kchaincomplex_aux1 = EclObject("kchaincomplex_aux1") +_sfinitesimplicialset_aux1 = EclObject("sfinitesimplicialset_aux1") +_spectral_sequence_group = EclObject("spectral-sequence-group") +_spectral_sequence_differential_matrix = EclObject("spectral-sequence-differential-matrix") +_eilenberg_moore_spectral_sequence = EclObject("eilenberg-moore-spectral-sequence") +_serre_whitehead_spectral_sequence = EclObject("serre-whitehead-spectral-sequence") +_serre_spectral_sequence_product = EclObject("serre-spectral-sequence-product") +_wedge = EclObject("wedge") +_join = EclObject("join") +_kmorphismchaincomplex_aux1 = EclObject("kmorphismchaincomplex_aux1") +_bicomplex_spectral_sequence = EclObject("bicomplex-spectral-sequence") +_nreverse = EclObject("nreverse") +_smash_product = EclObject("smash-product") +_build_mrph_aux = EclObject("build-mrph-aux") +_zero_mrph = EclObject("zero-mrph") +_idnt_mrph = EclObject("idnt-mrph") +_dffr_aux = EclObject("dffr-aux") +_sorc_aux = EclObject("sorc-aux") +_trgt_aux = EclObject("trgt-aux") +_degr_aux = EclObject("degr-aux") +_evaluation_aux1 = EclObject("evaluation-aux1") +_opps = EclObject("opps") +_cmps = EclObject("cmps") +_add = EclObject("add") +_sbtr = EclObject("sbtr") +_change_sorc_trgt_aux = EclObject("change-sorc-trgt-aux") +_dstr_change_sorc_trgt_aux = EclObject("dstr-change-sorc-trgt-aux") def Sphere(n): @@ -140,7 +141,7 @@ def Sphere(n): sage: [s2.homology(i) for i in range(8)] # optional - kenzo [Z, 0, Z, 0, 0, 0, 0, 0] """ - kenzosphere = sphere(n) + kenzosphere = _sphere(n) return KenzoSimplicialSet(kenzosphere) @@ -171,7 +172,7 @@ def MooreSpace(m, n): sage: [m24.homology(i) for i in range(8)] # optional - kenzo [Z, 0, 0, 0, C2, 0, 0, 0] """ - kenzomoore = moore(m, n) + kenzomoore = _moore(m, n) return KenzoSimplicialSet(kenzomoore) @@ -204,13 +205,13 @@ def EilenbergMacLaneSpace(G, n): [Z, 0, 0, C2, 0, C2, C2, C2] """ if G == ZZ: - kenzospace = k_z(n) + kenzospace = _k_z(n) return KenzoSimplicialGroup(kenzospace) elif G == AdditiveAbelianGroup([2]): - kenzospace = k_z2(n) + kenzospace = _k_z2(n) return KenzoSimplicialGroup(kenzospace) elif G in CommutativeAdditiveGroups() and G.is_cyclic(): - kenzospace = k_zp(G.cardinality(), n) + kenzospace = _k_zp(G.cardinality(), n) return KenzoSimplicialGroup(kenzospace) else: raise NotImplementedError("Eilenberg-MacLane spaces are only supported over ZZ and ZZ_n") @@ -233,8 +234,8 @@ def __init__(self, kenzo_object): TESTS:: sage: from sage.interfaces.kenzo import KenzoObject # optional -kenzo - sage: from sage.interfaces.kenzo import sphere # optional -kenzo - sage: ks = sphere(2) # optional -kenzo + sage: from sage.interfaces.kenzo import _sphere # optional -kenzo + sage: ks = _sphere(2) # optional -kenzo sage: ks # optional -kenzo sage: s2 = KenzoObject(ks) # optional -kenzo @@ -290,7 +291,7 @@ def group(self, p, i, j): sage: EMS.group(0, -1, 3) # optional - kenzo Trivial group """ - invs = spectral_sequence_group(self._kenzo, p, i, j).python() + invs = _spectral_sequence_group(self._kenzo, p, i, j).python() if not invs: invs = [] return AdditiveAbelianGroup(invs) @@ -324,7 +325,7 @@ def matrix(self, p, i, j): [ 3 0 -3] [ 0 2 -3] """ - klist = spectral_sequence_differential_matrix(self._kenzo, p, i, j) + klist = _spectral_sequence_differential_matrix(self._kenzo, p, i, j) plist = klist.python() if plist is None or plist == [None]: i = len(self.group(p, i, j).invariants()) @@ -433,10 +434,10 @@ def homology(self, n): sage: s2.homology(2) # optional - kenzo Z """ - echcm1 = echcm(self._kenzo) - m1 = chcm_mat(echcm1, n) - m2 = chcm_mat(echcm1, n + 1) - homology = homologie(m1, m2) + echcm1 = _echcm(self._kenzo) + m1 = _chcm_mat(echcm1, n) + m2 = _chcm_mat(echcm1, n + 1) + homology = _homologie(m1, m2) lhomomology = [i for i in EclListIterator(homology)] res = [] for component in lhomomology: @@ -467,7 +468,7 @@ def tensor_product(self, other): sage: [p.homology(i) for i in range(8)] # optional - kenzo [Z, 0, Z, Z, 0, Z, 0, 0] """ - return KenzoChainComplex(tnsr_prdc(self._kenzo, other._kenzo)) + return KenzoChainComplex(_tnsr_prdc(self._kenzo, other._kenzo)) def basis(self, dim): r""" @@ -501,7 +502,7 @@ def basis(self, dim): Basis in dimension 5: ['G5G0', 'G5G1', 'G5G2'] """ - return basis_aux1(self._kenzo, dim).python() + return _basis_aux1(self._kenzo, dim).python() def identity_morphism(self): r""" @@ -516,11 +517,11 @@ def identity_morphism(self): sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: tp = s2.tensor_product(s2) # optional - kenzo - sage: id = tp.identity_morphism() # optional - kenzo - sage: type(id) # optional - kenzo + sage: idnt = tp.identity_morphism() # optional - kenzo + sage: type(idnt) # optional - kenzo """ - return KenzoChainComplexMorphism(idnt_mrph(self._kenzo)) + return KenzoChainComplexMorphism(_idnt_mrph(self._kenzo)) def null_morphism(self, target=None, degree=None): r""" @@ -535,9 +536,9 @@ def null_morphism(self, target=None, degree=None): OUTPUT: - A :class:`KenzoChainComplexMorphism` representing the null morphism between - ``self`` and ``target`` of degree ``degree``. If ``target`` takes None value, - ``self`` is assumed as the target chain complex; if ``degree`` takes None value, - 0 is assumed as the degree of the null morphism. + ``self`` and ``target`` of degree ``degree``. If ``target`` takes None value, + ``self`` is assumed as the target chain complex; if ``degree`` takes None value, + 0 is assumed as the degree of the null morphism. EXAMPLES:: @@ -566,7 +567,7 @@ def null_morphism(self, target=None, degree=None): elif (not degree == 0) and (not degree.is_integer()): raise ValueError("'degree' parameter must be an Integer number") else: - return KenzoChainComplexMorphism(zero_mrph(self._kenzo, target._kenzo, degree)) + return KenzoChainComplexMorphism(_zero_mrph(self._kenzo, target._kenzo, degree)) def differential(self, dim=None, comb=None): r""" @@ -577,20 +578,20 @@ def differential(self, dim=None, comb=None): - ``dim`` -- An integer number or None (default) - ``comb`` -- A list representing a formal sum of generators in the module - of dimension ``dim`` or None (default). For example, to represent - G7G12 + 3*G7G0 - 5*G7G3 we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. - Note that the generators must be in ascending order respect to the number - after the second G in their representation; the parameter - ``comb`` = [1, 'G7G12', 3, 'G7G0', -5, 'G7G3'] will produce an error in - Kenzo. + of dimension ``dim`` or None (default). For example, to represent + G7G12 + 3*G7G0 - 5*G7G3 we use the list [3, 'G7G0', -5, 'G7G3', 1, 'G7G12']. + Note that the generators must be in ascending order respect to the number + after the second G in their representation; the parameter + ``comb`` = [1, 'G7G12', 3, 'G7G0', -5, 'G7G3'] will produce an error in + Kenzo. OUTPUT: - If ``dim`` and ``comb`` are not None, it returns a Kenzo combination - representing the differential of the formal combination represented by - ``comb`` in the chain complex ``self`` in dimension ``dim``. On the other - hand, if `dim`` or ``comb`` (or both) take None value, the differential - :class:`KenzoMorphismChainComplex` of ``self`` is returned. + representing the differential of the formal combination represented by + ``comb`` in the chain complex ``self`` in dimension ``dim``. On the other + hand, if `dim`` or ``comb`` (or both) take None value, the differential + :class:`KenzoMorphismChainComplex` of ``self`` is returned. EXAMPLES:: @@ -623,9 +624,9 @@ def differential(self, dim=None, comb=None): """ if dim is not None and comb is not None: cmbn_list = pairing(comb) - return KenzoObject(dffr_aux1(self._kenzo, dim, cmbn_list)) + return KenzoObject(_dffr_aux1(self._kenzo, dim, cmbn_list)) else: - return KenzoChainComplexMorphism(dffr_aux(self._kenzo)) + return KenzoChainComplexMorphism(_dffr_aux(self._kenzo)) def orgn(self): r""" @@ -633,7 +634,7 @@ def orgn(self): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere, loop_space # optional - kenzo + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: l2 = s2.loop_space() # optional - kenzo sage: l2.orgn() # optional - kenzo @@ -642,7 +643,7 @@ def orgn(self): sage: A.orgn() # optional - kenzo '(CRTS-PRDC [K... Simplicial-Group] [K... Simplicial-Set])' """ - return str(orgn_aux1(self._kenzo)) + return str(_orgn_aux1(self._kenzo)) class KenzoSimplicialSet(KenzoChainComplex): @@ -674,7 +675,7 @@ def loop_space(self, n=1): sage: [l2.homology(i) for i in range(8)] # optional - kenzo [Z, Z, Z, Z, Z, Z, Z, Z] """ - return KenzoSimplicialGroup(loop_space(self._kenzo, n)) + return KenzoSimplicialGroup(_loop_space(self._kenzo, n)) def cartesian_product(self, other): r""" @@ -699,7 +700,7 @@ def cartesian_product(self, other): sage: [p.homology(i) for i in range(6)] # optional - kenzo [Z, 0, Z, Z, 0, Z] """ - prod_kenzo = crts_prdc(self._kenzo, other._kenzo) + prod_kenzo = _crts_prdc(self._kenzo, other._kenzo) return KenzoSimplicialSet(prod_kenzo) def suspension(self): @@ -720,7 +721,7 @@ def suspension(self): sage: [s.homology(i) for i in range(6)] # optional - kenzo [Z, 0, 0, 0, Z, 0] """ - return KenzoSimplicialSet(suspension(self._kenzo)) + return KenzoSimplicialSet(_suspension(self._kenzo)) def homotopy_group(self, n): """ @@ -741,7 +742,7 @@ def homotopy_group(self, n): if n not in ZZ or n < 2: raise ValueError("""homotopy groups can only be computed for dimensions greater than 1""") - lgens = homotopy_list(self._kenzo, n).python() + lgens = _homotopy_list(self._kenzo, n).python() if lgens is not None: trgens = [0 if i == 1 else i for i in sorted(lgens)] return AbelianGroup(trgens) @@ -771,7 +772,7 @@ def em_spectral_sequence(self): if self.homology(1).invariants(): raise ValueError("""Eilenberg-Moore spectral sequence implemented only for 1-reduced simplicial sets""") - return KenzoSpectralSequence(eilenberg_moore_spectral_sequence(self._kenzo)) + return KenzoSpectralSequence(_eilenberg_moore_spectral_sequence(self._kenzo)) def sw_spectral_sequence(self): r""" @@ -794,7 +795,7 @@ def sw_spectral_sequence(self): 0 0 0 0 0 Z 0 0 Z 0 """ - return KenzoSpectralSequence(serre_whitehead_spectral_sequence(self._kenzo)) + return KenzoSpectralSequence(_serre_whitehead_spectral_sequence(self._kenzo)) def serre_spectral_sequence(self): r""" @@ -819,7 +820,7 @@ def serre_spectral_sequence(self): 0 0 0 Z 0 Z """ - return KenzoSpectralSequence(serre_spectral_sequence_product(self._kenzo)) + return KenzoSpectralSequence(_serre_spectral_sequence_product(self._kenzo)) def wedge(self, other): r""" @@ -844,7 +845,7 @@ def wedge(self, other): sage: [w.homology(i) for i in range(6)] # optional - kenzo [Z, 0, Z, Z, 0, 0] """ - wedge_kenzo = wedge(self._kenzo, other._kenzo) + wedge_kenzo = _wedge(self._kenzo, other._kenzo) return KenzoSimplicialSet(wedge_kenzo) def join(self, other): @@ -870,7 +871,7 @@ def join(self, other): sage: [j.homology(i) for i in range(6)] # optional - kenzo [Z, 0, 0, 0, 0, 0] """ - join_kenzo = join(self._kenzo, other._kenzo) + join_kenzo = _join(self._kenzo, other._kenzo) return KenzoSimplicialSet(join_kenzo) def smash_product(self, other): @@ -896,7 +897,7 @@ def smash_product(self, other): sage: [s.homology(i) for i in range(6)] # optional - kenzo [Z, 0, 0, 0, 0, Z] """ - smash_kenzo = smash_product(self._kenzo, other._kenzo) + smash_kenzo = _smash_product(self._kenzo, other._kenzo) return KenzoSimplicialSet(smash_kenzo) @@ -924,7 +925,7 @@ def classifying_space(self): sage: [c.homology(i) for i in range(8)] # optional - kenzo [Z, 0, 0, 0, C2, 0, 0, 0] """ - return KenzoSimplicialGroup(classifying_space(self._kenzo)) + return KenzoSimplicialGroup(_classifying_space(self._kenzo)) def k2s_matrix(kmatrix): @@ -945,8 +946,8 @@ def k2s_matrix(kmatrix): [3 2 1] [1 1 1] """ - dimensions = array_dimensions(kmatrix).python() - kmatrix_list = make_array_to_lists(kmatrix).python() + dimensions = _array_dimensions(kmatrix).python() + kmatrix_list = _make_array_to_lists(kmatrix).python() return matrix(dimensions[0], dimensions[1], kmatrix_list) @@ -973,7 +974,7 @@ def s2k_matrix(smatrix): dimensions = smatrix.dimensions() for i in smatrix.rows(): initcontents.append(i.list()) - return make_array_from_lists(dimensions[0], dimensions[1], initcontents) + return _make_array_from_lists(dimensions[0], dimensions[1], initcontents) def s2k_dictmat(sdictmat): @@ -1059,7 +1060,7 @@ def KChainComplex(chain_complex): d = chain_complex.differential() chcm = s2k_dictmat(d) str_orgn = str(d)[1:-1].replace(":", " ").replace(" ", ".").replace("\n", "").replace(",", "") - return KenzoChainComplex(kchaincomplex_aux1(chcm, str_orgn)) + return KenzoChainComplex(_kchaincomplex_aux1(chcm, str_orgn)) def SChainComplex(kchaincomplex, start=0, end=15): @@ -1091,9 +1092,9 @@ def SChainComplex(kchaincomplex, start=0, end=15): """ matrices = {} for i in range(start, end): - dffr_i = chcm_mat2(kchaincomplex._kenzo, i) - if ((nlig(dffr_i).python() != 0) and (ncol(dffr_i).python() != 0)): - matrices[i] = k2s_matrix(convertmatrice(dffr_i)) + dffr_i = _chcm_mat2(kchaincomplex._kenzo, i) + if ((_nlig(dffr_i).python() != 0) and (_ncol(dffr_i).python() != 0)): + matrices[i] = k2s_matrix(_convertmatrice(dffr_i)) return ChainComplex(matrices, degree=-1) @@ -1126,12 +1127,12 @@ def SAbstractSimplex(simplex, dim): sage: SAbSm2.dimension() # optional - kenzo 11 """ - degeneracies = dgop_int_ext(dgop(simplex._kenzo)).python() + degeneracies = _dgop_int_ext(_dgop(simplex._kenzo)).python() if degeneracies is None: degeneracies = [] else: degeneracies = tuple(degeneracies) - name = gmsm(simplex._kenzo).python() + name = _gmsm(simplex._kenzo).python() return AbstractSimplex(dim, degeneracies, name=name) @@ -1160,7 +1161,7 @@ def KAbstractSimplex(simplex): sage: SAbSm.dimension() == SAbSm2.dimension() # optional - kenzo True """ - return KenzoObject(kabstractsimplex_aux1(simplex.degeneracies(), + return KenzoObject(_kabstractsimplex_aux1(simplex.degeneracies(), 's' + str(hash(simplex)))) @@ -1226,7 +1227,7 @@ def KFiniteSimplicialSet(sset): degen_z.append(name) auxiliar_list.append(degen_z) list_rslt.append(auxiliar_list) - return KenzoSimplicialSet(build_finite_ss2(list_rslt)) + return KenzoSimplicialSet(_build_finite_ss2(list_rslt)) def SFiniteSimplicialSet(ksimpset, limit): @@ -1269,23 +1270,23 @@ def SFiniteSimplicialSet(ksimpset, limit): sage: SS1vS3.homology() # optional - kenzo {0: 0, 1: Z, 2: 0, 3: Z} """ - list_orgn = orgn_aux1(ksimpset._kenzo).python() - if nth(0, list_orgn).python()[0] == 'CRTS-PRDC': + list_orgn = _orgn_aux1(ksimpset._kenzo).python() + if _nth(0, list_orgn).python()[0] == 'CRTS-PRDC': return SFiniteSimplicialSet( - KenzoSimplicialSet(nth(1, list_orgn)), limit).cartesian_product( - SFiniteSimplicialSet(KenzoSimplicialSet(nth(2, list_orgn)), limit)) + KenzoSimplicialSet(_nth(1, list_orgn)), limit).cartesian_product( + SFiniteSimplicialSet(KenzoSimplicialSet(_nth(2, list_orgn)), limit)) rslt = {} simplices = [] faces = [] bases = [] names = [] for k in range(limit + 1): - basis_k = basis_aux1(ksimpset._kenzo, k) + basis_k = _basis_aux1(ksimpset._kenzo, k) names_k = ksimpset.basis(k) lbasis_k = [AbstractSimplex(k, name=i) for i in EclListIterator(basis_k)] bases.append(lbasis_k) names.append(names_k) - all_simplices = sfinitesimplicialset_aux1(ksimpset._kenzo, limit) + all_simplices = _sfinitesimplicialset_aux1(ksimpset._kenzo, limit) lall_simplices = [i for i in EclListIterator(all_simplices)] dim = 1 for Kdim in lall_simplices: @@ -1293,10 +1294,10 @@ def SFiniteSimplicialSet(ksimpset, limit): index1 = names[dim].index(str(simp.car())) lKdim_cdr = [] for i in EclListIterator(simp.cdr()): - degenop = dgop_int_ext(dgop(i)).python() + degenop = _dgop_int_ext(_dgop(i)).python() if degenop is None: degenop = [] - index2 = names[dim - len(degenop) - 1].index(str(gmsm(i))) + index2 = names[dim - len(degenop) - 1].index(str(_gmsm(i))) lKdim_cdr.append(bases[dim - len(degenop) - 1][index2].apply_degeneracies(*degenop)) simplices.append(bases[dim][index1]) faces.append(tuple(lKdim_cdr)) @@ -1335,7 +1336,7 @@ def source_complex(self): sage: differential_morphism.source_complex() # optional - kenzo [K... Chain-Complex] """ - return KenzoChainComplex(sorc_aux(self._kenzo)) + return KenzoChainComplex(_sorc_aux(self._kenzo)) def target_complex(self): r""" @@ -1361,7 +1362,7 @@ def target_complex(self): sage: differential_morphism.target_complex() # optional - kenzo [K... Chain-Complex] """ - return KenzoChainComplex(trgt_aux(self._kenzo)) + return KenzoChainComplex(_trgt_aux(self._kenzo)) def degree(self): r""" @@ -1391,7 +1392,7 @@ def degree(self): sage: kenzo_chcm.null_morphism().degree() # optional - kenzo 0 """ - return degr_aux(self._kenzo).python() + return _degr_aux(self._kenzo).python() def evaluation(self, dim, comb): r""" @@ -1452,9 +1453,9 @@ def evaluation(self, dim, comb): ----------------------------------------------------------------------{CMBN 3} ------------------------------------------------------------------------------ - sage: id = kenzo_chcm.identity_morphism() # optional - kenzo - sage: idx2 = id.sum(id) # optional - kenzo - sage: id.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo + sage: idnt = kenzo_chcm.identity_morphism() # optional - kenzo + sage: idx2 = idnt.sum(idnt) # optional - kenzo + sage: idnt.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo ----------------------------------------------------------------------{CMBN 5} <1 * G5G0> @@ -1472,7 +1473,7 @@ def evaluation(self, dim, comb): if dim.is_integer(): if isinstance(comb, list): cmbn_list = pairing(comb) - return KenzoObject(evaluation_aux1(self._kenzo, dim, cmbn_list)) + return KenzoObject(_evaluation_aux1(self._kenzo, dim, cmbn_list)) else: raise ValueError("'comb' parameter must be a list") else: @@ -1496,15 +1497,15 @@ def opposite(self): sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] - sage: id = kenzo_chcm.identity_morphism() # optional - kenzo - sage: id # optional - kenzo + sage: idnt = kenzo_chcm.identity_morphism() # optional - kenzo + sage: idnt # optional - kenzo [K... Morphism (degree 0): K... -> K...] - sage: opps_id = id.opposite() # optional - kenzo + sage: opps_id = idnt.opposite() # optional - kenzo sage: opps_id # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] - sage: id.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo + sage: idnt.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo ----------------------------------------------------------------------{CMBN 4} <2 * G4G0> @@ -1519,7 +1520,7 @@ def opposite(self): ------------------------------------------------------------------------------ """ - return KenzoChainComplexMorphism(opps(self._kenzo)) + return KenzoChainComplexMorphism(_opps(self._kenzo)) def composite(self, object=None): r""" @@ -1546,25 +1547,25 @@ def composite(self, object=None): sage: s3 = Sphere(3) # optional - kenzo sage: tp22 = s2.tensor_product(s2) # optional - kenzo sage: tp23 = s2.tensor_product(s3) # optional - kenzo - sage: id = tp22.identity_morphism() # optional - kenzo - sage: id # optional - kenzo + sage: idnt = tp22.identity_morphism() # optional - kenzo + sage: idnt # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: null = tp23.null_morphism(target = tp22, degree = 4) # optional - kenzo sage: null # optional - kenzo [K... Morphism (degree 4): K... -> K...] - sage: id.composite((tp22, null)) # optional - kenzo + sage: idnt.composite((tp22, null)) # optional - kenzo [K... Morphism (degree 3): K... -> K...] """ if object is None: return self if isinstance(object, KenzoChainComplexMorphism): - return KenzoChainComplexMorphism(cmps(self._kenzo, object._kenzo)) + return KenzoChainComplexMorphism(_cmps(self._kenzo, object._kenzo)) elif isinstance(object, KenzoChainComplex): - return KenzoChainComplexMorphism(cmps(self._kenzo, dffr_aux(object._kenzo))) + return KenzoChainComplexMorphism(_cmps(self._kenzo, _dffr_aux(object._kenzo))) elif isinstance(object, tuple): rslt = self._kenzo for mrph in object: - rslt = cmps(rslt, mrph._kenzo) + rslt = _cmps(rslt, mrph._kenzo) return KenzoChainComplexMorphism(rslt) def sum(self, object=None): @@ -1592,18 +1593,18 @@ def sum(self, object=None): sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] - sage: id = kenzo_chcm.identity_morphism() # optional - kenzo - sage: id # optional - kenzo + sage: idnt = kenzo_chcm.identity_morphism() # optional - kenzo + sage: idnt # optional - kenzo [K... Morphism (degree 0): K... -> K...] - sage: opps_id = id.opposite() # optional - kenzo + sage: opps_id = idnt.opposite() # optional - kenzo sage: opps_id # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: null = kenzo_chcm.null_morphism() # optional - kenzo sage: null # optional - kenzo [K... Morphism (degree 0): K... -> K...] - sage: idx2 = id.sum(id) # optional - kenzo + sage: idx2 = idnt.sum(idnt) # optional - kenzo sage: idx5 = idx2.sum(\ - ....: (opps_id, id, id, null, idx2.sum(id), opps_id)) # optional - kenzo + ....: (opps_id, idnt, idnt, null, idx2.sum(idnt), opps_id)) # optional - kenzo sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] sage: idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo @@ -1624,11 +1625,11 @@ def sum(self, object=None): if object is None: return self if isinstance(object, KenzoChainComplexMorphism): - return KenzoChainComplexMorphism(add(self._kenzo, object._kenzo)) + return KenzoChainComplexMorphism(_add(self._kenzo, object._kenzo)) elif isinstance(object, tuple): rslt = self._kenzo for mrph in object: - rslt = add(rslt, mrph._kenzo) + rslt = _add(rslt, mrph._kenzo) return KenzoChainComplexMorphism(rslt) def substract(self, object=None): @@ -1658,18 +1659,18 @@ def substract(self, object=None): sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] - sage: id = kenzo_chcm.identity_morphism() # optional - kenzo - sage: id # optional - kenzo + sage: idnt = kenzo_chcm.identity_morphism() # optional - kenzo + sage: idnt # optional - kenzo [K... Morphism (degree 0): K... -> K...] - sage: opps_id = id.opposite() # optional - kenzo + sage: opps_id = idnt.opposite() # optional - kenzo sage: opps_id # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: null = kenzo_chcm.null_morphism() # optional - kenzo sage: null # optional - kenzo [K... Morphism (degree 0): K... -> K...] - sage: idx2 = id.substract(opps_id) # optional - kenzo + sage: idx2 = idnt.substract(opps_id) # optional - kenzo sage: opps_idx2 = idx2.substract\ - ....: ((opps_id, id, id, null, idx2.substract(opps_id))) # optional - kenzo + ....: ((opps_id, idnt, idnt, null, idx2.substract(opps_id))) # optional - kenzo sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] sage: idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo @@ -1690,11 +1691,11 @@ def substract(self, object=None): if object is None: return self if isinstance(object, KenzoChainComplexMorphism): - return KenzoChainComplexMorphism(sbtr(self._kenzo, object._kenzo)) + return KenzoChainComplexMorphism(_sbtr(self._kenzo, object._kenzo)) elif isinstance(object, tuple): rslt = self._kenzo for mrph in object: - rslt = sbtr(rslt, mrph._kenzo) + rslt = _sbtr(rslt, mrph._kenzo) return KenzoChainComplexMorphism(rslt) def change_source_target_complex(self, source=None, target=None): @@ -1743,7 +1744,7 @@ def change_source_target_complex(self, source=None, target=None): source = source or self.source_complex() target = target or self.target_complex() return KenzoChainComplexMorphism( - change_sorc_trgt_aux(self._kenzo, source._kenzo, target._kenzo)) + _change_sorc_trgt_aux(self._kenzo, source._kenzo, target._kenzo)) def destructive_change_source_target_complex(self, source=None, target=None): r""" @@ -1787,7 +1788,7 @@ def destructive_change_source_target_complex(self, source=None, target=None): source = source or self.source_complex() target = target or self.target_complex() return KenzoChainComplexMorphism( - dstr_change_sorc_trgt_aux(self._kenzo, source._kenzo, target._kenzo)) + _dstr_change_sorc_trgt_aux(self._kenzo, source._kenzo, target._kenzo)) def build_morphism(source_complex, target_complex, degree, algorithm, strategy, orgn): @@ -1806,9 +1807,9 @@ def build_morphism(source_complex, target_complex, degree, algorithm, strategy, - ``algorithm`` -- A Lisp function defining the mapping (:intr slot in Kenzo) - ``strategy`` -- The strategy (:strt slot in Kenzo), which must be one of - the two strings ``gnrt`` or ``cmbn``, depending if the ``algorithm`` (a Lisp - function) uses as arguments a degree and a generator or a combination, - respectively. + the two strings ``gnrt`` or ``cmbn``, depending if the ``algorithm`` (a Lisp + function) uses as arguments a degree and a generator or a combination, + respectively. - ``orgn`` -- A list containing a description about the origin of the morphism @@ -1833,7 +1834,7 @@ def build_morphism(source_complex, target_complex, degree, algorithm, strategy, """ return KenzoChainComplexMorphism( - build_mrph_aux(source_complex._kenzo, target_complex._kenzo, + _build_mrph_aux(source_complex._kenzo, target_complex._kenzo, degree, algorithm, ":"+strategy, orgn)) @@ -1897,7 +1898,7 @@ def KChainComplexMorphism(morphism): target = KChainComplex(morphism.codomain()) matrix_list = morphism_dictmat(morphism) return KenzoChainComplexMorphism( - kmorphismchaincomplex_aux1(matrix_list, source._kenzo, target._kenzo)) + _kmorphismchaincomplex_aux1(matrix_list, source._kenzo, target._kenzo)) def s2k_listofmorphisms(l): @@ -1927,7 +1928,7 @@ def s2k_listofmorphisms(l): rslt = EclObject([]) for m in l: rslt = EclObject(KChainComplexMorphism(m)._kenzo).cons(rslt) - return nreverse(rslt) + return _nreverse(rslt) def BicomplexSpectralSequence(l): @@ -1962,4 +1963,4 @@ def BicomplexSpectralSequence(l): [ 0 0] [-4 0] """ - return KenzoSpectralSequence(bicomplex_spectral_sequence(s2k_listofmorphisms(l))) + return KenzoSpectralSequence(_bicomplex_spectral_sequence(s2k_listofmorphisms(l))) From ce108c3832dc6fa91653e1bc7ad44ff0622fe2ed Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Wed, 18 Dec 2019 17:00:55 -0800 Subject: [PATCH 258/301] trac 27880: hide some objects from importing. --- src/sage/interfaces/kenzo.py | 250 +++++++++++++++++------------------ 1 file changed, 125 insertions(+), 125 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 05ae36a5176..7c065025ab3 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -61,63 +61,63 @@ # defining the auxiliary functions as wrappers over the kenzo ones -_chcm_mat = EclObject("chcm-mat") -_homologie = EclObject("homologie") -_sphere = EclObject("sphere") -_crts_prdc = EclObject("crts-prdc") -_moore = EclObject("moore") -_k_z = EclObject("k-z") -_k_z2 = EclObject("k-z2") -_k_zp = EclObject("k-zp") -_echcm = EclObject("echcm") -_loop_space = EclObject("loop-space") -_tnsr_prdc = EclObject("tnsr-prdc") -_classifying_space = EclObject("classifying-space") -_suspension = EclObject("suspension") -_homotopy_list = EclObject("homotopy-list") -_nth = EclObject("nth") -_nlig = EclObject("nlig") -_ncol = EclObject("ncol") -_array_dimensions = EclObject("array-dimensions") -_convertmatrice = EclObject("convertmatrice") -_make_array_to_lists = EclObject("make-array-to-lists") -_make_array_from_lists = EclObject("make-array-from-lists") -_chcm_mat2 = EclObject("chcm-mat2") -_build_finite_ss2 = EclObject("build-finite-ss2") -_gmsm = EclObject("gmsm") -_dgop = EclObject("dgop") -_dgop_int_ext = EclObject("dgop-int-ext") -_basis_aux1 = EclObject("basis_aux1") -_orgn_aux1 = EclObject("orgn_aux1") -_dffr_aux1 = EclObject("dffr_aux1") -_kabstractsimplex_aux1 = EclObject("kabstractsimplex_aux1") -_kchaincomplex_aux1 = EclObject("kchaincomplex_aux1") -_sfinitesimplicialset_aux1 = EclObject("sfinitesimplicialset_aux1") -_spectral_sequence_group = EclObject("spectral-sequence-group") -_spectral_sequence_differential_matrix = EclObject("spectral-sequence-differential-matrix") -_eilenberg_moore_spectral_sequence = EclObject("eilenberg-moore-spectral-sequence") -_serre_whitehead_spectral_sequence = EclObject("serre-whitehead-spectral-sequence") -_serre_spectral_sequence_product = EclObject("serre-spectral-sequence-product") -_wedge = EclObject("wedge") -_join = EclObject("join") -_kmorphismchaincomplex_aux1 = EclObject("kmorphismchaincomplex_aux1") -_bicomplex_spectral_sequence = EclObject("bicomplex-spectral-sequence") -_nreverse = EclObject("nreverse") -_smash_product = EclObject("smash-product") -_build_mrph_aux = EclObject("build-mrph-aux") -_zero_mrph = EclObject("zero-mrph") -_idnt_mrph = EclObject("idnt-mrph") -_dffr_aux = EclObject("dffr-aux") -_sorc_aux = EclObject("sorc-aux") -_trgt_aux = EclObject("trgt-aux") -_degr_aux = EclObject("degr-aux") -_evaluation_aux1 = EclObject("evaluation-aux1") -_opps = EclObject("opps") -_cmps = EclObject("cmps") -_add = EclObject("add") -_sbtr = EclObject("sbtr") -_change_sorc_trgt_aux = EclObject("change-sorc-trgt-aux") -_dstr_change_sorc_trgt_aux = EclObject("dstr-change-sorc-trgt-aux") +__chcm_mat__ = EclObject("chcm-mat") +__homologie__ = EclObject("homologie") +__sphere__ = EclObject("sphere") +__crts_prdc__ = EclObject("crts-prdc") +__moore__ = EclObject("moore") +__k_z__ = EclObject("k-z") +__k_z2__ = EclObject("k-z2") +__k_zp__ = EclObject("k-zp") +__echcm__ = EclObject("echcm") +__loop_space__ = EclObject("loop-space") +__tnsr_prdc__ = EclObject("tnsr-prdc") +__classifying_space__ = EclObject("classifying-space") +__suspension__ = EclObject("suspension") +__homotopy_list__ = EclObject("homotopy-list") +__nth__ = EclObject("nth") +__nlig__ = EclObject("nlig") +__ncol__ = EclObject("ncol") +__array_dimensions__ = EclObject("array-dimensions") +__convertmatrice__ = EclObject("convertmatrice") +__make_array_to_lists__ = EclObject("make-array-to-lists") +__make_array_from_lists__ = EclObject("make-array-from-lists") +__chcm_mat2__ = EclObject("chcm-mat2") +__build_finite_ss2__ = EclObject("build-finite-ss2") +__gmsm__ = EclObject("gmsm") +__dgop__ = EclObject("dgop") +__dgop_int_ext__ = EclObject("dgop-int-ext") +__basis_aux1__ = EclObject("basis_aux1") +__orgn_aux1__ = EclObject("orgn_aux1") +__dffr_aux_1__ = EclObject("dffr_aux1") +__kabstractsimplex_aux1__ = EclObject("kabstractsimplex_aux1") +__kchaincomplex_aux1__ = EclObject("kchaincomplex_aux1") +__sfinitesimplicialset_aux1__ = EclObject("sfinitesimplicialset_aux1") +__spectral_sequence_group__ = EclObject("spectral-sequence-group") +__spectral_sequence_differential_matrix__ = EclObject("spectral-sequence-differential-matrix") +__eilenberg_moore_spectral_sequence__ = EclObject("eilenberg-moore-spectral-sequence") +__serre_whitehead_spectral_sequence__ = EclObject("serre-whitehead-spectral-sequence") +__serre_spectral_sequence_product__ = EclObject("serre-spectral-sequence-product") +__wedge__ = EclObject("wedge") +__join__ = EclObject("join") +__kmorphismchaincomplex_aux1__ = EclObject("kmorphismchaincomplex_aux1") +__bicomplex_spectral_sequence__ = EclObject("bicomplex-spectral-sequence") +__nreverse__ = EclObject("nreverse") +__smash_product__ = EclObject("smash-product") +__build_mrph_aux__ = EclObject("build-mrph-aux") +__zero_mrph__ = EclObject("zero-mrph") +__idnt_mrph__ = EclObject("idnt-mrph") +__dffr_aux__ = EclObject("dffr-aux") +__sorc_aux__ = EclObject("sorc-aux") +__trgt_aux__ = EclObject("trgt-aux") +__degr_aux__ = EclObject("degr-aux") +__evaluation_aux1__ = EclObject("evaluation-aux1") +__opps__ = EclObject("opps") +__cmps__ = EclObject("cmps") +__add__ = EclObject("add") +__sbtr__ = EclObject("sbtr") +__change_sorc_trgt_aux__ = EclObject("change-sorc-trgt-aux") +__dstr_change_sorc_trgt_aux__ = EclObject("dstr-change-sorc-trgt-aux") def Sphere(n): @@ -141,7 +141,7 @@ def Sphere(n): sage: [s2.homology(i) for i in range(8)] # optional - kenzo [Z, 0, Z, 0, 0, 0, 0, 0] """ - kenzosphere = _sphere(n) + kenzosphere = __sphere__(n) return KenzoSimplicialSet(kenzosphere) @@ -172,7 +172,7 @@ def MooreSpace(m, n): sage: [m24.homology(i) for i in range(8)] # optional - kenzo [Z, 0, 0, 0, C2, 0, 0, 0] """ - kenzomoore = _moore(m, n) + kenzomoore = __moore__(m, n) return KenzoSimplicialSet(kenzomoore) @@ -205,13 +205,13 @@ def EilenbergMacLaneSpace(G, n): [Z, 0, 0, C2, 0, C2, C2, C2] """ if G == ZZ: - kenzospace = _k_z(n) + kenzospace = __k_z__(n) return KenzoSimplicialGroup(kenzospace) elif G == AdditiveAbelianGroup([2]): - kenzospace = _k_z2(n) + kenzospace = __k_z2__(n) return KenzoSimplicialGroup(kenzospace) elif G in CommutativeAdditiveGroups() and G.is_cyclic(): - kenzospace = _k_zp(G.cardinality(), n) + kenzospace = __k_zp__(G.cardinality(), n) return KenzoSimplicialGroup(kenzospace) else: raise NotImplementedError("Eilenberg-MacLane spaces are only supported over ZZ and ZZ_n") @@ -234,8 +234,8 @@ def __init__(self, kenzo_object): TESTS:: sage: from sage.interfaces.kenzo import KenzoObject # optional -kenzo - sage: from sage.interfaces.kenzo import _sphere # optional -kenzo - sage: ks = _sphere(2) # optional -kenzo + sage: from sage.interfaces.kenzo import __sphere__ # optional -kenzo + sage: ks = __sphere__(2) # optional -kenzo sage: ks # optional -kenzo sage: s2 = KenzoObject(ks) # optional -kenzo @@ -291,7 +291,7 @@ def group(self, p, i, j): sage: EMS.group(0, -1, 3) # optional - kenzo Trivial group """ - invs = _spectral_sequence_group(self._kenzo, p, i, j).python() + invs = __spectral_sequence_group__(self._kenzo, p, i, j).python() if not invs: invs = [] return AdditiveAbelianGroup(invs) @@ -325,7 +325,7 @@ def matrix(self, p, i, j): [ 3 0 -3] [ 0 2 -3] """ - klist = _spectral_sequence_differential_matrix(self._kenzo, p, i, j) + klist = __spectral_sequence_differential_matrix__(self._kenzo, p, i, j) plist = klist.python() if plist is None or plist == [None]: i = len(self.group(p, i, j).invariants()) @@ -434,10 +434,10 @@ def homology(self, n): sage: s2.homology(2) # optional - kenzo Z """ - echcm1 = _echcm(self._kenzo) - m1 = _chcm_mat(echcm1, n) - m2 = _chcm_mat(echcm1, n + 1) - homology = _homologie(m1, m2) + echcm1 = __echcm__(self._kenzo) + m1 = __chcm_mat__(echcm1, n) + m2 = __chcm_mat__(echcm1, n + 1) + homology = __homologie__(m1, m2) lhomomology = [i for i in EclListIterator(homology)] res = [] for component in lhomomology: @@ -468,7 +468,7 @@ def tensor_product(self, other): sage: [p.homology(i) for i in range(8)] # optional - kenzo [Z, 0, Z, Z, 0, Z, 0, 0] """ - return KenzoChainComplex(_tnsr_prdc(self._kenzo, other._kenzo)) + return KenzoChainComplex(__tnsr_prdc__(self._kenzo, other._kenzo)) def basis(self, dim): r""" @@ -502,7 +502,7 @@ def basis(self, dim): Basis in dimension 5: ['G5G0', 'G5G1', 'G5G2'] """ - return _basis_aux1(self._kenzo, dim).python() + return __basis_aux1__(self._kenzo, dim).python() def identity_morphism(self): r""" @@ -521,7 +521,7 @@ def identity_morphism(self): sage: type(idnt) # optional - kenzo """ - return KenzoChainComplexMorphism(_idnt_mrph(self._kenzo)) + return KenzoChainComplexMorphism(__idnt_mrph__(self._kenzo)) def null_morphism(self, target=None, degree=None): r""" @@ -567,7 +567,7 @@ def null_morphism(self, target=None, degree=None): elif (not degree == 0) and (not degree.is_integer()): raise ValueError("'degree' parameter must be an Integer number") else: - return KenzoChainComplexMorphism(_zero_mrph(self._kenzo, target._kenzo, degree)) + return KenzoChainComplexMorphism(__zero_mrph__(self._kenzo, target._kenzo, degree)) def differential(self, dim=None, comb=None): r""" @@ -624,9 +624,9 @@ def differential(self, dim=None, comb=None): """ if dim is not None and comb is not None: cmbn_list = pairing(comb) - return KenzoObject(_dffr_aux1(self._kenzo, dim, cmbn_list)) + return KenzoObject(__dffr_aux_1__(self._kenzo, dim, cmbn_list)) else: - return KenzoChainComplexMorphism(_dffr_aux(self._kenzo)) + return KenzoChainComplexMorphism(__dffr_aux__(self._kenzo)) def orgn(self): r""" @@ -643,7 +643,7 @@ def orgn(self): sage: A.orgn() # optional - kenzo '(CRTS-PRDC [K... Simplicial-Group] [K... Simplicial-Set])' """ - return str(_orgn_aux1(self._kenzo)) + return str(__orgn_aux1__(self._kenzo)) class KenzoSimplicialSet(KenzoChainComplex): @@ -675,7 +675,7 @@ def loop_space(self, n=1): sage: [l2.homology(i) for i in range(8)] # optional - kenzo [Z, Z, Z, Z, Z, Z, Z, Z] """ - return KenzoSimplicialGroup(_loop_space(self._kenzo, n)) + return KenzoSimplicialGroup(__loop_space__(self._kenzo, n)) def cartesian_product(self, other): r""" @@ -700,7 +700,7 @@ def cartesian_product(self, other): sage: [p.homology(i) for i in range(6)] # optional - kenzo [Z, 0, Z, Z, 0, Z] """ - prod_kenzo = _crts_prdc(self._kenzo, other._kenzo) + prod_kenzo = __crts_prdc__(self._kenzo, other._kenzo) return KenzoSimplicialSet(prod_kenzo) def suspension(self): @@ -721,7 +721,7 @@ def suspension(self): sage: [s.homology(i) for i in range(6)] # optional - kenzo [Z, 0, 0, 0, Z, 0] """ - return KenzoSimplicialSet(_suspension(self._kenzo)) + return KenzoSimplicialSet(__suspension__(self._kenzo)) def homotopy_group(self, n): """ @@ -742,7 +742,7 @@ def homotopy_group(self, n): if n not in ZZ or n < 2: raise ValueError("""homotopy groups can only be computed for dimensions greater than 1""") - lgens = _homotopy_list(self._kenzo, n).python() + lgens = __homotopy_list__(self._kenzo, n).python() if lgens is not None: trgens = [0 if i == 1 else i for i in sorted(lgens)] return AbelianGroup(trgens) @@ -772,7 +772,7 @@ def em_spectral_sequence(self): if self.homology(1).invariants(): raise ValueError("""Eilenberg-Moore spectral sequence implemented only for 1-reduced simplicial sets""") - return KenzoSpectralSequence(_eilenberg_moore_spectral_sequence(self._kenzo)) + return KenzoSpectralSequence(__eilenberg_moore_spectral_sequence__(self._kenzo)) def sw_spectral_sequence(self): r""" @@ -795,7 +795,7 @@ def sw_spectral_sequence(self): 0 0 0 0 0 Z 0 0 Z 0 """ - return KenzoSpectralSequence(_serre_whitehead_spectral_sequence(self._kenzo)) + return KenzoSpectralSequence(__serre_whitehead_spectral_sequence__(self._kenzo)) def serre_spectral_sequence(self): r""" @@ -820,7 +820,7 @@ def serre_spectral_sequence(self): 0 0 0 Z 0 Z """ - return KenzoSpectralSequence(_serre_spectral_sequence_product(self._kenzo)) + return KenzoSpectralSequence(__serre_spectral_sequence_product__(self._kenzo)) def wedge(self, other): r""" @@ -845,7 +845,7 @@ def wedge(self, other): sage: [w.homology(i) for i in range(6)] # optional - kenzo [Z, 0, Z, Z, 0, 0] """ - wedge_kenzo = _wedge(self._kenzo, other._kenzo) + wedge_kenzo = __wedge__(self._kenzo, other._kenzo) return KenzoSimplicialSet(wedge_kenzo) def join(self, other): @@ -871,7 +871,7 @@ def join(self, other): sage: [j.homology(i) for i in range(6)] # optional - kenzo [Z, 0, 0, 0, 0, 0] """ - join_kenzo = _join(self._kenzo, other._kenzo) + join_kenzo = __join__(self._kenzo, other._kenzo) return KenzoSimplicialSet(join_kenzo) def smash_product(self, other): @@ -897,7 +897,7 @@ def smash_product(self, other): sage: [s.homology(i) for i in range(6)] # optional - kenzo [Z, 0, 0, 0, 0, Z] """ - smash_kenzo = _smash_product(self._kenzo, other._kenzo) + smash_kenzo = __smash_product__(self._kenzo, other._kenzo) return KenzoSimplicialSet(smash_kenzo) @@ -925,7 +925,7 @@ def classifying_space(self): sage: [c.homology(i) for i in range(8)] # optional - kenzo [Z, 0, 0, 0, C2, 0, 0, 0] """ - return KenzoSimplicialGroup(_classifying_space(self._kenzo)) + return KenzoSimplicialGroup(__classifying_space__(self._kenzo)) def k2s_matrix(kmatrix): @@ -946,8 +946,8 @@ def k2s_matrix(kmatrix): [3 2 1] [1 1 1] """ - dimensions = _array_dimensions(kmatrix).python() - kmatrix_list = _make_array_to_lists(kmatrix).python() + dimensions = __array_dimensions__(kmatrix).python() + kmatrix_list = __make_array_to_lists__(kmatrix).python() return matrix(dimensions[0], dimensions[1], kmatrix_list) @@ -974,7 +974,7 @@ def s2k_matrix(smatrix): dimensions = smatrix.dimensions() for i in smatrix.rows(): initcontents.append(i.list()) - return _make_array_from_lists(dimensions[0], dimensions[1], initcontents) + return __make_array_from_lists__(dimensions[0], dimensions[1], initcontents) def s2k_dictmat(sdictmat): @@ -1060,7 +1060,7 @@ def KChainComplex(chain_complex): d = chain_complex.differential() chcm = s2k_dictmat(d) str_orgn = str(d)[1:-1].replace(":", " ").replace(" ", ".").replace("\n", "").replace(",", "") - return KenzoChainComplex(_kchaincomplex_aux1(chcm, str_orgn)) + return KenzoChainComplex(__kchaincomplex_aux1__(chcm, str_orgn)) def SChainComplex(kchaincomplex, start=0, end=15): @@ -1092,9 +1092,9 @@ def SChainComplex(kchaincomplex, start=0, end=15): """ matrices = {} for i in range(start, end): - dffr_i = _chcm_mat2(kchaincomplex._kenzo, i) - if ((_nlig(dffr_i).python() != 0) and (_ncol(dffr_i).python() != 0)): - matrices[i] = k2s_matrix(_convertmatrice(dffr_i)) + dffr_i = __chcm_mat2__(kchaincomplex._kenzo, i) + if ((__nlig__(dffr_i).python() != 0) and (__ncol__(dffr_i).python() != 0)): + matrices[i] = k2s_matrix(__convertmatrice__(dffr_i)) return ChainComplex(matrices, degree=-1) @@ -1127,12 +1127,12 @@ def SAbstractSimplex(simplex, dim): sage: SAbSm2.dimension() # optional - kenzo 11 """ - degeneracies = _dgop_int_ext(_dgop(simplex._kenzo)).python() + degeneracies = __dgop_int_ext__(__dgop__(simplex._kenzo)).python() if degeneracies is None: degeneracies = [] else: degeneracies = tuple(degeneracies) - name = _gmsm(simplex._kenzo).python() + name = __gmsm__(simplex._kenzo).python() return AbstractSimplex(dim, degeneracies, name=name) @@ -1161,7 +1161,7 @@ def KAbstractSimplex(simplex): sage: SAbSm.dimension() == SAbSm2.dimension() # optional - kenzo True """ - return KenzoObject(_kabstractsimplex_aux1(simplex.degeneracies(), + return KenzoObject(__kabstractsimplex_aux1__(simplex.degeneracies(), 's' + str(hash(simplex)))) @@ -1227,7 +1227,7 @@ def KFiniteSimplicialSet(sset): degen_z.append(name) auxiliar_list.append(degen_z) list_rslt.append(auxiliar_list) - return KenzoSimplicialSet(_build_finite_ss2(list_rslt)) + return KenzoSimplicialSet(__build_finite_ss2__(list_rslt)) def SFiniteSimplicialSet(ksimpset, limit): @@ -1270,23 +1270,23 @@ def SFiniteSimplicialSet(ksimpset, limit): sage: SS1vS3.homology() # optional - kenzo {0: 0, 1: Z, 2: 0, 3: Z} """ - list_orgn = _orgn_aux1(ksimpset._kenzo).python() - if _nth(0, list_orgn).python()[0] == 'CRTS-PRDC': + list_orgn = __orgn_aux1__(ksimpset._kenzo).python() + if __nth__(0, list_orgn).python()[0] == 'CRTS-PRDC': return SFiniteSimplicialSet( - KenzoSimplicialSet(_nth(1, list_orgn)), limit).cartesian_product( - SFiniteSimplicialSet(KenzoSimplicialSet(_nth(2, list_orgn)), limit)) + KenzoSimplicialSet(__nth__(1, list_orgn)), limit).cartesian_product( + SFiniteSimplicialSet(KenzoSimplicialSet(__nth__(2, list_orgn)), limit)) rslt = {} simplices = [] faces = [] bases = [] names = [] for k in range(limit + 1): - basis_k = _basis_aux1(ksimpset._kenzo, k) + basis_k = __basis_aux1__(ksimpset._kenzo, k) names_k = ksimpset.basis(k) lbasis_k = [AbstractSimplex(k, name=i) for i in EclListIterator(basis_k)] bases.append(lbasis_k) names.append(names_k) - all_simplices = _sfinitesimplicialset_aux1(ksimpset._kenzo, limit) + all_simplices = __sfinitesimplicialset_aux1__(ksimpset._kenzo, limit) lall_simplices = [i for i in EclListIterator(all_simplices)] dim = 1 for Kdim in lall_simplices: @@ -1294,10 +1294,10 @@ def SFiniteSimplicialSet(ksimpset, limit): index1 = names[dim].index(str(simp.car())) lKdim_cdr = [] for i in EclListIterator(simp.cdr()): - degenop = _dgop_int_ext(_dgop(i)).python() + degenop = __dgop_int_ext__(__dgop__(i)).python() if degenop is None: degenop = [] - index2 = names[dim - len(degenop) - 1].index(str(_gmsm(i))) + index2 = names[dim - len(degenop) - 1].index(str(__gmsm__(i))) lKdim_cdr.append(bases[dim - len(degenop) - 1][index2].apply_degeneracies(*degenop)) simplices.append(bases[dim][index1]) faces.append(tuple(lKdim_cdr)) @@ -1336,7 +1336,7 @@ def source_complex(self): sage: differential_morphism.source_complex() # optional - kenzo [K... Chain-Complex] """ - return KenzoChainComplex(_sorc_aux(self._kenzo)) + return KenzoChainComplex(__sorc_aux__(self._kenzo)) def target_complex(self): r""" @@ -1362,7 +1362,7 @@ def target_complex(self): sage: differential_morphism.target_complex() # optional - kenzo [K... Chain-Complex] """ - return KenzoChainComplex(_trgt_aux(self._kenzo)) + return KenzoChainComplex(__trgt_aux__(self._kenzo)) def degree(self): r""" @@ -1392,7 +1392,7 @@ def degree(self): sage: kenzo_chcm.null_morphism().degree() # optional - kenzo 0 """ - return _degr_aux(self._kenzo).python() + return __degr_aux__(self._kenzo).python() def evaluation(self, dim, comb): r""" @@ -1473,7 +1473,7 @@ def evaluation(self, dim, comb): if dim.is_integer(): if isinstance(comb, list): cmbn_list = pairing(comb) - return KenzoObject(_evaluation_aux1(self._kenzo, dim, cmbn_list)) + return KenzoObject(__evaluation_aux1__(self._kenzo, dim, cmbn_list)) else: raise ValueError("'comb' parameter must be a list") else: @@ -1520,7 +1520,7 @@ def opposite(self): ------------------------------------------------------------------------------ """ - return KenzoChainComplexMorphism(_opps(self._kenzo)) + return KenzoChainComplexMorphism(__opps__(self._kenzo)) def composite(self, object=None): r""" @@ -1559,13 +1559,13 @@ def composite(self, object=None): if object is None: return self if isinstance(object, KenzoChainComplexMorphism): - return KenzoChainComplexMorphism(_cmps(self._kenzo, object._kenzo)) + return KenzoChainComplexMorphism(__cmps__(self._kenzo, object._kenzo)) elif isinstance(object, KenzoChainComplex): - return KenzoChainComplexMorphism(_cmps(self._kenzo, _dffr_aux(object._kenzo))) + return KenzoChainComplexMorphism(__cmps__(self._kenzo, __dffr_aux__(object._kenzo))) elif isinstance(object, tuple): rslt = self._kenzo for mrph in object: - rslt = _cmps(rslt, mrph._kenzo) + rslt = __cmps__(rslt, mrph._kenzo) return KenzoChainComplexMorphism(rslt) def sum(self, object=None): @@ -1625,11 +1625,11 @@ def sum(self, object=None): if object is None: return self if isinstance(object, KenzoChainComplexMorphism): - return KenzoChainComplexMorphism(_add(self._kenzo, object._kenzo)) + return KenzoChainComplexMorphism(__add__(self._kenzo, object._kenzo)) elif isinstance(object, tuple): rslt = self._kenzo for mrph in object: - rslt = _add(rslt, mrph._kenzo) + rslt = __add__(rslt, mrph._kenzo) return KenzoChainComplexMorphism(rslt) def substract(self, object=None): @@ -1691,11 +1691,11 @@ def substract(self, object=None): if object is None: return self if isinstance(object, KenzoChainComplexMorphism): - return KenzoChainComplexMorphism(_sbtr(self._kenzo, object._kenzo)) + return KenzoChainComplexMorphism(__sbtr__(self._kenzo, object._kenzo)) elif isinstance(object, tuple): rslt = self._kenzo for mrph in object: - rslt = _sbtr(rslt, mrph._kenzo) + rslt = __sbtr__(rslt, mrph._kenzo) return KenzoChainComplexMorphism(rslt) def change_source_target_complex(self, source=None, target=None): @@ -1744,7 +1744,7 @@ def change_source_target_complex(self, source=None, target=None): source = source or self.source_complex() target = target or self.target_complex() return KenzoChainComplexMorphism( - _change_sorc_trgt_aux(self._kenzo, source._kenzo, target._kenzo)) + __change_sorc_trgt_aux__(self._kenzo, source._kenzo, target._kenzo)) def destructive_change_source_target_complex(self, source=None, target=None): r""" @@ -1788,7 +1788,7 @@ def destructive_change_source_target_complex(self, source=None, target=None): source = source or self.source_complex() target = target or self.target_complex() return KenzoChainComplexMorphism( - _dstr_change_sorc_trgt_aux(self._kenzo, source._kenzo, target._kenzo)) + __dstr_change_sorc_trgt_aux__(self._kenzo, source._kenzo, target._kenzo)) def build_morphism(source_complex, target_complex, degree, algorithm, strategy, orgn): @@ -1834,7 +1834,7 @@ def build_morphism(source_complex, target_complex, degree, algorithm, strategy, """ return KenzoChainComplexMorphism( - _build_mrph_aux(source_complex._kenzo, target_complex._kenzo, + __build_mrph_aux__(source_complex._kenzo, target_complex._kenzo, degree, algorithm, ":"+strategy, orgn)) @@ -1898,7 +1898,7 @@ def KChainComplexMorphism(morphism): target = KChainComplex(morphism.codomain()) matrix_list = morphism_dictmat(morphism) return KenzoChainComplexMorphism( - _kmorphismchaincomplex_aux1(matrix_list, source._kenzo, target._kenzo)) + __kmorphismchaincomplex_aux1__(matrix_list, source._kenzo, target._kenzo)) def s2k_listofmorphisms(l): @@ -1928,7 +1928,7 @@ def s2k_listofmorphisms(l): rslt = EclObject([]) for m in l: rslt = EclObject(KChainComplexMorphism(m)._kenzo).cons(rslt) - return _nreverse(rslt) + return __nreverse__(rslt) def BicomplexSpectralSequence(l): @@ -1963,4 +1963,4 @@ def BicomplexSpectralSequence(l): [ 0 0] [-4 0] """ - return KenzoSpectralSequence(_bicomplex_spectral_sequence(s2k_listofmorphisms(l))) + return KenzoSpectralSequence(__bicomplex_spectral_sequence__(s2k_listofmorphisms(l))) From 87718ea01cdb21c5152db43db2b17be846eb7719 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Thu, 19 Dec 2019 13:48:24 +0100 Subject: [PATCH 259/301] Treat case with trivial modules in SChainComplex --- src/sage/interfaces/kenzo.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 7c065025ab3..997357a3b1c 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -1089,12 +1089,28 @@ def SChainComplex(kchaincomplex, start=0, end=15): sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: SChainComplex(KChainComplex(sage_chcm)) == sage_chcm # optional - kenzo True + + :: + + sage: from sage.interfaces.kenzo import SChainComplex, Sphere + sage: S4 = Sphere(4) + sage: C = SChainComplex(S4) + sage: C + Chain complex with at most 3 nonzero terms over Integer Ring + sage: C._ascii_art_() + 0 <-- C_4 <-- 0 ... 0 <-- C_0 <-- 0 + sage: [C.homology(i) for i in range(6)] + [Z, 0, 0, 0, Z, 0] """ matrices = {} for i in range(start, end): dffr_i = __chcm_mat2__(kchaincomplex._kenzo, i) - if ((__nlig__(dffr_i).python() != 0) and (__ncol__(dffr_i).python() != 0)): + nlig = __nlig__(dffr_i).python() + ncol = __ncol__(dffr_i).python() + if ((nlig != 0) and (ncol != 0)): matrices[i] = k2s_matrix(__convertmatrice__(dffr_i)) + else: + matrices[i] = matrix(nlig, ncol) return ChainComplex(matrices, degree=-1) From 96c9050131672175f6b065218c743c48dc629940 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Wed, 15 Jan 2020 15:31:34 +0100 Subject: [PATCH 260/301] Document that kenzo simplicial set inherits from kenzo chain complex --- src/sage/interfaces/kenzo.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 997357a3b1c..ab4dc17cd74 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -411,11 +411,13 @@ def table(self, p, i1, i2, j1, j2): class KenzoChainComplex(KenzoObject): r""" - Wrapper to Kenzo chain complexes. + Wrapper to Kenzo chain complexes. Kenzo simplicial sets are a particular case + of Kenzo chain complexes. """ def homology(self, n): r""" - Return the ``n``'th homology group of the kenzo chain complex + Return the ``n``'th homology group of the chain complex associated to this + kenzo object. INPUT: @@ -472,7 +474,8 @@ def tensor_product(self, other): def basis(self, dim): r""" - Return the list of generators of the Kenzo chain complex ``self`` in dimension ``dim``. + Return the list of generators of the chain complex associated to the kenzo + object ``self`` in dimension ``dim``. INPUT: @@ -649,6 +652,9 @@ def orgn(self): class KenzoSimplicialSet(KenzoChainComplex): r""" Wrapper to Kenzo simplicial sets. + + In Kenzo, the homology of a simplicial set in computed from its associated + chain complex. Hence, this class inherits from `KenzoChainComplex`. """ def loop_space(self, n=1): From 6a6678b1f8828e6e04281faabf850182b1d1fc99 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Thu, 21 May 2020 16:48:58 +0200 Subject: [PATCH 261/301] Added warnings for simply-connectedness --- src/sage/interfaces/kenzo.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index ab4dc17cd74..dd3aeae9fee 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -744,6 +744,12 @@ def homotopy_group(self, n): sage: p = s2.cartesian_product(s2) # optional - kenzo sage: p.homotopy_group(3) # optional - kenzo Multiplicative Abelian group isomorphic to Z x Z + + + .. WARNING:: + + This method assumes that the underlying space is simply connected. + You might get wrong answers if it is not. """ if n not in ZZ or n < 2: raise ValueError("""homotopy groups can only be computed @@ -774,6 +780,12 @@ def em_spectral_sequence(self): 0 0 Z 0 0 0 0 0 0 0 0 0 0 0 0 + + + .. WARNING:: + + This method assumes that the underlying space is simply connected. + You might get wrong answers if it is not. """ if self.homology(1).invariants(): raise ValueError("""Eilenberg-Moore spectral sequence implemented @@ -790,7 +802,7 @@ def sw_spectral_sequence(self): EXAMPLES:: - sage: from sage.interfaces.kenzo import Sphere + sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: S3 = Sphere(3) # optional - kenzo sage: E = S3.sw_spectral_sequence() # optional - kenzo sage: T = E.table(0, 0, 4, 0, 4) # optional - kenzo @@ -801,6 +813,9 @@ def sw_spectral_sequence(self): 0 0 0 0 0 Z 0 0 Z 0 """ + if self.homology(1).invariants(): + raise ValueError("""Eilenberg-Moore spectral sequence implemented + only for 1-reduced simplicial sets""") return KenzoSpectralSequence(__serre_whitehead_spectral_sequence__(self._kenzo)) def serre_spectral_sequence(self): @@ -825,7 +840,15 @@ def serre_spectral_sequence(self): 0 0 0 0 0 0 Z 0 Z + + .. WARNING:: + + This method assumes that the underlying space is simply connected. + You might get wrong answers if it is not. """ + if self.homology(1).invariants(): + raise ValueError("""Eilenberg-Moore spectral sequence implemented + only for 1-reduced simplicial sets""") return KenzoSpectralSequence(__serre_spectral_sequence_product__(self._kenzo)) def wedge(self, other): From 4b04baa2d701d876d2361dda1484db05fadf3e87 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Thu, 21 May 2020 17:01:45 +0200 Subject: [PATCH 262/301] Kenzo version bump --- build/pkgs/kenzo/checksums.ini | 6 +++--- build/pkgs/kenzo/package-version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/pkgs/kenzo/checksums.ini b/build/pkgs/kenzo/checksums.ini index f4068e4588d..ab13adc9f9c 100644 --- a/build/pkgs/kenzo/checksums.ini +++ b/build/pkgs/kenzo/checksums.ini @@ -1,4 +1,4 @@ tarball=kenzo-1.1.8.tar.gz -sha1=365185b1c3373060bd7124937aad13c3df82b4b7 -md5=7cd942e5c725327624266a4cf094113c -cksum=2540973636 +sha1=f153b0c172b6c11851a5f248947b61b0bf5be527 +md5=98adc197c6f23716a6ddd115115ab4f6 +cksum=880933361 diff --git a/build/pkgs/kenzo/package-version.txt b/build/pkgs/kenzo/package-version.txt index 18efdb9ae67..512a1faa680 100644 --- a/build/pkgs/kenzo/package-version.txt +++ b/build/pkgs/kenzo/package-version.txt @@ -1 +1 @@ -1.1.8 +1.1.9 From 9c021a7e98cd76723a6826adb8cc0adb0f88e78a Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Fri, 22 May 2020 00:39:36 +0200 Subject: [PATCH 263/301] Fixed checksums.ini --- build/pkgs/kenzo/checksums.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/pkgs/kenzo/checksums.ini b/build/pkgs/kenzo/checksums.ini index ab13adc9f9c..22ef2a25127 100644 --- a/build/pkgs/kenzo/checksums.ini +++ b/build/pkgs/kenzo/checksums.ini @@ -1,4 +1,5 @@ -tarball=kenzo-1.1.8.tar.gz +tarball=kenzo-1.1.9.tar.gz +upstream_url=https://github.com/miguelmarco/kenzo/releases/download/1.1.9/kenzo-1.1.9.tar.gz sha1=f153b0c172b6c11851a5f248947b61b0bf5be527 md5=98adc197c6f23716a6ddd115115ab4f6 cksum=880933361 From 217e47c23a094e28573a615bd42fc29232d38f3c Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Wed, 27 May 2020 18:36:40 -0700 Subject: [PATCH 264/301] trac 27880: various fixes: - tag some more doctests as "optional - kenzo" - change Kenzo's spkg-install.in to use sdh_install instead of mv - change initialization of names in sage.interfaces.kenzo: don't raise an error if Kenzo is not installed, and clean up how the names are defined. --- build/pkgs/kenzo/spkg-install.in | 2 +- src/sage/interfaces/kenzo.py | 177 +++++++++++++++++-------------- 2 files changed, 99 insertions(+), 80 deletions(-) diff --git a/build/pkgs/kenzo/spkg-install.in b/build/pkgs/kenzo/spkg-install.in index cd64e0213c4..294a543d7e7 100644 --- a/build/pkgs/kenzo/spkg-install.in +++ b/build/pkgs/kenzo/spkg-install.in @@ -8,7 +8,7 @@ cd src ecl < compile.lisp echo "moving kenzo--all-systems.fasb to $SAGE_LOCAL/lib/ecl/kenzo.fas" -mv kenzo--all-systems.fasb $SAGE_LOCAL/lib/ecl/kenzo.fas +sdh_install -T kenzo--all-systems.fasb $SAGE_LOCAL/lib/ecl/kenzo.fas if [ $? -ne 0 ]; then diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index dd3aeae9fee..58222b49a7e 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -39,85 +39,104 @@ from sage.homology.simplicial_set import AbstractSimplex, SimplicialSet from sage.libs.ecl import EclObject, ecl_eval, EclListIterator -from sage.misc.package import installed_packages, PackageNotFoundError -if not 'kenzo' in installed_packages(): - raise PackageNotFoundError('kenzo') +def kenzo_installed(): + """ + True if Kenzo is installed. + + EXAMPLES:: -# Redirection of ECL and Maxima stdout to /dev/null -# This is also done in the Maxima library, but we -# also do it here for redundancy. -ecl_eval(r"""(defparameter *dev-null* (make-two-way-stream - (make-concatenated-stream) (make-broadcast-stream)))""") -ecl_eval("(setf original-standard-output *standard-output*)") -ecl_eval("(setf *standard-output* *dev-null*)") + sage: from sage.interfaces.kenzo import kenzo_installed + sage: kenzo_installed() # random + False + """ + # Redirection of ECL and Maxima stdout to /dev/null + # This is also done in the Maxima library, but we + # also do it here for redundancy. + ecl_eval(r"""(defparameter *dev-null* (make-two-way-stream + (make-concatenated-stream) (make-broadcast-stream)))""") + ecl_eval("(setf original-standard-output *standard-output*)") + ecl_eval("(setf *standard-output* *dev-null*)") -# Loading and initialization of Kenzo -# Note that it will load kenzo.fas file from $SAGE_LOCAL/lib/ecl/ -ecl_eval("(require :kenzo)") -ecl_eval("(in-package :cat)") -ecl_eval("(setf *HOMOLOGY-VERBOSE* nil)") + try: + ecl_eval("(require :kenzo)") + except RuntimeError: + return False + return True # defining the auxiliary functions as wrappers over the kenzo ones -__chcm_mat__ = EclObject("chcm-mat") -__homologie__ = EclObject("homologie") -__sphere__ = EclObject("sphere") -__crts_prdc__ = EclObject("crts-prdc") -__moore__ = EclObject("moore") -__k_z__ = EclObject("k-z") -__k_z2__ = EclObject("k-z2") -__k_zp__ = EclObject("k-zp") -__echcm__ = EclObject("echcm") -__loop_space__ = EclObject("loop-space") -__tnsr_prdc__ = EclObject("tnsr-prdc") -__classifying_space__ = EclObject("classifying-space") -__suspension__ = EclObject("suspension") -__homotopy_list__ = EclObject("homotopy-list") -__nth__ = EclObject("nth") -__nlig__ = EclObject("nlig") -__ncol__ = EclObject("ncol") -__array_dimensions__ = EclObject("array-dimensions") -__convertmatrice__ = EclObject("convertmatrice") -__make_array_to_lists__ = EclObject("make-array-to-lists") -__make_array_from_lists__ = EclObject("make-array-from-lists") -__chcm_mat2__ = EclObject("chcm-mat2") -__build_finite_ss2__ = EclObject("build-finite-ss2") -__gmsm__ = EclObject("gmsm") -__dgop__ = EclObject("dgop") -__dgop_int_ext__ = EclObject("dgop-int-ext") -__basis_aux1__ = EclObject("basis_aux1") -__orgn_aux1__ = EclObject("orgn_aux1") -__dffr_aux_1__ = EclObject("dffr_aux1") -__kabstractsimplex_aux1__ = EclObject("kabstractsimplex_aux1") -__kchaincomplex_aux1__ = EclObject("kchaincomplex_aux1") -__sfinitesimplicialset_aux1__ = EclObject("sfinitesimplicialset_aux1") -__spectral_sequence_group__ = EclObject("spectral-sequence-group") -__spectral_sequence_differential_matrix__ = EclObject("spectral-sequence-differential-matrix") -__eilenberg_moore_spectral_sequence__ = EclObject("eilenberg-moore-spectral-sequence") -__serre_whitehead_spectral_sequence__ = EclObject("serre-whitehead-spectral-sequence") -__serre_spectral_sequence_product__ = EclObject("serre-spectral-sequence-product") -__wedge__ = EclObject("wedge") -__join__ = EclObject("join") -__kmorphismchaincomplex_aux1__ = EclObject("kmorphismchaincomplex_aux1") -__bicomplex_spectral_sequence__ = EclObject("bicomplex-spectral-sequence") -__nreverse__ = EclObject("nreverse") -__smash_product__ = EclObject("smash-product") -__build_mrph_aux__ = EclObject("build-mrph-aux") -__zero_mrph__ = EclObject("zero-mrph") -__idnt_mrph__ = EclObject("idnt-mrph") -__dffr_aux__ = EclObject("dffr-aux") -__sorc_aux__ = EclObject("sorc-aux") -__trgt_aux__ = EclObject("trgt-aux") -__degr_aux__ = EclObject("degr-aux") -__evaluation_aux1__ = EclObject("evaluation-aux1") -__opps__ = EclObject("opps") -__cmps__ = EclObject("cmps") -__add__ = EclObject("add") -__sbtr__ = EclObject("sbtr") -__change_sorc_trgt_aux__ = EclObject("change-sorc-trgt-aux") -__dstr_change_sorc_trgt_aux__ = EclObject("dstr-change-sorc-trgt-aux") +kenzo_names = ['add', + 'array-dimensions', + 'basis_aux1', + 'basis_aux1', + 'bicomplex-spectral-sequence', + 'build-finite-ss2', + 'build-mrph-aux', + 'change-sorc-trgt-aux', + 'chcm-mat', + 'chcm-mat2', + 'classifying-space', + 'cmps', + 'convertmatrice', + 'crts-prdc', + 'degr-aux', + 'dffr-aux', + 'dffr_aux1', + 'dgop', + 'dgop-int-ext', + 'dstr-change-sorc-trgt-aux', + 'echcm', + 'eilenberg-moore-spectral-sequence', + 'evaluation-aux1', + 'gmsm', + 'homologie', + 'homotopy-list', + 'idnt-mrph', + 'join', + 'k-z', + 'k-z2', + 'k-zp', + 'kabstractsimplex_aux1', + 'kchaincomplex_aux1', + 'kmorphismchaincomplex_aux1', + 'loop-space', + 'make-array-from-lists', + 'make-array-to-lists', + 'moore', + 'ncol', + 'nlig', + 'nreverse', + 'nth', + 'opps', + 'orgn_aux1', + 'sbtr', + 'serre-spectral-sequence-product', + 'serre-whitehead-spectral-sequence', + 'sfinitesimplicialset_aux1', + 'smash-product', + 'sorc-aux', + 'spectral-sequence-differential-matrix', + 'spectral-sequence-group', + 'sphere', + 'suspension', + 'tnsr-prdc', + 'trgt-aux', + 'wedge', + 'zero-mrph'] + + +# Now initialize Kenzo. For each string s in kenzo_names, the +# following defines __s__, a wrapper for a Kenzo function. For +# example __sphere__ is defined as EclObject("sphere"). Hyphens +# are replaced with underscores to get valid Python identifiers. +if kenzo_installed(): + ecl_eval("(in-package :cat)") + ecl_eval("(setf *HOMOLOGY-VERBOSE* nil)") + for s in kenzo_names: + name = '__{}__'.format(s.replace('-', '_')) + exec('{} = EclObject("{}")'.format(name, s)) def Sphere(n): @@ -627,7 +646,7 @@ def differential(self, dim=None, comb=None): """ if dim is not None and comb is not None: cmbn_list = pairing(comb) - return KenzoObject(__dffr_aux_1__(self._kenzo, dim, cmbn_list)) + return KenzoObject(__dffr_aux1__(self._kenzo, dim, cmbn_list)) else: return KenzoChainComplexMorphism(__dffr_aux__(self._kenzo)) @@ -1121,14 +1140,14 @@ def SChainComplex(kchaincomplex, start=0, end=15): :: - sage: from sage.interfaces.kenzo import SChainComplex, Sphere - sage: S4 = Sphere(4) - sage: C = SChainComplex(S4) - sage: C + sage: from sage.interfaces.kenzo import SChainComplex, Sphere # optional - kenzo + sage: S4 = Sphere(4) # optional - kenzo + sage: C = SChainComplex(S4) # optional - kenzo + sage: C # optional - kenzo Chain complex with at most 3 nonzero terms over Integer Ring - sage: C._ascii_art_() + sage: C._ascii_art_() # optional - kenzo 0 <-- C_4 <-- 0 ... 0 <-- C_0 <-- 0 - sage: [C.homology(i) for i in range(6)] + sage: [C.homology(i) for i in range(6)] # optional - kenzo [Z, 0, 0, 0, Z, 0] """ matrices = {} From 0c4107c71fa6dc9ffbfd6cfcc6f222a4b4f4d972 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Thu, 28 May 2020 15:03:39 +1000 Subject: [PATCH 265/301] Using join and faster bool check in RAAG cohomology. --- src/sage/groups/raag.py | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/sage/groups/raag.py b/src/sage/groups/raag.py index a4f210377d5..c7fd9437dff 100644 --- a/src/sage/groups/raag.py +++ b/src/sage/groups/raag.py @@ -698,14 +698,9 @@ def _repr_term(self, m): sage: y*w + x*z -e0*e2 + e1*e3 """ - if len(m) == 0: + if not m: return '1' - term = '' - for i in m: - if len(term) != 0: - term += '*' - term += 'e' + str(i) - return term + return '*'.join('e' + str(i) for i in m) def _ascii_art_term(self, m): r""" @@ -722,7 +717,7 @@ def _ascii_art_term(self, m): sage: ascii_art(y*w + 2*x*z) -e0/\e2 + 2*e1/\e3 """ - if len(m) == 0: + if not m: return ascii_art('1') wedge = '/\\' return ascii_art(*['e' + str(i) for i in m], sep=wedge) @@ -742,7 +737,7 @@ def _unicode_art_term(self, m): sage: unicode_art(y*w + x*z) -e0∧e2 + e1∧e3 """ - if len(m) == 0: + if not m: return unicode_art('1') import unicodedata wedge = unicodedata.lookup('LOGICAL AND') @@ -759,17 +754,12 @@ def _latex_term(self, m): sage: A = groups.misc.RightAngledArtin(C4) sage: H = A.cohomology() sage: H._latex_term((0,1,3)) - ' e_{0} \\wedge e_{1} \\wedge e_{3}' + 'e_{0} \\wedge e_{1} \\wedge e_{3}' """ - if len(m) == 0: + if not m: return '1' - term = '' from sage.misc.latex import latex - for i in m: - if len(term) != 0: - term += ' \\wedge' - term += ' e_{{{}}}'.format(latex(i)) - return term + return " \\wedge ".join('e_{{{}}}'.format(latex(i)) for i in m) def gen(self, i): """ From 27b3e27ca0403ec920ae7c6d34b416f974f14506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20R=C3=BCth?= Date: Thu, 28 May 2020 13:57:21 +0200 Subject: [PATCH 266/301] Make docker versions compatible in GitLab CI there used to be a bug in docker:dind that we needed to work around by pinning its version. That's not necessary anymore. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 22a4075b91e..677f02e7ba0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,7 +37,7 @@ # If you want to provide your own runners, make sure to tag them as follows: # * "big" (60GB of disk space are available) to make build-from-clean pass. -image: docker:latest +image: docker:stable stages: - build @@ -77,7 +77,7 @@ before_script: # better isolation. If you expect many builds to run simultaneously on a host, # conflicting tags can cause issues with a mounted DOCKER_HOST. services: -- docker:18.05.0-ce-dind +- docker:stable-dind # Build Sage and its documentation. # The build starts from the build artifacts of DEFAULT_ARTIFACT_BASE which is From c4d2974d25adbe1aa21b2cf7471fd14a7a08dd54 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Thu, 28 May 2020 21:10:41 +0900 Subject: [PATCH 267/301] Fix a bug in _singularities --- src/sage/schemes/curves/projective_curve.py | 31 ++++++++++++--------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/sage/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py index 592bb68dc65..052218063d4 100644 --- a/src/sage/schemes/curves/projective_curve.py +++ b/src/sage/schemes/curves/projective_curve.py @@ -2307,6 +2307,10 @@ def _singularities(self): sage: C = Curve(y^2*z^7 - x^9 - x*z^8) sage: C._singularities [(Point (x, z), [Place (1/y, 1/y*z^5 + 4*y*z^4 + 1/y^2*z)])] + sage: D = Curve(x) + sage: D._singularities + [] + """ S = self.ambient_space().coordinate_ring() to_F = self._lift_to_function_field @@ -2317,19 +2321,20 @@ def _singularities(self): places = [] for i in range(self.ngens()): denom = self._coordinate_functions[i] - funcs = [] - for p in S._first_ngens(i) + sing.defining_polynomials(): - f = to_F(p)/denom**p.degree() - if not f.is_zero(): - funcs.append(f) - - if funcs: - f = funcs.pop() - pls = f.zeros() - for f in funcs: - pls = [p for p in pls if f.valuation(p) > 0] - - places.extend(pls) + if denom: + funcs = [] + for p in S._first_ngens(i) + sing.defining_polynomials(): + f = to_F(p)/denom**p.degree() + if not f.is_zero(): + funcs.append(f) + + if funcs: + f = funcs.pop() + pls = f.zeros() + for f in funcs: + pls = [p for p in pls if f.valuation(p) > 0] + + places.extend(pls) # compute closed points below the places lying on the singular locus, # and then collect places lying on each closed points From cd4c06307cce805351e7c75037e4bd7c2ebe61c3 Mon Sep 17 00:00:00 2001 From: "E. Madison Bray" Date: Thu, 28 May 2020 14:37:38 +0200 Subject: [PATCH 268/301] Trac #29749: correct package name for python37-urllib3 on Cygwin --- build/pkgs/cygwin.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/cygwin.txt b/build/pkgs/cygwin.txt index 51c562cb9b9..635afe8f9c9 100644 --- a/build/pkgs/cygwin.txt +++ b/build/pkgs/cygwin.txt @@ -13,7 +13,7 @@ binutils make m4 # a system python is needed for downloading the sage packages, https://trac.sagemath.org/ticket/29090 -python37-urllib python37 +python37-urllib3 python37 perl perl-ExtUtils-MakeMaker tar From 860e4dc9881966a36ef8808a0d1fae0c6b54f741 Mon Sep 17 00:00:00 2001 From: Release Manager Date: Thu, 28 May 2020 22:46:42 +0200 Subject: [PATCH 269/301] Updated SageMath version to 9.2.beta0 --- VERSION.txt | 2 +- build/pkgs/configure/checksums.ini | 6 +++--- build/pkgs/configure/package-version.txt | 2 +- src/bin/sage-version.sh | 6 +++--- src/sage/version.py | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index c8420b88690..64dc3bd1d87 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -SageMath version 9.1, Release Date: 2020-05-20 +SageMath version 9.2.beta0, Release Date: 2020-05-28 diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini index cf1e0d39191..4c52d48dc9f 100644 --- a/build/pkgs/configure/checksums.ini +++ b/build/pkgs/configure/checksums.ini @@ -1,4 +1,4 @@ tarball=configure-VERSION.tar.gz -sha1=7014628894a64d34dd630591909f38b6f093054c -md5=1b43ec2c96858d07c693c6a3c7a297db -cksum=3626783792 +sha1=1c21f6e635a7b999032dfb5e3bd569fca562cead +md5=b18610cb53599bfff817e4d1f26d09ef +cksum=763933029 diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt index f9b6cacd515..c881e48d22b 100644 --- a/build/pkgs/configure/package-version.txt +++ b/build/pkgs/configure/package-version.txt @@ -1 +1 @@ -765c5cb3e24dd134708eca97e4c52e0221cd94ba +982d86df0eb7517b9aed2a911e76ed5dd96fe1ac diff --git a/src/bin/sage-version.sh b/src/bin/sage-version.sh index 9980a861504..a22186797fc 100644 --- a/src/bin/sage-version.sh +++ b/src/bin/sage-version.sh @@ -1,5 +1,5 @@ # Sage version information for shell scripts # This file is auto-generated by the sage-update-version script, do not edit! -SAGE_VERSION='9.1' -SAGE_RELEASE_DATE='2020-05-20' -SAGE_VERSION_BANNER='SageMath version 9.1, Release Date: 2020-05-20' +SAGE_VERSION='9.2.beta0' +SAGE_RELEASE_DATE='2020-05-28' +SAGE_VERSION_BANNER='SageMath version 9.2.beta0, Release Date: 2020-05-28' diff --git a/src/sage/version.py b/src/sage/version.py index 01ffc37e358..42ea1e04034 100644 --- a/src/sage/version.py +++ b/src/sage/version.py @@ -1,5 +1,5 @@ # Sage version information for Python scripts # This file is auto-generated by the sage-update-version script, do not edit! -version = '9.1' -date = '2020-05-20' -banner = 'SageMath version 9.1, Release Date: 2020-05-20' +version = '9.2.beta0' +date = '2020-05-28' +banner = 'SageMath version 9.2.beta0, Release Date: 2020-05-28' From 1149ce49e157684a30a682e033148c1a706b6dbc Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Fri, 29 May 2020 11:28:50 +1000 Subject: [PATCH 270/301] Using Features for Kenzo. --- src/sage/features/kenzo.py | 53 ++++++++++++++++++++++++++++++++++++ src/sage/interfaces/kenzo.py | 28 ++----------------- 2 files changed, 55 insertions(+), 26 deletions(-) create mode 100644 src/sage/features/kenzo.py diff --git a/src/sage/features/kenzo.py b/src/sage/features/kenzo.py new file mode 100644 index 00000000000..c3c68ede71b --- /dev/null +++ b/src/sage/features/kenzo.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +r""" +Check for Kenzo +""" + +from sage.libs.ecl import ecl_eval +from . import Feature, FeatureTestResult + +class Kenzo(Feature): + r""" + A :class:`sage.features.Feature` describing the presence of ``Kenzo``. + + EXAMPLES:: + + sage: from sage.features.kenzo import Kenzo + sage: Kenzo().is_present() # optional - kenzo + FeatureTestResult('Kenzo', True) + """ + def __init__(self): + r""" + TESTS:: + + sage: from sage.features.kenzo import Kenzo + sage: isinstance(Kenzo(), Kenzo) + True + """ + Feature.__init__(self, name="Kenzo", spkg="kenzo", + url="https://github.com/miguelmarco/kenzo/") + + def _is_present(self): + r""" + Check whether Kenzo is installed and works. + + EXAMPLES:: + + sage: from sage.features.kenzo import Kenzo + sage: Kenzo()._is_present() # optional - kenzo + FeatureTestResult('Kenzo', True) + """ + # Redirection of ECL and Maxima stdout to /dev/null + # This is also done in the Maxima library, but we + # also do it here for redundancy. + ecl_eval(r"""(defparameter *dev-null* (make-two-way-stream + (make-concatenated-stream) (make-broadcast-stream)))""") + ecl_eval("(setf original-standard-output *standard-output*)") + ecl_eval("(setf *standard-output* *dev-null*)") + + try: + ecl_eval("(require :kenzo)") + except RuntimeError: + return FeatureTestResult(self, False, reason="Unable to make ECL require kenzo") + return FeatureTestResult(self, True) + diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index 58222b49a7e..c7463946a61 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -39,31 +39,7 @@ from sage.homology.simplicial_set import AbstractSimplex, SimplicialSet from sage.libs.ecl import EclObject, ecl_eval, EclListIterator - - -def kenzo_installed(): - """ - True if Kenzo is installed. - - EXAMPLES:: - - sage: from sage.interfaces.kenzo import kenzo_installed - sage: kenzo_installed() # random - False - """ - # Redirection of ECL and Maxima stdout to /dev/null - # This is also done in the Maxima library, but we - # also do it here for redundancy. - ecl_eval(r"""(defparameter *dev-null* (make-two-way-stream - (make-concatenated-stream) (make-broadcast-stream)))""") - ecl_eval("(setf original-standard-output *standard-output*)") - ecl_eval("(setf *standard-output* *dev-null*)") - - try: - ecl_eval("(require :kenzo)") - except RuntimeError: - return False - return True +from sage.features.kenzo import Kenzo # defining the auxiliary functions as wrappers over the kenzo ones @@ -131,7 +107,7 @@ def kenzo_installed(): # following defines __s__, a wrapper for a Kenzo function. For # example __sphere__ is defined as EclObject("sphere"). Hyphens # are replaced with underscores to get valid Python identifiers. -if kenzo_installed(): +if Kenzo().is_present(): ecl_eval("(in-package :cat)") ecl_eval("(setf *HOMOLOGY-VERBOSE* nil)") for s in kenzo_names: From 57bc9f6d68da9c4e9a596d942562e03f4d76dc78 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Fri, 29 May 2020 11:39:20 +1000 Subject: [PATCH 271/301] Attempt to fix pdf build, plus other misc fixes. --- src/doc/en/reference/references/index.rst | 2 +- src/sage/algebras/catalog.py | 2 +- src/sage/combinat/diagram_algebras.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 17fbacb9f00..e2d8fda8a6a 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -2863,7 +2863,7 @@ REFERENCES: .. [ILZ2018] \K. Iohara, G. Lehrer, and R. Zhang. *Schur-Weyl duality for certain infinite dimensional* - `U_q(\mathfrak{sl}_2`-*modules*. + `U_q(\mathfrak{sl}_2)`-*modules*. Preprint, :arxiv:`1811.01325` (2018). .. [IR1990] \K. Ireland and M. Rosen, *A Classical Introduction to diff --git a/src/sage/algebras/catalog.py b/src/sage/algebras/catalog.py index 261d7667fb3..76a59c355cc 100644 --- a/src/sage/algebras/catalog.py +++ b/src/sage/algebras/catalog.py @@ -12,8 +12,8 @@ - :class:`algebras.ArikiKoike ` - :class:`algebras.AskeyWilson ` -- :class:`algebras.Brauer ` - :class:`algebras.Blob ` +- :class:`algebras.Brauer ` - :class:`algebras.Clifford ` - :class:`algebras.ClusterAlgebra ` - :class:`algebras.Descent ` diff --git a/src/sage/combinat/diagram_algebras.py b/src/sage/combinat/diagram_algebras.py index fae2a9a1040..a8a52ff6743 100644 --- a/src/sage/combinat/diagram_algebras.py +++ b/src/sage/combinat/diagram_algebras.py @@ -3747,7 +3747,7 @@ def TL_diagram_ascii_art(diagram, use_unicode=False, blobs=[]): INPUT: - ``diagram`` -- a list of pairs of matchings of the set - `\{-1, \dotsc, -n, 1, \dotsc, n\}` + `\{-1, \ldots, -n, 1, \ldots, n\}` - ``use_unicode`` -- (default: ``False``): whether or not to use unicode art instead of ascii art - ``blobs`` -- (optional) a list of matchings with blobs on them From b0553e58a3e717d630a7bd89d438318a7c5af639 Mon Sep 17 00:00:00 2001 From: Bruce Westbury Date: Fri, 29 May 2020 12:46:27 +0100 Subject: [PATCH 272/301] A few little changes --- src/sage/combinat/gelfand_tsetlin_patterns.py | 50 +++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/src/sage/combinat/gelfand_tsetlin_patterns.py b/src/sage/combinat/gelfand_tsetlin_patterns.py index ae1de2faa15..d1a3070958a 100644 --- a/src/sage/combinat/gelfand_tsetlin_patterns.py +++ b/src/sage/combinat/gelfand_tsetlin_patterns.py @@ -511,9 +511,12 @@ def Tokuyama_coefficient(self, name='t'): def bender_knuth_involution(self,i): r""" - Return the image of ''self'' under the 'i'-th Bender-Knuth involution. + Return the image of ``self`` under the `i`-th Bender-Knuth involution. - If the triangle 'G' has size 'n' then this is defined for '0 < i < n'. + If the triangle ``self`` has size `n` then this is defined for `0 < i < n`. + + The entries of ``self`` can take values in any ordered ring. Usually, + this will be the integers but can also be the rationals or the real numbers. This implements the construction of the Bender-Knuth involution using toggling due to Berenstein-Kirillov. @@ -526,6 +529,10 @@ def bender_knuth_involution(self,i): sage: G.bender_knuth_involution(2) [[5, 3, 2, 1, 0], [4, 3, 2, 0], [4, 2, 1], [4, 1], [3]] + sage: G = GelfandTsetlinPattern([[3,2,0],[2.2,0],[2]]) + sage: G.bender_knuth_involution(2) + [[3, 2, 0], [2.80000000000000, 2], [2]] + TESTS:: sage: all(all( G.bender_knuth_involution(i).to_tableau() == G.to_tableau().bender_knuth_involution(i) \ @@ -543,33 +550,34 @@ def bender_knuth_involution(self,i): ValueError: must have 0 < 3 < 3 """ - from copy import copy + #from copy import copy n = len(self) def toggle(i,j): - """ - Return the toggle of entry 'G[i][j]' in a Gelfand-Tsetlin pattern, 'G'. - """ - if i == n-1: - return self[n-2][0]+self[n-2][1]-self[n-1][0] - - if j == 0: - left = self[i-1][0] - else: - left = min(self[i-1][j], self[i+1][j-1]) - if j == n-i-1: - right = self[i-1][j+1] - else: - right = max(self[i-1][j+1], self[i+1][j]) + """ + Return the toggle of entry 'G[i][j]' in a Gelfand-Tsetlin pattern, 'G'. + """ + if i == n-1: + return self[n-2][0]+self[n-2][1]-self[n-1][0] + + if j == 0: + left = self[i-1][0] + else: + left = min(self[i-1][j], self[i+1][j-1]) + if j == n-i-1: + right = self[i-1][j+1] + else: + right = max(self[i-1][j+1], self[i+1][j]) - return left + right - self[i][j] + return left + right - self[i][j] if not 0 < i < n: raise ValueError(f"must have 0 < {i} < {n}") r = n-i - result = copy(self) - result[r] = [toggle(r,s) for s in range(i)] - return result + P = self.parent() + data = [list(row) for row in self] + data[r] = [toggle(r,s) for s in range(i)] + return P.element_class(P, data) class GelfandTsetlinPatterns(UniqueRepresentation, Parent): """ From fd2eac0367395d87447b6308f2724d6565c6ef2d Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Fri, 29 May 2020 21:33:33 +0200 Subject: [PATCH 273/301] 29759: replace string_types by str --- src/sage/interfaces/macaulay2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/interfaces/macaulay2.py b/src/sage/interfaces/macaulay2.py index f6f7df8dc7f..a2e93ebb688 100644 --- a/src/sage/interfaces/macaulay2.py +++ b/src/sage/interfaces/macaulay2.py @@ -857,7 +857,7 @@ def _macaulay2_input_ring(self, base_ring, vars, order='GRevLex'): sage: macaulay2._macaulay2_input_ring(R.base_ring(), R.gens(), 'Lex') # optional - macaulay2 'sage...[symbol x, MonomialSize=>16, MonomialOrder=>Lex]' """ - if not isinstance(base_ring, string_types): + if not isinstance(base_ring, str): base_ring = self(base_ring).name() varstr = str(vars)[1:-1].rstrip(',') From f92fd0807a470bdc0a4cbdcd73aa284660b3533e Mon Sep 17 00:00:00 2001 From: "John H. Palmieri" Date: Fri, 29 May 2020 12:51:13 -0700 Subject: [PATCH 274/301] trac 27880: fix spkg-install.in problems, explicitly require :kenzo --- build/pkgs/kenzo/spkg-install.in | 12 +++++++----- src/sage/interfaces/kenzo.py | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build/pkgs/kenzo/spkg-install.in b/build/pkgs/kenzo/spkg-install.in index 294a543d7e7..3c8e5946547 100644 --- a/build/pkgs/kenzo/spkg-install.in +++ b/build/pkgs/kenzo/spkg-install.in @@ -1,15 +1,17 @@ cd src - - # create a short lisp file with the instructions to load kenzo from ecl # This will compile the lisp files since it is the first time they are loaded ecl < compile.lisp -echo "moving kenzo--all-systems.fasb to $SAGE_LOCAL/lib/ecl/kenzo.fas" -sdh_install -T kenzo--all-systems.fasb $SAGE_LOCAL/lib/ecl/kenzo.fas - +# Install Kenzo into ECL's library directory (installation procedure +# copied from Maxima's spkg-install.in file): +ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"` +echo +echo "Now installing Kenzo as '$ECLLIB/kenzo.fas'..." +cp -f kenzo--all-systems.fasb "$ECLLIB/kenzo.fas" \ + || sdh_die "Failed to install 'kenzo--all-systems.fasb' as '$ECLLIB/kenzo.fas'." if [ $? -ne 0 ]; then echo >&2 "Error installing Kenzo." diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index c7463946a61..43142421140 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -108,6 +108,7 @@ # example __sphere__ is defined as EclObject("sphere"). Hyphens # are replaced with underscores to get valid Python identifiers. if Kenzo().is_present(): + ecl_eval("(require :kenzo)") ecl_eval("(in-package :cat)") ecl_eval("(setf *HOMOLOGY-VERBOSE* nil)") for s in kenzo_names: From 225f730a309728b404d61b65efbd151911fe1c67 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 29 May 2020 14:44:44 -0700 Subject: [PATCH 275/301] .github/workflows/tox-gcc_spkg.yml: Remove python2 --- .github/workflows/tox-gcc_spkg.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tox-gcc_spkg.yml b/.github/workflows/tox-gcc_spkg.yml index cff253c99a3..7b66b586314 100644 --- a/.github/workflows/tox-gcc_spkg.yml +++ b/.github/workflows/tox-gcc_spkg.yml @@ -36,7 +36,7 @@ jobs: fail-fast: false matrix: tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-eoan, ubuntu-focal, debian-jessie, debian-stretch, debian-buster, debian-bullseye, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, centos-7, centos-8, archlinux-latest, slackware-14.2, conda-forge, ubuntu-bionic-i386, ubuntu-eoan-i386, debian-buster-i386, centos-7-i386] - tox_packages_factor: [minimal-gcc_spkg, standard-gcc_spkg, standard-python2-gcc_spkg] + tox_packages_factor: [minimal-gcc_spkg, standard-gcc_spkg] env: TOX_ENV: docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} @@ -101,7 +101,7 @@ jobs: fail-fast: false matrix: tox_system_factor: [conda-forge-ubuntu] - tox_packages_factor: [minimal-gcc_spkg, standard-gcc_spkg, standard-python2-gcc_spkg] + tox_packages_factor: [minimal-gcc_spkg, standard-gcc_spkg, standard] env: TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} From cc4fd9c1b4277eae66345802e138067fdc834e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 30 May 2020 13:27:51 +0200 Subject: [PATCH 276/301] fix one doc glitch in spanning tree --- src/sage/graphs/spanning_tree.pyx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sage/graphs/spanning_tree.pyx b/src/sage/graphs/spanning_tree.pyx index 1572f35bac4..ec05b0a4040 100644 --- a/src/sage/graphs/spanning_tree.pyx +++ b/src/sage/graphs/spanning_tree.pyx @@ -286,6 +286,7 @@ def kruskal_iterator(G, wfunction=None, bint check=False): weighted=G.weighted(), weight_function=wfunction) + def kruskal_iterator_from_edges(edges, union_find, weighted=False, weight_function=None): """ Return an iterator implementation of Kruskal algorithm on list of edges. @@ -342,6 +343,7 @@ def kruskal_iterator_from_edges(edges, union_find, weighted=False, weight_functi if union_find.number_of_subsets() == 1: return + def filter_kruskal(G, threshold=10000, weight_function=None, bint check=False): """ Minimum spanning tree using Filter Kruskal algorithm. @@ -418,6 +420,7 @@ def filter_kruskal(G, threshold=10000, weight_function=None, bint check=False): """ return list(filter_kruskal_iterator(G, threshold=threshold, weight_function=weight_function, check=check)) + def filter_kruskal_iterator(G, threshold=10000, weight_function=None, bint check=False): r""" Return an iterator implementation of Filter Kruskal's algorithm. @@ -436,7 +439,7 @@ def filter_kruskal_iterator(G, threshold=10000, weight_function=None, bint check EXAMPLES: The edges of a minimum spanning tree of ``G``, if one exists, otherwise - returns the empty list. + returns the empty list. :: sage: from sage.graphs.spanning_tree import filter_kruskal_iterator sage: G = Graph({1:{2:28, 6:10}, 2:{3:16, 7:14}, 3:{4:12}, 4:{5:22, 7:18}, 5:{6:25, 7:24}}) @@ -791,6 +794,7 @@ cpdef boruvka(G, wfunction=None, bint check=False, bint by_weight=True): return T + @cython.binding(True) def random_spanning_tree(self, output_as_graph=False): r""" From 620d6ada8559bb06e5bfaa9b98d40f1604cd474d Mon Sep 17 00:00:00 2001 From: Bruce Westbury Date: Sat, 30 May 2020 12:43:29 +0100 Subject: [PATCH 277/301] Changed line break to ellipsis --- src/sage/combinat/gelfand_tsetlin_patterns.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/gelfand_tsetlin_patterns.py b/src/sage/combinat/gelfand_tsetlin_patterns.py index d1a3070958a..a4da99c8eed 100644 --- a/src/sage/combinat/gelfand_tsetlin_patterns.py +++ b/src/sage/combinat/gelfand_tsetlin_patterns.py @@ -535,8 +535,8 @@ def bender_knuth_involution(self,i): TESTS:: - sage: all(all( G.bender_knuth_involution(i).to_tableau() == G.to_tableau().bender_knuth_involution(i) \ - for i in range(1,len(G)) ) for G in GelfandTsetlinPatterns(top_row=[3,3,3,0,0])) + sage: all(all( G.bender_knuth_involution(i).to_tableau() == G.to_tableau().bender_knuth_involution(i) + ....: for i in range(1,len(G)) ) for G in GelfandTsetlinPatterns(top_row=[3,3,3,0,0])) True sage: G = GelfandTsetlinPattern([[2,1,0],[1,0],[0]]) From 80d2fbe5a3ab4efb9e645ce25b9a66770a681b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 30 May 2020 15:13:50 +0200 Subject: [PATCH 278/301] some details in doc of Hasse diagrams --- src/sage/combinat/posets/hasse_diagram.py | 70 ++++++++++++----------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/src/sage/combinat/posets/hasse_diagram.py b/src/sage/combinat/posets/hasse_diagram.py index de9c28a785a..082bffcbd3b 100644 --- a/src/sage/combinat/posets/hasse_diagram.py +++ b/src/sage/combinat/posets/hasse_diagram.py @@ -99,7 +99,7 @@ def linear_extension(self): r""" Return a linear extension - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[1,2],1:[3],2:[3],3:[]}) @@ -113,7 +113,7 @@ def linear_extensions(self): r""" Return an iterator over all linear extensions. - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[1,2],1:[3],2:[3],3:[]}) @@ -144,7 +144,7 @@ def greedy_linear_extensions_iterator(self): [0, 1, 2, 3, 4] [0, 2, 3, 1, 4] - TESTS: + TESTS:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: list(HasseDiagram({}).greedy_linear_extensions_iterator()) @@ -244,7 +244,7 @@ def is_linear_extension(self, lin_ext=None): r""" Test if an ordering is a linear extension. - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[1,2],1:[3],2:[3],3:[]}) @@ -268,7 +268,7 @@ def cover_relations_iterator(self): r""" Iterate over cover relations. - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[2,3], 1:[3,4], 2:[5], 3:[5], 4:[5]}) @@ -282,7 +282,7 @@ def cover_relations(self): r""" Return the list of cover relations. - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[2,3], 1:[3,4], 2:[5], 3:[5], 4:[5]}) @@ -293,15 +293,15 @@ def cover_relations(self): def is_lequal(self, i, j): """ - Return True if i is less than or equal to j in the poset, and - False otherwise. + Return ``True`` if i is less than or equal to j in the poset, and + ``False`` otherwise. .. note:: If the :meth:`lequal_matrix` has been computed, then this method is redefined to use the cached data (see :meth:`_alternate_is_lequal`). - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[2], 1:[2], 2:[3], 3:[4], 4:[]}) @@ -321,10 +321,10 @@ def is_lequal(self, i, j): def is_less_than(self, x, y): r""" - Return True if ``x`` is less than or equal to ``y`` in the - poset, and False otherwise. + Return ``True`` if ``x`` is less than or equal to ``y`` in the + poset, and ``False`` otherwise. - TESTS:: + EXAMPLES:: sage: from sage.combinat.posets.hasse_diagram import HasseDiagram sage: H = HasseDiagram({0:[2], 1:[2], 2:[3], 3:[4], 4:[]}) @@ -342,8 +342,7 @@ def is_less_than(self, x, y): """ if x == y: return False - else: - return self.is_lequal(x, y) + return self.is_lequal(x, y) def is_gequal(self, x, y): r""" @@ -443,7 +442,7 @@ def bottom(self): def has_bottom(self): """ - Return True if the poset has a unique minimal element. + Return ``True`` if the poset has a unique minimal element. EXAMPLES:: @@ -492,8 +491,8 @@ def has_top(self): def is_bounded(self): """ - Return True if the poset contains a unique maximal element and a - unique minimal element, and False otherwise. + Return ``True`` if the poset contains a unique maximal element and a + unique minimal element, and ``False`` otherwise. EXAMPLES:: @@ -508,7 +507,7 @@ def is_bounded(self): def is_chain(self): """ - Return True if the poset is totally ordered, and False otherwise. + Return ``True`` if the poset is totally ordered, and ``False`` otherwise. EXAMPLES:: @@ -556,6 +555,10 @@ def dual(self): """ Return a poset that is dual to the given poset. + This means that it has the same elements but opposite order. + The elements are renumbered to ensure that ``range(n)`` + is a linear extension. + EXAMPLES:: sage: P = posets.IntegerPartitions(4) @@ -631,8 +634,9 @@ def _alternate_interval(self, x, y): def interval(self, x, y): r""" Return a list of the elements `z` of ``self`` such that - `x \leq z \leq y`. The order is that induced by the - ordering in ``self.linear_extension``. + `x \leq z \leq y`. + + The order is that induced by the ordering in ``self.linear_extension``. INPUT: @@ -657,9 +661,9 @@ def interval(self, x, y): def open_interval(self, x, y): """ - Return a list of the elements `z` of ``self`` such that - `x < z < y`. The order is that induced by the ordering in - ``self.linear_extension``. + Return a list of the elements `z` of ``self`` such that `x < z < y`. + + The order is that induced by the ordering in ``self.linear_extension``. EXAMPLES:: @@ -828,7 +832,7 @@ def rank(self, element=None): def is_ranked(self): r""" - Return True if the poset is ranked, and False otherwise. + Return ``True`` if the poset is ranked, and ``False`` otherwise. A poset is *ranked* if it admits a rank function. For more information about the rank function, see :meth:`~rank_function` @@ -847,7 +851,7 @@ def is_ranked(self): def covers(self, x, y): """ - Return True if y covers x and False otherwise. + Return ``True`` if y covers x and ``False`` otherwise. EXAMPLES:: @@ -1428,8 +1432,10 @@ def _meet(self): def meet_matrix(self): r""" - Return the matrix of meets of ``self``. The ``(x,y)``-entry of - this matrix is the meet of ``x`` and ``y`` in ``self``. + Return the matrix of meets of ``self``. + + The ``(x,y)``-entry of this matrix is the meet of ``x`` and + ``y`` in ``self``. This algorithm is modelled after the algorithm of Freese-Jezek-Nation (p217). It can also be found on page 140 of [Gec81]_. @@ -2100,7 +2106,7 @@ def are_incomparable(self, i, j): INPUT: - - ``i``, ``j`` -- vertices of this Hasse diagram + - ``i``, ``j`` -- vertices of this Hasse diagram EXAMPLES:: @@ -2140,7 +2146,7 @@ def antichains(self, element_class=list): INPUT: - - ``element_class`` -- (default:list) an iterable type + - ``element_class`` -- (default:list) an iterable type EXAMPLES:: @@ -2160,8 +2166,6 @@ def antichains(self, element_class=list): sage: TestSuite(A).run() - TESTS:: - sage: A = Poset()._hasse_diagram.antichains() sage: list(A) [[]] @@ -2209,7 +2213,7 @@ def chains(self, element_class=list, exclude=None): [[], [0], [0, 1], [0, 2], [1], [2]] The ``element_class`` keyword determines how the chains are - being returned: + being returned:: sage: P = Poset({1: [2, 3], 2: [4]}) sage: list(P._hasse_diagram.chains(element_class=tuple)) @@ -2217,7 +2221,7 @@ def chains(self, element_class=list, exclude=None): sage: list(P._hasse_diagram.chains()) [[], [0], [0, 1], [0, 1, 2], [0, 2], [0, 3], [1], [1, 2], [2], [3]] - (Note that taking the Hasse diagram has renamed the vertices.) + (Note that taking the Hasse diagram has renamed the vertices.) :: sage: list(P._hasse_diagram.chains(element_class=tuple, exclude=[0])) [(), (1,), (1, 2), (2,), (3,)] From 144ecaba04aa65878ebbc6261f636cd550a0f9a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 30 May 2020 20:53:02 +0200 Subject: [PATCH 279/301] get rid of _cmp_ for polynomials --- .../rings/polynomial/multi_polynomial_libsingular.pyx | 9 ++++----- src/sage/rings/polynomial/pbori.pyx | 6 +++--- src/sage/rings/polynomial/plural.pyx | 10 +++++----- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx index ab1879650e4..779ad041d7f 100644 --- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx +++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx @@ -2165,10 +2165,9 @@ cdef class MPolynomial_libsingular(MPolynomial): """ return self._hash_c() - cpdef int _cmp_(left, right) except -2: + cpdef _richcmp_(left, right, int op): """ - Compare left and right and return -1, 0, and 1 for <,==, and > - respectively. + Compare left and right. EXAMPLES:: @@ -2218,11 +2217,11 @@ cdef class MPolynomial_libsingular(MPolynomial): True """ if left is right: - return 0 + return rich_to_bool(op, 0) cdef poly *p = (left)._poly cdef poly *q = (right)._poly cdef ring *r = (left)._parent_ring - return singular_polynomial_cmp(p, q, r) + return rich_to_bool(op, singular_polynomial_cmp(p, q, r)) cpdef _add_(left, right): """ diff --git a/src/sage/rings/polynomial/pbori.pyx b/src/sage/rings/polynomial/pbori.pyx index 0ea74a744ce..e4d6fb4a415 100644 --- a/src/sage/rings/polynomial/pbori.pyx +++ b/src/sage/rings/polynomial/pbori.pyx @@ -207,7 +207,7 @@ from sage.structure.parent cimport Parent from sage.structure.sequence import Sequence from sage.structure.element import coerce_binop from sage.structure.unique_representation import UniqueRepresentation -from sage.structure.richcmp cimport richcmp, richcmp_not_equal +from sage.structure.richcmp cimport richcmp, richcmp_not_equal, rich_to_bool from sage.categories.action cimport Action @@ -2241,7 +2241,7 @@ cdef class BooleanMonomial(MonoidElement): gens = self._parent.gens() return self._parent, (tuple(gens.index(x) for x in self.variables()),) - cpdef int _cmp_(left, right) except -2: + cpdef _richcmp_(left, right, int op): """ Compare BooleanMonomial objects. @@ -2267,7 +2267,7 @@ cdef class BooleanMonomial(MonoidElement): """ cdef int res res = left._pbmonom.compare((right)._pbmonom) - return res + return rich_to_bool(op, res) def _repr_(self): """ diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx index 42001d4fcfa..99cf3a2963f 100644 --- a/src/sage/rings/polynomial/plural.pyx +++ b/src/sage/rings/polynomial/plural.pyx @@ -133,6 +133,7 @@ from sage.rings.polynomial.polydict import ETuple from sage.rings.ring import check_default_category from sage.structure.element cimport CommutativeRingElement, Element, ModuleElement, RingElement from sage.structure.factory import UniqueFactory +from sage.structure.richcmp cimport rich_to_bool from sage.structure.parent cimport Parent from sage.structure.parent_gens cimport ParentWithGens from sage.rings.polynomial.term_order import TermOrder @@ -1469,10 +1470,9 @@ cdef class NCPolynomial_plural(RingElement): """ return self._hash_c() - cpdef int _cmp_(left, right) except -2: + cpdef _richcmp_(left, right, int op): """ - Compare left and right and return -1, 0, and 1 for <,==, and > - respectively. + Compare left and right. EXAMPLES:: @@ -1515,11 +1515,11 @@ cdef class NCPolynomial_plural(RingElement): True """ if left is right: - return 0 + return rich_to_bool(op, 0) cdef poly *p = (left)._poly cdef poly *q = (right)._poly cdef ring *r = (left._parent)._ring - return singular_polynomial_cmp(p, q, r) + return rich_to_bool(op, singular_polynomial_cmp(p, q, r)) cpdef _add_(left, right): """ From c75f16cd575c5be1e82b2f7a80ef0bae1e20595b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 31 May 2020 11:47:56 +0200 Subject: [PATCH 280/301] remove very old deprecated stuff in fast_callable and fast_eval --- src/sage/ext/fast_callable.pyx | 7 +------ src/sage/ext/fast_eval.pyx | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/sage/ext/fast_callable.pyx b/src/sage/ext/fast_callable.pyx index 94e2928525b..86033d983be 100644 --- a/src/sage/ext/fast_callable.pyx +++ b/src/sage/ext/fast_callable.pyx @@ -311,7 +311,6 @@ from sage.structure.element cimport parent def fast_callable(x, domain=None, vars=None, - _autocompute_vars_for_backward_compatibility_with_deprecated_fast_float_functionality=False, expect_one_var=False): r""" Given an expression x, compile it into a form that can be quickly @@ -481,11 +480,7 @@ def fast_callable(x, domain=None, vars=None, if len(vars) == 0: vars = ['EXTRA_VAR0'] else: - if _autocompute_vars_for_backward_compatibility_with_deprecated_fast_float_functionality: - from sage.misc.superseded import deprecation - deprecation(5413, "Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...)") - else: - raise ValueError("List of variables must be specified for symbolic expressions") + raise ValueError("List of variables must be specified for symbolic expressions") from sage.rings.polynomial.polynomial_ring import is_PolynomialRing from sage.rings.polynomial.multi_polynomial_ring import is_MPolynomialRing if is_PolynomialRing(x.parent()) or is_MPolynomialRing(x.parent()): diff --git a/src/sage/ext/fast_eval.pyx b/src/sage/ext/fast_eval.pyx index 0743f3052ca..1d2c1bf4470 100644 --- a/src/sage/ext/fast_eval.pyx +++ b/src/sage/ext/fast_eval.pyx @@ -1399,7 +1399,8 @@ def fast_float(f, *vars, old=None, expect_one_var=False): if old: return f._fast_float_(*vars) else: - return fast_callable(f, vars=vars, domain=float, _autocompute_vars_for_backward_compatibility_with_deprecated_fast_float_functionality=True, expect_one_var=expect_one_var) + return fast_callable(f, vars=vars, domain=float, + expect_one_var=expect_one_var) except AttributeError: pass From c2e4da8be64e61372d4bb2f552a7ae678cc5d433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 31 May 2020 13:08:07 +0200 Subject: [PATCH 281/301] pyflakes cleanup for sage/misc --- src/sage/misc/remote_file.py | 1 - src/sage/misc/sage_timeit.py | 2 +- src/sage/misc/sageinspect.py | 1 - src/sage/misc/sphinxify.py | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/sage/misc/remote_file.py b/src/sage/misc/remote_file.py index 5d99a2e8670..297c5376e55 100644 --- a/src/sage/misc/remote_file.py +++ b/src/sage/misc/remote_file.py @@ -3,7 +3,6 @@ from __future__ import absolute_import import os -import sys from urllib.request import Request, urlopen diff --git a/src/sage/misc/sage_timeit.py b/src/sage/misc/sage_timeit.py index 13035cc5134..f82300651dc 100644 --- a/src/sage/misc/sage_timeit.py +++ b/src/sage/misc/sage_timeit.py @@ -201,7 +201,7 @@ def sage_timeit(stmt, globals_dict=None, preparse=None, number=0, repeat=3, prec sage: gc.isenabled() True """ - import time, math + import math import timeit as timeit_ import sage.repl.interpreter as interpreter diff --git a/src/sage/misc/sageinspect.py b/src/sage/misc/sageinspect.py index 6251ec5742c..635415dd5f5 100644 --- a/src/sage/misc/sageinspect.py +++ b/src/sage/misc/sageinspect.py @@ -118,7 +118,6 @@ def foo(unsigned int x=1, a=')"', b={not (2+1==3):'bar'}, *args, **kwds): return import inspect import functools import os -import sys import tokenize import re EMBEDDED_MODE = False diff --git a/src/sage/misc/sphinxify.py b/src/sage/misc/sphinxify.py index ab0de0a7b66..4077044624d 100644 --- a/src/sage/misc/sphinxify.py +++ b/src/sage/misc/sphinxify.py @@ -158,7 +158,6 @@ def sphinxify(docstring, format='html'): if __name__ == '__main__': - import sys if len(sys.argv) == 2: print(sphinxify(sys.argv[1])) else: From 762cacef83a0c8328d53bda9359ab2fc59e75a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 31 May 2020 13:14:17 +0200 Subject: [PATCH 282/301] one more pyflakes fix --- src/sage/doctest/control.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py index 8073a2373fe..cd771ae279a 100644 --- a/src/sage/doctest/control.py +++ b/src/sage/doctest/control.py @@ -7,8 +7,7 @@ - David Roe (2012-03-27) -- initial version, based on Robert Bradshaw's code. """ - -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2012 David Roe # Robert Bradshaw # William Stein @@ -18,11 +17,17 @@ # it under the terms of the GNU General Public License 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 __future__ import absolute_import, division, print_function -import random, os, sys, time, json, re, types +import random +import os +import sys +import time +import json +import re +import types import sage.misc.flatten from sage.structure.sage_object import SageObject from sage.env import DOT_SAGE, SAGE_LIB, SAGE_SRC, SAGE_LOCAL, SAGE_EXTCODE @@ -626,7 +631,6 @@ def test_safe_directory(self, dir=None): ... RuntimeError: refusing to run doctests... """ - import os import stat is_world_writeable = bool(os.stat(dir or os.getcwd()).st_mode & stat.S_IWOTH) if is_world_writeable: From 47937760b86c79b3b58a38ab0827ca8d5587b4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 31 May 2020 20:02:59 +0200 Subject: [PATCH 283/301] tiny details --- src/sage/doctest/control.py | 3 ++- src/sage/misc/sphinxify.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py index cd771ae279a..a90b45981bb 100644 --- a/src/sage/doctest/control.py +++ b/src/sage/doctest/control.py @@ -1126,7 +1126,8 @@ def run_val_gdb(self, testing=False): os.putenv('CYSIGNALS_CRASH_LOGS', tmp_dir("crash_logs_")) init_cysignals() - import signal, subprocess + import signal + import subprocess p = subprocess.Popen(cmd, shell=True) if opt.timeout > 0: signal.alarm(opt.timeout) diff --git a/src/sage/misc/sphinxify.py b/src/sage/misc/sphinxify.py index 4077044624d..d3db30be44b 100644 --- a/src/sage/misc/sphinxify.py +++ b/src/sage/misc/sphinxify.py @@ -107,8 +107,8 @@ def sphinxify(docstring, format='html'): """) staticdir = os.path.join(confdir, 'static') os.makedirs(staticdir) - with open(os.path.join(staticdir, 'empty'), 'w') as filed: pass - + with open(os.path.join(staticdir, 'empty'), 'w') as filed: + pass with open(os.path.join(srcdir, 'docutils.conf'), 'w') as filed: filed.write(r""" [parsers] From b05bed81730982752805c1bae629782d94fd7aff Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Mon, 1 Jun 2020 10:21:23 +0900 Subject: [PATCH 284/301] Add tangent_line() and line_through() methods --- src/sage/schemes/affine/affine_space.py | 91 ++++++++++++++++++- src/sage/schemes/affine/affine_subscheme.py | 58 ++++++++++++ src/sage/schemes/curves/affine_curve.py | 62 ++++++++++++- src/sage/schemes/curves/projective_curve.py | 28 ++++++ .../schemes/projective/projective_space.py | 33 ++++++- 5 files changed, 268 insertions(+), 4 deletions(-) diff --git a/src/sage/schemes/affine/affine_space.py b/src/sage/schemes/affine/affine_space.py index 0c847dbea65..4e7c65a283e 100644 --- a/src/sage/schemes/affine/affine_space.py +++ b/src/sage/schemes/affine/affine_space.py @@ -957,6 +957,21 @@ def chebyshev_polynomial(self, n, kind='first', monic=False): else: raise ValueError("keyword 'kind' must have a value of either 'first' or 'second'") + def origin(self): + """ + Return the rational point at the origin of this affine space. + + EXAMPLES:: + + sage: A. = AffineSpace(QQ, 3) + sage: A.origin() + (0, 0, 0) + sage: _ == A(0,0,0) + True + + """ + return self([0 for i in range(self.ngens())]) + class AffineSpace_field(AffineSpace_generic): def _point(self, *args, **kwds): @@ -1125,7 +1140,7 @@ def curve(self,F): INPUT: - ``F`` -- a polynomial, or a list or tuple of polynomials in - the coordinate ring of this affine space. + the coordinate ring of this affine space EXAMPLES:: @@ -1136,6 +1151,80 @@ def curve(self,F): from sage.schemes.curves.constructor import Curve return Curve(F, self) + def line_through(self, p, q): + """ + Return the line through ``p`` and ``q``. + + INPUT: + + - ``p``, ``q`` -- distinct rational points of the affine space + + EXAMPLES:: + + sage: A3. = AffineSpace(3, QQ) + sage: p1 = A3(1, 2, 3) + sage: p2 = A3(4, 5, 6) + sage: A3.line_through(p1, p2) + Affine Curve over Rational Field defined by -1/6*x + 1/6*y - 1/6, + -1/6*x + 1/6*z - 1/3, -1/6*y + 1/6*z - 1/6, -1/6*x + 1/3*y - 1/6*z + sage: L = _ + sage: L(p1) + (1, 2, 3) + sage: L(p2) + (4, 5, 6) + sage: A3.line_through(p1, p1) + Traceback (most recent call last): + ... + ValueError: not distinct points + + """ + if p == q: + raise ValueError("not distinct points") + + proj = self.projective_embedding(0) + P = proj.codomain() + return P.line_through(proj(p), proj(q)).affine_patch(0, self) + + def translation(self, p, q=None): + """ + Return the automorphism of the affine space translating ``p`` to the origin. + + If ``q`` is given, the automorphism translates ``p`` to ``q``. + + INPUT: + + - ``p`` -- a rational point + + - ``q`` -- (default: ``None``) a rational point + + EXAMPLES:: + + sage: A. = AffineSpace(QQ, 3) + sage: p = A(1,2,3) + sage: q = A(4,5,6) + sage: A.translation(p, q) + Scheme endomorphism of Affine Space of dimension 3 over Rational Field + Defn: Defined on coordinates by sending (x, y, z) to + (x + 3, y + 3, z + 3) + sage: phi = A.translation(p) + sage: psi = A.translation(A.origin(), q) + sage: psi * phi + Scheme endomorphism of Affine Space of dimension 3 over Rational Field + Defn: Defined on coordinates by sending (x, y, z) to + (x + 3, y + 3, z + 3) + sage: psi * phi == A.translation(p, q) + True + + """ + gens = self.gens() + + if q is not None: + v = [cp - cq for cp, cq in zip(p, q)] + else: + v = [cp for cp in p] + + return self._morphism(self.Hom(self), [x - c for x, c in zip(gens, v)]) + class AffineSpace_finite_field(AffineSpace_field): def _point(self, *args, **kwds): diff --git a/src/sage/schemes/affine/affine_subscheme.py b/src/sage/schemes/affine/affine_subscheme.py index b5a0435b77c..1f7bc652234 100644 --- a/src/sage/schemes/affine/affine_subscheme.py +++ b/src/sage/schemes/affine/affine_subscheme.py @@ -22,6 +22,7 @@ from sage.categories.fields import Fields from sage.interfaces.all import singular +from sage.modules.all import vector from sage.schemes.generic.algebraic_scheme import AlgebraicScheme_subscheme from .affine_morphism import SchemeMorphism_polynomial_affine_subscheme_field @@ -537,3 +538,60 @@ def _morphism(self, *args, **kwds): (x*y : x : y) """ return SchemeMorphism_polynomial_affine_subscheme_field(*args, **kwds) + + def tangent_space(self, p): + """ + Return the tangent space at the point ``p``. + + The points of the tangent space are the tangent vectors at ``p``. + + INPUT: + + - ``p`` -- a rational point + + EXAMPLES:: + + sage: A3. = AffineSpace(3, QQ) + sage: X = A3.subscheme(z-x*y) + sage: X.tangent_space(A3.origin()) + Closed subscheme of Affine Space of dimension 3 over Rational Field + defined by: + z + sage: X.tangent_space(X(1,1,1)) + Closed subscheme of Affine Space of dimension 3 over Rational Field + defined by: + -x - y + z + + Tangent space at a point may have higher dimension than the dimension + of the point. :: + + sage: C = Curve([x + y + z, x^2 - y^2*z^2 + z^3]) + sage: C.singular_points() + [(0, 0, 0)] + sage: p = C(0,0,0) + sage: C.tangent_space(p) + Closed subscheme of Affine Space of dimension 3 over Rational Field + defined by: + x + y + z + sage: _.dimension() + 2 + sage: q = C(1,0,-1) + sage: C.tangent_space(q) + Closed subscheme of Affine Space of dimension 3 over Rational Field + defined by: + x + y + z, + 2*x + 3*z + sage: _.dimension() + 1 + + """ + A = self.ambient_space() + R = A.coordinate_ring() + gens = R.gens() + + J = self.Jacobian_matrix() + Jp = J.apply_map( lambda f: f.subs(dict(zip(gens, list(p)))) ) + I = [f for f in Jp * vector(gens) if f] + + return A.subscheme(R.ideal(I)) + diff --git a/src/sage/schemes/curves/affine_curve.py b/src/sage/schemes/curves/affine_curve.py index c5384f08387..9e511f44514 100644 --- a/src/sage/schemes/curves/affine_curve.py +++ b/src/sage/schemes/curves/affine_curve.py @@ -117,7 +117,8 @@ from sage.rings.infinity import infinity from sage.schemes.affine.affine_space import AffineSpace, is_AffineSpace -from sage.schemes.affine.affine_subscheme import AlgebraicScheme_subscheme_affine +from sage.schemes.affine.affine_subscheme import (AlgebraicScheme_subscheme_affine, + AlgebraicScheme_subscheme_affine_field) from .curve import Curve_generic @@ -785,7 +786,7 @@ def rational_parameterization(self): return H([para[1]/para[0], para[2]/para[0]]) -class AffineCurve_field(AffineCurve): +class AffineCurve_field(AffineCurve, AlgebraicScheme_subscheme_affine_field): """ Affine curves over fields. """ @@ -1600,6 +1601,63 @@ def extension(self): p_maps = [res[i][2] for i in range(len(res))] return tuple([tuple(patches), tuple(t_maps), tuple(p_maps)]) + def tangent_line(self, p): + """ + Return the tangent line at the point ``p``. + + INPUT: + + - ``p`` -- a rational point of the curve + + EXAMPLES:: + + sage: A3. = AffineSpace(3, QQ) + sage: C = Curve([x + y + z, x^2 - y^2*z^2 + z^3]) + sage: p = C(0,0,0) + sage: C.tangent_line(p) + Traceback (most recent call last): + ... + ValueError: the curve is not smooth at (0, 0, 0) + sage: p = C(1,0,-1) + sage: C.tangent_line(p) + Affine Curve over Rational Field defined by x + y + z, 2*x + 3*z + 1 + + We check that the tangent line at ``p`` is the tangent space at ``p``, + translated to ``p``. :: + + sage: Tp = C.tangent_space(p) + sage: Tp + Closed subscheme of Affine Space of dimension 3 over Rational Field defined by: + x + y + z, + 2*x + 3*z + sage: phi = A3.translation(A3.origin(), p) + sage: T = phi * Tp.embedding_morphism() + sage: T.image() + Closed subscheme of Affine Space of dimension 3 over Rational Field defined by: + -2*y + z + 1, + x + y + z + sage: _ == C.tangent_line(p) + True + + """ + A = self.ambient_space() + R = A.coordinate_ring() + gens = R.gens() + + Tp = self.tangent_space(p) + + if Tp.dimension() > 1: + raise ValueError("the curve is not smooth at {}".format(p)) + + from sage.schemes.curves.all import Curve + + # translate to p + I = [] + for poly in Tp.defining_polynomials(): + I.append(poly.subs(dict([x, x - c] for x, c in zip(gens, list(p))))) + + return Curve(I) + class AffinePlaneCurve_field(AffinePlaneCurve, AffineCurve_field): """ diff --git a/src/sage/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py index 592bb68dc65..37db99c4e37 100644 --- a/src/sage/schemes/curves/projective_curve.py +++ b/src/sage/schemes/curves/projective_curve.py @@ -122,6 +122,7 @@ QQbar) from sage.rings.rational_field import is_RationalField from sage.rings.integer import Integer + from sage.schemes.projective.projective_space import ProjectiveSpace, is_ProjectiveSpace from sage.schemes.projective.projective_subscheme import (AlgebraicScheme_subscheme_projective, @@ -1558,6 +1559,33 @@ def is_complete_intersection(self): L = singular.is_ci(I).sage() return len(self.ambient_space().gens()) - len(I.sage().gens()) == L[-1] + def tangent_line(self, p): + """ + Return the tangent line at the point ``p``. + + INPUT: + + - ``p`` -- a rational point of the curve + + EXAMPLES:: + + sage: P. = ProjectiveSpace(QQ, 3) + sage: C = Curve([x*y - z*w, x^2 - y*w, y^2*w - x*z*w], P) + sage: p = C(1,1,1,1) + sage: C.tangent_line(p) + Projective Curve over Rational Field defined by -2*x + y + w, -3*x + z + 2*w + + """ + for i in range(len(p)): + if p[i]: + break + + C = self.affine_patch(i) + q = p.dehomogenize(i) + T = C.tangent_line(q) + + return T.projective_closure(i, self.ambient_space()) + class ProjectivePlaneCurve_field(ProjectivePlaneCurve, ProjectiveCurve_field): """ diff --git a/src/sage/schemes/projective/projective_space.py b/src/sage/schemes/projective/projective_space.py index 2a2916ef49c..4fed0413bac 100644 --- a/src/sage/schemes/projective/projective_space.py +++ b/src/sage/schemes/projective/projective_space.py @@ -1679,7 +1679,7 @@ def curve(self,F): INPUT: - ``F`` -- a polynomial, or a list or tuple of polynomials in - the coordinate ring of this projective space. + the coordinate ring of this projective space EXAMPLES:: @@ -1690,6 +1690,37 @@ def curve(self,F): from sage.schemes.curves.constructor import Curve return Curve(F, self) + def line_through(self, p, q): + """ + Return the line through ``p`` and ``q``. + + INPUT: + + - ``p``, ``q`` -- distinct rational points of the projective space + + EXAMPLES:: + + sage: P3. = ProjectiveSpace(3, QQ) + sage: p1 = P3(1, 2, 3, 4) + sage: p2 = P3(4, 3, 2, 1) + sage: P3.line_through(p1, p2) + Projective Curve over Rational Field defined by -5/4*x0 + 5/2*x1 - 5/4*x2, + -5/2*x0 + 15/4*x1 - 5/4*x3, -5/4*x0 + 15/4*x2 - 5/2*x3, -5/4*x1 + 5/2*x2 - 5/4*x3 + sage: p3 = P3(2,4,6,8) + sage: P3.line_through(p1, p3) + Traceback (most recent call last): + ... + ValueError: not distinct points + + """ + if p == q: + raise ValueError("not distinct points") + + from sage.schemes.curves.constructor import Curve + + m = matrix(3, list(self.gens()) + list(p) + list(q)) + return Curve([f for f in m.minors(3) if f]) + class ProjectiveSpace_finite_field(ProjectiveSpace_field): def _point(self, *args, **kwds): From bcb56ac4e1e1a9e9ac283f5ee82d3519f22d439d Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Mon, 1 Jun 2020 10:47:01 +0900 Subject: [PATCH 285/301] A bug fix --- src/sage/schemes/curves/affine_curve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/schemes/curves/affine_curve.py b/src/sage/schemes/curves/affine_curve.py index 9e511f44514..af0789e1d33 100644 --- a/src/sage/schemes/curves/affine_curve.py +++ b/src/sage/schemes/curves/affine_curve.py @@ -1656,7 +1656,7 @@ def tangent_line(self, p): for poly in Tp.defining_polynomials(): I.append(poly.subs(dict([x, x - c] for x, c in zip(gens, list(p))))) - return Curve(I) + return Curve(I, A) class AffinePlaneCurve_field(AffinePlaneCurve, AffineCurve_field): From 86729adfd580b6008d7494934abc715feaa269cd Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Mon, 1 Jun 2020 15:22:54 +0900 Subject: [PATCH 286/301] Cleaning fixes suggested by the reviewer --- src/sage/schemes/affine/affine_space.py | 2 +- src/sage/schemes/affine/affine_subscheme.py | 2 +- src/sage/schemes/curves/affine_curve.py | 2 +- src/sage/schemes/curves/projective_curve.py | 11 +++++------ 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/sage/schemes/affine/affine_space.py b/src/sage/schemes/affine/affine_space.py index 4e7c65a283e..b6c2f2d6989 100644 --- a/src/sage/schemes/affine/affine_space.py +++ b/src/sage/schemes/affine/affine_space.py @@ -970,7 +970,7 @@ def origin(self): True """ - return self([0 for i in range(self.ngens())]) + return self([0]*self.ngens()) class AffineSpace_field(AffineSpace_generic): diff --git a/src/sage/schemes/affine/affine_subscheme.py b/src/sage/schemes/affine/affine_subscheme.py index 1f7bc652234..f6a2171bfca 100644 --- a/src/sage/schemes/affine/affine_subscheme.py +++ b/src/sage/schemes/affine/affine_subscheme.py @@ -590,7 +590,7 @@ def tangent_space(self, p): gens = R.gens() J = self.Jacobian_matrix() - Jp = J.apply_map( lambda f: f.subs(dict(zip(gens, list(p)))) ) + Jp = J.apply_map( lambda f: f.subs(dict(zip(gens, p))) ) I = [f for f in Jp * vector(gens) if f] return A.subscheme(R.ideal(I)) diff --git a/src/sage/schemes/curves/affine_curve.py b/src/sage/schemes/curves/affine_curve.py index af0789e1d33..a0bb92c7b59 100644 --- a/src/sage/schemes/curves/affine_curve.py +++ b/src/sage/schemes/curves/affine_curve.py @@ -1654,7 +1654,7 @@ def tangent_line(self, p): # translate to p I = [] for poly in Tp.defining_polynomials(): - I.append(poly.subs(dict([x, x - c] for x, c in zip(gens, list(p))))) + I.append(poly.subs({x: x - c for x, c in zip(gens, p)})) return Curve(I, A) diff --git a/src/sage/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py index 37db99c4e37..a7bfdd7c943 100644 --- a/src/sage/schemes/curves/projective_curve.py +++ b/src/sage/schemes/curves/projective_curve.py @@ -1578,13 +1578,12 @@ def tangent_line(self, p): """ for i in range(len(p)): if p[i]: - break - - C = self.affine_patch(i) - q = p.dehomogenize(i) - T = C.tangent_line(q) + C = self.affine_patch(i) + q = p.dehomogenize(i) + T = C.tangent_line(q) + return T.projective_closure(i, self.ambient_space()) - return T.projective_closure(i, self.ambient_space()) + raise TypeError("{} does not define a point in the projective space".format(p)) class ProjectivePlaneCurve_field(ProjectivePlaneCurve, ProjectiveCurve_field): From 8d84c436878cb61c19db470c23711d1c6804de37 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 1 Jun 2020 08:58:06 +0200 Subject: [PATCH 287/301] Remove a few future imports These are obsolete with Python 3.7. See https://docs.python.org/3/reference/simple_stmts.html#future-statements --- src/sage/all.py | 9 ++------- src/sage/manifolds/manifold.py | 2 -- src/sage/tensor/all.py | 1 - src/sage/tensor/differential_form_element.py | 2 -- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/sage/all.py b/src/sage/all.py index 94337b48d5f..9425219b7c1 100644 --- a/src/sage/all.py +++ b/src/sage/all.py @@ -57,12 +57,6 @@ # https://www.gnu.org/licenses/ # **************************************************************************** -# Future statements which apply to this module. We delete the -# future globals because we do not want these to appear in the sage.all -# namespace. This deleting does not affect the parsing of this module. -from __future__ import absolute_import, division, print_function -del absolute_import, division, print_function - import os import sys import operator @@ -79,7 +73,8 @@ warnings.filterwarnings('ignore', category=ImportWarning) warnings.filterwarnings('ignore', category=ResourceWarning) else: - warnings.filters.remove(('ignore', None, DeprecationWarning, None, 0)) + deprecationWarning = ('ignore', None, DeprecationWarning, None, 0) + if deprecationWarning in warnings.filters: warnings.filters.remove(deprecationWarning) # The psutil swap_memory() function tries to collect some statistics # that may not be available and that we don't need. Hide the warnings diff --git a/src/sage/manifolds/manifold.py b/src/sage/manifolds/manifold.py index 942e8d58cd8..68668fb9a46 100644 --- a/src/sage/manifolds/manifold.py +++ b/src/sage/manifolds/manifold.py @@ -324,8 +324,6 @@ # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** -from __future__ import print_function -from __future__ import absolute_import from sage.categories.fields import Fields from sage.categories.manifolds import Manifolds diff --git a/src/sage/tensor/all.py b/src/sage/tensor/all.py index cb7b9845b0c..b85a40c1b9d 100644 --- a/src/sage/tensor/all.py +++ b/src/sage/tensor/all.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import from .coordinate_patch import CoordinatePatch from .differential_forms import DifferentialForms from .differential_form_element import DifferentialForm, wedge diff --git a/src/sage/tensor/differential_form_element.py b/src/sage/tensor/differential_form_element.py index 6721da31c57..8971514bbbe 100644 --- a/src/sage/tensor/differential_form_element.py +++ b/src/sage/tensor/differential_form_element.py @@ -21,8 +21,6 @@ # # https://www.gnu.org/licenses/ # **************************************************************************** -from __future__ import print_function - from sage.symbolic.ring import SR from sage.structure.element import RingElement, AlgebraElement From ea00610ae9d4b99c4e81b6b5a76fcb1f246726ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 1 Jun 2020 10:30:17 +0200 Subject: [PATCH 288/301] fix syntax error, oups --- src/sage/combinat/finite_state_machine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/combinat/finite_state_machine.py b/src/sage/combinat/finite_state_machine.py index 48c928cb284..369f8abf039 100644 --- a/src/sage/combinat/finite_state_machine.py +++ b/src/sage/combinat/finite_state_machine.py @@ -4934,7 +4934,7 @@ def key_function(s): )) for ((source, target), transitions) in adjacent.items(): - if transitions): + if transitions: labels = [] for transition in transitions: if hasattr(transition, "format_label"): From 791bb94dc489931990c2875cdb413788c3009143 Mon Sep 17 00:00:00 2001 From: Antonio Rojas Date: Mon, 1 Jun 2020 11:04:24 +0200 Subject: [PATCH 289/301] Ignore jedi deprecation warnings --- src/sage/all.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/all.py b/src/sage/all.py index 94337b48d5f..88682c1ce38 100644 --- a/src/sage/all.py +++ b/src/sage/all.py @@ -91,7 +91,7 @@ # Ignore all deprecations from IPython etc. warnings.filterwarnings('ignore', category=DeprecationWarning, - module='.*(IPython|ipykernel|jupyter_client|jupyter_core|nbformat|notebook|ipywidgets|storemagic)') + module='.*(IPython|ipykernel|jupyter_client|jupyter_core|nbformat|notebook|ipywidgets|storemagic|jedi)') # Ignore collections.abc warnings, there are a lot of them but they are # harmless. warnings.filterwarnings('ignore', category=DeprecationWarning, From 0bba07c056ba7e1eb2cee0bbc763cc1e7041b933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 1 Jun 2020 13:17:20 +0200 Subject: [PATCH 290/301] one detail in sparse matrices --- src/sage/matrix/matrix_rational_sparse.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sage/matrix/matrix_rational_sparse.pyx b/src/sage/matrix/matrix_rational_sparse.pyx index 15476b9f48d..e4c6ac85f6c 100644 --- a/src/sage/matrix/matrix_rational_sparse.pyx +++ b/src/sage/matrix/matrix_rational_sparse.pyx @@ -179,6 +179,8 @@ cdef class Matrix_rational_sparse(Matrix_sparse): mpq_init(s) for i from 0 <= i < self._nrows: v = &self._matrix[i] + if not v.num_nonzero: + continue for j from 0 <= j < right._ncols: mpq_set_si(s, 0, 1) c = nonzero_positions_in_columns[j] From 787e2bc6fdc950cdec225fc3a9fc7908badcdc7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 1 Jun 2020 15:51:49 +0200 Subject: [PATCH 291/301] more details in product of sparse matrices over QQ --- src/sage/matrix/matrix_rational_sparse.pyx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/sage/matrix/matrix_rational_sparse.pyx b/src/sage/matrix/matrix_rational_sparse.pyx index e4c6ac85f6c..306433431b8 100644 --- a/src/sage/matrix/matrix_rational_sparse.pyx +++ b/src/sage/matrix/matrix_rational_sparse.pyx @@ -165,10 +165,14 @@ cdef class Matrix_rational_sparse(Matrix_sparse): # Build a table that gives the nonzero positions in each column of right nonzero_positions_in_columns = [set([]) for _ in range(right._ncols)] cdef Py_ssize_t i, j, k - for i from 0 <= i < right._nrows: + for i in range(right._nrows): v = &(right._matrix[i]) - for j from 0 <= j < right._matrix[i].num_nonzero: + for j in range(right._matrix[i].num_nonzero): nonzero_positions_in_columns[v.positions[j]].add(i) + # prec-computes the list of nonzero columns of right + cdef list right_indices + right_indices = [j for j in range(right._ncols) + if nonzero_positions_in_columns[j]] ans = self.new_matrix(self._nrows, right._ncols) @@ -177,11 +181,11 @@ cdef class Matrix_rational_sparse(Matrix_sparse): mpq_init(x) mpq_init(y) mpq_init(s) - for i from 0 <= i < self._nrows: + for i in range(self._nrows): v = &self._matrix[i] if not v.num_nonzero: continue - for j from 0 <= j < right._ncols: + for j in right_indices: mpq_set_si(s, 0, 1) c = nonzero_positions_in_columns[j] for k from 0 <= k < v.num_nonzero: From 23cf6e7e04153d43d8504495dda46064f722bc84 Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Mon, 1 Jun 2020 15:13:57 +0200 Subject: [PATCH 292/301] 29776: fix tab-completion for morphism methods --- src/sage/cpython/getattr.pyx | 11 ++++++++--- src/sage/structure/element.pyx | 24 ++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/sage/cpython/getattr.pyx b/src/sage/cpython/getattr.pyx index 0e4f9a49698..94d1d7fabfb 100644 --- a/src/sage/cpython/getattr.pyx +++ b/src/sage/cpython/getattr.pyx @@ -411,7 +411,7 @@ cpdef getattr_from_other_class(self, cls, name): raise AttributeError(dummy_error_message) -def dir_with_other_class(self, cls): +def dir_with_other_class(self, *cls): r""" Emulates ``dir(self)``, as if self was also an instance ``cls``, right after ``caller_class`` in the method resolution order @@ -432,6 +432,10 @@ def dir_with_other_class(self, cls): sage: from sage.cpython.getattr import dir_with_other_class sage: dir_with_other_class(x, B) [..., 'a', 'b', 'c', 'd', 'e'] + sage: class C(object): + ....: f = 6 + sage: dir_with_other_class(x, B, C) + [..., 'a', 'b', 'c', 'd', 'e', 'f'] Check that objects without dicts are well handled:: @@ -459,6 +463,7 @@ def dir_with_other_class(self, cls): ret.update(dir(self.__class__)) if hasattr(self, "__dict__"): ret.update(list(self.__dict__)) - if not isinstance(self, cls): - ret.update(dir(cls)) + for c in cls: + if not isinstance(self, c): + ret.update(dir(c)) return sorted(ret) diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx index a5fbd555f2d..0791c72a70c 100644 --- a/src/sage/structure/element.pyx +++ b/src/sage/structure/element.pyx @@ -501,9 +501,12 @@ cdef class Element(SageObject): def __dir__(self): """ + Emulate ``__dir__`` for elements with dynamically attached methods. + Let cat be the category of the parent of ``self``. This method emulates ``self`` being an instance of both ``Element`` and - ``cat.element_class``, in that order, for attribute directory. + ``cat.element_class`` (and the corresponding ``morphism_class`` in the + case of a morphism), in that order, for attribute directory. EXAMPLES:: @@ -516,9 +519,26 @@ cdef class Element(SageObject): [..., 'is_idempotent', 'is_integer', 'is_integral', ...] sage: dir(1) # todo: not implemented [..., 'is_idempotent', 'is_integer', 'is_integral', ...] + + TESTS: + + Check that morphism classes are handled correctly (:trac:`29776`):: + + sage: R. = QQ[] + sage: f = R.hom([x, y+1], R) + sage: 'cartesian_product' in dir(f) + True + sage: 'extend_to_fraction_field' in dir(f) + True """ from sage.cpython.getattr import dir_with_other_class - return dir_with_other_class(self, self.parent().category().element_class) + ec = self.parent().category().element_class + try: + mc = self.category_for().morphism_class + except AttributeError: + return dir_with_other_class(self, ec) + else: + return dir_with_other_class(self, ec, mc) def _repr_(self): return "Generic element of a structure" From eac7eca8ffd825e248c50eb7c9a69a723d47642c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 1 Jun 2020 14:59:28 -0700 Subject: [PATCH 293/301] Fixup --- .github/workflows/tox-gcc_spkg.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tox-gcc_spkg.yml b/.github/workflows/tox-gcc_spkg.yml index 7b66b586314..f9a9847f9a9 100644 --- a/.github/workflows/tox-gcc_spkg.yml +++ b/.github/workflows/tox-gcc_spkg.yml @@ -101,7 +101,7 @@ jobs: fail-fast: false matrix: tox_system_factor: [conda-forge-ubuntu] - tox_packages_factor: [minimal-gcc_spkg, standard-gcc_spkg, standard] + tox_packages_factor: [minimal-gcc_spkg, standard-gcc_spkg] env: TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }} From 170231f673dea3ccf65dd3ee486571f2c663e906 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Tue, 2 Jun 2020 14:11:11 +1000 Subject: [PATCH 294/301] Some additional changes to rational sparse matrix mult. --- src/sage/matrix/matrix_rational_sparse.pyx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/sage/matrix/matrix_rational_sparse.pyx b/src/sage/matrix/matrix_rational_sparse.pyx index 306433431b8..aa532514023 100644 --- a/src/sage/matrix/matrix_rational_sparse.pyx +++ b/src/sage/matrix/matrix_rational_sparse.pyx @@ -163,13 +163,13 @@ cdef class Matrix_rational_sparse(Matrix_sparse): cdef mpq_vector* v # Build a table that gives the nonzero positions in each column of right - nonzero_positions_in_columns = [set([]) for _ in range(right._ncols)] + cdef list nonzero_positions_in_columns = [set() for _ in range(right._ncols)] cdef Py_ssize_t i, j, k for i in range(right._nrows): v = &(right._matrix[i]) - for j in range(right._matrix[i].num_nonzero): - nonzero_positions_in_columns[v.positions[j]].add(i) - # prec-computes the list of nonzero columns of right + for j in range(v.num_nonzero): + ( nonzero_positions_in_columns[v.positions[j]]).add(i) + # pre-computes the list of nonzero columns of right cdef list right_indices right_indices = [j for j in range(right._ncols) if nonzero_positions_in_columns[j]] @@ -177,18 +177,19 @@ cdef class Matrix_rational_sparse(Matrix_sparse): ans = self.new_matrix(self._nrows, right._ncols) # Now do the multiplication, getting each row completely before filling it in. + cdef set c cdef mpq_t x, y, s mpq_init(x) mpq_init(y) mpq_init(s) for i in range(self._nrows): - v = &self._matrix[i] + v = &(self._matrix[i]) if not v.num_nonzero: continue for j in right_indices: mpq_set_si(s, 0, 1) - c = nonzero_positions_in_columns[j] - for k from 0 <= k < v.num_nonzero: + c = nonzero_positions_in_columns[j] + for k in range(v.num_nonzero): if v.positions[k] in c: mpq_vector_get_entry(y, &right._matrix[v.positions[k]], j) mpq_mul(x, v.entries[k], y) From c146ac073e16a0d651b2041ce69491dd7741f4b5 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Tue, 2 Jun 2020 14:11:34 +1000 Subject: [PATCH 295/301] Making similar changes to matrix_modn_sparse.pyx. --- src/sage/matrix/matrix_modn_sparse.pyx | 27 +++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/sage/matrix/matrix_modn_sparse.pyx b/src/sage/matrix/matrix_modn_sparse.pyx index 1d0f8e94c32..335be5fb687 100644 --- a/src/sage/matrix/matrix_modn_sparse.pyx +++ b/src/sage/matrix/matrix_modn_sparse.pyx @@ -271,7 +271,8 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): Even though sparse and dense matrices are represented differently, they still compare as equal if they have the - same entries: + same entries:: + sage: a*b == a._matrix_times_matrix_dense(b) True sage: d = matrix(GF(43), 3, 8, range(24)) @@ -287,7 +288,6 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): [32770 32770 32770] sage: M*M.transpose() # previously returned [32738] [3] - """ cdef Matrix_modn_sparse right, ans right = _right @@ -295,24 +295,29 @@ cdef class Matrix_modn_sparse(matrix_sparse.Matrix_sparse): cdef c_vector_modint* v # Build a table that gives the nonzero positions in each column of right - nonzero_positions_in_columns = [set([]) for _ in range(right._ncols)] + cdef list nonzero_positions_in_columns = [set() for _ in range(right._ncols)] cdef Py_ssize_t i, j, k - for i from 0 <= i < right._nrows: + for i in range(right._nrows): v = &(right.rows[i]) - for j from 0 <= j < right.rows[i].num_nonzero: - nonzero_positions_in_columns[v.positions[j]].add(i) + for j in range(v.num_nonzero): + ( nonzero_positions_in_columns[v.positions[j]]).add(i) + # pre-computes the list of nonzero columns of right + cdef list right_indices + right_indices = [j for j in range(right._ncols) + if nonzero_positions_in_columns[j]] ans = self.new_matrix(self._nrows, right._ncols) # Now do the multiplication, getting each row completely before filling it in. cdef int x, y, s + cdef set c - for i from 0 <= i < self._nrows: - v = &self.rows[i] - for j from 0 <= j < right._ncols: + for i in range(self._nrows): + v = &(self.rows[i]) + for j in range(right._ncols): s = 0 - c = nonzero_positions_in_columns[j] - for k from 0 <= k < v.num_nonzero: + c = nonzero_positions_in_columns[j] + for k in range(v.num_nonzero): if v.positions[k] in c: y = get_entry(&right.rows[v.positions[k]], j) x = v.entries[k] * y From e396cefbb5df32902ad136fb651f9a8390eecccf Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Tue, 2 Jun 2020 14:11:53 +1000 Subject: [PATCH 296/301] Adding custom _matrix_times_matrix_ for sparse ZZ matrices. --- src/sage/matrix/matrix_integer_sparse.pyx | 57 +++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/sage/matrix/matrix_integer_sparse.pyx b/src/sage/matrix/matrix_integer_sparse.pyx index c6cb12ad86a..8163172d862 100644 --- a/src/sage/matrix/matrix_integer_sparse.pyx +++ b/src/sage/matrix/matrix_integer_sparse.pyx @@ -219,6 +219,63 @@ cdef class Matrix_integer_sparse(Matrix_sparse): self.cache('dict', d) return d + cdef sage.structure.element.Matrix _matrix_times_matrix_(self, sage.structure.element.Matrix _right): + """ + Return the product of the sparse integer matrices + ``self`` and ``_right``. + + EXAMPLES:: + + sage: a = matrix(ZZ, 2, [1,2,3,4], sparse=True) + sage: b = matrix(ZZ, 2, 3, [1..6], sparse=True) + sage: a * b + [ 9 12 15] + [19 26 33] + """ + cdef Matrix_integer_sparse right, ans + right = _right + + cdef mpz_vector* v + + # Build a table that gives the nonzero positions in each column of right + cdef list nonzero_positions_in_columns = [set() for _ in range(right._ncols)] + cdef Py_ssize_t i, j, k + for i in range(right._nrows): + v = &(right._matrix[i]) + for j in range(v.num_nonzero): + ( nonzero_positions_in_columns[v.positions[j]]).add(i) + # pre-computes the list of nonzero columns of right + cdef list right_indices + right_indices = [j for j in range(right._ncols) + if nonzero_positions_in_columns[j]] + + ans = self.new_matrix(self._nrows, right._ncols) + + # Now do the multiplication, getting each row completely before filling it in. + cdef set c + cdef mpz_t x, y, s + mpz_init(x) + mpz_init(y) + mpz_init(s) + for i in range(self._nrows): + v = &(self._matrix[i]) + if not v.num_nonzero: + continue + for j in right_indices: + mpz_set_si(s, 0) + c = nonzero_positions_in_columns[j] + for k in range(v.num_nonzero): + if v.positions[k] in c: + mpz_vector_get_entry(y, &right._matrix[v.positions[k]], j) + mpz_mul(x, v.entries[k], y) + mpz_add(s, s, x) + mpz_vector_set_entry(&ans._matrix[i], j, s) + + mpz_clear(x) + mpz_clear(y) + mpz_clear(s) + return ans + ######################################################################## # LEVEL 3 functionality (Optional) # * cdef _sub_ From 0e6d768dc9b415facc07d9458545fa6900f7adce Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Tue, 2 Jun 2020 14:13:10 +1000 Subject: [PATCH 297/301] Making generic sparse tests actually test generic sparse matrices. --- src/sage/matrix/matrix_generic_sparse.pyx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sage/matrix/matrix_generic_sparse.pyx b/src/sage/matrix/matrix_generic_sparse.pyx index bbf0015ca8a..7618257e13a 100644 --- a/src/sage/matrix/matrix_generic_sparse.pyx +++ b/src/sage/matrix/matrix_generic_sparse.pyx @@ -210,7 +210,8 @@ cdef class Matrix_generic_sparse(matrix_sparse.Matrix_sparse): """ EXAMPLES:: - sage: a = matrix([[1,10],[3,4]],sparse=True); a + sage: R. = ZZ[] + sage: a = matrix(R, [[1,10],[3,4]],sparse=True); a [ 1 10] [ 3 4] sage: loads(dumps(a)) == a @@ -239,7 +240,8 @@ cdef class Matrix_generic_sparse(matrix_sparse.Matrix_sparse): """ EXAMPLES:: - sage: a = matrix([[1,10],[3,4]],sparse=True); a + sage: R. = QQ[] + sage: a = matrix(R, [[1,10],[3,4]],sparse=True); a [ 1 10] [ 3 4] sage: a+a @@ -248,7 +250,7 @@ cdef class Matrix_generic_sparse(matrix_sparse.Matrix_sparse): :: - sage: a = matrix([[1,10,-5/3],[2/8,3,4]],sparse=True); a + sage: a = matrix(R, [[1,10,-5/3],[2/8,3,4]], sparse=True); a [ 1 10 -5/3] [ 1/4 3 4] sage: a+a From 2053489fe558b86aa5f6e7789afd0663b7045db0 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Tue, 2 Jun 2020 15:55:24 +1000 Subject: [PATCH 298/301] Microimprovements and cleanup of generic sparse multiplication. --- src/sage/matrix/matrix_sparse.pyx | 47 ++++++++++++++++--------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/src/sage/matrix/matrix_sparse.pyx b/src/sage/matrix/matrix_sparse.pyx index d5dca213251..80b1d979d74 100644 --- a/src/sage/matrix/matrix_sparse.pyx +++ b/src/sage/matrix/matrix_sparse.pyx @@ -177,17 +177,20 @@ cdef class Matrix_sparse(matrix.Matrix): sage: type(A) sage: B = matrix(QQ['x,y'], 2, [-1,-1,-2,-2], sparse=True) - sage: A*B + sage: A * B [2 2] [2 2] + sage: B * A + [-2 3] + [-4 6] """ cdef Py_ssize_t row, col, row_start, k1, k2, len_left, len_right, a, b - left_nonzero = left.nonzero_positions(copy=False, column_order=False) - right_nonzero = right.nonzero_positions(copy=False, column_order=True) + cdef list left_nonzero = left.nonzero_positions(copy=False, column_order=False) + cdef list right_nonzero = right.nonzero_positions(copy=False, column_order=True) len_left = len(left_nonzero) len_right = len(right_nonzero) - e = {} + cdef dict e = {} k1 = 0 while k1 < len_left: row_start = k1 @@ -196,30 +199,30 @@ cdef class Matrix_sparse(matrix.Matrix): while k2 < len_right: sig_check() col = get_ij(right_nonzero, k2, 1) - sum = None + s = None k1 = row_start - while k1 < len_left and get_ij(left_nonzero,k1,0) == row and \ - k2 < len_right and get_ij(right_nonzero,k2,1) == col: + while (k1 < len_left and get_ij(left_nonzero,k1,0) == row + and k2 < len_right and get_ij(right_nonzero,k2,1) == col): sig_check() - a = get_ij(left_nonzero, k1,1) - b = get_ij(right_nonzero,k2,0) + a = get_ij(left_nonzero, k1, 1) + b = get_ij(right_nonzero, k2, 0) if a == b: - if sum is None: - sum = left.get_unsafe(row,a)*right.get_unsafe(a,col) + if s is None: + s = left.get_unsafe(row,a) * right.get_unsafe(a,col) else: - sum = sum + left.get_unsafe(row,a)*right.get_unsafe(a,col) - k1 = k1 + 1 - k2 = k2 + 1 + s += left.get_unsafe(row,a) * right.get_unsafe(a,col) + k1 += 1 + k2 += 1 elif a < b: - k1 = k1 + 1 + k1 += 1 else: - k2 = k2 + 1 - if sum is not None: - e[row, col] = sum - while k2 < len_right and get_ij(right_nonzero,k2,1) == col: - k2 = k2 + 1 - while k1 < len_left and get_ij(left_nonzero,k1,0) == row: - k1 = k1 + 1 + k2 += 1 + if s is not None: + e[row, col] = s + while k2 < len_right and get_ij(right_nonzero, k2, 1) == col: + k2 += 1 + while k1 < len_left and get_ij(left_nonzero, k1, 0) == row: + k1 += 1 return left.new_matrix(left._nrows, right._ncols, entries=e, coerce=False, copy=False) def _multiply_classical_with_cache(Matrix_sparse left, Matrix_sparse right): From 746982bdc67e6c4a9b37a08fe756b02e3ddabe36 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Tue, 2 Jun 2020 11:36:12 +0100 Subject: [PATCH 299/301] properly catch exceptions in Dijkstra_Boost recent versions of Boost (1.73) throw an exception on encountering a negative edge weight. It needs to be properly caught with try/except. --- src/sage/graphs/base/boost_graph.pyx | 29 +++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/sage/graphs/base/boost_graph.pyx b/src/sage/graphs/base/boost_graph.pyx index 6ba0a44c9af..216688c733b 100644 --- a/src/sage/graphs/base/boost_graph.pyx +++ b/src/sage/graphs/base/boost_graph.pyx @@ -977,19 +977,22 @@ cpdef shortest_paths(g, start, weight_function=None, algorithm=None): raise ValueError("the graph contains a negative cycle") elif algorithm in ['Dijkstra', 'Dijkstra_Boost']: - if g.is_directed(): - boost_weighted_graph_from_sage_graph(&g_boost_dir, g, v_to_int, weight_function) - vi = v_to_int[start] - sig_on() - result = g_boost_dir.dijkstra_shortest_paths(vi) - sig_off() - else: - boost_weighted_graph_from_sage_graph(&g_boost_und, g, v_to_int, weight_function) - vi = v_to_int[start] - sig_on() - result = g_boost_und.dijkstra_shortest_paths(vi) - sig_off() - if not result.distances.size(): + try: + if g.is_directed(): + boost_weighted_graph_from_sage_graph(&g_boost_dir, g, v_to_int, weight_function) + vi = v_to_int[start] + sig_on() + result = g_boost_dir.dijkstra_shortest_paths(vi) + sig_off() + else: + boost_weighted_graph_from_sage_graph(&g_boost_und, g, v_to_int, weight_function) + vi = v_to_int[start] + sig_on() + result = g_boost_und.dijkstra_shortest_paths(vi) + sig_off() + if not result.distances.size(): + raise RuntimeError("Dijkstra algorithm does not work with negative weights, use Bellman-Ford instead") + except RuntimeError: raise RuntimeError("Dijkstra algorithm does not work with negative weights, use Bellman-Ford instead") else: From 8061aa2073e806dc3c465c4a53828604d5b1802d Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Wed, 3 Jun 2020 16:01:57 +1000 Subject: [PATCH 300/301] Fixing the pdf docbuild. --- src/doc/en/reference/combinat/module_list.rst | 1 + src/sage/combinat/algebraic_combinatorics.py | 1 + src/sage/docs/conf.py | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/src/doc/en/reference/combinat/module_list.rst b/src/doc/en/reference/combinat/module_list.rst index 64e844e9b8a..47dbe0fb281 100644 --- a/src/doc/en/reference/combinat/module_list.rst +++ b/src/doc/en/reference/combinat/module_list.rst @@ -25,6 +25,7 @@ Comprehensive Module list sage/combinat/baxter_permutations sage/combinat/binary_recurrence_sequences sage/combinat/binary_tree + sage/combinat/blob_algebra sage/combinat/cartesian_product sage/combinat/catalog_partitions sage/combinat/chas/__init__ diff --git a/src/sage/combinat/algebraic_combinatorics.py b/src/sage/combinat/algebraic_combinatorics.py index f0ff485a5a2..599913ffdb8 100644 --- a/src/sage/combinat/algebraic_combinatorics.py +++ b/src/sage/combinat/algebraic_combinatorics.py @@ -36,6 +36,7 @@ - :class:`~sage.algebras.affine_nil_temperley_lieb.AffineNilTemperleyLiebTypeA` - :ref:`sage.combinat.descent_algebra` - :ref:`sage.combinat.diagram_algebras` +- :ref:`sage.combinat.blob_algebra` Combinatorial Representation Theory ----------------------------------- diff --git a/src/sage/docs/conf.py b/src/sage/docs/conf.py index a5c8d96acdf..7a4c0002050 100644 --- a/src/sage/docs/conf.py +++ b/src/sage/docs/conf.py @@ -455,6 +455,13 @@ def set_intersphinx_mappings(app): \DeclareUnicodeCharacter{23AE}{\ensuremath{\|}} % integral extenison \DeclareUnicodeCharacter{2571}{/} % Box drawings light diagonal upper right to lower left + + \DeclareUnicodeCharacter{25CF}{\ensuremath{\bullet}} % medium black circle + \DeclareUnicodeCharacter{26AC}{\ensuremath{\circ}} % medium small white circle + \DeclareUnicodeCharacter{256D}{+} + \DeclareUnicodeCharacter{256E}{+} + \DeclareUnicodeCharacter{256F}{+} + \DeclareUnicodeCharacter{2570}{+} \fi \let\textLaTeX\LaTeX From e2dcdeeabb578c37bcf0361c0be3079315e9252c Mon Sep 17 00:00:00 2001 From: Release Manager Date: Sun, 14 Jun 2020 00:16:49 +0200 Subject: [PATCH 301/301] Updated SageMath version to 9.2.beta1 --- VERSION.txt | 2 +- build/pkgs/configure/checksums.ini | 6 +++--- build/pkgs/configure/package-version.txt | 2 +- src/bin/sage-version.sh | 6 +++--- src/sage/version.py | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 64dc3bd1d87..d85786ed487 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -SageMath version 9.2.beta0, Release Date: 2020-05-28 +SageMath version 9.2.beta1, Release Date: 2020-06-13 diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini index 4c52d48dc9f..87816b1af1c 100644 --- a/build/pkgs/configure/checksums.ini +++ b/build/pkgs/configure/checksums.ini @@ -1,4 +1,4 @@ tarball=configure-VERSION.tar.gz -sha1=1c21f6e635a7b999032dfb5e3bd569fca562cead -md5=b18610cb53599bfff817e4d1f26d09ef -cksum=763933029 +sha1=b46c24804d86a51b879c6bb187fe5e61b391c35b +md5=e1688a365fcadb8e9a82fbf598973b89 +cksum=189029443 diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt index c881e48d22b..5560beb0ced 100644 --- a/build/pkgs/configure/package-version.txt +++ b/build/pkgs/configure/package-version.txt @@ -1 +1 @@ -982d86df0eb7517b9aed2a911e76ed5dd96fe1ac +2fb1ae046cb7336b4e54f668084d7b773e3a8151 diff --git a/src/bin/sage-version.sh b/src/bin/sage-version.sh index a22186797fc..e0b573e5b87 100644 --- a/src/bin/sage-version.sh +++ b/src/bin/sage-version.sh @@ -1,5 +1,5 @@ # Sage version information for shell scripts # This file is auto-generated by the sage-update-version script, do not edit! -SAGE_VERSION='9.2.beta0' -SAGE_RELEASE_DATE='2020-05-28' -SAGE_VERSION_BANNER='SageMath version 9.2.beta0, Release Date: 2020-05-28' +SAGE_VERSION='9.2.beta1' +SAGE_RELEASE_DATE='2020-06-13' +SAGE_VERSION_BANNER='SageMath version 9.2.beta1, Release Date: 2020-06-13' diff --git a/src/sage/version.py b/src/sage/version.py index 42ea1e04034..951db210d81 100644 --- a/src/sage/version.py +++ b/src/sage/version.py @@ -1,5 +1,5 @@ # Sage version information for Python scripts # This file is auto-generated by the sage-update-version script, do not edit! -version = '9.2.beta0' -date = '2020-05-28' -banner = 'SageMath version 9.2.beta0, Release Date: 2020-05-28' +version = '9.2.beta1' +date = '2020-06-13' +banner = 'SageMath version 9.2.beta1, Release Date: 2020-06-13'