Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

totally trivial space adding ticket #39327

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sage/calculus/interpolators.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
14 changes: 7 additions & 7 deletions src/sage/calculus/riemann.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions src/sage/categories/homset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out code here at all?

# 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
Expand Down
4 changes: 2 additions & 2 deletions src/sage/coding/binary_code.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2140,7 +2140,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
Expand Down Expand Up @@ -4035,7 +4035,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])
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/crystals/pbw_datum.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/sage/combinat/crystals/spins.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -24,7 +24,7 @@ representing the elements of the spin crystal by sequences of signs
# ``-`` by `-1`.


#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2007 Anne Schilling <anne at math.ucdavis.edu>
# Nicolas Thiery <nthiery at users.sf.net>
# Daniel Bump <bump at match.stanford.edu>
Expand All @@ -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
Expand Down
23 changes: 11 additions & 12 deletions src/sage/combinat/permutation_cython.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/rooted_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 4 additions & 4 deletions src/sage/dynamics/complex_dynamics/mandel_julia_helper.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/sage/geometry/integral_points_generic_dense.pyx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/sage/geometry/integral_points_integer_dense.pyx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/sage/graphs/base/c_graph.pxd
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#**************************************************************************
# *************************************************************************
# Copyright (C) 2008-9 Robert L. Miller <[email protected]>
#
# 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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/base/static_sparse_graph.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
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
Expand Down Expand Up @@ -1111,7 +1111,7 @@
sage: while not G.is_strongly_connected():
....: shuffle(r)
....: G.add_edges(enumerate(r), loops=False)
sage: spectral_radius(G, 1e-10) # random

Check warning on line 1114 in src/sage/graphs/base/static_sparse_graph.pyx

View workflow job for this annotation

GitHub Actions / test-long (src/sage/[g-o]*)

Warning: slow doctest:

slow doctest:
(1.9997956006500042, 1.9998043797692782)

The algorithm takes care of multiple edges::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/graph_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand Down
2 changes: 1 addition & 1 deletion src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/libs/sirocco.pyx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/sage/modular/modform/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -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() ])
Expand Down
2 changes: 1 addition & 1 deletion src/sage/modular/overconvergent/genus0.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 11 additions & 11 deletions src/sage/modules/free_module_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/sage/rings/finite_rings/element_givaro.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cdef extern from "givaro/givrandom.h":

cdef extern from "givaro/gfq.h":
cdef cppclass GivaroGfq "Givaro::GFqDom<int>":
#attributes
# attributes
unsigned int one
unsigned int zero

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/number_field/number_field_rel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading