Skip to content

Commit 6b28ac2

Browse files
committed
fix some suggested details
1 parent e59963e commit 6b28ac2

File tree

4 files changed

+37
-37
lines changed

4 files changed

+37
-37
lines changed

src/sage/combinat/designs/orthogonal_arrays_find_recursive.pyx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ cpdef find_product_decomposition(int k,int n):
145145
sage: _ = f(*args)
146146
"""
147147
cdef int n1,n2
148-
for n1 in range(2,n):
148+
for n1 in range(2, n):
149149
n2 = n/n1 # n2 is decreasing along the loop
150150
if n2 < n1:
151151
break
@@ -296,7 +296,7 @@ cpdef find_construction_3_3(int k,int n):
296296
if not(is_available(k, mm) and is_available(k, mm + 1)):
297297
continue
298298

299-
for nn in range(2,n//mm+1):
299+
for nn in range(2, n//mm+1):
300300
i = n-nn*mm
301301
if i <= 0:
302302
continue
@@ -335,7 +335,7 @@ cpdef find_construction_3_4(int k, int n):
335335
not is_available(k,mm+2)):
336336
continue
337337

338-
for nn in range(2,n/mm+1):
338+
for nn in range(2, n//mm+1):
339339
i = n-nn*mm
340340
if i<=0:
341341
continue
@@ -372,14 +372,14 @@ cpdef find_construction_3_5(int k, int n):
372372
sage: find_construction_3_5(9,24)
373373
"""
374374
cdef int mm,i,nn,r,s,t
375-
for mm in range(2,n/2+1):
375+
for mm in range(2, n//2+1):
376376
if (mm+3 >= n or
377377
not is_available(k,mm+1) or
378378
not is_available(k,mm+2) or
379379
not is_available(k,mm+3)):
380380
continue
381381

382-
for nn in range(2,n/mm+1):
382+
for nn in range(2, n//mm+1):
383383
i = n-nn*mm
384384
if i<=0:
385385
continue
@@ -429,7 +429,7 @@ cpdef find_construction_3_6(int k,int n):
429429
not is_available(k,mm+2)):
430430
continue
431431

432-
for nn in range(2,n/mm+1):
432+
for nn in range(2, n//mm+1):
433433
i = n-nn*mm
434434
if i<=0:
435435
continue
@@ -909,7 +909,7 @@ cpdef find_brouwer_van_rees_with_one_truncated_column(int k,int n):
909909
cdef tuple values
910910

911911
# We write n=rm+remainder
912-
for m in range(2,n//2):
912+
for m in range(2, n//2):
913913
if not is_available(k,m):
914914
continue
915915

@@ -931,7 +931,7 @@ cpdef find_brouwer_van_rees_with_one_truncated_column(int k,int n):
931931
continue
932932

933933
max_multiplier = max(available_multipliers)
934-
for r in range(2,n//m+1):
934+
for r in range(2, n//m+1):
935935
remainder = n-r*m
936936
if (remainder > r*max_multiplier or
937937
not is_available(k+1,r) or

src/sage/libs/giac/giac.pyx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -887,15 +887,15 @@ cdef class Pygen(GiacMethods_base):
887887
return result
888888
else:
889889
sig_on()
890-
result = str(self.type)+"\nResult is too big for Display. If you really want to see it use print"
890+
result = str(self.type) + "\nResult is too big for Display. If you really want to see it use print"
891891
sig_off()
892892
return result
893893
894894
def __str__(self):
895895
#if self.gptr == NULL:
896896
# return ''
897897
sig_on()
898-
result=decstring23(GIAC_print(self.gptr[0], context_ptr).c_str()) #python3
898+
result = decstring23(GIAC_print(self.gptr[0], context_ptr).c_str())
899899
sig_off()
900900
return result
901901
@@ -960,15 +960,15 @@ cdef class Pygen(GiacMethods_base):
960960
if(i<0):
961961
i=i+n
962962
sig_on()
963-
result=self.gptr[0][<int>i]
963+
result = self.gptr[0][<int>i]
964964
sig_off()
965965
return _wrap_gen(result)
966966
else:
967967
raise IndexError('list index %s out of range'%(i))
968968
else:
969969
if isinstance(i,slice):
970970
sig_on()
971-
result=gen(_getgiacslice(self,i),<short int>self._subtype)
971+
result = gen(_getgiacslice(self,i),<short int>self._subtype)
972972
sig_off()
973973
return _wrap_gen(result)
974974
# add support for multi indexes
@@ -1065,7 +1065,7 @@ cdef class Pygen(GiacMethods_base):
10651065
def eval(self):
10661066
cdef gen result
10671067
sig_on()
1068-
result=GIAC_protecteval(self.gptr[0],giacsettings.eval_level,context_ptr)
1068+
result = GIAC_protecteval(self.gptr[0],giacsettings.eval_level,context_ptr)
10691069
sig_off()
10701070
return _wrap_gen(result)
10711071
@@ -1078,7 +1078,7 @@ cdef class Pygen(GiacMethods_base):
10781078
if not isinstance(self, Pygen):
10791079
self=Pygen(self)
10801080
sig_on()
1081-
result= (<Pygen>self).gptr[0] + (<Pygen>right).gptr[0]
1081+
result = (<Pygen>self).gptr[0] + (<Pygen>right).gptr[0]
10821082
sig_off()
10831083
return _wrap_gen(result)
10841084
@@ -1128,7 +1128,7 @@ cdef class Pygen(GiacMethods_base):
11281128
if not isinstance(self, Pygen):
11291129
self=Pygen(self)
11301130
sig_on()
1131-
result= (<Pygen>self).gptr[0] - (<Pygen>right).gptr[0]
1131+
result = (<Pygen>self).gptr[0] - (<Pygen>right).gptr[0]
11321132
sig_off()
11331133
return _wrap_gen(result)
11341134
@@ -1147,7 +1147,7 @@ cdef class Pygen(GiacMethods_base):
11471147
right = Pygen(right)
11481148
if not isinstance(self, Pygen):
11491149
self = Pygen(self)
1150-
#result= (<Pygen>self).gptr[0] * (<Pygen>right).gptr[0]
1150+
#result = (<Pygen>self).gptr[0] * (<Pygen>right).gptr[0]
11511151
#NB: with the natural previous method, the following error generated by
11521152
#giac causes python to quit instead of an error message.
11531153
#l=Pygen([1,2]);l.transpose()*l;
@@ -1184,7 +1184,7 @@ cdef class Pygen(GiacMethods_base):
11841184
if not isinstance(self, Pygen):
11851185
self = Pygen(self)
11861186
sig_on()
1187-
result= (<Pygen>self).gptr[0] / (<Pygen>right).gptr[0]
1187+
result = (<Pygen>self).gptr[0] / (<Pygen>right).gptr[0]
11881188
sig_off()
11891189
return _wrap_gen(result)
11901190
@@ -1195,7 +1195,7 @@ cdef class Pygen(GiacMethods_base):
11951195
if not isinstance(self, Pygen):
11961196
self = Pygen(self)
11971197
sig_on()
1198-
result= GIAC_pow((<Pygen>self).gptr[0], (<Pygen>right).gptr[0], context_ptr )
1198+
result = GIAC_pow((<Pygen>self).gptr[0], (<Pygen>right).gptr[0], context_ptr )
11991199
sig_off()
12001200
return _wrap_gen(result)
12011201
@@ -1205,12 +1205,12 @@ cdef class Pygen(GiacMethods_base):
12051205
right = Pygen(right)
12061206
if not isinstance(self, Pygen):
12071207
self = Pygen(self)
1208-
#result= gen(GIAC_makenewvecteur((<Pygen>self).gptr[0],(<Pygen>right).gptr[0]),<short int>1)
1208+
#result = gen(GIAC_makenewvecteur((<Pygen>self).gptr[0],(<Pygen>right).gptr[0]),<short int>1)
12091209
#to have an integer output:
1210-
#result= GIAC_smod(result,context_ptr)
1210+
#result = GIAC_smod(result,context_ptr)
12111211
#we give a modular output:
12121212
sig_on()
1213-
result= GIAC_giacmod((<Pygen>self).gptr[0], (<Pygen>right).gptr[0],context_ptr)
1213+
result = GIAC_giacmod((<Pygen>self).gptr[0], (<Pygen>right).gptr[0],context_ptr)
12141214
sig_off()
12151215
return _wrap_gen(result)
12161216
@@ -1338,7 +1338,7 @@ cdef class Pygen(GiacMethods_base):
13381338
\frac{...x^{4}...-...y...}{...y^{2}-3...x...}
13391339
"""
13401340
sig_on()
1341-
result=decstring23(GIAC_gen2tex(self.gptr[0], context_ptr).c_str()) #python3
1341+
result = decstring23(GIAC_gen2tex(self.gptr[0], context_ptr).c_str())
13421342
sig_off()
13431343
return result
13441344
@@ -1547,7 +1547,7 @@ cdef class Pygen(GiacMethods_base):
15471547
raise NotImplementedError("Unable to parse Giac output: %s" % self.__repr__())
15481548
else:
15491549
try:
1550-
result=R(self.__str__())
1550+
result = R(self.__str__())
15511551
return result
15521552
15531553
except Exception:
@@ -1668,7 +1668,7 @@ cdef class Pygen(GiacMethods_base):
16681668
if not isinstance(self, Pygen):
16691669
self = Pygen(self)
16701670
sig_on()
1671-
result= giacgenrichcmp((<Pygen>self).gptr[0],(<Pygen>other).gptr[0], op, context_ptr )
1671+
result = giacgenrichcmp((<Pygen>self).gptr[0],(<Pygen>other).gptr[0], op, context_ptr )
16721672
sig_off()
16731673
return result == 1
16741674
@@ -1686,7 +1686,7 @@ cdef class Pygen(GiacMethods_base):
16861686
property _subtype:
16871687
def __get__(self):
16881688
sig_on()
1689-
result=self.gptr.subtype
1689+
result = self.gptr.subtype
16901690
sig_off()
16911691
return result
16921692
@@ -1862,7 +1862,7 @@ cdef gen pylongtogen(a) except +:
18621862
#def giaceval(Pygen self):
18631863
# cdef gen result
18641864
# try:
1865-
# result=GIAC_protecteval(self.gptr[0],1,context_ptr)
1865+
# result = GIAC_protecteval(self.gptr[0],1,context_ptr)
18661866
# return _wrap_gen(result)
18671867
# except:
18681868
# raise
@@ -1872,7 +1872,7 @@ cdef gen pylongtogen(a) except +:
18721872
#
18731873
# cdef gen result
18741874
# try:
1875-
# result=GIAC_factor(self.gptr[0],context_ptr)
1875+
# result = GIAC_factor(self.gptr[0],context_ptr)
18761876
# return _wrap_gen(result)
18771877
# except:
18781878
# raise
@@ -1882,7 +1882,7 @@ cdef gen pylongtogen(a) except +:
18821882
#def giacfactors(Pygen self):
18831883
# cdef gen result
18841884
# try:
1885-
# result=GIAC_factors(self.gptr[0],context_ptr)
1885+
# result = GIAC_factors(self.gptr[0],context_ptr)
18861886
# return _wrap_gen(result)
18871887
# except:
18881888
# raise
@@ -1893,7 +1893,7 @@ cdef gen pylongtogen(a) except +:
18931893
#def giacnormal(Pygen self):
18941894
# cdef gen result
18951895
# try:
1896-
# result=GIAC_normal(self.gptr[0],context_ptr)
1896+
# result = GIAC_normal(self.gptr[0],context_ptr)
18971897
# return _wrap_gen(result)
18981898
# except:
18991899
# raise
@@ -1902,8 +1902,8 @@ cdef gen pylongtogen(a) except +:
19021902
#def giacgcd(Pygen a, Pygen b):
19031903
# cdef gen result
19041904
# try:
1905-
# result=gen( GIAC_makenewvecteur(a.gptr[0],b.gptr[0]) ,<short int>1)
1906-
# result=GIAC_gcd(result,context_ptr)
1905+
# result = gen( GIAC_makenewvecteur(a.gptr[0],b.gptr[0]) ,<short int>1)
1906+
# result = GIAC_gcd(result,context_ptr)
19071907
# return _wrap_gen(result)
19081908
# except:
19091909
# raise
@@ -1983,7 +1983,7 @@ for i in moremethods:
19831983
GiacMethods[i] = tmp
19841984
19851985
for i in mostkeywords+moremethods:
1986-
GiacMethods[i].__doc__ = eval("Pygen."+i+".__doc__")
1986+
GiacMethods[i].__doc__ = eval("Pygen." + i + ".__doc__")
19871987
19881988
# To avoid conflicts we export only these few ones. Most giac keywords will be
19891989
# available through: libgiac.keywordname
@@ -2016,7 +2016,7 @@ def loadgiacgen(str filename):
20162016
"""
20172017
cdef gen result
20182018
sig_on()
2019-
result=GIAC_unarchive( <string>encstring23(filename), context_ptr)
2019+
result = GIAC_unarchive( <string>encstring23(filename), context_ptr)
20202020
sig_off()
20212021
return _wrap_gen(result)
20222022

src/sage/matrix/matrix_dense.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ cdef class Matrix_dense(matrix.Matrix):
171171
[4|1]
172172
[3|0]
173173
"""
174-
nc, nr = (self.ncols(), self.nrows())
174+
nc, nr = self.ncols(), self.nrows()
175175
cdef Matrix_dense atrans
176176
atrans = self.new_matrix(nrows=nc, ncols=nr,
177177
copy=False, coerce=False)
@@ -256,7 +256,7 @@ cdef class Matrix_dense(matrix.Matrix):
256256
prod = self.new_matrix(nr, nc, copy=False, coerce=False)
257257
for r in range(nr):
258258
for c in range(nc):
259-
entry = self.get_unsafe(r,c)*other.get_unsafe(r,c)
259+
entry = self.get_unsafe(r, c)*other.get_unsafe(r,c)
260260
prod.set_unsafe(r,c,entry)
261261
return prod
262262

src/sage/matrix/matrix_integer_dense.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5697,12 +5697,12 @@ cdef class Matrix_integer_dense(Matrix_dense):
56975697
[4|1]
56985698
[3|0]
56995699
"""
5700-
nr, nc = (self._nrows, self._ncols)
5700+
nr, nc = self._nrows, self._ncols
57015701

57025702
cdef Matrix_integer_dense A
57035703
A = self._new(nc,nr)
57045704
cdef Py_ssize_t i, j
5705-
cdef Py_ssize_t ri, rj # reversed i and j
5705+
cdef Py_ssize_t ri, rj # reversed i and j
57065706
sig_on()
57075707
ri = nr
57085708
for i from 0 <= i < nr:

0 commit comments

Comments
 (0)