Skip to content

Commit 686390a

Browse files
authored
pre-commit errors in comments (#141)
1 parent 3d0643e commit 686390a

11 files changed

Lines changed: 35 additions & 36 deletions

‎.coveragerc‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
[report]
44
# RE patterns for lines to be excluded from consideration.
55
exclude_lines =
6-
## Have to re-enable the standard pragma
6+
# Have to re-enable the standard pragma
77
pragma: no cover
8-
## Don't complain if tests don't hit defensive assertion code:
8+
# Don't complain if tests don't hit defensive assertion code:
99
raise AssertionError
1010
raise NotImplementedError
1111
^[ ]*assert False
1212

13-
## Don't complain if non-runnable code isn't run:
13+
# Don't complain if non-runnable code isn't run:
1414
^[ ]*@unittest.skip\b
1515
^[ ]{4}unittest.main()
1616
if __name__ == .__main__.:
1717

1818

1919
[run]
2020
omit =
21-
## exclude debug.py from codecov report
21+
# exclude debug.py from codecov report
2222
*/tests/debug.py

‎src/diffpy/pdfgui/gui/bondangledialog.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def __do_layout(self):
7979
self.Layout()
8080
# end wxGlade
8181

82-
###########################################################################
82+
# #########################################################################
8383

8484
def __customProperties(self):
8585
"""Set the custom properties."""
@@ -138,8 +138,8 @@ def onSpin(self, event):
138138
loop = True
139139
while loop:
140140
loop = False
141-
for l in letters:
142-
if newval == getattr(self, l):
141+
for letter in letters:
142+
if newval == getattr(self, letter):
143143
loop = True
144144
if increasing:
145145
newval += 1

‎src/diffpy/pdfgui/gui/parameterspanel.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __do_layout(self):
9898
self.Layout()
9999
# end wxGlade
100100

101-
##########################################################################
101+
# ########################################################################
102102
# Misc Methods
103103

104104
def __customProperties(self):

‎src/diffpy/pdfgui/gui/phaseconfigurepanel.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def __init__(self, *args, **kwds):
221221
# end wxGlade
222222
self.__customProperties()
223223

224-
##########################################################################
224+
# ########################################################################
225225
# Misc Methods
226226

227227
def __customProperties(self):
@@ -319,7 +319,7 @@ def restrictConstrainedParameters(self):
319319
"""Set 'read-only' boxes that correspond to constrained parameters."""
320320

321321
self.setToolTips(tooltips.phasepanel)
322-
txtbg = self.textCtrlA.DefaultStyle.BackgroundColour
322+
self.textCtrlA.DefaultStyle.BackgroundColour
323323

324324
# First the TextCtrls
325325
for key, var in self.lConstraintsMap.items():
@@ -447,7 +447,7 @@ def applyCellChange(self, i, j, value):
447447
except ValueError:
448448
return
449449

450-
##########################################################################
450+
# ########################################################################
451451
# Event Handlers
452452

453453
# TextCtrl Events
@@ -629,7 +629,7 @@ def onKey(self, event):
629629

630630
return
631631

632-
##########################################################################
632+
# ########################################################################
633633
# Grid popup menu and handlers
634634

635635
def popupMenu(self, window, x, y):

‎src/diffpy/pdfgui/gui/phaseconstraintspanel.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def __init__(self, *args, **kwds):
210210
# end wxGlade
211211
self.__customProperties()
212212

213-
##########################################################################
213+
# ########################################################################
214214
# Misc Methods
215215

216216
def __customProperties(self):
@@ -314,7 +314,7 @@ def refresh(self):
314314

315315
self.refreshTextCtrls()
316316

317-
### update the grid ###
317+
# # update the grid ###
318318
natoms = len(self.structure)
319319
nrows = self.gridAtoms.GetNumberRows()
320320
self.gridAtoms.BeginBatch()
@@ -339,7 +339,7 @@ def refresh(self):
339339
if not m:
340340
continue
341341
barevar = m.group(1)
342-
if not barevar in bareAtomVarColumn:
342+
if barevar not in bareAtomVarColumn:
343343
continue
344344
column = bareAtomVarColumn[barevar]
345345
row = int(m.group(2)) - 1
@@ -348,7 +348,7 @@ def refresh(self):
348348
raise ControlValueError(emsg)
349349
self.gridAtoms.SetCellValue(row, column, con.formula)
350350
barevar = re.sub(r"\(\d+\)$", "", var)
351-
if not barevar in bareAtomVarColumn:
351+
if barevar not in bareAtomVarColumn:
352352
continue
353353

354354
self.gridAtoms.AutosizeLabels()
@@ -411,7 +411,7 @@ def applyCellChange(self, i, j, value):
411411
return ""
412412
return
413413

414-
##########################################################################
414+
# ########################################################################
415415
# Event Handlers
416416

417417
# TextCtrl Events
@@ -554,12 +554,12 @@ def onKey(self, event):
554554
self.mainFrame.needsSave()
555555

556556
# Can't get these to work. Maybe later.
557-
## Copy - Ctrl+C / Ctrl+Insert
557+
# Copy - Ctrl+C / Ctrl+Insert
558558
# if event.ControlDown() and (key == 67 or key == wx.WXK_INSERT):
559559
# if phasepanelutils.canCopySelectedCells(self):
560560
# phasepanelutils.copySelectedCells(self)
561561

562-
## Paste - Ctrl+V / Shift+Insert
562+
# Paste - Ctrl+V / Shift+Insert
563563
# if (event.ControlDown() and key == 86) or\
564564
# (event.ShiftDown() and key == wx.WXK_INSERT):
565565
# if phasepanelutils.canPasteIntoCells(self):
@@ -569,7 +569,7 @@ def onKey(self, event):
569569
event.Skip()
570570
return
571571

572-
##########################################################################
572+
# ########################################################################
573573
# Grid popup menu and handlers
574574

575575
def popupMenu(self, window, x, y):

‎src/diffpy/pdfgui/gui/phaseresultspanel.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def __init__(self, *args, **kwds):
198198
self.__customProperties()
199199
return
200200

201-
##########################################################################
201+
# ########################################################################
202202
# Misc Methods
203203

204204
def __customProperties(self):

‎src/diffpy/pdfgui/gui/rseriespanel.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(self, *args, **kwds):
3232
self.instructionsLabel = wx.StaticText(
3333
self,
3434
wx.ID_ANY,
35-
"Select a fit from the tree on the left and set the first value, last value, \nand the step size of the maximum and/or minimum of the fit range\nbelow. If you have not set up a fit to be the template for the series, hit\ncancel and rerun this macro once a fit has been created.",
35+
"Select a fit from the tree on the left and set the first value, last value, \nand the step size of the maximum and/or minimum of the fit range\nbelow. If you have not set up a fit to be the template for the series, hit\ncancel and rerun this macro once a fit has been created.", # noqa: E501
3636
)
3737
self.maxFirstLabel = wx.StaticText(self, wx.ID_ANY, "first")
3838
self.maxFirstTextCtrl = wx.TextCtrl(self, wx.ID_ANY, "")
@@ -101,7 +101,7 @@ def __do_layout(self):
101101
self.Layout()
102102
# end wxGlade
103103

104-
##################################################
104+
# ################################################
105105
def __customProperties(self):
106106
"""Set the custom properties of this panel."""
107107
self.fit = None

‎src/diffpy/pdfgui/gui/sgconstraindialog.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def __init__(self, *args, **kwds):
101101
# end wxGlade
102102
self.__customProperties()
103103

104-
###########################################################################
104+
# #########################################################################
105105

106106
def __customProperties(self):
107107
"""Set the custom properties."""
@@ -204,7 +204,7 @@ def updateWidgets(self):
204204
raise ControlValueError(error)
205205
return
206206

207-
### Events
207+
# # Events
208208

209209
def onKillFocus(self, event):
210210
"""Check value of widgets and update the dialog message."""

‎src/diffpy/pdfgui/gui/sgstructuredialog.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def __init__(self, *args, **kwds):
9191
# end wxGlade
9292
self.__customProperties()
9393

94-
###########################################################################
94+
# #########################################################################
9595

9696
def __customProperties(self):
9797
"""Set the custom properties."""
@@ -195,7 +195,7 @@ def updateWidgets(self):
195195
raise ControlValueError(error)
196196
return
197197

198-
### Events
198+
# # Events
199199
def onKillFocus(self, event):
200200
"""Check value of widgets and update the dialog message."""
201201
self.updateWidgets()

‎src/diffpy/pdfgui/gui/supercelldialog.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __do_layout(self):
7474
self.Layout()
7575
# end wxGlade
7676

77-
############################################################################
77+
# ##########################################################################
7878

7979
def __customProperties(self):
8080
"""Set custom properties."""

0 commit comments

Comments
 (0)