diff --git a/Framework/PythonInterface/plugins/algorithms/ApplyNegMuCorrection.py b/Framework/PythonInterface/plugins/algorithms/ApplyNegMuCorrection.py index 57037d6af2e581c29387657ce8674f746f5f1769..523c775ee6c84a245e9ff55cf3972eb8532b423f 100644 --- a/Framework/PythonInterface/plugins/algorithms/ApplyNegMuCorrection.py +++ b/Framework/PythonInterface/plugins/algorithms/ApplyNegMuCorrection.py @@ -1,4 +1,3 @@ -import os from mantid.api import * # PythonAlgorithm, registerAlgorithm, WorkspaceProperty from mantid.simpleapi import * from mantid.kernel import * diff --git a/Framework/PythonInterface/plugins/algorithms/ComputeIncoherentDOS.py b/Framework/PythonInterface/plugins/algorithms/ComputeIncoherentDOS.py index 9ef2e40aa18f470f27e0ed488dcc8a7502db94d9..4b19c2a61d13c2aca5eb8a1e972cb64ef92f57e0 100644 --- a/Framework/PythonInterface/plugins/algorithms/ComputeIncoherentDOS.py +++ b/Framework/PythonInterface/plugins/algorithms/ComputeIncoherentDOS.py @@ -71,7 +71,7 @@ class ComputeIncoherentDOS(PythonAlgorithm): QSumRange = self.getPropertyValue('QSumRange') EnergyBinning = self.getPropertyValue('EnergyBinning') cm = int(self.getPropertyValue('Wavenumbers')) - absunits = bool(self.getPropertyValue('StatesPerEnergy')) + absunits = int(self.getPropertyValue('StatesPerEnergy')) # Checks if the input workspace is valid, and which way around it is (Q along x or Q along y). u0 = inws.getAxis(0).getUnit().unitID() @@ -173,9 +173,8 @@ class ComputeIncoherentDOS(PythonAlgorithm): y = y/mev2cm e = e/mev2cm #yunit = 'DeltaE_inWavenumber' - else: + #else: #yunit = 'DeltaE' - pass # Outputs the calculated density of states to another workspace dos2d = CloneWorkspace(inws) diff --git a/Framework/PythonInterface/plugins/algorithms/LRReflectivityOutput.py b/Framework/PythonInterface/plugins/algorithms/LRReflectivityOutput.py index bc1bb3da1e83993bb39c67db33a9d59d9731262a..b5692c4e1b131428a82199ff41fae27489c63f92 100644 --- a/Framework/PythonInterface/plugins/algorithms/LRReflectivityOutput.py +++ b/Framework/PythonInterface/plugins/algorithms/LRReflectivityOutput.py @@ -85,7 +85,7 @@ class LRReflectivityOutput(PythonAlgorithm): # Get binning parameters binning_parameters = self.getProperty("OutputBinning").value header_list = ("DataRun", "NormRun", "TwoTheta(deg)", "LambdaMin(A)", - "LambdaMax(A)", "Qmin(1/A)", "Qmax(1/A)", "SF_A", "SF_B", "PrimaryFrac") + "LambdaMax(A)", "Qmin(1/A)", "Qmax(1/A)", "SF_A", "SF_B", "PrimaryFrac") header_info = "# %-9s %-9s %-14s %-14s %-12s %-12s %-12s %-12s %-12s %-12s\n" % header_list # Convert each histo to histograms and rebin to final binning for ws in scaled_ws_list: diff --git a/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn3Ascii.py b/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn3Ascii.py index f7ad63e900f8acf2ae0027ef7fbe256e3aeea998..7d95040ae6c75e212128ecffc306ec05ed7812bd 100644 --- a/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn3Ascii.py +++ b/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn3Ascii.py @@ -100,7 +100,7 @@ class LoadNMoldyn3Ascii(PythonAlgorithm): self.declareProperty(FileProperty('Filename', '', action=FileAction.Load, extensions=['.cdl', '.dat']), - doc='File path for data') + doc='File path for data') self.declareProperty(StringArrayProperty('Functions'), doc='Names of functions to attempt to load from file') diff --git a/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticBS.py b/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticBS.py index 03557e8d898122b48991be3b4b050c31b1fe2112..5bf9f757399011719495c96b167ea81cbd08e985 100644 --- a/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticBS.py +++ b/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticBS.py @@ -60,8 +60,8 @@ class LoadVisionElasticBS(PythonAlgorithm): # Now lets try histograms. for bank in banks_list: mantid.simpleapi.LoadFlexiNexus(Filename=filename, - Dictionary=os.path.join(dictionary_path, 'vision-'+bank+'.dic'), - OutputWorkspace=bank) + Dictionary=os.path.join(dictionary_path, 'vision-'+bank+'.dic'), + OutputWorkspace=bank) mantid.simpleapi.LoadInstrument(Workspace=bank, Filename=ExperimentInfo.getInstrumentFilename('VISION'), RewriteSpectraMap=False) diff --git a/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticEQ.py b/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticEQ.py index b7a22460b3b9fb3398430b29fb38d11950534ef6..55fab591d6916e1f3d46c603ad08466518b21dd0 100644 --- a/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticEQ.py +++ b/Framework/PythonInterface/plugins/algorithms/LoadVisionElasticEQ.py @@ -60,8 +60,8 @@ class LoadVisionElasticEQ(PythonAlgorithm): # Now lets try histograms. for bank in banks_list: mantid.simpleapi.LoadFlexiNexus(Filename=filename, - Dictionary=os.path.join(dictionary_path, 'vision-'+bank+'.dic'), - OutputWorkspace=bank) + Dictionary=os.path.join(dictionary_path, 'vision-'+bank+'.dic'), + OutputWorkspace=bank) mantid.simpleapi.LoadInstrument(Workspace=bank, Filename=ExperimentInfo.getInstrumentFilename('VISION'), RewriteSpectraMap=False) diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSDarkRunBackgroundCorrection.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSDarkRunBackgroundCorrection.py index 158715eded83546d3009f12cdc8921209bcbaa88..303eeea078216570794084c7cbabfcf0d069d83c 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSDarkRunBackgroundCorrection.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSDarkRunBackgroundCorrection.py @@ -23,11 +23,11 @@ class SANSDarkRunBackgroundCorrection(PythonAlgorithm): direction=Direction.Input)) self.declareProperty(MatrixWorkspaceProperty("OutputWorkspace", "", direction = Direction.Output), - "The corrected SANS workspace.") + "The corrected SANS workspace.") self.declareProperty("NormalizationRatio", 1.0, "Number to scale the dark run in order" - "to make it comparable to the SANS run") + "to make it comparable to the SANS run") self.declareProperty("Mean", False, "If True then a mean value of all spectra is used to " - "calculate the value to subtract") + "calculate the value to subtract") self.declareProperty("Uniform", True, "If True then we treat the treat the tim ebins a") self.declareProperty("ApplyToDetectors", True, "If True then we apply the correction to the detector pixels") self.declareProperty("ApplyToMonitors", False, "If True then we apply the correction to the monitors") @@ -39,7 +39,7 @@ class SANSDarkRunBackgroundCorrection(PythonAlgorithm): direction=Direction.Input), "List of selected detector IDs of monitors to which the " "correction should be applied. If empty, all monitors will " - "be corrected, if ApplyToMonitors has been selected.") + "be corrected, if ApplyToMonitors has been selected.") def PyExec(self): # Get the workspaces workspace = self.getProperty("InputWorkspace").value diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSStitch.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSStitch.py index 34c033e5a524708917ce69e70e8b909cd5b6d3cb..2b4501660cb12cf262d144a087137a1a79772c5d 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSStitch.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSStitch.py @@ -267,7 +267,7 @@ class SANSStitch(DataProcessorAlgorithm): # Calculate merged q for the can merged_q_can = self._calculate_merged_q_can(cF=cF_can, nF=nF_can, cR=cR_can, nR=nR_can, - scale_factor=scale_factor) + scale_factor=scale_factor) # Subtract it from the sample merged_q = self._subract(merged_q, merged_q_can) @@ -377,7 +377,7 @@ class QErrorCorrectionForMergedWorkspaces(object): return q_res_buffer def correct_q_resolution_for_merged(self, count_ws_front, count_ws_rear, - output_ws, scale): + output_ws, scale): """ We need to transfer the DX error values from the original workspaces to the merged worksapce. We have: diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TOSCABankCorrection.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TOSCABankCorrection.py index fff35fbf4419f769c19441e2b6eed9cda95ccfc4..01aba1c3a90508ec9fe54acaaefdb989f8816f9c 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TOSCABankCorrection.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TOSCABankCorrection.py @@ -24,7 +24,7 @@ class TOSCABankCorrection(DataProcessorAlgorithm): def PyInit(self): self.declareProperty(WorkspaceProperty(name='InputWorkspace', defaultValue='', - direction=Direction.Input), + direction=Direction.Input), doc='Input reduced workspace') self.declareProperty(FloatArrayProperty(name='SearchRange', @@ -42,7 +42,7 @@ class TOSCABankCorrection(DataProcessorAlgorithm): doc='Type of peak to search for') self.declareProperty(MatrixWorkspaceProperty(name='OutputWorkspace', defaultValue='', - direction=Direction.Output), + direction=Direction.Output), doc='Output corrected workspace') self.declareProperty(name='TargetPeakCentre', defaultValue=0.0, diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TransformToIqt.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TransformToIqt.py index 0d9bcbdced9a6171a1bfa14f16496592a853c944..b146de92ee4bcbb8467f153eb13c34fd55a42c6f 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TransformToIqt.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TransformToIqt.py @@ -194,11 +194,9 @@ class TransformToIqt(PythonAlgorithm): def _add_logs(self): - sample_logs = [ - ('iqt_sample_workspace', self._sample), - ('iqt_resolution_workspace', self._resolution), - ('iqt_binning', '%f,%f,%f' % (self._e_min, self._e_width, self._e_max)) - ] + sample_logs = [('iqt_sample_workspace', self._sample), + ('iqt_resolution_workspace', self._resolution), + ('iqt_binning', '%f,%f,%f' % (self._e_min, self._e_width, self._e_max))] log_alg = self.createChildAlgorithm(name='AddSampleLogMultiple', startProgress=0.8, endProgress=1.0, enableLogging=True) diff --git a/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAutoPolarizationCorrection.py b/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAutoPolarizationCorrection.py index 2296bfa76a6ca56baffd93ea9d25ea85ed0044b3..613a4165de0df9ef5b88d3a5c1368f7ad4c2b697 100644 --- a/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAutoPolarizationCorrection.py +++ b/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAutoPolarizationCorrection.py @@ -27,13 +27,13 @@ class OFFSPECReflRedOneAutoPolarizationCorrection(stresstesting.MantidStressTest CPp=[1] #run reflectometryReductionOneAuto __, _IvsLam_polCorr,__ = ReflectometryReductionOneAuto(inputWorkspace, AnalysisMode="MultiDetectorAnalysis", - ProcessingInstructions="110-120", - FirstTransmissionRun=transWorkspace, - ThetaIn="1.2",WavelengthMin=2.0, - WavelengthStep=0.05, - WavelengthMax=12.0,CorrectionAlgorithm='None', - PolarizationAnalysis='PA', MomentumTransferStep=0.1, - CPp=CPp,CAp=CAp,CRho=CRho,CAlpha=CAlpha) + ProcessingInstructions="110-120", + FirstTransmissionRun=transWorkspace, + ThetaIn="1.2",WavelengthMin=2.0, + WavelengthStep=0.05, + WavelengthMax=12.0,CorrectionAlgorithm='None', + PolarizationAnalysis='PA', MomentumTransferStep=0.1, + CPp=CPp,CAp=CAp,CRho=CRho,CAlpha=CAlpha) return True def validate(self): diff --git a/Testing/SystemTests/tests/analysis/ReflectometryISIS.py b/Testing/SystemTests/tests/analysis/ReflectometryISIS.py index 6ab242a9d464a1ab751f934bffeee82f47f79d1b..0ec7f63c9ee9e86effc81a87de5440eb4b769e66 100644 --- a/Testing/SystemTests/tests/analysis/ReflectometryISIS.py +++ b/Testing/SystemTests/tests/analysis/ReflectometryISIS.py @@ -65,11 +65,11 @@ class ReflectometryISIS(stresstesting.MantidStressTest): # MD transformations QxQy, _QxQy_vertexes = ConvertToReflectometryQ(InputWorkspace='SignedTheta_vs_Wavelength', - OutputDimensions='Q (lab frame)', Extents='-0.0005,0.0005,0,0.12') + OutputDimensions='Q (lab frame)', Extents='-0.0005,0.0005,0,0.12') KiKf, _KiKF_vertexes = ConvertToReflectometryQ(InputWorkspace='SignedTheta_vs_Wavelength', - OutputDimensions='K (incident, final)', Extents='0,0.05,0,0.05') + OutputDimensions='K (incident, final)', Extents='0,0.05,0,0.05') PiPf, _PiPf_vertexes = ConvertToReflectometryQ(InputWorkspace='SignedTheta_vs_Wavelength', - OutputDimensions='P (lab frame)', Extents='0,0.1,-0.02,0.15') + OutputDimensions='P (lab frame)', Extents='0,0.1,-0.02,0.15') # Bin the outputs to histograms because observations are not important. BinMD(InputWorkspace=QxQy, AxisAligned='0',BasisVector0='Qx,(Ang^-1),1,0',BasisVector1='Qz,(Ang^-1),0,1', diff --git a/Testing/SystemTests/tests/analysis/SANSDarkRunSubtractionTest.py b/Testing/SystemTests/tests/analysis/SANSDarkRunSubtractionTest.py index aa21a059b93130c9967c89202ef80736b8c1d674..2709889157777ef0ffa8dc0b94092eb81547d2c1 100644 --- a/Testing/SystemTests/tests/analysis/SANSDarkRunSubtractionTest.py +++ b/Testing/SystemTests/tests/analysis/SANSDarkRunSubtractionTest.py @@ -313,8 +313,8 @@ class DarkRunSubtractionTest(unittest.TestCase): # We only have monitors in our transmission file for i in [0,1,2,3]: - self.assertFalse(all_entries_zero(transmission_workspace, i), ("Monitor1, Monitor2," - "Monitor3 and Monitor4 entries should not all be 0")) + self.assertFalse(all_entries_zero(transmission_workspace, i), + ("Monitor1, Monitor2, Monitor3 and Monitor4 entries should not all be 0")) def test_that_subtracts_monitors_and_detectors_for_transmission_workspace_with_monitors_and_detectors(self): # Arrange diff --git a/Testing/SystemTests/tests/analysis/SortHKLTest.py b/Testing/SystemTests/tests/analysis/SortHKLTest.py index 00a6197c0f5e5458a0528acd98b36427c8834f70..b3d22c07f900cba2b1deaf1d5e865f5d3f1ac755 100644 --- a/Testing/SystemTests/tests/analysis/SortHKLTest.py +++ b/Testing/SystemTests/tests/analysis/SortHKLTest.py @@ -88,8 +88,8 @@ class SortHKLTest(stresstesting.MantidStressTest): # pylint: disable=unused-variable sorted_hkls, chi2, statistics = SortHKL(InputWorkspace=reflections, - PointGroup=point_group_name, - LatticeCentering=centering_name) + PointGroup=point_group_name, + LatticeCentering=centering_name) return statistics.row(0), sorted_hkls diff --git a/Testing/SystemTests/tests/analysis/SpaceGroupFactoryTest.py b/Testing/SystemTests/tests/analysis/SpaceGroupFactoryTest.py index a7f65d9da2c2feadcbc43cb2edf923fa9344c6ae..76887caca0c4bdfd6ef7c490668aafdfe2d2e155 100644 --- a/Testing/SystemTests/tests/analysis/SpaceGroupFactoryTest.py +++ b/Testing/SystemTests/tests/analysis/SpaceGroupFactoryTest.py @@ -62,9 +62,9 @@ class SpaceGroupFactoryTest(stresstesting.MantidStressTest): pointGroup = spaceGroup.getPointGroup() self.assertFalse( - set(onlyMatrices.getSymmetryOperationStrings()).isdisjoint(pointGroup.getSymmetryOperationStrings()), - ("Point group of space group " + spaceGroup.getHMSymbol() + " does not match group obtained from" - " matrices of symmetry operations.")) + set(onlyMatrices.getSymmetryOperationStrings()).isdisjoint(pointGroup.getSymmetryOperationStrings()), + ("Point group of space group " + spaceGroup.getHMSymbol() + " does not match group obtained from" + " matrices of symmetry operations.")) def loadReferenceData(self): # Reference data, generated using sginfo (http://cci.lbl.gov/sginfo/) diff --git a/docs/sphinxext/mantiddoc/directives/properties.py b/docs/sphinxext/mantiddoc/directives/properties.py index 2e14a854077bea111e82ccfd43608175a5733b77..5133df9e7fa446a65f9c592bcac2b14864e73399 100644 --- a/docs/sphinxext/mantiddoc/directives/properties.py +++ b/docs/sphinxext/mantiddoc/directives/properties.py @@ -36,7 +36,7 @@ class PropertiesDirective(AlgorithmBaseDirective): properties.append((ifunc.parameterName(i), str(ifunc.getParameterValue(i)), ifunc.paramDescription(i) - )) + )) self.add_rst(self.make_header("Properties (fitting parameters)")) else: # this is an Algorithm alg = self.create_mantid_algorithm(self.algorithm_name(), diff --git a/scripts/Calibration/Examples/TubeCalibDemoMaps_All.py b/scripts/Calibration/Examples/TubeCalibDemoMaps_All.py index 3938be682040b99bd18dea8a70a015f1252190ca..fce8bea27e79e8ab8f3a4cf77e1898f86541db7e 100644 --- a/scripts/Calibration/Examples/TubeCalibDemoMaps_All.py +++ b/scripts/Calibration/Examples/TubeCalibDemoMaps_All.py @@ -269,17 +269,17 @@ def improvingCalibrationOfListOfTubes(filename): # it is defined as the mean values around the neighbours define_peaks = {19:[10, 80.9771, 123.221, 164.993, 245.717], # the first one was bad - 37: [6.36, 80.9347, 122.941, 165.104, 248.32], # the first one was bad - 71: [8.62752, 85.074, 124.919, 164.116, 246.82 ], # the last one was bad - check if we can inprove - 75: [14.4285, 90.087, 128.987, 167.047, 242.62], # the last one was bad - check if we can inprove - 181: [11.726, 94.0496, 137.816, 180, 255], # the third peak was lost - 186:[11.9382, 71.5203, 107, 147.727, 239.041], #lost the second peak - 234: [4.84, 82.7824, 123.125, 163.945, 241.877], # the first one was bad - 235: [4.84, 80.0077, 121.002, 161.098, 238.502], # the first one was bad - 245: [9.88089, 93.0593, 136.911, 179.5, 255], # the third peak was bad - 273: [18.3711, 105.5, 145.5, 181.6, 243.252], # lost first and third peaks - 345: [4.6084, 87.0351, 128.125, 169.923, 245.3] # the last one was bad - } + 37: [6.36, 80.9347, 122.941, 165.104, 248.32], # the first one was bad + 71: [8.62752, 85.074, 124.919, 164.116, 246.82 ], # the last one was bad - check if we can inprove + 75: [14.4285, 90.087, 128.987, 167.047, 242.62], # the last one was bad - check if we can inprove + 181: [11.726, 94.0496, 137.816, 180, 255], # the third peak was lost + 186:[11.9382, 71.5203, 107, 147.727, 239.041], #lost the second peak + 234: [4.84, 82.7824, 123.125, 163.945, 241.877], # the first one was bad + 235: [4.84, 80.0077, 121.002, 161.098, 238.502], # the first one was bad + 245: [9.88089, 93.0593, 136.911, 179.5, 255], # the third peak was bad + 273: [18.3711, 105.5, 145.5, 181.6, 243.252], # lost first and third peaks + 345: [4.6084, 87.0351, 128.125, 169.923, 245.3] # the last one was bad + } calibrationTable, peakTable= tube.calibrate(CalibInstWS, CalibratedComponent, knownPos, funcFactor, fitPar=fitPar, outputPeak=True, overridePeaks=define_peaks) @@ -487,12 +487,12 @@ def completeCalibration(filename): # apply the calibration for the b2_window 2 strips values calibrationTable, peak2Table = tube.calibrate(CalibInstWS, CalibratedComponent, - knownPos, #these parameters now have only 4 points - funcFactor, - fitPar=fitPar, - outputPeak=True, - calibTable = calibrationTable, # it will append to the calibTable - rangeList = b2_window) + knownPos, #these parameters now have only 4 points + funcFactor, + fitPar=fitPar, + outputPeak=True, + calibTable = calibrationTable, # it will append to the calibTable + rangeList = b2_window) ApplyCalibration( Workspace=CalibInstWS, PositionTable=calibrationTable) diff --git a/scripts/Calibration/Examples/TubeCalibDemoMerlin.py b/scripts/Calibration/Examples/TubeCalibDemoMerlin.py index 4fb14c18ea79c2a610e03188260ff7dffcc25b90..3e83f0459f93b81fb496d476bde64790590bd732 100644 --- a/scripts/Calibration/Examples/TubeCalibDemoMerlin.py +++ b/scripts/Calibration/Examples/TubeCalibDemoMerlin.py @@ -86,7 +86,8 @@ def calibrateMerlin(filename): # the known positions are given in pixels inside the tubes and transformed to provide the positions # with the center of the tube as the origin - knownPositions = 2.92713867188*(numpy.array([ 27.30074322, 92.5, 294.65178585, 362.37861919 , 512.77103043 ,663.41425323, 798.3223896, 930.9, 997.08480835])/1024 - 0.5) + knownPositions = 2.92713867188*(numpy.array([27.30074322, 92.5, 294.65178585, 362.37861919, + 512.77103043, 663.41425323, 798.3223896, 930.9, 997.08480835])/1024 - 0.5) funcForm = numpy.array([2,2,1,1,1,1,1,2,2],numpy.int8) # The calibration will follow different steps for sets of tubes @@ -100,10 +101,10 @@ def calibrateMerlin(filename): # == Get the calibration and put results into calibration table == # also put peaks into PeakFile calibrationTable, peakTable = tube.calibrate(CalibInstWS, CalibratedComponent, door9pos, door9func, - outputPeak=True, - margin=30, - rangeList=range(20) # because 20, 21, 22, 23 are defective detectors - ) + outputPeak=True, + margin=30, + rangeList=range(20) # because 20, 21, 22, 23 are defective detectors + ) print "Got calibration (new positions of detectors) and put slit peaks into file TubeDemoMerlin01.txt" analisePeakTable(peakTable, 'door9_tube1_peaks') @@ -112,10 +113,10 @@ def calibrateMerlin(filename): door8func = points7func CalibratedComponent = 'MERLIN/door8' calibrationTable, peakTable = tube.calibrate(CalibInstWS, CalibratedComponent, door8pos, - door8func, - outputPeak = True, #change to peakTable to append to peakTable - calibTable = calibrationTable, - margin = 30) + door8func, + outputPeak = True, #change to peakTable to append to peakTable + calibTable = calibrationTable, + margin = 30) analisePeakTable(peakTable, 'door8_peaks') # For the doors 7,6,5,4, 2, 1 we may use the 9 points diff --git a/scripts/Calibration/Examples/TubeCalibDemoWish_Simple.py b/scripts/Calibration/Examples/TubeCalibDemoWish_Simple.py index 66d4f301bf8956b4f9106a18f8aee0cc436b7fc5..c305be13827879faa458bb392a7294bdc9f9b59a 100644 --- a/scripts/Calibration/Examples/TubeCalibDemoWish_Simple.py +++ b/scripts/Calibration/Examples/TubeCalibDemoWish_Simple.py @@ -44,10 +44,10 @@ def CalibrateWish( RunNumber, PanelNumber): #calibrate the upper tubes calibrationTable, peakTable = tube.calibrate(CalibInstWS, CalibratedComponent, upper_tube, funcForm, - rangeList = range(76,152), - calibTable=calibrationTable,#give the calibration table to append data - outputPeak = peakTable#give peak table to append data - ) + rangeList = range(76,152), + calibTable=calibrationTable,#give the calibration table to append data + outputPeak = peakTable#give peak table to append data + ) print "Got calibration (new positions of detectors)" diff --git a/scripts/HFIRPowderReduction/HfirPDReductionControl.py b/scripts/HFIRPowderReduction/HfirPDReductionControl.py index 66472f471e51b83bbfd123d47791bef53c82f482..4c91290ee9b9c55c1db55ddbcdab769afd8622d1 100644 --- a/scripts/HFIRPowderReduction/HfirPDReductionControl.py +++ b/scripts/HFIRPowderReduction/HfirPDReductionControl.py @@ -26,7 +26,7 @@ from mantid.simpleapi import AnalysisDataService VanadiumPeakPositions = [0.5044,0.5191,0.5350,0.5526,0.5936,0.6178,0.6453,0.6768, - 0.7134,0.7566,0.8089,0.8737,0.9571,1.0701,1.2356,1.5133,2.1401] + 0.7134,0.7566,0.8089,0.8737,0.9571,1.0701,1.2356,1.5133,2.1401] class PDRManager(object): """ Powder diffraction reduction workspace manager @@ -571,7 +571,7 @@ class HFIRPDRedControl(object): tablewsname = basewsname + "_RawTable" infowsname = basewsname + "ExpInfo" api.LoadSpiceAscii(Filename=datafilename, - OutputWorkspace=tablewsname, RunInfoWorkspace=infowsname) + OutputWorkspace=tablewsname, RunInfoWorkspace=infowsname) tablews = AnalysisDataService.retrieve(tablewsname) infows = AnalysisDataService.retrieve(infowsname) @@ -689,8 +689,7 @@ class HFIRPDRedControl(object): try: wsmanager = self._myWorkspaceDict[ (int(expno), int(scanno) )] except KeyError: - raise NotImplementedError("Exp %d Scan %d has not been loaded yet." % (int(expno), - int(scanno))) + raise NotImplementedError("Exp %d Scan %d has not been loaded yet." % (int(expno),int(scanno))) # Convert to MDWorkspace tablews = wsmanager.getRawSpiceTable() @@ -836,13 +835,13 @@ class HFIRPDRedControl(object): basewsname = datamdws.name().split("_DataMD")[0] outwsname = basewsname + "_Reduced" api.ConvertCWPDMDToSpectra(InputWorkspace=datamdws, - InputMonitorWorkspace=monitormdws, - OutputWorkspace=outwsname, - BinningParams=binpar, - UnitOutput = unit, - NeutronWaveLength=wavelength, - ExcludedDetectorIDs=numpy.array(excludeddetlist), - ScaleFactor=scalefactor) + InputMonitorWorkspace=monitormdws, + OutputWorkspace=outwsname, + BinningParams=binpar, + UnitOutput = unit, + NeutronWaveLength=wavelength, + ExcludedDetectorIDs=numpy.array(excludeddetlist), + ScaleFactor=scalefactor) print "[DB] Reduction is finished. Data is in workspace %s. " % (outwsname) @@ -1002,8 +1001,8 @@ class HFIRPDRedControl(object): # Save api.SaveFocusedXYE(InputWorkspace=wksp, - StartAtBankNumber=1, - Filename=savefilename) + StartAtBankNumber=1, + Filename=savefilename) return diff --git a/scripts/HFIRPowderReduction/HfirPDReductionGUI.py b/scripts/HFIRPowderReduction/HfirPDReductionGUI.py index 706ae01a4a4392bb2f96ef853544ba7eccc0032b..4d49cad64a0e008ee7cf5cbe1031471d02776629 100644 --- a/scripts/HFIRPowderReduction/HfirPDReductionGUI.py +++ b/scripts/HFIRPowderReduction/HfirPDReductionGUI.py @@ -146,7 +146,7 @@ class MainWindow(QtGui.QMainWindow): self.connect(self.ui.actionQuit, QtCore.SIGNAL('triggered()'), self.doExist) self.connect(self.ui.actionFind_Help, QtCore.SIGNAL('triggered()'), - self.doHelp) + self.doHelp) # main self.connect(self.ui.comboBox_wavelength, QtCore.SIGNAL('currentIndexChanged(int)'), @@ -180,69 +180,69 @@ class MainWindow(QtGui.QMainWindow): # tab 'Normalized' self.connect(self.ui.pushButton_loadData, QtCore.SIGNAL('clicked()'), - self.doLoadData) + self.doLoadData) self.connect(self.ui.pushButton_prevScan, QtCore.SIGNAL('clicked()'), - self.doLoadReduceScanPrev) + self.doLoadReduceScanPrev) self.connect(self.ui.pushButton_nextScan, QtCore.SIGNAL('clicked()'), - self.doLoadReduceScanNext) + self.doLoadReduceScanNext) self.connect(self.ui.pushButton_unit2theta, QtCore.SIGNAL('clicked()'), - self.doReduce2Theta) + self.doReduce2Theta) self.connect(self.ui.pushButton_unitD, QtCore.SIGNAL('clicked()'), - self.doReduceDSpacing) + self.doReduceDSpacing) self.connect(self.ui.pushButton_unitQ, QtCore.SIGNAL('clicked()'), - self.doReduceQ) + self.doReduceQ) self.connect(self.ui.pushButton_saveData, QtCore.SIGNAL('clicked()'), - self.doSaveData) + self.doSaveData) self.connect(self.ui.pushButton_clearTab2Canvas, QtCore.SIGNAL('clicked()'), - self.doClearCanvas) + self.doClearCanvas) # tab 'Multiple Scans' self.connect(self.ui.pushButton_loadMultData, QtCore.SIGNAL('clicked()'), self.doLoadSetData) self.connect(self.ui.pushButton_mscanBin, QtCore.SIGNAL('clicked()'), - self.doReduceSetData) + self.doReduceSetData) self.connect(self.ui.pushButton_mergeScans, QtCore.SIGNAL('clicked()'), - self.doMergeScans) + self.doMergeScans) self.connect(self.ui.pushButton_viewMScan1D, QtCore.SIGNAL('clicked()'), - self.doMergeScanView1D) + self.doMergeScanView1D) self.connect(self.ui.pushButton_view2D, QtCore.SIGNAL('clicked()'), - self.doMergeScanView2D) + self.doMergeScanView2D) self.connect(self.ui.pushButton_viewMerge, QtCore.SIGNAL('clicked()'), - self.doMergeScanViewMerged) + self.doMergeScanViewMerged) self.connect(self.ui.pushButton_clearMultCanvas, QtCore.SIGNAL('clicked()'), - self.doClearMultiRunCanvas) + self.doClearMultiRunCanvas) self.connect(self.ui.pushButton_saveAllIndScans, QtCore.SIGNAL('clicked()'), - self.doSaveMultipleScans) + self.doSaveMultipleScans) self.connect(self.ui.pushButton_saveMerge, QtCore.SIGNAL('clicked()'), - self.doSaveMergedScan) + self.doSaveMergedScan) self.connect(self.ui.pushButton_plotRawMultiScans, QtCore.SIGNAL('clicked()'), self.do_convert_plot_multi_scans) # tab 'Vanadium' self.connect(self.ui.pushButton_stripVanPeaks, QtCore.SIGNAL('clicked()'), - self.doStripVandiumPeaks) + self.doStripVandiumPeaks) self.connect(self.ui.pushButton_saveVanRun, QtCore.SIGNAL('clicked()'), - self.doSaveVanRun) + self.doSaveVanRun) self.connect(self.ui.pushButton_rebin2Theta, QtCore.SIGNAL('clicked()'), - self.doReduceVanadium2Theta) + self.doReduceVanadium2Theta) self.connect(self.ui.pushButton_smoothVanData, QtCore.SIGNAL('clicked()'), - self.doSmoothVanadiumData) + self.doSmoothVanadiumData) self.connect(self.ui.pushButton_applySmooth, QtCore.SIGNAL('clicked()'), - self.doSmoothVanadiumApply) + self.doSmoothVanadiumApply) self.connect(self.ui.pushButton_undoSmooth, QtCore.SIGNAL('clicked()'), - self.doSmoothVanadiumUndo) + self.doSmoothVanadiumUndo) # tab 'Advanced Setup' self.connect(self.ui.pushButton_browseCache, QtCore.SIGNAL('clicked()'), - self.doBrowseCache) + self.doBrowseCache) self.connect(self.ui.radioButton_useServer, QtCore.SIGNAL('clicked()'), - self.doChangeSrcLocation) + self.doChangeSrcLocation) self.connect(self.ui.radioButton_useLocal, QtCore.SIGNAL('clicked()'), - self.doChangeSrcLocation) + self.doChangeSrcLocation) self.connect(self.ui.pushButton_browseLocalSrc, QtCore.SIGNAL('clicked()'), - self.doBrowseLocalDataSrc) + self.doBrowseLocalDataSrc) self.connect(self.ui.pushButton_chkServer, QtCore.SIGNAL('clicked()'), - self.doCheckSrcServer) + self.doCheckSrcServer) # Define signal-event handling @@ -1119,7 +1119,7 @@ class MainWindow(QtGui.QMainWindow): self.doClearIndDetCanvas() self._plot_individual_detector_counts(self._expNo, self._scanNo, currdetid, - self._indvXLabel) + self._indvXLabel) except KeyError as e: self._logError(str(e)) else: @@ -1143,7 +1143,7 @@ class MainWindow(QtGui.QMainWindow): self.doClearIndDetCanvas() self._plot_individual_detector_counts(self._expNo, self._scanNo, currdetid, - self._indvXLabel) + self._indvXLabel) except KeyError as e: self._logError(str(e)) else: @@ -1266,7 +1266,7 @@ class MainWindow(QtGui.QMainWindow): plotmode = str(self.ui.comboBox_rawDetMode.currentText()) overplot = bool(self.ui.checkBox_overpltRawDet.isChecked()) execstatus = self._plotRawDetSignal(self._rawDetExpNo, self._rawDetScanNo, plotmode, - ptno, overplot) + ptno, overplot) # update if it is good to plot if execstatus is True: @@ -1301,7 +1301,7 @@ class MainWindow(QtGui.QMainWindow): plotmode = str(self.ui.comboBox_rawDetMode.currentText()) overplot = bool(self.ui.checkBox_overpltRawDet.isChecked()) execstatus = self._plotRawDetSignal(self._rawDetExpNo, self._rawDetScanNo, plotmode, - ptno, overplot) + ptno, overplot) # update if it is good to plot if execstatus is True: @@ -1933,7 +1933,7 @@ class MainWindow(QtGui.QMainWindow): xlabel = self._getXLabelFromUnit(self.ui.comboBox_mscanUnit.currentText()) canvas.add_plot1d(vecx, vecy, marker=marker, color=color, - x_label=xlabel, y_label='intensity',label=label) + x_label=xlabel, y_label='intensity',label=label) xmax = max(vecx) xmin = min(vecx) @@ -2102,11 +2102,11 @@ class MainWindow(QtGui.QMainWindow): # plot canvas.add_plot1d(vecx, vecy, marker=marker, color=color, - x_label=xlabel, y_label='intensity',label=label) + x_label=xlabel, y_label='intensity',label=label) if TempData is False: canvas.add_plot1d(vecx, diffY, marker='+', color='green', - x_label=xlabel, y_label='intensity',label='Diff') + x_label=xlabel, y_label='intensity',label='Diff') # reset canvas limits if clearcanvas is True: diff --git a/scripts/Inelastic/Direct/DirectEnergyConversion.py b/scripts/Inelastic/Direct/DirectEnergyConversion.py index 7800a0e535be015b694d369987f4c96378d8e853..c78ae08450d3f97f538910541e26cfe38630705e 100644 --- a/scripts/Inelastic/Direct/DirectEnergyConversion.py +++ b/scripts/Inelastic/Direct/DirectEnergyConversion.py @@ -459,7 +459,7 @@ class DirectEnergyConversion(object): if not prop_man.motor_offset is None and np.isnan(psi): #logs have a problem prop_man.log("*** Can not retrieve rotation value from sample environment logs: {0}.\n" - " Rotation angle remains undefined".format(prop_man.motor_log_names)) + " Rotation angle remains undefined".format(prop_man.motor_log_names)) PropertyManager.psi = None # Just in case else: # store psi in property not to retrieve it from workspace again diff --git a/scripts/Inelastic/Direct/ReductionWrapper.py b/scripts/Inelastic/Direct/ReductionWrapper.py index 0a3cefa84480a24325e1ca8f77cf0d041cec14ec..2f2039d496b893a47b3abf9cf2e3d264dd6bf8a8 100644 --- a/scripts/Inelastic/Direct/ReductionWrapper.py +++ b/scripts/Inelastic/Direct/ReductionWrapper.py @@ -14,7 +14,7 @@ try: h5py_installed = True except ImportError: h5py_installed = False - pass + from abc import abstractmethod # R0921 abstract class not referenced -- wrong, client references it. @@ -227,8 +227,7 @@ class ReductionWrapper(object): or workspace Change this method to verify different results or validate results differently""" - rez,message = ReductionWrapper.build_or_validate_result(self, - Error,ToleranceRelErr) + rez,message = ReductionWrapper.build_or_validate_result(self,Error,ToleranceRelErr) return rez,message # @@ -522,7 +521,7 @@ class ReductionWrapper(object): # here we have run numbers. Let's get real file names prop_man = self.reducer.prop_man instr_name = prop_man.short_instr_name - is_found,fname = PropertyManager.sample_run.find_file(prop_man,instr_name,run); + is_found,fname = PropertyManager.sample_run.find_file(prop_man,instr_name,run) if not is_found: raise RuntimeError("File has been found earlier but can not been retrieved now. Logical bug") else: diff --git a/scripts/Inelastic/Direct/RunDescriptor.py b/scripts/Inelastic/Direct/RunDescriptor.py index 0f0289d967858da16490a7006547adebea12e725..c492c384c861b850e1e1f08a31821feada797ca4 100644 --- a/scripts/Inelastic/Direct/RunDescriptor.py +++ b/scripts/Inelastic/Direct/RunDescriptor.py @@ -1379,12 +1379,12 @@ class RunDescriptor(PropDescriptor): f_guess,index = self._run_list.get_file_guess(inst_name,run_num) wsp = self.load_file(inst_name,term_name,False, - monitors_with_ws,False,file_hint=f_guess) + monitors_with_ws,False,file_hint=f_guess) wsp_name = wsp.name() wsp_mon_name = wsp_name + '_monitors' Plus(LHSWorkspace=sum_ws_name,RHSWorkspace=wsp_name, - OutputWorkspace=sum_ws_name,ClearRHSWorkspace=True) + OutputWorkspace=sum_ws_name,ClearRHSWorkspace=True) # AddedRunNumbers.append(run_num) AddedRunNumbers+=',' + str(run_num) if not monitors_with_ws: @@ -1401,7 +1401,7 @@ class RunDescriptor(PropDescriptor): #RunDescriptor._sum_log_name, # LogText=AddedRunNumbers,LogType='Number Series') AddSampleLog(Workspace=sum_ws_name,LogName = RunDescriptor._sum_log_name, - LogText=AddedRunNumbers,LogType='String') + LogText=AddedRunNumbers,LogType='String') if RunDescriptor._holder.cashe_sum_ws: # store workspace in cash for further usage diff --git a/scripts/Inelastic/Direct/diagnostics.py b/scripts/Inelastic/Direct/diagnostics.py index 8114b24706bd4ca2fce5a37824269256ea40889d..66901e27f0d78d33351cacaabcd54122d70d8592 100644 --- a/scripts/Inelastic/Direct/diagnostics.py +++ b/scripts/Inelastic/Direct/diagnostics.py @@ -99,9 +99,9 @@ def diagnose(white_int,**kwargs): test_results['First detector vanadium test:'] = ['white_mask cache global', num_failed] else: __white_masks, num_failed = do_white_test(white_int, parser.tiny, parser.huge, - parser.van_out_lo, parser.van_out_hi, - parser.van_lo, parser.van_hi, - parser.van_sig, start_index, end_index) + parser.van_out_lo, parser.van_out_hi, + parser.van_lo, parser.van_hi, + parser.van_sig, start_index, end_index) test_results['First detector vanadium test:'] = [str(__white_masks), num_failed] add_masking(white_int, __white_masks, start_index, end_index) if van_mask: diff --git a/scripts/Interface/reduction_gui/reduction/diffraction/diffraction_reduction_script.py b/scripts/Interface/reduction_gui/reduction/diffraction/diffraction_reduction_script.py index 4e2b146ad641a7166445e9d39035e902c79e3e9f..e23aebdf7d6b480f8105eafc73b9e7c600bf8433 100644 --- a/scripts/Interface/reduction_gui/reduction/diffraction/diffraction_reduction_script.py +++ b/scripts/Interface/reduction_gui/reduction/diffraction/diffraction_reduction_script.py @@ -45,7 +45,7 @@ class DiffractionReductionScripter(BaseReductionScripter): self.facility_name = 'SNS' dbmsg = '[SNS Powder Reduction] Facility = %s, Instrument = %s\n' \ 'Auto-save Directory %s' % (self.facility_name, self.instrument_name, - mantidconfigdir) + mantidconfigdir) Logger("DiffractionReductionScripter").debug(str(dbmsg)) return @@ -84,7 +84,7 @@ class DiffractionReductionScripter(BaseReductionScripter): # Information output wbuf = "Reduction script: (script is saved to %s; setup is saved to %s. \n" % ( - file_name, autosavexmlfname) + file_name, autosavexmlfname) wbuf += script wbuf += "\n========== End of Script ===========" print wbuf @@ -199,16 +199,16 @@ class DiffractionReductionScripter(BaseReductionScripter): if filterdict["LogValueInterval"] != "": # Filter by log value interval script += "%sLogValueInterval = '%s',\n" % ( - DiffractionReductionScripter.WIDTH, - filterdict["LogValueInterval"]) + DiffractionReductionScripter.WIDTH, + filterdict["LogValueInterval"]) script += "%sLogBoundary = '%s',\n" % ( - DiffractionReductionScripter.WIDTH, filterdict["LogBoundary"]) + DiffractionReductionScripter.WIDTH, filterdict["LogBoundary"]) if filterdict["TimeTolerance"] != "": script += "%sTimeTolerance = '%s',\n" % ( - DiffractionReductionScripter.WIDTH, filterdict["TimeTolerance"]) + DiffractionReductionScripter.WIDTH, filterdict["TimeTolerance"]) if filterdict["LogValueTolerance"] != "": script += "%sLogValueTolerance = '%s',\n" % ( - DiffractionReductionScripter.WIDTH, filterdict["LogValueTolerance"]) + DiffractionReductionScripter.WIDTH, filterdict["LogValueTolerance"]) # ENDIF script += ")\n" diff --git a/scripts/Interface/reduction_gui/reduction/diffraction/diffraction_run_setup_script.py b/scripts/Interface/reduction_gui/reduction/diffraction/diffraction_run_setup_script.py index 1344b5c6dd1b69df7efc7463424b8f53f36560bd..c379e781c10bcde9c059944f025b7fe084270c36 100644 --- a/scripts/Interface/reduction_gui/reduction/diffraction/diffraction_run_setup_script.py +++ b/scripts/Interface/reduction_gui/reduction/diffraction/diffraction_run_setup_script.py @@ -187,7 +187,7 @@ class RunSetupScript(BaseScriptElement): self.calibfilename = BaseScriptElement.getStringElement(instrument_dom,\ "calibrationfile", default=RunSetupScript.calibfilename) - self.exp_ini_file_name = BaseScriptElement.getStringElement(instrument_dom, + self.exp_ini_file_name = BaseScriptElement.getStringElement(instrument_dom,\ 'expinifilename', default=RunSetupScript.exp_ini_file_name) self.charfilename = BaseScriptElement.getStringElement(instrument_dom,\ diff --git a/scripts/Interface/reduction_gui/reduction/inelastic/dgs_sample_data_setup_script.py b/scripts/Interface/reduction_gui/reduction/inelastic/dgs_sample_data_setup_script.py index 5cb73f98311c9b88183895d76afed147cb5ea251..6743996bd51c17c18de51c6ddd0de076263c6adf 100644 --- a/scripts/Interface/reduction_gui/reduction/inelastic/dgs_sample_data_setup_script.py +++ b/scripts/Interface/reduction_gui/reduction/inelastic/dgs_sample_data_setup_script.py @@ -159,11 +159,11 @@ class SampleSetupScript(BaseScriptElement): "tzero_guess", default=SampleSetupScript.tzero_guess) self.monitor1_specid = BaseScriptElement.getStringElement(instrument_dom, - "monitor1_specid", - default=SampleSetupScript.monitor1_specid) + "monitor1_specid", + default=SampleSetupScript.monitor1_specid) self.monitor2_specid = BaseScriptElement.getStringElement(instrument_dom, - "monitor2_specid", - default=SampleSetupScript.monitor2_specid) + "monitor2_specid", + default=SampleSetupScript.monitor2_specid) self.et_range_low = BaseScriptElement.getStringElement(instrument_dom, "et_range/low", default=SampleSetupScript.et_range_low) diff --git a/scripts/Interface/reduction_gui/widgets/sans/hfir_sample_data.py b/scripts/Interface/reduction_gui/widgets/sans/hfir_sample_data.py index 48a3a701cd715154db1f6d92e4eb9ad2a9f57173..78ca5d5efc96fea3ff3a4f1a1fa54c938a53ee61 100644 --- a/scripts/Interface/reduction_gui/widgets/sans/hfir_sample_data.py +++ b/scripts/Interface/reduction_gui/widgets/sans/hfir_sample_data.py @@ -438,7 +438,7 @@ class SampleDataWidget(BaseWidget): if dataproxy.sample_si_window_distance is not None: self._content.sample_si_window_dist_edit.setText(str(dataproxy.sample_si_window_distance)) util._check_and_get_float_line_edit(self._content.sample_si_window_dist_edit, min=0.0) - + if dataproxy.wavelength is not None: self._content.wavelength_edit.setText(str(dataproxy.wavelength)) util._check_and_get_float_line_edit(self._content.wavelength_edit, min=0.0) diff --git a/scripts/Powder_Diffraction_Reduction.py b/scripts/Powder_Diffraction_Reduction.py index 73ccc25e770f468180ed1c528dfeb8b5600fc91c..18cfdb72f1cb0cb72263a73ddf2e2d17d79c4005 100644 --- a/scripts/Powder_Diffraction_Reduction.py +++ b/scripts/Powder_Diffraction_Reduction.py @@ -20,7 +20,7 @@ if reducer.setup_layout(load_last=True): reducer.open_file(autopath) except IOError as e: print "[Error] Unable to load previously reduction setup from file %s.\nReason: %s." % ( - autopath, str(e)) + autopath, str(e)) else: print "[Info] Load earlier reduction setup from auto-saved %s." % (autopath) diff --git a/scripts/Reflectometry/isis_reflectometry/combineMulti.py b/scripts/Reflectometry/isis_reflectometry/combineMulti.py index b4eef6432240de543dfc18899893ff51adfc7f7e..cba4117e1f61231467bf7b3259f6e0b27a8e1826 100644 --- a/scripts/Reflectometry/isis_reflectometry/combineMulti.py +++ b/scripts/Reflectometry/isis_reflectometry/combineMulti.py @@ -37,8 +37,9 @@ def combineDataMulti(wksp_list, output_wksp, beg_overlap, end_overlap, Qmin, Qma for i in range(0, len(wksp_list) - 1): w1 = currentSum - w2 = getWorkspace(wksp_list[ - i + 1]) # TODO: distinguishing between a group and a individual workspace is unnecessary for an algorithm. But custom group behavior WILL be required. + w2 = getWorkspace(wksp_list[i + 1]) + # TODO: distinguishing between a group and a individual workspace is unnecessary for an algorithm. + # But custom group behavior WILL be required. if defaultoverlaps: overlapLow = w2.readX(0)[0] overlapHigh = 0.5 * max(w1.readX(0)) diff --git a/scripts/SANS/ISISCommandInterface.py b/scripts/SANS/ISISCommandInterface.py index a1779ea7aa2ff929e62e45f301f7157f0dfcedc8..266b7b4b87ff7aa1d606711cad320b946f3b54dc 100644 --- a/scripts/SANS/ISISCommandInterface.py +++ b/scripts/SANS/ISISCommandInterface.py @@ -1778,7 +1778,7 @@ def MatchIDFInReducerAndWorkspace(file_name): idf_path_reducer = get_current_idf_path_in_reducer() if ((idf_path_reducer == idf_path_workspace) and - su.are_two_files_identical(idf_path_reducer, idf_path_reducer)): + su.are_two_files_identical(idf_path_reducer, idf_path_reducer)): is_matched = True else: is_matched = False diff --git a/scripts/SANS/SANSUserFileParser.py b/scripts/SANS/SANSUserFileParser.py index d39c3312e223f1f7b1be59f16690abeb3c3194e9..ca297d419b30510c4a75191e3c400148bd706bb9 100644 --- a/scripts/SANS/SANSUserFileParser.py +++ b/scripts/SANS/SANSUserFileParser.py @@ -195,10 +195,10 @@ class BackCommandParser(object): # Now pass the arguments back in a defined format setting = DarkRunSettings(mon = self._mon, - run_number = self._run_number, - time = self._use_time, - mean = self._use_mean, - mon_number = self._mon_number) + run_number = self._run_number, + time = self._use_time, + mean = self._use_mean, + mon_number = self._mon_number) # Reset the parse results just in case we want to use it again self._reset_parse_results() diff --git a/scripts/SANS/SANSUtility.py b/scripts/SANS/SANSUtility.py index 5e5dbc214cbb308367b95b12b345b75226d1b758..c07bd18bdb26247eb488cc663e634f9618a00a63 100644 --- a/scripts/SANS/SANSUtility.py +++ b/scripts/SANS/SANSUtility.py @@ -974,7 +974,7 @@ def transfer_special_sample_logs(from_ws, to_ws): # Populate the time series for time_series_name in time_series_names: if (run_from.hasProperty(time_series_name) and - run_to.hasProperty(time_series_name)): + run_to.hasProperty(time_series_name)): times = run_from.getProperty(time_series_name).times values = run_from.getProperty(time_series_name).value @@ -990,7 +990,7 @@ def transfer_special_sample_logs(from_ws, to_ws): alg_log.setChild(True) for single_valued_name in single_valued_names: if (run_from.hasProperty(single_valued_name) and - run_to.hasProperty(single_valued_name)): + run_to.hasProperty(single_valued_name)): value = run_from.getProperty(single_valued_name).value alg_log.setProperty("Workspace", to_ws) alg_log.setProperty("LogName", single_valued_name) @@ -1034,7 +1034,7 @@ class CummulativeTimeSeriesPropertyAdder(object): # Get the cummulative time s for element in self._time_series: if (run_lhs.hasProperty(element) and - run_rhs.hasProperty(element)): + run_rhs.hasProperty(element)): # Get values for lhs property_lhs = run_lhs.getProperty(element) self._original_times_lhs[element] = property_lhs.times @@ -1047,7 +1047,7 @@ class CummulativeTimeSeriesPropertyAdder(object): for element in self._single_valued: if (run_lhs.hasProperty(element) and - run_rhs.hasProperty(element)): + run_rhs.hasProperty(element)): # Get the values for lhs property_lhs = run_lhs.getProperty(element) self._original_single_valued_lhs[element] = property_lhs.value @@ -1058,7 +1058,7 @@ class CummulativeTimeSeriesPropertyAdder(object): log_name_start_time = "start_time" if (run_lhs.hasProperty(log_name_start_time) and - run_rhs.hasProperty(log_name_start_time)): + run_rhs.hasProperty(log_name_start_time)): convert_to_date = lambda val: DateAndTime(val) if isinstance(val, str) else val self._start_time_lhs = convert_to_date(run_lhs.getProperty(log_name_start_time).value) self._start_time_rhs = convert_to_date(run_rhs.getProperty(log_name_start_time).value) @@ -1070,7 +1070,7 @@ class CummulativeTimeSeriesPropertyAdder(object): ''' for element in self._time_series: if (element in self._original_times_rhs and - element in self._original_values_rhs): + element in self._original_values_rhs): run = workspace.getRun() prop = run.getProperty(element) prop.clear() @@ -1526,7 +1526,7 @@ def correct_q_resolution_for_merged(count_ws_front, count_ws_rear, # We need to make sure that the workspaces match in length if ((len(q_resolution_front) != len(q_resolution_rear)) or - (len(counts_front) != len(counts_rear))): + (len(counts_front) != len(counts_rear))): return # Get everything for the FRONT detector diff --git a/scripts/SANS/centre_finder.py b/scripts/SANS/centre_finder.py index db86f5be5c480e821de4adb636a74f7908b855b4..a26455a09239e8751d269801b29c79e9a9005778 100644 --- a/scripts/SANS/centre_finder.py +++ b/scripts/SANS/centre_finder.py @@ -519,11 +519,11 @@ class PositionProviderFactory(object): coord1_scale_factor = reducer.get_beam_center_scale_factor1() return PositionProviderAngleY(increment_coord1 = increment_coord1_angle, - increment_coord2 = self.increment_coord2, - tolerance = self.tolerance, - tolerance_angle = tolerance_angle, - coord1_offset = coord1_offset, - coord1_scale_factor = coord1_scale_factor) + increment_coord2 = self.increment_coord2, + tolerance = self.tolerance, + tolerance_angle = tolerance_angle, + coord1_offset = coord1_offset, + coord1_scale_factor = coord1_scale_factor) else: return PositionProviderXY(increment_coord1 = self.increment_coord1, increment_coord2 = self.increment_coord2, diff --git a/tools/Documentation/wiki2rst.py b/tools/Documentation/wiki2rst.py index 5672f7d28594b234b33c6fa3fc9fa6e5053a3b6f..3f5251a617e35bef275f4188272fb96cf7f0a475 100755 --- a/tools/Documentation/wiki2rst.py +++ b/tools/Documentation/wiki2rst.py @@ -177,7 +177,7 @@ def fix_image_links(rst_text, wiki_markup, rel_img_dir): It returns the processed text + the names of the required images from the wiki """ mw_img_re = re.compile(r'\[\[(Image|File):(.+?)(\|.*?)?(\|.*?)?(\|.*?)?(\|.*?)?(\|.*?)?(\|.*?)?\]\]', - re.IGNORECASE) + re.IGNORECASE) rst_img_re = re.compile(r'figure:: (([\w\-\_\\\/]+)\.(\w{2,5}))(.{0,50}\3){2}', re.DOTALL) rst_sub_re = re.compile(r'(figure|image):: (([\w\-\_\\\/]+)\.(\w{2,5}))') diff --git a/tools/reports/facility-code-changes.py b/tools/reports/facility-code-changes.py index 99ab50198bdea6b6a6f08fd86cd6df17f26ad2ed..ff81ad0bcb2e7fbdc2bb9b2a22e6f32fa26f0638 100644 --- a/tools/reports/facility-code-changes.py +++ b/tools/reports/facility-code-changes.py @@ -131,7 +131,7 @@ if __name__ == '__main__': 'tom.g.r.brooks@gmail.com': 'STFC', 'ross.whitfield@gmail.com': 'ORNL', 'MikeHart85@users.noreply.github.com': 'STFC' - } + } days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]