From 82be283b68f328f9169b366a22e625559ab1f59b Mon Sep 17 00:00:00 2001
From: Andrei Savici <saviciat@ornl.gov>
Date: Tue, 11 Aug 2015 16:52:35 -0400
Subject: [PATCH] More pylint. Refs #12661

---
 .../algorithms/CollectHB3AExperimentInfo.py   |  2 +-
 .../CylinderPaalmanPingsCorrection.py         | 18 ++++++------
 .../CylinderPaalmanPingsCorrection2.py        | 28 ++++++++-----------
 .../algorithms/EnggVanadiumCorrections.py     |  4 +--
 .../plugins/algorithms/GetNuMegMuonicXRD.py   | 22 +++++++--------
 .../plugins/algorithms/MuscatSofQW.py         |  4 +--
 .../ElasticWindowMultiple.py                  |  2 +-
 .../OSIRISDiffractionReduction.py             | 22 +++++++--------
 .../tests/analysis/CRISPLoadingTest.py        |  7 ++---
 .../SystemTests/tests/analysis/utils.py       |  6 ++--
 .../Direct/ISISDirecInelasticConfig.py        | 22 +++++++--------
 .../Inelastic/Direct/PropertyManager.py       |  2 +-
 .../scripts/Inelastic/Direct/diagnostics.py   |  2 +-
 .../Reflectometry/isis_reflectometry/quick.py |  6 ++--
 .../scripts/SANS/isis_reduction_steps.py      |  6 ++--
 15 files changed, 75 insertions(+), 78 deletions(-)

diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CollectHB3AExperimentInfo.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CollectHB3AExperimentInfo.py
index c8b34a5ff82..34a60e2a872 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CollectHB3AExperimentInfo.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CollectHB3AExperimentInfo.py
@@ -307,7 +307,7 @@ class CollectHB3AExperimentInfo(PythonAlgorithm):
 
         self.log().notice("[DB] Load SPICE file %s to %s." % (xmlfilename, outwsname))
         dataws = api.LoadSpiceXML2DDet(Filename=xmlfilename, LoadInstrument=True,
-                    OutputWorkspace=outwsname, DetectorGeometry='256,256')
+                                       OutputWorkspace=outwsname, DetectorGeometry='256,256')
 
         return dataws
 
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection.py
index e56af5905ce..5470e2a9f31 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection.py
@@ -50,8 +50,8 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
         ws_validator = CompositeValidator([WorkspaceUnitValidator('Wavelength'), InstrumentValidator()])
 
         self.declareProperty(MatrixWorkspaceProperty('SampleWorkspace', '',
-                             direction=Direction.Input,
-                             validator=ws_validator),
+                                                     direction=Direction.Input,
+                                                     validator=ws_validator),
                              doc='Name for the input sample workspace')
 
         self.declareProperty(name='SampleChemicalFormula', defaultValue='',
@@ -66,9 +66,9 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
                              doc='Sample outer radius')
 
         self.declareProperty(MatrixWorkspaceProperty('CanWorkspace', '',
-                             direction=Direction.Input,
-                             optional=PropertyMode.Optional,
-                             validator=ws_validator),
+                                                     direction=Direction.Input,
+                                                     optional=PropertyMode.Optional,
+                                                     validator=ws_validator),
                              doc="Name for the input container workspace")
 
         self.declareProperty(name='CanChemicalFormula', defaultValue='',
@@ -96,7 +96,7 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
                              doc='Analyser energy')
 
         self.declareProperty(WorkspaceGroupProperty('OutputWorkspace', '',
-                             direction=Direction.Output),
+                                                    direction=Direction.Output),
                              doc='The output corrections workspace group')
 
 #------------------------------------------------------------------------------
@@ -165,8 +165,8 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
 
         for angle_idx in range(number_angles):
             kill, ass, assc, acsc, acc = cylabs.cylabs(self._step_size, beam, ncan, radii,
-                density, sigs, siga, self._angles[angle_idx], self._elastic, self._waves, angle_idx, wrk, 0)
-
+                                                       density, sigs, siga, self._angles[angle_idx],
+                                                       self._elastic, self._waves, angle_idx, wrk, 0)
             if kill == 0:
                 logger.information('Angle %d: %f successful' % (angle_idx+1, self._angles[angle_idx]))
 
@@ -179,7 +179,7 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
                 raise ValueError('Angle ' + str(angle_idx) + ' : ' + str(self._angles[angle_idx]) + ' *** failed : Error code ' + str(kill))
 
         sample_logs = {'sample_shape': 'cylinder', 'sample_filename': self._sample_ws_name,
-                        'sample_inner_radius': self._sample_inner_radius, 'sample_outer_radius': self._sample_outer_radius}
+                       'sample_inner_radius': self._sample_inner_radius, 'sample_outer_radius': self._sample_outer_radius}
         dataX = self._waves * number_angles
 
         # Create the output workspaces
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection2.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection2.py
index d400bb18af0..778c1c97980 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection2.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/CylinderPaalmanPingsCorrection2.py
@@ -55,8 +55,8 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
         ws_validator = CompositeValidator([WorkspaceUnitValidator('Wavelength'), InstrumentValidator()])
 
         self.declareProperty(MatrixWorkspaceProperty('SampleWorkspace', '',
-                             validator=ws_validator,
-                             direction=Direction.Input),
+                                                     validator=ws_validator,
+                                                     direction=Direction.Input),
                              doc="Name for the input Sample workspace.")
 
         self.declareProperty(name='SampleChemicalFormula', defaultValue='',
@@ -73,9 +73,9 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
                              doc='Sample outer radius')
 
         self.declareProperty(MatrixWorkspaceProperty('CanWorkspace', '',
-                             optional=PropertyMode.Optional,
-                             validator=ws_validator,
-                             direction=Direction.Input),
+                                                     optional=PropertyMode.Optional,
+                                                     validator=ws_validator,
+                                                     direction=Direction.Input),
                              doc="Name for the input Can workspace.")
 
         self.declareProperty(name='CanChemicalFormula', defaultValue='',
@@ -110,7 +110,7 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
                              doc='Analyser energy')
 
         self.declareProperty(WorkspaceGroupProperty('OutputWorkspace', '',
-                             direction=Direction.Output),
+                                                    direction=Direction.Output),
                              doc='The output corrections workspace group')
 #------------------------------------------------------------------------------
 
@@ -241,8 +241,7 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
         if (self._radii[1] - self._radii[0]) < 1e-4:
             raise ValueError('Sample outer radius not > inner radius')
         else:
-            logger.information('Sample : inner radius = %f ; outer radius = %f' % (
-                               self._radii[0], self._radii[1]))
+            logger.information('Sample : inner radius = %f ; outer radius = %f' % (self._radii[0], self._radii[1]))
             self._ms = int((self._radii[1] - self._radii[0] + 0.0001)/self._step_size)
             if self._ms < 20:
                 raise ValueError('Number of steps ( %i ) should be >= 20' % (self._ms))
@@ -255,8 +254,7 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
             if (self._radii[2] - self._radii[1]) < 1e-4:
                 raise ValueError('Can outer radius not > sample outer radius')
             else:
-                logger.information('Can : inner radius = %f ; outer radius = %f' % (
-                                   self._radii[1], self._radii[2]))
+                logger.information('Can : inner radius = %f ; outer radius = %f' % (self._radii[1], self._radii[2]))
 
         beam_width = self.getProperty('BeamWidth').value
         beam_height = self.getProperty('BeamHeight').value
@@ -316,8 +314,7 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
             detector = mtd[self._sample_ws_name].getDetector(index)
             two_theta = detector.getTwoTheta(sample_pos, beam_pos) * 180.0 / math.pi
             self._angles.append(two_theta)
-        logger.information('Detector angles : %i from %f to %f ' % (
-                           len(self._angles), self._angles[0], self._angles[-1]))
+        logger.information('Detector angles : %i from %f to %f ' % (len(self._angles), self._angles[0], self._angles[-1]))
 
 #------------------------------------------------------------------------------
 
@@ -344,8 +341,7 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
             self._elastic = math.sqrt(81.787/self._efixed) # elastic wavelength
 
         logger.information('Elastic lambda : %f' % (self._elastic))
-        logger.information('Lambda : %i values from %f to %f' % (
-                           len(self._waves), self._waves[0], self._waves[-1]))
+        logger.information('Lambda : %i values from %f to %f' % (len(self._waves), self._waves[0], self._waves[-1]))
 
 #------------------------------------------------------------------------------
 
@@ -436,9 +432,9 @@ class CylinderPaalmanPingsCorrection(PythonAlgorithm):
 #  No. STEPS ARE CHOSEN SO THAT STEP WIDTH IS THE SAME FOR ALL ANNULI
 #
             AAAA, BBBA, Area_A = self._sum_rom(0, 0, A, self._radii[0], self._radii[1], self._ms,
-                                         theta, amu_scat, amu_tot_i, amu_tot_s)
+                                               theta, amu_scat, amu_tot_i, amu_tot_s)
             AAAB, BBBB, Area_B = self._sum_rom(0, 0, -A, self._radii[0], self._radii[1], self._ms,
-                                         theta, amu_scat, amu_tot_i, amu_tot_s)
+                                               theta, amu_scat, amu_tot_i, amu_tot_s)
             Area_s += Area_A + Area_B
             Ass += AAAA + AAAB
             Ass = Ass/Area_s
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py
index a398b8e3811..1125fff13be 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py
@@ -32,7 +32,7 @@ class EnggVanadiumCorrections(PythonAlgorithm):
                              "Workspace with the reference Vanadium diffraction data.")
 
         self.declareProperty(ITableWorkspaceProperty("OutIntegrationWorkspace", "", Direction.Output,
-                                                    PropertyMode.Optional),
+                                                     PropertyMode.Optional),
                              'Output integration workspace produced when given an input Vanadium workspace')
 
         self.declareProperty(MatrixWorkspaceProperty("OutCurvesWorkspace", "", Direction.Output,
@@ -40,7 +40,7 @@ class EnggVanadiumCorrections(PythonAlgorithm):
                              'Output curves workspace produced when given an input Vanadium workspace')
 
         self.declareProperty(ITableWorkspaceProperty("IntegrationWorkspace", "", Direction.Input,
-                                                    PropertyMode.Optional),
+                                                     PropertyMode.Optional),
                              "Workspace with the integrated values for every spectra of the reference "
                              "Vanadium diffraction data. One row per spectrum.")
 
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/GetNuMegMuonicXRD.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/GetNuMegMuonicXRD.py
index bdac92be1a4..fc6876d6d85 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/GetNuMegMuonicXRD.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/GetNuMegMuonicXRD.py
@@ -5,27 +5,25 @@ from mantid.kernel import *
 class GetNegMuMuonicXRD(PythonAlgorithm):
     #Dictionary of <element>:<peaks> easily extendible by user.
     Muonic_XR={'Au' :[8135.2,8090.6,8105.4,8069.4,5764.89,5594.97,3360.2,
-                       3206.8,2474.22,2341.21,2304.44,1436.05,1391.58,1104.9,
-                       899.14,869.98,405.654,400.143],
-               'Ag': [3184.7,3147.7,901.2,869.2,308.428,304.759],
+                      3206.8,2474.22,2341.21,2304.44,1436.05,1391.58,1104.9,
+                      899.14,869.98,405.654,400.143],
+               'Ag' :[3184.7,3147.7,901.2,869.2,308.428,304.759],
                'Cu' :[1512.78,1506.61,334.8,330.26],
                'Zn' :[1600.15,1592.97,360.75,354.29],
                'Pb' :[8523.3,8442.11,5966.0,5780.1,2641.8,2499.7,
-                        2459.7,1511.63,1214.12,1028.83,972.3,938.4,
-                        437.687,431.285],
-               'As' : [1866.9,1855.8,436.6,427.5],
-               'Sn' : [3457.3,3412.8,1022.6,982.5,349.953,345.226]}
+                      2459.7,1511.63,1214.12,1028.83,972.3,938.4,
+                      437.687,431.285],
+               'As' :[1866.9,1855.8,436.6,427.5],
+               'Sn' :[3457.3,3412.8,1022.6,982.5,349.953,345.226]}
 
     def PyInit(self):
         element_type = self.Muonic_XR.keys()
         self.declareProperty("ElementList", "None", StringListValidator(element_type),
                              doc="List of available elements")
-        self.declareProperty(StringArrayProperty("Elements", values=[],
-                             direction=Direction.Input
-                             ))
+        self.declareProperty(StringArrayProperty("Elements", values=[],direction=Direction.Input))
         self.declareProperty(name="YAxisPosition",
-                                    defaultValue=-0.001,
-                                    doc="Position for Markers on the y-axis")
+                             defaultValue=-0.001,
+                             doc="Position for Markers on the y-axis")
 
     def get_Muonic_XR(self, element):
         #retrieve peak values from dictionary Muonic_XR
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/MuscatSofQW.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/MuscatSofQW.py
index a2e755b52a5..29647f14533 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/MuscatSofQW.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/MuscatSofQW.py
@@ -86,8 +86,8 @@ class MuscatSofQW(DataProcessorAlgorithm):
         pk_1 = '(composite=Convolution,FixResolution=true,NumDeriv=true;name=Resolution, Workspace="{0}"'.format(self._res_rebin)
 
         if self._lor >= 1:
-            lor_fun = 'composite=ProductFunction,NumDeriv=false;name=Lorentzian,Amplitude={0},PeakCentre=0.0,FWHM={1}'.format(
-                    l_height_1[peak_idx], l_width_1[peak_idx])
+            lor_fun = 'composite=ProductFunction,NumDeriv=false;name=Lorentzian,Amplitude={0},'
+                      'PeakCentre=0.0,FWHM={1}'.format(l_height_1[peak_idx], l_width_1[peak_idx])
         elif self._lor == 2:
             funcIndex = 1 if self._delta else 0
             lor_2 = 'name=Lorentzian,Amplitude='+str(l_height_2[peak_idx])+',PeakCentre=0.0,FWHM='+str(l_width_2[peak_idx])
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py
index 6dad626d2e4..fc52059afd2 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py
@@ -338,7 +338,7 @@ class ElasticWindowMultiple(DataProcessorAlgorithm):
             tmp = run[self._sample_log_name].value
             value_action = {'last_value': lambda x: x[len(x)-1],
                             'average': lambda x: x.mean()
-                            }
+                           }
             temp = value_action[self._sample_log_value](tmp)
             logger.debug('Temperature %d K found for run: %s' % (temp, run_name))
             return temp
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/OSIRISDiffractionReduction.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/OSIRISDiffractionReduction.py
index e37bc82f11c..0078c24b00e 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/OSIRISDiffractionReduction.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/OSIRISDiffractionReduction.py
@@ -22,17 +22,17 @@ class DRange(object):
 
 
 TIME_REGIME_TO_DRANGE = {
-     1.17e4: DRange( 0.7,  2.5),
-     2.94e4: DRange( 2.1,  3.3),
-     4.71e4: DRange( 3.1,  4.3),
-     6.48e4: DRange( 4.1,  5.3),
-     8.25e4: DRange( 5.2,  6.2),
-    10.02e4: DRange( 6.2,  7.3),
-    11.79e4: DRange( 7.3,  8.3),
-    13.55e4: DRange( 8.3,  9.5),
-    15.32e4: DRange( 9.4, 10.6),
-    17.09e4: DRange(10.4, 11.6),
-    18.86e4: DRange(11.0, 12.5)
+                         1.17e4: DRange( 0.7,  2.5),
+                         2.94e4: DRange( 2.1,  3.3),
+                         4.71e4: DRange( 3.1,  4.3),
+                         6.48e4: DRange( 4.1,  5.3),
+                         8.25e4: DRange( 5.2,  6.2),
+                         10.02e4: DRange( 6.2,  7.3),
+                         11.79e4: DRange( 7.3,  8.3),
+                         13.55e4: DRange( 8.3,  9.5),
+                         15.32e4: DRange( 9.4, 10.6),
+                         17.09e4: DRange(10.4, 11.6),
+                         18.86e4: DRange(11.0, 12.5)
 }
 
 
diff --git a/Code/Mantid/Testing/SystemTests/tests/analysis/CRISPLoadingTest.py b/Code/Mantid/Testing/SystemTests/tests/analysis/CRISPLoadingTest.py
index 784435f1e1a..4bf90f3799f 100644
--- a/Code/Mantid/Testing/SystemTests/tests/analysis/CRISPLoadingTest.py
+++ b/Code/Mantid/Testing/SystemTests/tests/analysis/CRISPLoadingTest.py
@@ -1,10 +1,9 @@
 from LoadAndCheckBase import *
 
-'''
-Test File loading and basic data integrity checks of CRISP data in Mantid.
-'''
 class CRISPLoadingTest(LoadAndCheckBase):
-
+    '''
+    Test File loading and basic data integrity checks of CRISP data in Mantid.
+    '''
     def __init__(self):
         super(self.__class__,self).__init__()
         self.disableChecking.append("Instrument")
diff --git a/Code/Mantid/Testing/SystemTests/tests/analysis/utils.py b/Code/Mantid/Testing/SystemTests/tests/analysis/utils.py
index ba8f732a1cb..79682259435 100644
--- a/Code/Mantid/Testing/SystemTests/tests/analysis/utils.py
+++ b/Code/Mantid/Testing/SystemTests/tests/analysis/utils.py
@@ -173,7 +173,7 @@ def expecting():
 		print "---", a,b,c,d
 		a, b = c, d = f()
 		print "---", a,b,c,d
-        
+
         Developers Notes:
 
 		Now works with an multiple assigments correctly.  This is verified by
@@ -192,6 +192,7 @@ def expecting():
             if name == 'CALL_FUNCTION':
                 return 1
 
+#pylint: disable=too-many-locals,too-many-branches
 def lhs(output='names'):
     '''
 	call signature(s)::
@@ -265,7 +266,8 @@ def lhs(output='names'):
 		#              a,b=c=d=f() => [ ['a','b'] , 'c','d' ]  So on and so forth.
 
 		# put this in a loop and stack the results in an array.
-        count = 0; maxReturns = 0 # Must count the maxReturns ourselves in this case
+        count = 0
+        maxReturns = 0 # Must count the maxReturns ourselves in this case
         while count < len(ins[CallFunctionLocation[i][0] :CallFunctionLocation[i][1]]):
             (offset_, op_, name_, argument_, argtype_, argvalue_) = ins[CallFunctionLocation[i][0]+count]
 			#print 'i= ',i,'count = ', count, 'maxReturns = ',maxReturns
diff --git a/Code/Mantid/scripts/Inelastic/Direct/ISISDirecInelasticConfig.py b/Code/Mantid/scripts/Inelastic/Direct/ISISDirecInelasticConfig.py
index acc33996bbd..8f337d02a91 100644
--- a/Code/Mantid/scripts/Inelastic/Direct/ISISDirecInelasticConfig.py
+++ b/Code/Mantid/scripts/Inelastic/Direct/ISISDirecInelasticConfig.py
@@ -100,7 +100,7 @@ class MantidConfigDirectInelastic(object):
         to have:
         Map/masks folder with layout defined on (e.g. svn checkout)
         https://svn.isis.rl.ac.uk/InstrumentFiles/trunk
-        2) User scripts folder with layout defined on 
+        2) User scripts folder with layout defined on
         (e.g. git checkout or Mantid script repository set-up):
         git@github.com:mantidproject/scriptrepository.git
         see https://github.com/mantidproject/scriptrepository for details
@@ -110,7 +110,7 @@ class MantidConfigDirectInelastic(object):
           and other folders
           All these assumptions are summarized within __init__
 
-       The class have to change/to be amended if the configuration 
+       The class have to change/to be amended if the configuration
        changes or has additional features.
     """
     def __init__(self,mantid='/opt/Mantid/',home='/home/',\
@@ -181,9 +181,9 @@ class MantidConfigDirectInelastic(object):
 
         # Methods, which build & verify various parts of Mantid configuration
         self._dynamic_options = [self._set_default_inst,
-                        self._set_script_repo, # this would be necessary to have on an Instrument scientist account, disabled on generic setup
-                        self._def_python_search_path,
-                        self._set_datasearch_directory,self._set_rb_directory]
+                                 self._set_script_repo, # necessary to have on an Instrument scientist account, disabled on generic setup
+                                 self._def_python_search_path,
+                                 self._set_datasearch_directory,self._set_rb_directory]
         self._user = None
         self._cycle_data_folder=set()
         # this is the list, containing configuration strings
@@ -202,7 +202,7 @@ class MantidConfigDirectInelastic(object):
             return True
         # missing file should always be replaced
         if not os.path.isfile(config_file_name):
-           return True
+            return True
         modification_date = date.fromtimestamp(os.path.getmtime(config_file_name))
         start_date = self._user.get_start_date()
         if modification_date<start_date:
@@ -218,7 +218,7 @@ class MantidConfigDirectInelastic(object):
             return True
         # non-existing file should always be replaced
         if not os.path.isfile(target_script_name):
-           return True
+            return True
         #Always replace sample file if it has not been touched
         start_date = self._user.get_start_date()
         # this time is set up to the file, copied from the repository
@@ -299,7 +299,7 @@ class MantidConfigDirectInelastic(object):
         self._cycle_data_folder=set()
         for date_key,folder_id in theUser.cycle_IDlist.items():
             self._cycle_data_folder.add(self.get_data_folder_name(theUser.instrument[date_key],folder_id))
-        # Initialize configuration settings 
+        # Initialize configuration settings
         self._dynamic_configuration = copy.deepcopy(self._dynamic_options_base)
         self._init_config()
     #
@@ -363,7 +363,7 @@ class MantidConfigDirectInelastic(object):
             raise RuntimeError("Can not define RB folder without user being defined")
     #
     def _set_datasearch_directory(self):
-        """Note, map/mask instrument folder is lower case as if loaded from SVN. 
+        """Note, map/mask instrument folder is lower case as if loaded from SVN.
            Autoreduction may have it upper case"""
         if not self._user:
             raise RuntimeError("Can not define Data search path without user being defined")
@@ -375,7 +375,7 @@ class MantidConfigDirectInelastic(object):
         all_data_folders=list(self._cycle_data_folder)
         data_dir = os.path.abspath('{0}'.format(all_data_folders[0]))
         for folder in all_data_folders[1:]:
-             data_dir +=';'+os.path.abspath('{0}'.format(folder))
+            data_dir +=';'+os.path.abspath('{0}'.format(folder))
 
         all_rb_folders = self._user.rb_dir
         for folder in all_rb_folders.values():
@@ -391,7 +391,7 @@ class MantidConfigDirectInelastic(object):
         config_path = os.path.join(user_path,'.mantid')
         if not os.path.exists(config_path):
             err = os.makedirs(config_path)
-            if err: 
+            if err:
                 raise RuntimeError('can not find or create Mantid configuration path {0}'.format(config_path))
 
         config_file = os.path.join(config_path,'Mantid.user.properties')
diff --git a/Code/Mantid/scripts/Inelastic/Direct/PropertyManager.py b/Code/Mantid/scripts/Inelastic/Direct/PropertyManager.py
index 63aeb894963..6000be229fa 100644
--- a/Code/Mantid/scripts/Inelastic/Direct/PropertyManager.py
+++ b/Code/Mantid/scripts/Inelastic/Direct/PropertyManager.py
@@ -412,7 +412,7 @@ class PropertyManager(NonIDF_Properties):
                 except:
                     try:
                         cur_val = getattr(self,key)
-                    except: 
+                    except:
                         cur_val = "Undefined"
                     self.log("Retrieving or reapplying script property {0} failed. Property value remains: {1}"\
                        .format(key,cur_val),'warning')
diff --git a/Code/Mantid/scripts/Inelastic/Direct/diagnostics.py b/Code/Mantid/scripts/Inelastic/Direct/diagnostics.py
index e5ceefd9d96..8114b24706b 100644
--- a/Code/Mantid/scripts/Inelastic/Direct/diagnostics.py
+++ b/Code/Mantid/scripts/Inelastic/Direct/diagnostics.py
@@ -397,7 +397,7 @@ def print_test_summary(test_results,test_name=None):
     Input:
     test_results - A list or tuple containing either the number of failed spectra or None
                    indicating that the test was not run
-    IMPORTANT: The output of this function is used as 
+    IMPORTANT: The output of this function is used as
                input for GUI, so the keys names, = sign and : are control
                symbols of MantidWidgets->DiagResults method.
     """
diff --git a/Code/Mantid/scripts/Reflectometry/isis_reflectometry/quick.py b/Code/Mantid/scripts/Reflectometry/isis_reflectometry/quick.py
index 41101523f41..28e1c4ffa2d 100644
--- a/Code/Mantid/scripts/Reflectometry/isis_reflectometry/quick.py
+++ b/Code/Mantid/scripts/Reflectometry/isis_reflectometry/quick.py
@@ -122,8 +122,10 @@ def quick_explicit(run, i0_monitor_index, lambda_min, lambda_max,  background_mi
         detector_index_ranges = (multi_detector_start, nHist-1)
 
 
-    _monitor_ws, _detector_ws = to_lam.convert(wavelength_min=lambda_min, wavelength_max=lambda_max, 
-    detector_workspace_indexes=detector_index_ranges, monitor_workspace_index=i0_monitor_index, correct_monitor=True, bg_min=background_min, bg_max=background_max )
+    _monitor_ws, _detector_ws = to_lam.convert(wavelength_min=lambda_min, wavelength_max=lambda_max,
+                                               detector_workspace_indexes=detector_index_ranges,
+                                               monitor_workspace_index=i0_monitor_index, correct_monitor=True,
+                                               bg_min=background_min, bg_max=background_max )
 
     inst = _sample_ws.getInstrument()
     # Some beamline constants from IDF
diff --git a/Code/Mantid/scripts/SANS/isis_reduction_steps.py b/Code/Mantid/scripts/SANS/isis_reduction_steps.py
index c5cc2207efa..0505afea4e4 100644
--- a/Code/Mantid/scripts/SANS/isis_reduction_steps.py
+++ b/Code/Mantid/scripts/SANS/isis_reduction_steps.py
@@ -1126,7 +1126,7 @@ class LoadSample(LoadRun):
 
     def execute(self, reducer, isSample):
         self._assignHelper(reducer)
-        
+
         if self.wksp_name == '':
             raise RuntimeError('Unable to load SANS sample run, cannot continue.')
 
@@ -1246,7 +1246,7 @@ class TransmissionCalc(ReductionStep):
         self.fit_settings = dict()
         for prop in self.fit_props:
             self.fit_settings['both::'+prop] = None
-        
+
         # CalculateTransmission can be given either a monitor detetor ID or a set of detector
         # ID's corresponding to a ROI (region of interest).  The monitor or ROI will specify
         # the *transmission* (not the incident beam).  A monitor is the standard functionality,
@@ -1371,7 +1371,7 @@ class TransmissionCalc(ReductionStep):
         # We perform a FlatBackground correction. We do this in two parts.
         # First we find the workspace indices which correspond to monitors
         # and perform the correction on these indicies.
-        # Second we perform the correction on all indices which are not 
+        # Second we perform the correction on all indices which are not
         # monitors
         for ws_index in range(tmp.getNumberHistograms()):
             if tmp.getDetector(ws_index).isMonitor():
-- 
GitLab