Skip to content

Commit df07636

Browse files
committed
flake8: fix E262 + E265 inline + block comment should start with '# '
printer.py is left untouched to reduce chance of conflicts
1 parent 0dcefae commit df07636

File tree

5 files changed

+33
-40
lines changed

5 files changed

+33
-40
lines changed

galgebra/dop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _eval_derivative_n_times_terms(terms, x, n):
5858
for k, term in enumerate(terms):
5959
dc = _basic_diff(term[0], x)
6060
pd = _basic_diff(term[1], x)
61-
#print 'D0, term, dc, pd =', D0, term, dc, pd
61+
# print 'D0, term, dc, pd =', D0, term, dc, pd
6262
if dc != 0:
6363
new_terms.append((dc, term[1]))
6464
if pd != 0:

galgebra/ga.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def __init__(self, bases, *, wedge=True, **kwargs):
477477
if self.e_sq == S(0):
478478
self.sing_flg = True
479479
print('!!!!If I**2 = 0, I cannot be normalized!!!!')
480-
#raise ValueError('!!!!If I**2 = 0, I cannot be normalized!!!!')
480+
# raise ValueError('!!!!If I**2 = 0, I cannot be normalized!!!!')
481481
if self.e_sq > S(0):
482482
self.i = self.e/sqrt(self.e_sq)
483483
self.i_inv = self.i
@@ -951,7 +951,7 @@ def _build_connection(self):
951951

952952
######## Functions for Calculation products of blades/bases ########
953953

954-
#******************** Geometric Product (*) ***********************#
954+
# ******************* Geometric Product (*) ********************** #
955955

956956
def geometric_product_basis_blades(self, blade12):
957957
# geometric (*) product for orthogonal basis
@@ -1037,9 +1037,9 @@ def reduce_basis(self, blst):
10371037
blst_flg[i] = tmp[2]
10381038
else: # blst_expand[i] revised
10391039
blst_coef[i] = -blst_coef[i]
1040-
#if revision force one more pass in case revision
1041-
#causes repeated index previous to revised pair of
1042-
#indexes
1040+
# if revision force one more pass in case revision
1041+
# causes repeated index previous to revised pair of
1042+
# indexes
10431043
blst_flg[i] = False
10441044
blst_expand[i] = tmp[3]
10451045
blst_coef.append(-blst_coef[i] * tmp[0])
@@ -1110,7 +1110,7 @@ def reduce_basis_loop(g, blst):
11101110

11111111
return True # revision complete, blst in normal order
11121112

1113-
#******************* Outer/wedge (^) product **********************#
1113+
# ****************** Outer/wedge (^) product ********************* #
11141114

11151115
@staticmethod
11161116
def blade_reduce(lst):
@@ -1152,7 +1152,7 @@ def wedge_product_basis_blades(self, blade12): # blade12 = blade1*blade2
11521152
else:
11531153
return S(0)
11541154

1155-
#****** Dot (|) product, reft (<) and right (>) contractions ******#
1155+
# ***** Dot (|) product, reft (<) and right (>) contractions ***** #
11561156

11571157
def _dot_product_grade(self, grade1, grade2, mode):
11581158
"""
@@ -2010,7 +2010,7 @@ def __init__(self, __u, __coords, *, ga, norm=False, name=None, root='e', debug=
20102010
Base Geometric Algebra
20112011
"""
20122012

2013-
#print '!!!Enter Sm!!!'
2013+
# print '!!!Enter Sm!!!'
20142014

20152015
if printer.GaLatexPrinter.latex_flg:
20162016
printer.GaLatexPrinter.restore()
@@ -2033,19 +2033,19 @@ def __init__(self, __u, __coords, *, ga, norm=False, name=None, root='e', debug=
20332033
basis_str = basis_str[:-1]
20342034
"""
20352035

2036-
#print 'u =', u
2036+
# print 'u =', u
20372037

2038-
if isinstance(u,mv.Mv): #Define vector manifold
2038+
if isinstance(u,mv.Mv): # Define vector manifold
20392039
self.ebasis = []
20402040
for coord in coords:
2041-
#Partial derivation of vector function to get basis vectors
2041+
# Partial derivation of vector function to get basis vectors
20422042
self.ebasis.append(u.diff(coord))
20432043

2044-
#print 'sm ebasis =', self.ebasis
2044+
# print 'sm ebasis =', self.ebasis
20452045

20462046
self.g = []
20472047
for b1 in self.ebasis:
2048-
#Metric tensor from dot products of basis vectors
2048+
# Metric tensor from dot products of basis vectors
20492049
tmp = []
20502050
for b2 in self.ebasis:
20512051
tmp.append(b1 | b2)
@@ -2063,12 +2063,12 @@ def __init__(self, __u, __coords, *, ga, norm=False, name=None, root='e', debug=
20632063
tmp.append(diff(x_i, u_j))
20642064
dxdu.append(tmp)
20652065

2066-
#print 'dxdu =', dxdu
2066+
# print 'dxdu =', dxdu
20672067

20682068
sub_pairs = list(zip(ga.coords, u))
20692069

2070-
#Construct metric tensor form coordinate maps
2071-
g = eye(n_sub) #Zero n_sub x n_sub sympy matrix
2070+
# Construct metric tensor form coordinate maps
2071+
g = eye(n_sub) # Zero n_sub x n_sub sympy matrix
20722072
n_range = list(range(n_sub))
20732073
for i in n_range:
20742074
for j in n_range:
@@ -2083,8 +2083,8 @@ def __init__(self, __u, __coords, *, ga, norm=False, name=None, root='e', debug=
20832083

20842084
Ga.__init__(self, root, g=g, coords=coords, norm=norm, debug=debug)
20852085

2086-
if isinstance(u,mv.Mv): #Construct additional functions for vector manifold
2087-
#self.r_basis_mv under construction
2086+
if isinstance(u,mv.Mv): # Construct additional functions for vector manifold
2087+
# self.r_basis_mv under construction
20882088

20892089
pass
20902090

galgebra/lt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class Lt(object):
155155

156156
@staticmethod
157157
def setup(ga):
158-
#coords = [Symbol('mu_' + str(x)) for x in ga.coords]
158+
# coords = [Symbol('mu_' + str(x)) for x in ga.coords]
159159
coords = ga.coords
160160
x = sum([coords[i] * ga.basis[i] for i in ga.n_range])
161161
return coords, x
@@ -203,7 +203,7 @@ def __init__(self, *args, ga, f=False, mode='g'):
203203
for (lt_i, base) in zip(mat_rep, self.Ga.basis):
204204
self.lt_dict[base] = lt_i
205205
else:
206-
#mat_rep = map(list, zip(*mat_rep)) # Transpose list of lists
206+
# mat_rep = map(list, zip(*mat_rep)) # Transpose list of lists
207207
for (row, base1) in zip(mat_rep, self.Ga.basis):
208208
tmp = 0
209209
for (col, base2) in zip(row, self.Ga.basis):

galgebra/mv.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def characterise_Mv(self):
132132
args = [obj]
133133

134134
grades = []
135-
#print 'args =', args
135+
# print 'args =', args
136136
self.is_blade_rep = True
137137
for term in args:
138138
if term.is_commutative:
@@ -141,7 +141,7 @@ def characterise_Mv(self):
141141
else:
142142
c, nc = term.args_cnc(split_1=False)
143143
blade = nc[0]
144-
#print 'blade =',blade
144+
# print 'blade =',blade
145145
if blade in self.Ga.blades.flat:
146146
grade = self.Ga.blades_to_grades_dict[blade]
147147
if grade not in grades:
@@ -349,9 +349,9 @@ def __init__(self, *args, ga, recp=None, coords=None, **kwargs):
349349
self.is_blade_rep = x.is_blade_rep
350350
self.i_grade = x.i_grade
351351
else:
352-
if isinstance(x, Expr): #copy constructor for obj expression
352+
if isinstance(x, Expr): # copy constructor for obj expression
353353
self.obj = x
354-
else: #copy constructor for scalar obj expression
354+
else: # copy constructor for scalar obj expression
355355
self.obj = S(x)
356356
self.is_blade_rep = True
357357
self.characterise_Mv()
@@ -443,7 +443,7 @@ def __hash__(self):
443443
def __eq__(self, A):
444444
if isinstance(A, Mv):
445445
diff = (self - A).expand().simplify()
446-
#diff = (self - A).expand()
446+
# diff = (self - A).expand()
447447
if diff.obj == S(0):
448448
return True
449449
else:
@@ -724,7 +724,7 @@ def append_plus(c_str):
724724
s = ''
725725
for (index, (coef, base, grade)) in sorted_terms:
726726
coef = printer.coef_simplify(coef)
727-
#coef = simplify(coef)
727+
# coef = simplify(coef)
728728
l_coef = printer.latex(coef)
729729
if l_coef == '1' and base != S(1):
730730
l_coef = ''
@@ -988,7 +988,7 @@ def blade_coefs(self, blade_lst=None):
988988
if blade_lst is None:
989989
blade_lst = self.Ga.mv_blades.flat
990990

991-
#print 'Enter blade_coefs blade_lst =', blade_lst, type(blade_lst), [i.is_blade() for i in blade_lst]
991+
# print 'Enter blade_coefs blade_lst =', blade_lst, type(blade_lst), [i.is_blade() for i in blade_lst]
992992

993993
for blade in blade_lst:
994994
if not blade.is_base() or not blade.is_blade():
@@ -1994,7 +1994,7 @@ def rot(itheta, A, hint='-'): # Rotate by the 2-blade itheta the multivector A
19941994
raise ValueError('A not a multivector in rotate(A,itheta)')
19951995

19961996

1997-
def refl(B, A): # Project on the blade B the multivector A
1997+
def refl(B, A): # Project on the blade B the multivector A
19981998
if isinstance(A,Mv):
19991999
return A.reflect_in_blade(B)
20002000
else:

setup.cfg

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,17 @@ per-file-ignores =
3232
./galgebra/deprecated.py:E231,E266
3333

3434
# E231 missing whitespace after ','
35-
# E265 block comment should start with '# '
3635
# E266 too many leading '#' for block comment
37-
./galgebra/dop.py:E231,E265,E266
36+
./galgebra/dop.py:E231,E266
3837

3938
# E231 missing whitespace after ','
4039
# E231 missing whitespace after ':'
41-
# E262 inline comment should start with '# '
42-
# E265 block comment should start with '# '
4340
# E266 too many leading '#' for block comment
44-
./galgebra/ga.py:E231,E231,E262,E265,E266
41+
./galgebra/ga.py:E231,E231,E266
4542

4643
# E231 missing whitespace after ','
47-
# E262 inline comment should start with '# '
48-
# E265 block comment should start with '# '
4944
# F401 'sys' imported but unused
50-
./galgebra/lt.py:E231,E262,E265,F401
45+
./galgebra/lt.py:E231,F401
5146

5247
# E124 closing bracket does not match visual indentation
5348
# E125 continuation line with same indent as next logical line
@@ -57,10 +52,8 @@ per-file-ignores =
5752
./galgebra/metric.py:E124,E125,E231,F821,F841
5853

5954
# E231 missing whitespace after ','
60-
# E262 inline comment should start with '# '
61-
# E265 block comment should start with '# '
6255
# E266 too many leading '#' for block comment
63-
./galgebra/mv.py:E231,E262,E265,E266
56+
./galgebra/mv.py:E231,E266
6457

6558
# E117 over-indented
6659
# E122 continuation line missing indentation or outdented

0 commit comments

Comments
 (0)