Skip to content

Commit 99aa65a

Browse files
committed
Correct unbearable spacing in function definitions.
No change in code function.
1 parent a371668 commit 99aa65a

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

diffpy/pdfgui/control/fitting.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def __init__(self, name):
136136
self.dataNameDict = {}
137137
self.itemIndex = 0
138138

139-
def __changeStatus(self, fitStatus = None, jobStatus = None):
139+
def __changeStatus(self, fitStatus=None, jobStatus=None):
140140
"""change current status of fitting
141141
142142
fitStatus -- new fitting status
@@ -166,7 +166,7 @@ def _getStrId(self):
166166
"""
167167
return "f_" + self.name
168168

169-
def copy(self, other = None):
169+
def copy(self, other=None):
170170
"""copy self to other. if other is None, create an instance
171171
172172
other -- ref to other object
@@ -235,7 +235,7 @@ def stripped(self):
235235
236236
returns reference to stripped copy
237237
"""
238-
unpickleables = ( 'controlCenter', 'lock', 'pauseEvent', 'thread' )
238+
unpickleables = ('controlCenter', 'lock', 'pauseEvent', 'thread')
239239
naked = self.copy()
240240
for a in unpickleables:
241241
if a in self.__dict__:
@@ -262,7 +262,7 @@ def updateParameters(self):
262262
if idx not in self.parameters:
263263
self.parameters[idx] = par
264264
# remove unused parameters
265-
unused = [ idx for idx in self.parameters if idx not in cpars ]
265+
unused = [idx for idx in self.parameters if idx not in cpars]
266266
for idx in unused:
267267
del self.parameters[idx]
268268
return self.parameters
@@ -303,7 +303,7 @@ def changeParameterIndex(self, oldidx, newidx):
303303

304304
return
305305

306-
def queue(self, enter = True ):
306+
def queue(self, enter=True):
307307
"""queue or dequeue self
308308
309309
enter -- True to queue, False to dequeue
@@ -384,7 +384,7 @@ def configure(self):
384384
return
385385

386386

387-
def resetStatus ( self ):
387+
def resetStatus(self):
388388
"""reset status back to initialized"""
389389
self.snapshots = []
390390
self.step = 0
@@ -394,11 +394,11 @@ def resetStatus ( self ):
394394
# This status will mandate allocation of a new PdfFit instance
395395
self.__changeStatus(fitStatus=Fitting.INITIALIZED)
396396

397-
def run ( self ):
397+
def run(self):
398398
"""function to be run in daemon thread.
399399
"""
400400
# Begin
401-
self.__changeStatus ( jobStatus = Fitting.RUNNING )
401+
self.__changeStatus(jobStatus=Fitting.RUNNING)
402402
try:
403403
for calc in self.calcs:
404404
calc.start()
@@ -415,11 +415,11 @@ def run ( self ):
415415
break
416416
else:
417417
#Wait on an event, pause for a while
418-
self.__changeStatus(jobStatus = Fitting.PAUSED)
418+
self.__changeStatus(jobStatus=Fitting.PAUSED)
419419
self.pauseEvent.wait()
420420

421421
# Recover from pause now
422-
self.__changeStatus ( jobStatus = Fitting.RUNNING )
422+
self.__changeStatus(jobStatus=Fitting.RUNNING)
423423

424424
finally:
425425
# whatever happened, resource should be released.
@@ -521,7 +521,7 @@ def outputBondLengthTypes(self, struc, a1, a2, lb, ub):
521521
return
522522

523523

524-
def pause ( self, bPause = None ):
524+
def pause(self, bPause=None):
525525
"""pause ( self, bPause = None ) --> pause a fitting process
526526
527527
bPause -- True to pause, False to restart. If None, it will figure out
@@ -536,7 +536,7 @@ def pause ( self, bPause = None ):
536536
self.paused = False
537537
self.pauseEvent.set()
538538

539-
def start ( self ):
539+
def start(self):
540540
"""start fitting"""
541541
# check if paused
542542
if self.jobStatus == Fitting.PAUSED:
@@ -552,28 +552,28 @@ def start ( self ):
552552
self.thread = Fitting.Worker(self)
553553
self.thread.start()
554554

555-
def stop ( self ):
555+
def stop(self):
556556
"""stop the fitting"""
557557
self.stopped = True
558558

559559
# wake up daemon thread if it is paused
560560
if self.jobStatus == Fitting.PAUSED:
561561
self.pause(False)
562562

563-
def isThreadRunning ( self ):
563+
def isThreadRunning(self):
564564
"""check if fitting thread is running
565565
566566
return: True if running, False otherwise
567567
"""
568568
return self.thread is not None and self.thread.isAlive()
569569

570-
def join (self):
570+
def join(self):
571571
"""wait for current fitting to finish"""
572572
if self.thread:
573573
self.thread.join()
574574
self.thread = None
575575

576-
def close ( self, force = False ):
576+
def close(self, force=False):
577577
"""close up the fitting in order to exit
578578
579579
force -- if force to exit
@@ -754,7 +754,7 @@ def getXNames(self):
754754
"""
755755
return []
756756

757-
def getData(self, name, step = -1 ):
757+
def getData(self, name, step=-1):
758758
"""get self's data member
759759
760760
name -- data item name
@@ -768,11 +768,11 @@ def getData(self, name, step = -1 ):
768768
# FIXME: for next plot interface, we need find how many steps the
769769
# plotter is requiring for and make exact same number of copies of
770770
# data by name
771-
data = self.getMetaData ( name )
771+
data = self.getMetaData(name)
772772
if data is not None:
773773
return data
774774

775-
return self._getData(self, name, step )
775+
return self._getData(self, name, step)
776776

777777
def getMetaDataNames(self):
778778
"""return all applicable meta data names
@@ -799,7 +799,7 @@ def getMetaData(self, name):
799799
except (KeyError, IndexError):
800800
return None
801801

802-
def _getData ( self, id, name, step = -1 ):
802+
def _getData(self, id, name, step=-1):
803803
"""get any data member from snapshots
804804
805805
id -- reference to a Fitting/Calculation/Phase/DataSet object

0 commit comments

Comments
 (0)