diff --git a/docs/source/algorithms/SavePDFGui-v1.rst b/docs/source/algorithms/SavePDFGui-v1.rst index 6bdb8bc8ae173857f61053e9a823726c56ce5ca5..1b964b46487f3c36a715f61bcb99ea421ad64142 100644 --- a/docs/source/algorithms/SavePDFGui-v1.rst +++ b/docs/source/algorithms/SavePDFGui-v1.rst @@ -35,7 +35,7 @@ Usage SavePDFGui(ws, path) # Check that the file exists - print os.path.isfile(path) + print(os.path.isfile(path)) Output: diff --git a/docs/source/algorithms/SavePHX-v1.rst b/docs/source/algorithms/SavePHX-v1.rst index abf97197231823f782587e0c9e7222411a56581c..49ff0e73bb50dc739b1bebdef2662441fcd1b8df 100644 --- a/docs/source/algorithms/SavePHX-v1.rst +++ b/docs/source/algorithms/SavePHX-v1.rst @@ -56,13 +56,13 @@ Usage # import os funcions to work with folders import os # create sample workspace - ws=CreateSampleWorkspace(); + ws=CreateSampleWorkspace() # test file name file_name = os.path.join(config["defaultsave.directory"], "TestSavePhx.phx") # save the file SavePHX(ws,Filename=file_name); - print "target file exists? {0}".format(os.path.exists(file_name)); + print("target file exists? {0}".format(os.path.exists(file_name))) .. testcleanup:: exSavePHX diff --git a/docs/source/algorithms/SaveParameterFile-v1.rst b/docs/source/algorithms/SaveParameterFile-v1.rst index 2407ebd1526409ab7cc074faba58d70e55605b2d..3903cf34bd7a16d0ba5cf6deda24c5a531b89320 100644 --- a/docs/source/algorithms/SaveParameterFile-v1.rst +++ b/docs/source/algorithms/SaveParameterFile-v1.rst @@ -37,7 +37,7 @@ Usage #Make sure the file was written successfully if os.path.isfile(filename): - print "Parameters written successfully." + print("Parameters written successfully.") .. testcleanup:: diff --git a/docs/source/algorithms/SavePlot1D-v1.rst b/docs/source/algorithms/SavePlot1D-v1.rst index 1803d9a912e8c32020019999916f8d020eef095a..b5f9ad78c892a5caeb320cdd1fab6f4f90f99009 100644 --- a/docs/source/algorithms/SavePlot1D-v1.rst +++ b/docs/source/algorithms/SavePlot1D-v1.rst @@ -72,7 +72,7 @@ Usage in autoreduction div = SavePlot1D(InputWorkspace='w1', OutputType='plotly') from postprocessing.publish_plot import publish_plot request = publish_plot('TESTINSTRUMENT', 12345, files={'file':div}) - print "post returned %d" % request.status_code + print("post returned {}".format(request.status_code)) To see what the result looks like on your local system, add the ``Filename`` argument (``.html`` extension) and change to diff --git a/docs/source/algorithms/SaveRKH-v1.rst b/docs/source/algorithms/SaveRKH-v1.rst index ae8363f1c55e514eb7fdfb16b24722c82d2dbc63..30cb6726492170822fa491b4b5cd1885b91ebbf9 100644 --- a/docs/source/algorithms/SaveRKH-v1.rst +++ b/docs/source/algorithms/SaveRKH-v1.rst @@ -38,7 +38,7 @@ Usage SaveRKH(out_ws, file_path) in_ws = LoadRKH(file_path) - print "Contents of the file = " + str(in_ws.readY(0)) + print("Contents of the file = " + str(in_ws.readY(0))) .. testcleanup:: ExSimpleSavingRoundtrip diff --git a/docs/source/algorithms/SaveSPE-v1.rst b/docs/source/algorithms/SaveSPE-v1.rst index 7c3f253c58c7e6aaf0b81420019af492503f416f..7cd4c44a9a0ae37a9a82ceef75f42e37b5d65722 100644 --- a/docs/source/algorithms/SaveSPE-v1.rst +++ b/docs/source/algorithms/SaveSPE-v1.rst @@ -104,7 +104,7 @@ Usage # perform the algorithm SaveSPE(InputWorkspace=ws1,Filename=savefile) - print "File Exists:", os.path.exists(savefile) + print("File Exists: {}".format(os.path.exists(savefile))) .. testcleanup:: ExSPESimple diff --git a/docs/source/algorithms/SaveTBL-v1.rst b/docs/source/algorithms/SaveTBL-v1.rst index 1bdff632f67cdef310196f6de4ce37e6a24c3c8d..f17c7d9eb7038df9ca541be9c15b0955ea8f9174 100644 --- a/docs/source/algorithms/SaveTBL-v1.rst +++ b/docs/source/algorithms/SaveTBL-v1.rst @@ -80,7 +80,7 @@ Usage # 13470,2.3,13463+13464,0.035,0.3,0.04,,0, # 13462,2.3,13463+13464,0.035,0.3,0.04,,1,ProcessingInstruction="1:2" # 13469,0.7,13463+13464,0.01,0.06,0.04,,1, - print "File Exists:", os.path.exists(savefile) + print("File Exists: {}".format(os.path.exists(savefile))) .. testcleanup:: ExTBLSimple diff --git a/docs/source/algorithms/SaveVulcanGSS-v1.rst b/docs/source/algorithms/SaveVulcanGSS-v1.rst index d526994de1b97531e5977b993ed418f1eed82bfa..15d8543cac271c8a34a427ccd555e6e76149940a 100644 --- a/docs/source/algorithms/SaveVulcanGSS-v1.rst +++ b/docs/source/algorithms/SaveVulcanGSS-v1.rst @@ -38,10 +38,10 @@ Usage lines = gfile.readlines() gfile.close() - print "[GSAS File Start]" - for i in xrange(11): - print lines[i].rstrip() - print "... ..." + print("[GSAS File Start]") + for i in range(11): + print(lines[i].rstrip()) + print("... ...") .. testcleanup:: ExSaveVulcanGSAS diff --git a/docs/source/algorithms/SaveYDA-v1.rst b/docs/source/algorithms/SaveYDA-v1.rst index 2fc34c37a903935cd63152a1f2280d549b320708..08b4eaf9f34517aeab9cb7bb68f5687cda265024 100644 --- a/docs/source/algorithms/SaveYDA-v1.rst +++ b/docs/source/algorithms/SaveYDA-v1.rst @@ -29,6 +29,7 @@ Usage import os import numpy as np + from sys import stdout # create x and y data dataX = np.arange(12).reshape(3, 4) @@ -53,10 +54,9 @@ Usage # save file SaveYDA(ws, filename) - with open(filename,'r') as f: for i in range(12): - print f.readline(), + stdout.write(f.readline()) **Output:** @@ -82,4 +82,4 @@ Usage .. categories:: -.. sourcelink:: \ No newline at end of file +.. sourcelink:: diff --git a/docs/source/algorithms/SaveZODS-v1.rst b/docs/source/algorithms/SaveZODS-v1.rst index a25d17ca16f1667cbc0f5683bce57a85ec7c2e15..a8eae4a0181688ad77f8c175e4617be41fed8388 100644 --- a/docs/source/algorithms/SaveZODS-v1.rst +++ b/docs/source/algorithms/SaveZODS-v1.rst @@ -87,7 +87,7 @@ using :ref:`CreateMDWorkspace <algm-CreateMDWorkspace>`. import os savefile = os.path.join(config["defaultsave.directory"], "ZODS.h5") SaveZODS(InputWorkspace=ws, FileName=savefile) - print "File created:", os.path.exists(savefile) + print("File created: {}".format(os.path.exists(savefile))) Output: diff --git a/docs/source/algorithms/Scale-v1.rst b/docs/source/algorithms/Scale-v1.rst index 3506b2d6e8c8bb68feda54f03e0a797caf5bbb0e..2e9d12029745e2979a56e4d32b7b949f14f2ea59 100644 --- a/docs/source/algorithms/Scale-v1.rst +++ b/docs/source/algorithms/Scale-v1.rst @@ -23,18 +23,18 @@ Usage .. testcode:: ExOffsetScale ws = CreateSampleWorkspace(BankPixelWidth=1) - print "Every 10th bin value of " + ws.name() - print ws.readY(0)[0:100:10] + print("Every 10th bin value of " + ws.name()) + print(ws.readY(0)[0:100:10]) # Add 2 using scale wsOffset = Scale(ws,2,"Add") - print "Every 10th bin value of " + wsOffset.name() - print wsOffset.readY(0)[0:100:10] + print("Every 10th bin value of " + wsOffset.name()) + print(wsOffset.readY(0)[0:100:10]) # Add 2 using the workspace operator overloads wsOffset2 = ws + 2 - print "Every 10th bin value of " + wsOffset2.name() - print wsOffset2.readY(0)[0:100:10] + print("Every 10th bin value of " + wsOffset2.name()) + print(wsOffset2.readY(0)[0:100:10]) Output: @@ -52,18 +52,18 @@ Output: .. testcode:: ExOffsetScale ws = CreateSampleWorkspace(BankPixelWidth=1) - print "Every 10th bin value of " + ws.name() - print ws.readY(0)[0:100:10] + print("Every 10th bin value of " + ws.name()) + print(ws.readY(0)[0:100:10]) # Multiply by 10 using scale wsScaled = Scale(ws,10,"Multiply") - print "Every 10th bin value of " + wsScaled.name() - print wsScaled.readY(0)[0:100:10] + print("Every 10th bin value of " + wsScaled.name()) + print(wsScaled.readY(0)[0:100:10]) # Multiply by 10 using the workspace operator overloads wsScaled2 = ws * 10 - print "Every 10th bin value of " + wsScaled2.name() - print wsScaled2.readY(0)[0:100:10] + print("Every 10th bin value of " + wsScaled2.name()) + print(wsScaled2.readY(0)[0:100:10]) Output: diff --git a/docs/source/algorithms/ScaleX-v1.rst b/docs/source/algorithms/ScaleX-v1.rst index 26ed1ca5760c8ec2e4835c6de086d62057a956c1..443e864f69d7fd363d1359d3ad42d90ca915adbd 100644 --- a/docs/source/algorithms/ScaleX-v1.rst +++ b/docs/source/algorithms/ScaleX-v1.rst @@ -36,12 +36,12 @@ Usage # Center the Gaussian by shifting the X-axis, then find its average ws2 = ScaleX(ws, Factor=-mean, Operation='Add') - print 'mean=%.2f'%abs(np.sum( ws2.dataX(0) *ws2.dataY(0) ) / np.sum( ws2.dataY(0) )) + print('mean={:.2f}'.format(abs(np.sum( ws2.dataX(0) *ws2.dataY(0) ) / np.sum( ws2.dataY(0) )))) # Decrease the standard deviation of the Gaussian by half via shrinkage of the X-axis, # then find its standard deviation ws3 = ScaleX(ws2, Factor=0.5, Operation='Multiply') - print 'sigma=%.2f'%np.sqrt( np.sum( ws3.dataX(0)**2 *ws3.dataY(0) ) / np.sum( ws3.dataY(0) ) ) + print('sigma={:.2f}'.format(np.sqrt( np.sum( ws3.dataX(0)**2 *ws3.dataY(0) ) / np.sum( ws3.dataY(0) ) ))) Output: