Skip to content

Commit 9668d45

Browse files
authored
Tidy redundant tuple parentheses and bad comma spacing (#242)
1 parent 77320a5 commit 9668d45

File tree

11 files changed

+265
-275
lines changed

11 files changed

+265
-275
lines changed

galgebra/deprecated.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ def convert_metric(gstr):
1818
return gstr
1919

2020
@staticmethod
21-
def setup(basis, metric=None, coords=None, rframe=False, debug=False, curv=(None,None)):
21+
def setup(basis, metric=None, coords=None, rframe=False, debug=False, curv=(None, None)):
2222

2323
if isinstance(metric, str):
2424
metric = MV.convert_metric(metric)
25-
if curv != (None,None):
25+
if curv != (None, None):
2626
MV.GA = ga.Ga(basis, g=None, coords=coords, X=curv[0], debug=debug)
2727
else:
2828
MV.GA = ga.Ga(basis, g=metric, coords=coords, X=curv[0], debug=debug)
2929
MV.I = MV.GA.i
3030
MV.metric = MV.GA.g
3131
if coords is not None:
32-
(MV.grad,MV.rgrad) = MV.GA.grads()
32+
MV.grad, MV.rgrad = MV.GA.grads()
3333
return list(MV.GA.mv()) + [MV.grad]
3434
else:
3535
return list(MV.GA.mv())

galgebra/dop.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _consolidate_terms(terms):
2121
"""
2222
new_coefs = []
2323
new_pdiffs = []
24-
for (coef, pd) in terms:
24+
for coef, pd in terms:
2525
if coef != S(0):
2626
if pd in new_pdiffs:
2727
index = new_pdiffs.index(pd)
@@ -93,7 +93,7 @@ class Sdop(_BaseDop):
9393

9494
def TSimplify(self):
9595
return Sdop([
96-
(metric.Simp.apply(coef), pdiff) for (coef, pdiff) in self.terms
96+
(metric.Simp.apply(coef), pdiff) for coef, pdiff in self.terms
9797
])
9898

9999
@staticmethod
@@ -122,7 +122,7 @@ def Sdop_str(self):
122122

123123
self = self._with_sorted_terms()
124124
s = ''
125-
for (coef, pdop) in self.terms:
125+
for coef, pdop in self.terms:
126126
coef_str = printer.latex(coef)
127127
pd_str = printer.latex(pdop)
128128

@@ -137,7 +137,7 @@ def Sdop_str(self):
137137
s += coef_str + '*' + pd_str
138138
s += ' + '
139139

140-
s = s.replace('+ -','- ')
140+
s = s.replace('+ -', '- ')
141141
s = s[:-3]
142142
if Sdop.str_mode:
143143
if len(self.terms) > 1 or isinstance(self.terms[0][0], Add):
@@ -151,7 +151,7 @@ def Sdop_latex_str(self):
151151
self = self._with_sorted_terms()
152152

153153
s = ''
154-
for (coef, pdop) in self.terms:
154+
for coef, pdop in self.terms:
155155
coef_str = printer.latex(coef)
156156
pd_str = printer.latex(pdop)
157157
if coef == S(1):
@@ -171,7 +171,7 @@ def Sdop_latex_str(self):
171171
s += coef_str + ' ' + pd_str
172172
s += ' + '
173173

174-
s = s.replace('+ -','- ')
174+
s = s.replace('+ -', '- ')
175175
return s[:-3]
176176

177177
def _repr_latex_(self):
@@ -324,7 +324,7 @@ def sort_key(self, order=None):
324324
])
325325
)
326326

327-
def __eq__(self,A):
327+
def __eq__(self, A):
328328
if isinstance(A, Pdop) and self.pdiffs == A.pdiffs:
329329
return True
330330
else:

0 commit comments

Comments
 (0)