From 378136e3cbdb5361a849c41797fbc3ce4527a607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Tue, 14 Jan 2025 17:33:03 +0100 Subject: [PATCH] totally trivial space adding ticket --- src/sage/calculus/interpolators.pyx | 2 +- src/sage/calculus/riemann.pyx | 14 ++++---- src/sage/categories/homset.py | 8 ++--- src/sage/coding/binary_code.pyx | 4 +-- src/sage/combinat/crystals/pbw_datum.pyx | 2 +- src/sage/combinat/crystals/spins.pyx | 10 +++--- src/sage/combinat/permutation_cython.pyx | 23 +++++++------ src/sage/combinat/rooted_tree.py | 4 +-- .../complex_dynamics/mandel_julia_helper.pyx | 8 ++--- .../integral_points_generic_dense.pyx | 2 +- .../integral_points_integer_dense.pyx | 2 +- src/sage/graphs/base/c_graph.pxd | 8 ++--- src/sage/graphs/base/static_sparse_graph.pyx | 2 +- src/sage/graphs/graph_database.py | 2 +- .../partn_ref2/refinement_generic.pyx | 2 +- src/sage/libs/sirocco.pyx | 2 +- src/sage/modular/modform/space.py | 4 +-- src/sage/modular/overconvergent/genus0.py | 2 +- src/sage/modules/free_module_element.pyx | 22 ++++++------- ...dratic_form__mass__Conway_Sloane_masses.py | 3 +- .../rings/finite_rings/element_givaro.pxd | 4 +-- .../rings/number_field/number_field_rel.py | 2 +- src/sage/rings/padics/factory.py | 2 +- src/sage/rings/padics/padic_generic.py | 2 +- src/sage/rings/padics/pow_computer_ext.pxd | 21 ++++++------ src/sage/schemes/elliptic_curves/heegner.py | 24 +++++++------- .../schemes/elliptic_curves/mod_sym_num.pyx | 32 +++++++++---------- src/sage/schemes/generic/morphism.py | 6 ++-- src/sage/structure/category_object.pyx | 2 +- src/sage/topology/cubical_complex.py | 14 ++++---- 30 files changed, 117 insertions(+), 118 deletions(-) diff --git a/src/sage/calculus/interpolators.pyx b/src/sage/calculus/interpolators.pyx index c13fcff8f93..6ad950c28d7 100644 --- a/src/sage/calculus/interpolators.pyx +++ b/src/sage/calculus/interpolators.pyx @@ -223,7 +223,7 @@ cdef class CCSpline: cdef int N cdef np.ndarray avec, bvec, cvec, dvec - #standard cubic interpolation method + # standard cubic interpolation method def __init__(self, pts): """ TESTS:: diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx index 455567371eb..b52997530b8 100644 --- a/src/sage/calculus/riemann.pyx +++ b/src/sage/calculus/riemann.pyx @@ -267,7 +267,7 @@ cdef class Riemann_Map: ymax = cps.imag.max() ymin = cps.imag.min() space = 0.1 * max(xmax - xmin, ymax - ymin) - #The default plotting window for this map. + # The default plotting window for this map. self.cps = cps self.dps = dps self.x_range = (xmin - space, xmax + space) @@ -1134,10 +1134,10 @@ cpdef get_derivatives(np.ndarray[COMPLEX_T, ndim=2] z_values, FLOAT_T xstep, cdef np.ndarray[FLOAT_T, ndim = 2] dr, dtheta, zabs imax = len(z_values)-2 jmax = len(z_values[0])-2 - #(f(x+delta)-f(x-delta))/2delta + # (f(x+delta)-f(x-delta))/2delta xderiv = (z_values[1:-1,2:]-z_values[1:-1,:-2])/(2*xstep) - #b/c the function is analytic, we know the magnitude of its - #derivative is equal in all directions + # b/c the function is analytic, we know the magnitude of its + # derivative is equal in all directions dr = np.abs(xderiv) # the abs(derivative) scaled by distance from origin zabs = np.abs(z_values[1:-1,1:-1]) @@ -1242,15 +1242,15 @@ cpdef complex_to_spiderweb(np.ndarray[COMPLEX_T, ndim = 2] z_values, spoke_angles = srange(-PI,PI+TWOPI/spokes,TWOPI/spokes) else: spoke_angles = [] - for i in range(imax-2): # the d arrays are 1 smaller on each side + for i in range(imax-2): # the d arrays are 1 smaller on each side for j in range(jmax-2): z = z_values[i+1,j+1] mag = abs(z) arg = phase(z) dmag = dr[i,j] darg = dtheta[i,j] - #points that change too rapidly are presumed to be borders - #points that are too small are presumed to be outside + # points that change too rapidly are presumed to be borders + # points that are too small are presumed to be outside if darg < DMAX and mag > min_mag: for target in circ_radii: if abs(mag - target)/dmag < precision: diff --git a/src/sage/categories/homset.py b/src/sage/categories/homset.py index 1b05cca4a52..5fd49d46ec9 100644 --- a/src/sage/categories/homset.py +++ b/src/sage/categories/homset.py @@ -663,10 +663,10 @@ def __init__(self, X, Y, category=None, base=None, check=True): if check: if not isinstance(category, Category): raise TypeError("category (=%s) must be a category" % category) - #if not X in category: - # raise TypeError, "X (=%s) must be in category (=%s)"%(X, category) - #if not Y in category: - # raise TypeError, "Y (=%s) must be in category (=%s)"%(Y, category) + # if not X in category: + # raise TypeError("X (=%s) must be in category (=%s)" % (X, category)) + # if not Y in category: + # raise TypeError("Y (=%s) must be in category (=%s)" % (Y, category)) if base is None and hasattr(category, "WithBasis"): # The above is a lame but fast check that category is a diff --git a/src/sage/coding/binary_code.pyx b/src/sage/coding/binary_code.pyx index dd7b017fbe4..2aedc47a5a3 100644 --- a/src/sage/coding/binary_code.pyx +++ b/src/sage/coding/binary_code.pyx @@ -2212,7 +2212,7 @@ cdef class PartitionStack: # location now points to the beginning of the first, smallest, # nontrivial cell j = location - #zero out this level of W: + # zero out this level of W: ell = 1 + nwords/radix if nwords%radix: ell += 1 @@ -4175,7 +4175,7 @@ cdef class BinaryCodeClassifier: bingo2 = 0 for coset_rep in rt_transversal: hwp = create_word_perm(coset_rep) - #dealloc_word_perm(gwp) + # dealloc_word_perm(gwp) bingo2 = 1 for j from 0 <= j < B.nrows: temp = permute_word_by_wp(hwp, temp_basis[j]) diff --git a/src/sage/combinat/crystals/pbw_datum.pyx b/src/sage/combinat/crystals/pbw_datum.pyx index fa3be1ca72e..7144feca9c6 100644 --- a/src/sage/combinat/crystals/pbw_datum.pyx +++ b/src/sage/combinat/crystals/pbw_datum.pyx @@ -22,7 +22,7 @@ AUTHORS: # https://www.gnu.org/licenses/ # **************************************************************************** -#from sage.misc.lazy_attribute import lazy_attribute +# from sage.misc.lazy_attribute import lazy_attribute from sage.misc.cachefunc import cached_method from sage.combinat.root_system.cartan_type import CartanType from sage.combinat.root_system.root_system import RootSystem diff --git a/src/sage/combinat/crystals/spins.pyx b/src/sage/combinat/crystals/spins.pyx index 28729fc93c0..a4f5229f92c 100644 --- a/src/sage/combinat/crystals/spins.pyx +++ b/src/sage/combinat/crystals/spins.pyx @@ -11,9 +11,9 @@ We follow Kashiwara and Nakashima (Journal of Algebra 165, 1994) in representing the elements of the spin crystal by sequences of signs `\pm`. """ -#TODO: Do we want the following two representations? +# TODO: Do we want the following two representations? # -#Two other representations are available as attributes +# Two other representations are available as attributes #:meth:`Spin.internal_repn` and :meth:`Spin.signature` of the crystal element. # #- A numerical internal representation, an integer `n` such that if `n-1` @@ -24,7 +24,7 @@ representing the elements of the spin crystal by sequences of signs # ``-`` by `-1`. -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2007 Anne Schilling # Nicolas Thiery # Daniel Bump @@ -39,8 +39,8 @@ representing the elements of the spin crystal by sequences of signs # # The full text of the GPL is available at: # -# http://www.gnu.org/licenses/ -#**************************************************************************** +# https://www.gnu.org/licenses/ +# *************************************************************************** from cpython.object cimport Py_EQ, Py_NE, Py_LE, Py_GE, Py_LT, Py_GT from cysignals.memory cimport sig_malloc, sig_free diff --git a/src/sage/combinat/permutation_cython.pyx b/src/sage/combinat/permutation_cython.pyx index db58f15f51e..62866bf2210 100644 --- a/src/sage/combinat/permutation_cython.pyx +++ b/src/sage/combinat/permutation_cython.pyx @@ -81,31 +81,30 @@ cdef int next_swap(int n, int *c, int *o) noexcept: Returns the index i such that the next permutation can be obtained by swapping P[i] <-> P[i+1] """ + cdef int j, s, q, offset - cdef int j,s,q,offset - - #state 3 + # state 3 j = n-1 if j <= 0: return -1 s = -1 while True: - #state 4 + # state 4 q = c[j] + o[j] if q == j: - #state 6 + # state 6 if j == 1: return -1 s = s+1 elif q >= -1: break - #state 7 + # state 7 o[j] = -o[j] j = j-1 - #state 5 + # state 5 offset = c[j] if q > offset: offset = q @@ -227,18 +226,18 @@ cpdef bint next_perm(array l) noexcept: if two == 0: return False - #starting from the end, find the first j such that - #l[j] > l[one] + # starting from the end, find the first j such that + # l[j] > l[one] while l.data.as_uints[j] <= l.data.as_uints[one]: j -= 1 - #Swap positions one and j + # Swap positions one and j t = l.data.as_uints[one] l.data.as_uints[one] = l.data.as_uints[j] l.data.as_uints[j] = t - #Reverse the list between two and last - #mset_list = mset_list[:two] + [x for x in reversed(mset_list[two:])] + # Reverse the list between two and last + # mset_list = mset_list[:two] + [x for x in reversed(mset_list[two:])] n -= 1 # In the loop, we only need n-1, so just do it once here cdef Py_ssize_t i for i in range((n + 1 - two) // 2 - 1, -1, -1): diff --git a/src/sage/combinat/rooted_tree.py b/src/sage/combinat/rooted_tree.py index 0ced874b74d..b82e0186029 100644 --- a/src/sage/combinat/rooted_tree.py +++ b/src/sage/combinat/rooted_tree.py @@ -192,8 +192,8 @@ def __init__(self, parent=None, children=[], check=True): children = list(children) except TypeError: raise TypeError(f"input ({children}) is not a valid tree") - #if not (children.__class__ is self.__class__ - # and children.parent() == parent): + # if not (children.__class__ is self.__class__ + # and children.parent() == parent): children = [self.__class__(parent, x) for x in children] NormalizedClonableList.__init__(self, parent, children, check=check) diff --git a/src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx b/src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx index 2fd00e9b07a..f51aad8884d 100644 --- a/src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx +++ b/src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx @@ -405,10 +405,10 @@ cpdef get_line(start, end): return points # Commented out temporarily for safekeeping, but probably should be deleted -#def fast_julia_plot(double c_real, double c_imag, -# double x_center, double y_center, double image_width, -# long max_iteration, long pixel_count, long level_sep, -# long color_num, base_color): +# def fast_julia_plot(double c_real, double c_imag, +# double x_center, double y_center, double image_width, +# long max_iteration, long pixel_count, long level_sep, +# long color_num, base_color): cpdef fast_julia_plot(double c_real, double c_imag, double x_center=0, double y_center=0, double image_width=4, diff --git a/src/sage/geometry/integral_points_generic_dense.pyx b/src/sage/geometry/integral_points_generic_dense.pyx index 5ff619f44d4..4709aa04fec 100644 --- a/src/sage/geometry/integral_points_generic_dense.pyx +++ b/src/sage/geometry/integral_points_generic_dense.pyx @@ -1,4 +1,4 @@ -#cython: wraparound=False, boundscheck=False +# cython: wraparound=False, boundscheck=False from sage.modules.vector_integer_dense cimport Vector_integer_dense as VectorClass from sage.matrix.matrix_dense cimport Matrix_dense as MatrixClass diff --git a/src/sage/geometry/integral_points_integer_dense.pyx b/src/sage/geometry/integral_points_integer_dense.pyx index 0151ffed5c0..c33e7246994 100644 --- a/src/sage/geometry/integral_points_integer_dense.pyx +++ b/src/sage/geometry/integral_points_integer_dense.pyx @@ -1,4 +1,4 @@ -#cython: wraparound=False, boundscheck=False +# cython: wraparound=False, boundscheck=False from sage.modules.vector_integer_dense cimport Vector_integer_dense as VectorClass from sage.matrix.matrix_integer_dense cimport Matrix_integer_dense as MatrixClass diff --git a/src/sage/graphs/base/c_graph.pxd b/src/sage/graphs/base/c_graph.pxd index 9cd670ccbc5..f1dc9857d93 100644 --- a/src/sage/graphs/base/c_graph.pxd +++ b/src/sage/graphs/base/c_graph.pxd @@ -1,9 +1,9 @@ -#************************************************************************** +# ************************************************************************* # Copyright (C) 2008-9 Robert L. Miller # # Distributed under the terms of the GNU General Public License (GPL) -# http://www.gnu.org/licenses/ -#************************************************************************** +# https://www.gnu.org/licenses/ +# ************************************************************************* from sage.data_structures.bitset cimport bitset_t from sage.graphs.base.graph_backends cimport GenericGraphBackend @@ -87,7 +87,7 @@ cdef class CGraphBackend(GenericGraphBackend): cdef int get_vertex_checked(self, u) except ? -2 cdef vertex_label(self, int u_int) cdef int check_labelled_vertex(self, u, bint reverse) except ? -1 - #cdef CGraph _cg # a child class should declare this accordingly + # cdef CGraph _cg # a child class should declare this accordingly cdef bint _directed cdef dict vertex_labels cdef dict vertex_ints diff --git a/src/sage/graphs/base/static_sparse_graph.pyx b/src/sage/graphs/base/static_sparse_graph.pyx index c27f0d9a8cc..0210122d5a9 100644 --- a/src/sage/graphs/base/static_sparse_graph.pyx +++ b/src/sage/graphs/base/static_sparse_graph.pyx @@ -328,7 +328,7 @@ cdef int init_short_digraph(short_digraph g, G, edge_labelled=False, g.neighbors[j][0] = i # Note: cannot use the dereference Cython operator here, do not # known why but the following line does not compile - #dereference(g.neighbors[j]) = i + # dereference(g.neighbors[j]) = i if edge_labelled: edge_labels[g.neighbors[j] - g.edges] = e[2] postincrement(g.neighbors[j]) # increment pointer to next item diff --git a/src/sage/graphs/graph_database.py b/src/sage/graphs/graph_database.py index 8549b208af6..b0fa83f55d4 100644 --- a/src/sage/graphs/graph_database.py +++ b/src/sage/graphs/graph_database.py @@ -428,7 +428,7 @@ class located in :mod:`sage.databases.sql_db` to make the query SQLQuery.__init__(self, graph_db) # if display_cols is None: - # raise TypeError, 'Nonetype display_cols cannot retrieve data.' + # raise TypeError('Nonetype display_cols cannot retrieve data') master_join = {} diff --git a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx index af1960e4632..c6b71e5cd77 100644 --- a/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx +++ b/src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx @@ -693,7 +693,7 @@ cdef class PartitionRefinement_generic: self._fixed_not_minimized.append(pos) self._backtrack() # backtracking - #restore the old state and continue backtracking + # restore the old state and continue backtracking self._part.depth = old_partition_depth self._fixed_minimized = self._fixed_minimized[:old_fixed_minimized_len] self._fixed_not_minimized = copy(old_fixed_not_minimized) diff --git a/src/sage/libs/sirocco.pyx b/src/sage/libs/sirocco.pyx index ca3b267fa66..7be4d96e7ac 100644 --- a/src/sage/libs/sirocco.pyx +++ b/src/sage/libs/sirocco.pyx @@ -1,4 +1,4 @@ -#cython: boundscheck=False, wraparound=False +# cython: boundscheck=False, wraparound=False # distutils: libraries = sirocco # distutils: language = c++ # sage_setup: distribution = sagemath-sirocco diff --git a/src/sage/modular/modform/space.py b/src/sage/modular/modform/space.py index 4405c38f764..9a80d4c97aa 100644 --- a/src/sage/modular/modform/space.py +++ b/src/sage/modular/modform/space.py @@ -1735,8 +1735,8 @@ def embedded_submodule(self): # """ # from sage.modular.modform.all import ModularForms # if self.ambient_module() != right.ambient_module(): -# raise ArithmeticError, "Intersection of %s and %s not defined."%\ -# (self, right) +# raise ArithmeticError("Intersection of %s and %s not defined." % +# (self, right)) # V = self.embedded_submodule().intersection(right.embedded_submodule()) # return ModularForms(self.ambient_module(),V) # return self.span([ self(b) for b in V.basis() ]) diff --git a/src/sage/modular/overconvergent/genus0.py b/src/sage/modular/overconvergent/genus0.py index e1df5066186..ef2d143b1af 100644 --- a/src/sage/modular/overconvergent/genus0.py +++ b/src/sage/modular/overconvergent/genus0.py @@ -1187,7 +1187,7 @@ def eigenfunctions(self, n, F=None, exact_arith=True): F = self.base_ring() if F.is_exact(): - # raise TypeError, "cannot calculate eigenfunctions over exact base fields" + # raise TypeError("cannot calculate eigenfunctions over exact base fields") F = pAdicField(self.prime(), 100) # noqa:F821 m = self.hecke_matrix(self.prime(), n, use_recurrence=True, exact_arith=exact_arith) diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx index a9d074007f0..617c53f8781 100644 --- a/src/sage/modules/free_module_element.pyx +++ b/src/sage/modules/free_module_element.pyx @@ -104,13 +104,13 @@ This is a test from :issue:`20211`:: [1] """ -#***************************************************************************** +# **************************************************************************** # 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/ +# **************************************************************************** cimport cython from cpython.slice cimport PySlice_GetIndicesEx @@ -2214,8 +2214,8 @@ cdef class FreeModuleElement(Vector): # abstract base class else: sep=", " entry = S[i] - #if i > 0: - # entry = " "*(width-len(entry)) + entry + # if i > 0: + # entry = " "*(width-len(entry)) + entry s = s + entry + sep s = s + ")" return s @@ -2339,9 +2339,9 @@ cdef class FreeModuleElement(Vector): # abstract base class e[i] = c return e - ############################# + # ############################ # Plotting - ############################# + # ############################ def plot(self, plot_type=None, start=None, **kwds): """ INPUT: @@ -4272,9 +4272,9 @@ cdef class FreeModuleElement(Vector): # abstract base class return vector(coeffs) -############################################# +# ############################################ # Generic dense element -############################################# +# ############################################ @cython.binding(True) def make_FreeModuleElement_generic_dense(parent, entries, degree): @@ -4734,9 +4734,9 @@ cdef class FreeModuleElement_generic_dense(FreeModuleElement): return vector(CallableSymbolicExpressionRing(args), self.list()) -############################################# +# ############################################ # Generic sparse element -############################################# +# ############################################ @cython.binding(True) def make_FreeModuleElement_generic_sparse(parent, entries, degree): diff --git a/src/sage/quadratic_forms/quadratic_form__mass__Conway_Sloane_masses.py b/src/sage/quadratic_forms/quadratic_form__mass__Conway_Sloane_masses.py index 89460d08713..cd86238e4d9 100644 --- a/src/sage/quadratic_forms/quadratic_form__mass__Conway_Sloane_masses.py +++ b/src/sage/quadratic_forms/quadratic_form__mass__Conway_Sloane_masses.py @@ -656,7 +656,6 @@ def conway_mass(self): # ans *= zeta(RR(j)) # # # Extra L-factor for even dimensional forms -- DO THIS!!! -# raise NotImplementedError, "This routine is not finished yet... =(" +# raise NotImplementedError("This routine is not finished yet") # -# # Return the answer # return ans diff --git a/src/sage/rings/finite_rings/element_givaro.pxd b/src/sage/rings/finite_rings/element_givaro.pxd index 4b1e0430a1c..eb9eca7f954 100644 --- a/src/sage/rings/finite_rings/element_givaro.pxd +++ b/src/sage/rings/finite_rings/element_givaro.pxd @@ -21,7 +21,7 @@ cdef extern from "givaro/givrandom.h": cdef extern from "givaro/gfq.h": cdef cppclass GivaroGfq "Givaro::GFqDom": - #attributes + # attributes unsigned int one unsigned int zero @@ -65,7 +65,7 @@ cdef class FiniteField_givaroElement(FinitePolyExtElement): cdef FiniteField_givaroElement _new_c(self, int value) cdef class Cache_givaro(Cache_base): - cdef GivaroGfq *objectptr # C++ object + cdef GivaroGfq *objectptr # C++ object cdef public object _array cdef FiniteField_givaroElement _zero_element cdef FiniteField_givaroElement _one_element diff --git a/src/sage/rings/number_field/number_field_rel.py b/src/sage/rings/number_field/number_field_rel.py index 861375b0fb7..a7b23599188 100644 --- a/src/sage/rings/number_field/number_field_rel.py +++ b/src/sage/rings/number_field/number_field_rel.py @@ -302,7 +302,7 @@ def __init__(self, base, polynomial, name, raise ValueError("base field and extension cannot have the same name %r" % name) if polynomial.parent().base_ring() != base: polynomial = polynomial.change_ring(base) - #raise ValueError, "The polynomial must be defined over the base field" + # raise ValueError("The polynomial must be defined over the base field") # Generate the nf and bnf corresponding to the base field # defined as polynomials in y, e.g. for rnfisfree diff --git a/src/sage/rings/padics/factory.py b/src/sage/rings/padics/factory.py index a0990ad1720..bb4f6721e6f 100644 --- a/src/sage/rings/padics/factory.py +++ b/src/sage/rings/padics/factory.py @@ -2597,7 +2597,7 @@ def Zq(q, prec=None, type='capped-rel', modulus=None, names=None, raise TypeError("modulus must be a polynomial") if names is not None and not isinstance(names, str): names = str(names) - #raise TypeError, "names must be a string" + # raise TypeError("names must be a string") q = Integer(q) F = q.factor() if len(F) != 1: diff --git a/src/sage/rings/padics/padic_generic.py b/src/sage/rings/padics/padic_generic.py index 39d1fb43006..2685eec7cb5 100644 --- a/src/sage/rings/padics/padic_generic.py +++ b/src/sage/rings/padics/padic_generic.py @@ -200,7 +200,7 @@ def __richcmp__(self, other, op): # def gen(self, n=0): # if n != 0: - # raise IndexError, "only one generator" + # raise IndexError("only one generator") # return self(self.prime()) def print_mode(self): diff --git a/src/sage/rings/padics/pow_computer_ext.pxd b/src/sage/rings/padics/pow_computer_ext.pxd index 5d31790e02e..75132381330 100644 --- a/src/sage/rings/padics/pow_computer_ext.pxd +++ b/src/sage/rings/padics/pow_computer_ext.pxd @@ -48,7 +48,7 @@ cdef class PowComputer_ZZ_pX_FM_Eis(PowComputer_ZZ_pX_FM): cdef void cleanup_ZZ_pX_FM_Eis(self) noexcept cdef class PowComputer_ZZ_pX_small(PowComputer_ZZ_pX): - cdef object c # using a python list so that we can store ntl_ZZ_pContext_class objects + cdef object c # using a python list so that we can store ntl_ZZ_pContext_class objects cdef ZZ_pX_Modulus_c *mod cdef void cleanup_ZZ_pX_small(self) noexcept @@ -62,14 +62,14 @@ cdef class PowComputer_ZZ_pX_small_Eis(PowComputer_ZZ_pX_small): cdef void cleanup_ZZ_pX_small_Eis(self) noexcept cdef class PowComputer_ZZ_pX_big(PowComputer_ZZ_pX): - cdef object context_list # using a python list so that we can store ntl_ZZ_pContext_class objects + cdef object context_list # using a python list so that we can store ntl_ZZ_pContext_class objects cdef ZZ_pX_Modulus_c *modulus_list cdef ntl_ZZ_pContext_class top_context cdef ZZ_pX_Modulus_c top_mod - cdef object context_dict #currently using a dict, optimize for speed later - cdef object modulus_dict #currently using a dict, optimize for speed later + cdef object context_dict # currently using a dict, optimize for speed later + cdef object modulus_dict # currently using a dict, optimize for speed later cdef void cleanup_ZZ_pX_big(self) noexcept @@ -81,7 +81,7 @@ cdef class PowComputer_ZZ_pX_big_Eis(PowComputer_ZZ_pX_big): cdef void cleanup_ZZ_pX_big_Eis(self) noexcept -#cdef class PowComputer_ZZ_pEX(PowComputer_ext): +# cdef class PowComputer_ZZ_pEX(PowComputer_ext): # cdef ntl_ZZ_pEContext get_context(self, long n) # cdef ntl_ZZ_pEContext get_top_context(self) # cdef void restore_context(self, long n) @@ -89,19 +89,18 @@ cdef class PowComputer_ZZ_pX_big_Eis(PowComputer_ZZ_pX_big): # cdef ZZ_pEX_Modulus_c get_modulus(self, long n) # cdef ZZ_pEX_Modulus_c get_top_modulus(self) # -#cdef class PowComputer_ZZ_pEX_FM(PowComputer_ZZ_pEX): +# cdef class PowComputer_ZZ_pEX_FM(PowComputer_ZZ_pEX): # cdef ZZ_pEX_c poly # cdef ntl_ZZ_pEContext c # cdef ZZ_pEX_Modulus_c mod # # -#cdef class PowComputer_ZZ_pEX_small(PowComputer_ZZ_pEX): +# cdef class PowComputer_ZZ_pEX_small(PowComputer_ZZ_pEX): # cdef ZZ_pEX_c *poly # cdef ntl_ZZ_pEContext *c # cdef ZZ_pEX_Modulus_c *mod # -#cdef class PowComputer_ZZ_pEX_big(PowComputer_ZZ_pEX): +# cdef class PowComputer_ZZ_pEX_big(PowComputer_ZZ_pEX): # cdef ZZ_pEX_c poly -# cdef context_dict #currently using a dict, optimize for speed later -# cdef modulus_dict #currently using a dict, optimize for speed later -# +# cdef context_dict # currently using a dict, optimize for speed later +# cdef modulus_dict # currently using a dict, optimize for speed later diff --git a/src/sage/schemes/elliptic_curves/heegner.py b/src/sage/schemes/elliptic_curves/heegner.py index f0a7087d7ea..52820d8166b 100644 --- a/src/sage/schemes/elliptic_curves/heegner.py +++ b/src/sage/schemes/elliptic_curves/heegner.py @@ -449,7 +449,7 @@ def degree_over_H(self): """ c = self.__c if c == 1: - return ZZ(1) + return ZZ.one() # Let K_c be the ring class field. We have by class field theory that # Gal(K_c / H) = (O_K / c O_K)^* / ((Z/cZ)^* M), @@ -1388,17 +1388,17 @@ def _repr_(self): """ return "Complex conjugation automorphism of %s" % self.domain() -## def __mul__(self, right): -## """ -## Return the composition of two automorphisms. +# def __mul__(self, right): +# """ +# Return the composition of two automorphisms. -## EXAMPLES:: +# EXAMPLES:: -## sage: ? -## """ -## if self.parent() != right.__parent(): -## raise TypeError, "automorphisms must be of the same class field" -## raise NotImplementedError +# sage: ? +# """ +# if self.parent() != right.__parent(): +# raise TypeError("automorphisms must be of the same class field") +# raise NotImplementedError def __invert__(self): """ @@ -1679,7 +1679,7 @@ def ideal(self): f = self.quadratic_form() c = M.conductor() sqrtD = K.gen() - (A,B,C) = f + A, B, C = f if A % c == 0: A, C = C, A return K.fractional_ideal([A, (-B+c*sqrtD)/2]) @@ -1706,7 +1706,7 @@ def ideal(self): ## """ ## if isinstance(z, HeegnerPointOnX0N): ## if z.ring_class_field() != self.domain(): -## raise NotImplementedError, "class fields must be the same" +## raise NotImplementedError("class fields must be the same") ## # TODO -- check more compatibilities? ## # TODO -- this is surely backwards -- something must be inverted? ## f = z.quadratic_form() * self.quadratic_form() diff --git a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx index e55500f0d0f..3ff26e6791c 100644 --- a/src/sage/schemes/elliptic_curves/mod_sym_num.pyx +++ b/src/sage/schemes/elliptic_curves/mod_sym_num.pyx @@ -1,6 +1,6 @@ -#cdivision=False -#cython: cdivision_warnings=False -#cython: profile=False +# cdivision=False +# cython: cdivision_warnings=False +# cython: profile=False r""" Modular symbols by numerical integration @@ -1254,8 +1254,8 @@ cdef class ModularSymbolNumerical: if err > 0.1: # the following did not work (compilation failed) - #from warnings import warn - #warn(Rounded an error of %s, looks like a bug." % err, + # 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 " + "in mod_sym_num.pyx.") @@ -1411,8 +1411,8 @@ cdef class ModularSymbolNumerical: cdef ComplexNumber q, s cdef int n - #self.nc_sums += 1 - #self.nc_terms += Integer(number_of_terms) + # self.nc_sums += 1 + # self.nc_terms += Integer(number_of_terms) if number_of_terms > 10000000: print("Warning: more than 10^7 terms to sum") @@ -1467,12 +1467,12 @@ cdef class ModularSymbolNumerical: # " T=%s" % (tau,number_of_terms), level=5) cdef complex q, s cdef int n - #self.nc_sums += 1 - #self.nc_terms += Integer(number_of_terms) + # self.nc_sums += 1 + # self.nc_terms += Integer(number_of_terms) if number_of_terms > 10000000: print("Warning: more than 10^7 terms to sum") - #raise Warning("more than 10^7 terms to sum") + # raise Warning("more than 10^7 terms to sum") if number_of_terms > self._lans: self._add_an_coefficients(number_of_terms) @@ -1525,8 +1525,8 @@ cdef class ModularSymbolNumerical: # " T=%s" % (y,m,number_of_terms), level=5) cdef double q, qq cdef int n, i - #self.nc_sums += 1 - #self.nc_terms += Integer(number_of_terms) + # self.nc_sums += 1 + # self.nc_terms += Integer(number_of_terms) if number_of_terms > 10000000: print(" Warning: more than 10^7 terms to sum") @@ -1605,8 +1605,8 @@ cdef class ModularSymbolNumerical: # " T=%s" % (y,m,number_of_terms), level=5) cdef RealNumber q, qq cdef int n, i - #self.nc_sums += 1 - #self.nc_terms += Integer(number_of_terms) + # self.nc_sums += 1 + # self.nc_terms += Integer(number_of_terms) if number_of_terms > 10000000: print(" Warning: more than 10^7 terms to sum") @@ -2293,7 +2293,7 @@ cdef class ModularSymbolNumerical: if method == "direct" or method == "both": verbose(" using the direct integration from %s to %s with " "%s terms to sum" % (r, rr, T), level=2) - #self.nc_direct += 1 + # self.nc_direct += 1 ans = self._from_r_to_rr_approx_direct(r, rr, epsQ, epsQQ, wQ, wQQ, T, prec, eps, use_partials) @@ -2303,7 +2303,7 @@ cdef class ModularSymbolNumerical: if method == "indirect" or method == "both": verbose(" using the indirect integration from %s to %s " "with %s terms to sum" % (r, rr, T1+T2), level=2) - #self.nc_indirect += 1 + # self.nc_indirect += 1 ans2 = (self._from_ioo_to_r_approx(r, eps/2, use_partials=use_partials) - self._from_ioo_to_r_approx(rr, eps/2, diff --git a/src/sage/schemes/generic/morphism.py b/src/sage/schemes/generic/morphism.py index 51906d804eb..c3ee035d907 100644 --- a/src/sage/schemes/generic/morphism.py +++ b/src/sage/schemes/generic/morphism.py @@ -248,12 +248,14 @@ def __call__(self, x, *args, **kwds): try: return self.pushforward(x, *args, **kwds) except (AttributeError, TypeError, NotImplementedError): - pass # raise TypeError, "%s must be coercible into %s"%(x, self.domain()) + # raise TypeError("%s must be coercible into %s" % (x, self.domain())) + pass + # Here, we would like to do ##try: ## x = D(x). ##except (TypeError, NotImplementedError): - ## raise TypeError, "%s fails to convert into the map's domain %s, but a `pushforward` method is not properly implemented"%(x, self.domain()) + ## raise TypeError("%s fails to convert into the map's domain %s, but a `pushforward` method is not properly implemented" % (x, self.domain())) # However, this would involve a test whether x.codomain() == # self. This would trigger a Groebner basis computation, that # (1) could be slow and (2) could involve an even slower toy diff --git a/src/sage/structure/category_object.pyx b/src/sage/structure/category_object.pyx index e0c217a0e3b..8571811dd97 100644 --- a/src/sage/structure/category_object.pyx +++ b/src/sage/structure/category_object.pyx @@ -756,7 +756,7 @@ cdef class CategoryObject(SageObject): pass except (AttributeError, KeyError): raise - #raise RuntimeError, "If you change the pickling code in parent or category_object, you need to update the _pickle_version field" + # raise RuntimeError("If you change the pickling code in parent or category_object, you need to update the _pickle_version field") def __hash__(self): """ diff --git a/src/sage/topology/cubical_complex.py b/src/sage/topology/cubical_complex.py index 055a597776e..5d95c8f7522 100644 --- a/src/sage/topology/cubical_complex.py +++ b/src/sage/topology/cubical_complex.py @@ -1472,13 +1472,13 @@ def suspension(self, n=1): ... NotImplementedError: suspensions are not implemented for cubical complexes """ -# if n<0: -# raise ValueError, "n must be nonnegative." -# if n==0: -# return self -# if n==1: -# return self.join(cubical_complexes.Sphere(0)) -# return self.suspension().suspension(int(n-1)) + # if n < 0: + # raise ValueError("n must be nonnegative") + # if n == 0: + # return self + # if n == 1: + # return self.join(cubical_complexes.Sphere(0)) + # return self.suspension().suspension(int(n-1)) raise NotImplementedError("suspensions are not implemented for cubical complexes") def product(self, other):