diff --git a/docs/source/algorithms/TOFTOFCropWorkspace-v1.rst b/docs/source/algorithms/TOFTOFCropWorkspace-v1.rst index c9aac22852b5be7dc22df0e66ac5bb04be2d75b2..c6a6dfcec8d1553170b1e229ca09bbfc00ca64a6 100644 --- a/docs/source/algorithms/TOFTOFCropWorkspace-v1.rst +++ b/docs/source/algorithms/TOFTOFCropWorkspace-v1.rst @@ -35,24 +35,24 @@ Usage # Load data ws=Load(Filename='TOFTOFTestdata.nxs') - print "Input workspace" - print "Total number of time channels: ", len(ws.readX(0)) - print "Number of filled time channels: ", ws.getRun().getLogData('full_channels').value + print("Input workspace") + print("Total number of time channels: {}".format(len(ws.readX(0)))) + print ("Number of filled time channels: {}".format(ws.getRun().getLogData('full_channels').value)) wscropped = TOFTOFCropWorkspace(ws) - print "Output workspace" - print "Total number of time channels: ", len(wscropped.readX(0)) + print("Output workspace") + print("Total number of time channels: {}".format(len(wscropped.readX(0)))) Output: .. testoutput:: ExTOFTOFCropWorkspace Input workspace - Total number of time channels: 1025 - Number of filled time channels: 1020.0 + Total number of time channels: 1025 + Number of filled time channels: 1020.0 Output workspace - Total number of time channels: 1020 + Total number of time channels: 1020 .. categories:: diff --git a/docs/source/algorithms/TOFTOFMergeRuns-v1.rst b/docs/source/algorithms/TOFTOFMergeRuns-v1.rst index f129e9ba5cc83599b4d5e6241ae41c75b9d0ed35..a82cb525d6bf8e42ccd6a77e8669690a95dc5a66 100644 --- a/docs/source/algorithms/TOFTOFMergeRuns-v1.rst +++ b/docs/source/algorithms/TOFTOFMergeRuns-v1.rst @@ -64,58 +64,58 @@ Usage ws3 = TOFTOFMergeRuns('ws1,ws2') # Temperature - print "Temperature of experiment for 1st workspace (in K): ", ws1.getRun().getLogData('temperature').value - print "Temperature of experiment for 2nd workspace (in K): ", ws2.getRun().getLogData('temperature').value - print "Temperature of experiment for merged workspaces = average over workspaces (in K): ", ws3.getRun().getLogData('temperature').value + print("Temperature of experiment for 1st workspace (in K): {}".format(ws1.getRun().getLogData('temperature').value)) + print("Temperature of experiment for 2nd workspace (in K): {}".format(ws2.getRun().getLogData('temperature').value)) + print("Temperature of experiment for merged workspaces = average over workspaces (in K): {}".format( ws3.getRun().getLogData('temperature').value)) # Duration - print "Duration of experiment for 1st workspace (in s): ", ws1.getRun().getLogData('duration').value - print "Duration of experiment for 2nd workspace (in s): ", ws2.getRun().getLogData('duration').value - print "Duration of experiment for merged workspaces = sum of all durations (in s): ", ws3.getRun().getLogData('duration').value + print("Duration of experiment for 1st workspace (in s): {}".format(ws1.getRun().getLogData('duration').value)) + print("Duration of experiment for 2nd workspace (in s): {}".format(ws2.getRun().getLogData('duration').value)) + print("Duration of experiment for merged workspaces = sum of all durations (in s): {}".format(ws3.getRun().getLogData('duration').value)) # Run start - print "Start of experiment for 1st workspace: ", ws1.getRun().getLogData('run_start').value - print "Start of experiment for 2nd workspace: ", ws2.getRun().getLogData('run_start').value - print "Start of experiment for merged workspaces = miminum of all workspaces: ", ws3.getRun().getLogData('run_start').value + print("Start of experiment for 1st workspace: {}".format(ws1.getRun().getLogData('run_start').value)) + print("Start of experiment for 2nd workspace: {}".format(ws2.getRun().getLogData('run_start').value)) + print("Start of experiment for merged workspaces = miminum of all workspaces: {}".format(ws3.getRun().getLogData('run_start').value)) # Run end - print "End of experiment for 1st workspace: ", ws1.getRun().getLogData('run_end').value - print "End of experiment for 2nd workspace: ", ws2.getRun().getLogData('run_end').value - print "End of experiment for merged workspaces = maximum of all workspaces: ", ws3.getRun().getLogData('run_end').value + print("End of experiment for 1st workspace: {}".format(ws1.getRun().getLogData('run_end').value)) + print("End of experiment for 2nd workspace: {}".format(ws2.getRun().getLogData('run_end').value)) + print("End of experiment for merged workspaces = maximum of all workspaces: {}".format(ws3.getRun().getLogData('run_end').value)) # Run number - print "Run number for 1st workspace: ", ws1.getRun().getLogData('run_number').value - print "Run number for 2nd workspace: ", ws2.getRun().getLogData('run_number').value - print "Run number for merged workspaces = list of all workspaces: ", ws3.getRun().getLogData('run_number').value + print("Run number for 1st workspace: {}".format(ws1.getRun().getLogData('run_number').value)) + print("Run number for 2nd workspace: {}".format(ws2.getRun().getLogData('run_number').value)) + print("Run number for merged workspaces = list of all workspaces: {}".format(ws3.getRun().getLogData('run_number').value)) # Monitor counts - print "Monitor counts for 1st workspace: ", ws1.getRun().getLogData('monitor_counts').value - print "Monitor counts for 2nd workspace: ", ws2.getRun().getLogData('monitor_counts').value - print "Monitor counts for merged workspaces = sum over all workspaces: ", ws3.getRun().getLogData('monitor_counts').value + print("Monitor counts for 1st workspace: {}".format(ws1.getRun().getLogData('monitor_counts').value)) + print("Monitor counts for 2nd workspace: {}".format(ws2.getRun().getLogData('monitor_counts').value)) + print("Monitor counts for merged workspaces = sum over all workspaces: {}".format(ws3.getRun().getLogData('monitor_counts').value)) Output: .. testoutput:: ExTOFTOFMergeRuns2ws - Temperature of experiment for 1st workspace (in K): 294.14 - Temperature of experiment for 2nd workspace (in K): 296.16 - Temperature of experiment for merged workspaces = average over workspaces (in K): 295.15 - Duration of experiment for 1st workspace (in s): 3601 - Duration of experiment for 2nd workspace (in s): 3601 - Duration of experiment for merged workspaces = sum of all durations (in s): 7202 - Start of experiment for 1st workspace: 2013-07-28T10:32:19+0053 - Start of experiment for 2nd workspace: 2013-07-28T11:32:19+0053 - Start of experiment for merged workspaces = miminum of all workspaces: 2013-07-28T10:32:19+0053 - End of experiment for 1st workspace: 2013-07-28T11:32:20+0053 - End of experiment for 2nd workspace: 2013-07-28T12:32:19+0053 - End of experiment for merged workspaces = maximum of all workspaces: 2013-07-28T12:32:19+0053 - Run number for 1st workspace: TOFTOFTestdata - Run number for 2nd workspace: TOFTOFTestdata2 - Run number for merged workspaces = list of all workspaces: ['TOFTOFTestdata', 'TOFTOFTestdata2'] - Monitor counts for 1st workspace: 136935 - Monitor counts for 2nd workspace: 145145 - Monitor counts for merged workspaces = sum over all workspaces: 282080 + Temperature of experiment for 1st workspace (in K): 294.14 + Temperature of experiment for 2nd workspace (in K): 296.16 + Temperature of experiment for merged workspaces = average over workspaces (in K): 295.15 + Duration of experiment for 1st workspace (in s): 3601 + Duration of experiment for 2nd workspace (in s): 3601 + Duration of experiment for merged workspaces = sum of all durations (in s): 7202 + Start of experiment for 1st workspace: 2013-07-28T10:32:19+0053 + Start of experiment for 2nd workspace: 2013-07-28T11:32:19+0053 + Start of experiment for merged workspaces = miminum of all workspaces: 2013-07-28T10:32:19+0053 + End of experiment for 1st workspace: 2013-07-28T11:32:20+0053 + End of experiment for 2nd workspace: 2013-07-28T12:32:19+0053 + End of experiment for merged workspaces = maximum of all workspaces: 2013-07-28T12:32:19+0053 + Run number for 1st workspace: TOFTOFTestdata + Run number for 2nd workspace: TOFTOFTestdata2 + Run number for merged workspaces = list of all workspaces: ['TOFTOFTestdata', 'TOFTOFTestdata2'] + Monitor counts for 1st workspace: 136935 + Monitor counts for 2nd workspace: 145145 + Monitor counts for merged workspaces = sum over all workspaces: 282080 **Example - Merge group of workspaces** @@ -132,17 +132,17 @@ Output: group=GroupWorkspaces('ws1,ws2') groupmerged=TOFTOFMergeRuns(group) - print "Monitor counts for 1st workspace: ", ws1.getRun().getLogData('monitor_counts').value - print "Monitor counts for 2nd workspace: ", ws2.getRun().getLogData('monitor_counts').value - print "Monitor counts for merged workspaces = sum over all workspaces: ", groupmerged.getRun().getLogData('monitor_counts').value + print("Monitor counts for 1st workspace: {}".format(ws1.getRun().getLogData('monitor_counts').value)) + print("Monitor counts for 2nd workspace: {}".format(ws2.getRun().getLogData('monitor_counts').value)) + print("Monitor counts for merged workspaces = sum over all workspaces: {}".format(groupmerged.getRun().getLogData('monitor_counts').value)) Output: .. testoutput:: ExTOFTOFMergeRunsGroup - Monitor counts for 1st workspace: 136935 - Monitor counts for 2nd workspace: 145145 - Monitor counts for merged workspaces = sum over all workspaces: 282080 + Monitor counts for 1st workspace: 136935 + Monitor counts for 2nd workspace: 145145 + Monitor counts for merged workspaces = sum over all workspaces: 282080 .. categories:: diff --git a/docs/source/algorithms/TOSCABankCorrection-v1.rst b/docs/source/algorithms/TOSCABankCorrection-v1.rst index 21a1da9a677f5faa15638beb7bb632d46cc22292..04ad8048292a66adf40c14b1016fe2bc9f54597a 100644 --- a/docs/source/algorithms/TOSCABankCorrection-v1.rst +++ b/docs/source/algorithms/TOSCABankCorrection-v1.rst @@ -71,7 +71,7 @@ Usage corrected_reduction, peak_position, scale_factor_1, scale_factor_2 = \ TOSCABankCorrection(InputWorkspace=original_reduction) - print 'Target peak centre: %.f' % peak_position + print('Target peak centre: %.f' % peak_position) Output: @@ -89,7 +89,7 @@ Output: TOSCABankCorrection(InputWorkspace=original_reduction, PeakPosition='715') - print 'Target peak centre: %.f' % peak_position + print( )'Target peak centre: %.f' % peak_position) Output: diff --git a/docs/source/algorithms/TransformHKL-v1.rst b/docs/source/algorithms/TransformHKL-v1.rst index 04b403ae80eab55e5af363f1a7347e1a26088e4b..8777193cd86f0c4277d25b68d48db0e20ef292bb 100644 --- a/docs/source/algorithms/TransformHKL-v1.rst +++ b/docs/source/algorithms/TransformHKL-v1.rst @@ -30,13 +30,13 @@ Usage ws=LoadIsawPeaks("TOPAZ_3007.peaks") FindUBUsingFFT(ws,MinD=8.0,MaxD=13.0) - print "Before Transformation:" - print ws.sample().getOrientedLattice().getUB() + print("Before Transformation:") + print(ws.sample().getOrientedLattice().getUB()) #This HKLTransform is a matrix that will swap H and K and negate L TransformHKL(ws,HKLTransform="0,1,0,1,0,0,0,0,-1") - print "\nAfter Transformation:" - print ws.sample().getOrientedLattice().getUB() + print("\nAfter Transformation:") + print(ws.sample().getOrientedLattice().getUB()) Output: diff --git a/docs/source/algorithms/TransformToIqt-v1.rst b/docs/source/algorithms/TransformToIqt-v1.rst index 3e97d8178b7a0e61a3fa45b6ea8146095c7fcb97..65aa3e41c86194f75c46dfdb4604885438194705 100644 --- a/docs/source/algorithms/TransformToIqt-v1.rst +++ b/docs/source/algorithms/TransformToIqt-v1.rst @@ -104,8 +104,8 @@ Usage EnergyMax=0.5, BinReductionFactor=10) - print 'Number of output bins: %d' % (params.cell('SampleOutputBins', 0)) - print 'Resolution bins: %d' % (params.cell('ResolutionBins', 0)) + print('Number of output bins: %d' % (params.cell('SampleOutputBins', 0))) + print('Resolution bins: %d' % (params.cell('ResolutionBins', 0))) Output: diff --git a/docs/source/algorithms/Transpose-v1.rst b/docs/source/algorithms/Transpose-v1.rst index 76e7264c9fe13dcce77b8bdea178ab1f2313ea43..0f1b630b43aabf2003e227a0a3dd40c331514c1c 100644 --- a/docs/source/algorithms/Transpose-v1.rst +++ b/docs/source/algorithms/Transpose-v1.rst @@ -33,16 +33,16 @@ Usage # Create a workspace with 2 banks and 4 pixels per bank (8 spectra) # and X axis with 100 bins ws = CreateSampleWorkspace(BankPixelWidth=2) - print "Rank before = (", ws.getNumberHistograms(), ",", ws.blocksize(), ")" + print("Rank before = ( {0}, {1} )".format(ws.getNumberHistograms(),ws.blocksize())) ws = Transpose(ws) - print "Rank after = (", ws.getNumberHistograms(), ",", ws.blocksize(), ")" + print("Rank after = ( {0}, {1} )".format(ws.getNumberHistograms(),ws.blocksize())) Output: .. testoutput:: Ex - Rank before = ( 8 , 100 ) - Rank after = ( 100 , 8 ) + Rank before = ( 8, 100 ) + Rank after = ( 100, 8 ) .. categories:: diff --git a/docs/source/algorithms/TransposeMD-v1.rst b/docs/source/algorithms/TransposeMD-v1.rst index 479c69a0515e635cf711c48fa7d90a05578506b1..3d2715ce1eee33da28cc1dee78cc50792ddfb75c 100644 --- a/docs/source/algorithms/TransposeMD-v1.rst +++ b/docs/source/algorithms/TransposeMD-v1.rst @@ -21,16 +21,16 @@ Usage def print_dims(ws): for i in range(ws.getNumDims()): - print 'Dimension %i is %s' % (i, ws.getDimension(i).name) + print('Dimension %i is %s' % (i, ws.getDimension(i).name)) mdws = CreateMDWorkspace(Dimensions=3, Extents='-10,10,-10,10,-10,10', Names='A,B,C', Units='U,U,U') FakeMDEventData(InputWorkspace=mdws, PeakParams='500000,0,0,0,3') binned = BinMD(InputWorkspace=mdws, AlignedDim0='A,0,10,100', AlignedDim1='B,-10,10,100', AlignedDim2='C,-10,10,1') - print 'Dimensions before', binned.getNumDims() + print('Dimensions before {}'.format(binned.getNumDims())) print_dims(binned) # Transpose the workspace transposed = TransposeMD(binned, Axes=[1,0]) - print 'Dimensions after', transposed.getNumDims() + print('Dimensions after {}'.format(transposed.getNumDims())) print_dims(transposed) Output: diff --git a/docs/source/algorithms/UnwrapMonitor-v1.rst b/docs/source/algorithms/UnwrapMonitor-v1.rst index b197d2b9de730e567ea25006d6bf5e4e682428bc..975f40952458004f623e0abb27bdc4354a4a80d1 100644 --- a/docs/source/algorithms/UnwrapMonitor-v1.rst +++ b/docs/source/algorithms/UnwrapMonitor-v1.rst @@ -100,7 +100,7 @@ Usage # To access individual outputs use result[i] where i is the index of the required output. result = UnwrapMonitor(InputWorkspace=ws,LRef=11) - print "JoinWaveLength is: " + str(result[1]) + print("JoinWaveLength is: " + str(result[1])) Output: diff --git a/docs/source/algorithms/UnwrapSNS-v1.rst b/docs/source/algorithms/UnwrapSNS-v1.rst index 7331b37c348018d3b5d04c5c440b50813aec8b0b..2ebcc6c4e9548e1af53e0d947f3166ec0799be18 100644 --- a/docs/source/algorithms/UnwrapSNS-v1.rst +++ b/docs/source/algorithms/UnwrapSNS-v1.rst @@ -54,8 +54,8 @@ Usage ws = CreateSampleWorkspace("Event",NumBanks=1,BankPixelWidth=1) wsOut = UnwrapSNS(ws,LRef=10) - print "Input", ws.readY(0)[ws.blocksize()-1] - print "Output", wsOut.readY(0)[wsOut.blocksize()-1] + print("Input {}".format(ws.readY(0)[ws.blocksize()-1])) + print("Output {}".format(wsOut.readY(0)[wsOut.blocksize()-1])) Output: diff --git a/docs/source/algorithms/UpdateInstrumentFromFile-v1.rst b/docs/source/algorithms/UpdateInstrumentFromFile-v1.rst index aaf7babcb7dffa71df890d261ca68dc16af96942..32d2db412416b71e9f2369202cfd066e7c51132d 100644 --- a/docs/source/algorithms/UpdateInstrumentFromFile-v1.rst +++ b/docs/source/algorithms/UpdateInstrumentFromFile-v1.rst @@ -82,7 +82,7 @@ Usage ''' print first 10 detectors from given instrument ''' # get first 10 detectors using detector ID - print "{0} {1} instrument".format(instr_type, instr.getName()) + print("{0} {1} instrument".format(instr_type, instr.getName())) for i in xrange(0,10): if i<3: detBase = 1 @@ -91,8 +91,8 @@ Usage detID = detBase+i det1 = instr.getDetector(detID); pos = det1.getPos(); - print 'det with ID: {0:5} is monitor? {1:5}, polar angle: {2:10.3f}, position: | {3:<10.3f} | {4:<10.3f} | {5:<10.3f}|\n'.format(\ - detID,det1.isMonitor(),(det1.getPhi()*(180/math.pi)),pos.X(),pos.Y(),pos.Z()), + print('det with ID: {0:5} is monitor? {1:5}, polar angle: {2:10.3f}, position: | {3:<10.3f} | {4:<10.3f} | {5:<10.3f}|'.format(\ + detID,det1.isMonitor(),(det1.getPhi()*(180/math.pi)),pos.X(),pos.Y(),pos.Z())) print '*********************************************************************************' #-------------------------------------------------------------------------------------- diff --git a/docs/source/algorithms/UpdatePeakParameterTableValue-v1.rst b/docs/source/algorithms/UpdatePeakParameterTableValue-v1.rst index 4628e8697d3c456900937dfb3bc82f0650fa3412..ac2bcafff2dedc7c70b00951b83400417d8c4e50 100644 --- a/docs/source/algorithms/UpdatePeakParameterTableValue-v1.rst +++ b/docs/source/algorithms/UpdatePeakParameterTableValue-v1.rst @@ -64,11 +64,11 @@ Usage tablews.addRow(["A", 1.34]) tablews.addRow(["B", 2.34]) - print "Value before %.2f" % tablews.cell(0, 1) + print("Value before %.2f" % tablews.cell(0, 1)) UpdatePeakParameterTableValue(tablews, Column="Value", ParameterNames=["A"], NewFloatValue=1.00) - print "Value after %.2f" % tablews.cell(0, 1) + print("Value after %.2f" % tablews.cell(0, 1)) Output: diff --git a/docs/source/algorithms/VesuvioCalculateGammaBackground-v1.rst b/docs/source/algorithms/VesuvioCalculateGammaBackground-v1.rst index a011c099c97fc7d004415c9954584b44714684ad..1f627b96cbc28d9ee874707435dcedbd1ae621b7 100644 --- a/docs/source/algorithms/VesuvioCalculateGammaBackground-v1.rst +++ b/docs/source/algorithms/VesuvioCalculateGammaBackground-v1.rst @@ -57,9 +57,9 @@ Usage corrected, background = VesuvioCalculateGammaBackground(tof_ws, ComptonFunction=mass_function, WorkspaceIndexList=0) - print "First 5 values of input:", tof_ws.readY(0)[0:4] - print "First 5 values of background:", background.readY(0)[0:4] - print "First 5 values of corrected:", corrected.readY(0)[0:4] + print("First 5 values of input: {}".format(tof_ws.readY(0)[0:4])) + print("First 5 values of background: {}".format(background.readY(0)[0:4])) + print("First 5 values of corrected: {}".format(corrected.readY(0)[0:4])) Output: @@ -89,8 +89,8 @@ Output: mass_function = "name=GaussianComptonProfile,Mass=1.0079,Width=0.4,Intensity=1.1" corrected, background = VesuvioCalculateGammaBackground(tof_ws, ComptonFunction=mass_function) - print "Number of background spectra:", background.getNumberHistograms() - print "Number of corrected spectra:", corrected.getNumberHistograms() + print("Number of background spectra: {}".format(background.getNumberHistograms())) + print("Number of corrected spectra: {}".format(corrected.getNumberHistograms())) Output: diff --git a/docs/source/algorithms/VesuvioDiffractionReduction-v1.rst b/docs/source/algorithms/VesuvioDiffractionReduction-v1.rst index b6ee15aa0185a53934fa5ff0704ad4c00f895968..7e040f332f19c5298052d73e831fc00546dd9c4c 100644 --- a/docs/source/algorithms/VesuvioDiffractionReduction-v1.rst +++ b/docs/source/algorithms/VesuvioDiffractionReduction-v1.rst @@ -38,9 +38,9 @@ Usage ws = mtd['DiffractionReductions'].getItem(0) - print 'Workspace name: %s' % ws.name() - print 'Number of spectra: %d' % ws.getNumberHistograms() - print 'Number of bins: %s' % ws.blocksize() + print('Workspace name: %s' % ws.name()) + print('Number of spectra: %d' % ws.getNumberHistograms()) + print('Number of bins: %s' % ws.blocksize()) Output: diff --git a/docs/source/algorithms/VesuvioL1ThetaResolution-v1.rst b/docs/source/algorithms/VesuvioL1ThetaResolution-v1.rst index 7515964d0829ea72b58ffbf7577a1d7314858278..c27d0c3dc6dd974bee56930d111dbe3fe3d8aaa8 100644 --- a/docs/source/algorithms/VesuvioL1ThetaResolution-v1.rst +++ b/docs/source/algorithms/VesuvioL1ThetaResolution-v1.rst @@ -27,10 +27,10 @@ Usage resolution, l1_dist, theta_dist = VesuvioL1ThetaResolution(NumEvents=1000) resolution_spec_names = resolution.getAxis(1).extractValues() - print "Resolution spectra: %s" % (', '.join(resolution_spec_names)) + print("Resolution spectra: %s" % (', '.join(resolution_spec_names))) - print "L1 distribution spectra count: %d" % (l1_dist.getNumberHistograms()) - print "Theta distribution spectra count: %d" % (theta_dist.getNumberHistograms()) + print("L1 distribution spectra count: %d" % (l1_dist.getNumberHistograms())) + print("Theta distribution spectra count: %d" % (theta_dist.getNumberHistograms())) Output: diff --git a/docs/source/algorithms/VesuvioResolution-v1.rst b/docs/source/algorithms/VesuvioResolution-v1.rst index f1bb8bbc00a94652d31cf93e09ec2971191b8401..96a8742dedabc6cc24e4514fcead1b1b8cce46a4 100644 --- a/docs/source/algorithms/VesuvioResolution-v1.rst +++ b/docs/source/algorithms/VesuvioResolution-v1.rst @@ -34,7 +34,7 @@ Usage tof, ysp = VesuvioResolution(Workspace=tof_ws, Mass=1.0079) - print 'Resolution in %s and %s.' % (tof.getAxis(0).getUnit().symbol(), ysp.getAxis(0).getUnit().symbol()) + print('Resolution in %s and %s.' % (tof.getAxis(0).getUnit().symbol(), ysp.getAxis(0).getUnit().symbol())) Output: diff --git a/docs/source/algorithms/VesuvioThickness-v1.rst b/docs/source/algorithms/VesuvioThickness-v1.rst index 16b324c623a25b5afc1305e0b5197458c56ffcdc..9933d3fe52a4a0b0fa7919ddc60a6511d7012ca5 100644 --- a/docs/source/algorithms/VesuvioThickness-v1.rst +++ b/docs/source/algorithms/VesuvioThickness-v1.rst @@ -30,8 +30,8 @@ Usage dens_tbl, trans_tbl = VesuvioThickness(masses, amplitudes, trans_guess, thickness, number_density) # Test output - print "The final density is: %.4f" % dens_tbl.cell(9,1) - print "The final transmission is: %.4f" % trans_tbl.cell(9,1) + print("The final density is: %.4f" % dens_tbl.cell(9,1)) + print("The final transmission is: %.4f" % trans_tbl.cell(9,1)) Output: diff --git a/docs/source/algorithms/ViewBOA-v1.rst b/docs/source/algorithms/ViewBOA-v1.rst index b5f5f02969cb25ffee068e48f8a144af3aee78f3..5ff2f80045b9e19b5c9199a13d6afe0504cf1dde 100644 --- a/docs/source/algorithms/ViewBOA-v1.rst +++ b/docs/source/algorithms/ViewBOA-v1.rst @@ -41,9 +41,9 @@ The following code loads a BOA file and prints out information about the wavelen lamdba_distribution = mtd['histogram61'].readY(0) lambda_values = mtd['histogram61'].readX(0) - print "The wavelength spectrum is described by", len(lamdba_distribution),"points." - print "The range covered is", round(lambda_values[0], 4), "-", round(lambda_values[-1], 4), "Angstrom." - print "The maximum is located at", round(lambda_values[np.argmax(lamdba_distribution)], 4), "Angstrom." + print("The wavelength spectrum is described by {}".format(len(lamdba_distribution),"points.")) + print("The range covered is {0} - {1} Angstrom.".format(round(lambda_values[0], 4),round(lambda_values[-1], 4))) + print("The maximum is located at {} Angstrom.".format(round(lambda_values[np.argmax(lamdba_distribution)], 4))) This script leads to the following output: diff --git a/docs/source/algorithms/WeightedMean-v1.rst b/docs/source/algorithms/WeightedMean-v1.rst index c23f8b132457ae3f287836fab845f25635920b2c..c442760088bbcc79487f6b5aac6f846b6dbda992 100644 --- a/docs/source/algorithms/WeightedMean-v1.rst +++ b/docs/source/algorithms/WeightedMean-v1.rst @@ -33,9 +33,9 @@ Usage # perform the algorithm ws = WeightedMean(ws1, ws2) - print "The X values are: " + str(ws.readX(0)) - print "The Y values are: " + str(ws.readY(0)) - print "The E values are: " + str(ws.readE(0)) + print("The X values are: " + str(ws.readX(0))) + print("The Y values are: " + str(ws.readY(0))) + print("The E values are: " + str(ws.readE(0))) Output: diff --git a/docs/source/algorithms/WeightedMeanOfWorkspace-v1.rst b/docs/source/algorithms/WeightedMeanOfWorkspace-v1.rst index 8c512b7c946d6209ed404878ad9832716fb092d7..637b0379f9d50d8bd4d04b93e02c18360c76ea3b 100644 --- a/docs/source/algorithms/WeightedMeanOfWorkspace-v1.rst +++ b/docs/source/algorithms/WeightedMeanOfWorkspace-v1.rst @@ -30,8 +30,8 @@ Usage dataE = range(1,12) ws = CreateWorkspace(dataX, dataY, dataE) ws1 = WeightedMeanOfWorkspace(ws) - print "Weighted Mean of Workspace:", str(ws1.readY(0)) - print "Weighted Mean Error of Workspace:", str(ws1.readE(0)) + print("Weighted Mean of Workspace: {}".format(str(ws1.readY(0)))) + print("Weighted Mean Error of Workspace: {}".format(str(ws1.readE(0)))) Output: