Skip to content
Snippets Groups Projects
Commit c6aa348f authored by Joseph Ramsay's avatar Joseph Ramsay
Browse files

Re #20830 Fixed float format problems

parent ace88294
No related branches found
No related tags found
No related merge requests found
...@@ -51,11 +51,12 @@ Output: ...@@ -51,11 +51,12 @@ Output:
.. testoutput:: ExSelectCellOfType .. testoutput:: ExSelectCellOfType
Lattice before SelectCellOfType: Lattice before SelectCellOfType:
8.60581864273 11.935925461 11.9418127661 107.429088323 98.7529124665 98.9511934747 8.605818643 11.935925461 11.941812766 107.429088323 98.752912466 98.951193475
Lattice after SelectCellOfType:
14.131051152 19.247332564 8.605818643 89.881170675 105.071333770 89.970386662
Lattice after SelectCellOfType:
14.1310511523 19.247332564 8.60581864273 89.8811706749 105.07133377 89.970386662
.. categories:: .. categories::
......
...@@ -51,11 +51,11 @@ Output: ...@@ -51,11 +51,11 @@ Output:
.. testoutput:: ExSelectCellWithForm .. testoutput:: ExSelectCellWithForm
Lattice before SelectCellWithForm: Lattice before SelectCellWithForm:
8.60581864273 11.935925461 11.9418127661 107.429088323 98.7529124665 98.9511934747 8.605818643 11.935925461 11.941812766 107.429088323 98.752912466 98.951193475
Lattice after SelectCellWithForm: Lattice after SelectCellWithForm:
14.1310511523 19.247332564 8.60581864273 89.8811706749 105.07133377 89.970386662 14.131051152 19.247332564 8.605818643 89.881170675 105.071333770 89.970386662
.. categories:: .. categories::
......
...@@ -30,11 +30,11 @@ Usage ...@@ -30,11 +30,11 @@ Usage
def outputMDDimensions(ws): def outputMDDimensions(ws):
num_dims = ws.getNumDims() num_dims = ws.getNumDims()
print "Name Bins Min Max" print("Name Bins Min Max")
for dim_index in range(num_dims): for dim_index in range(num_dims):
dim = ws.getDimension(dim_index) dim = ws.getDimension(dim_index)
print "%s %i %.2f %.2f" % (dim.name, print("{} {} {:.2f} {:.2f}".format(
dim.getNBins(), dim.getMinimum(), dim.getMaximum()) dim.name, dim.getNBins(), dim.getMinimum(), dim.getMaximum()))
#create a test MD event workspace #create a test MD event workspace
mdew = CreateMDWorkspace(Dimensions=3, Extents=[-1,1,-5,5,-9,10], mdew = CreateMDWorkspace(Dimensions=3, Extents=[-1,1,-5,5,-9,10],
...@@ -46,13 +46,13 @@ Usage ...@@ -46,13 +46,13 @@ Usage
AlignedDim1='B,-5,5,5', AlignedDim1='B,-5,5,5',
AlignedDim2='C,-9,10,9') AlignedDim2='C,-9,10,9')
print "The original workspace" print("The original workspace")
outputMDDimensions(wsHisto) outputMDDimensions(wsHisto)
#The values in start and end are the Bin numbers(staring at 0) of the dimensions #The values in start and end are the Bin numbers(staring at 0) of the dimensions
wsOut = SliceMDHisto(wsHisto,Start=[1,2,0],End=[7,4,7]) wsOut = SliceMDHisto(wsHisto,Start=[1,2,0],End=[7,4,7])
print "\nAfter Slicing" print("\nAfter Slicing")
outputMDDimensions(wsOut) outputMDDimensions(wsOut)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment