diff --git a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/sans/SANSScaleTest.py b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/sans/SANSScaleTest.py index 5a4137e92ea2f26356f05907e6908c5bcc432ad2..a671f78df7c6ef951c3c094186e5d272a85f16be 100644 --- a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/sans/SANSScaleTest.py +++ b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/sans/SANSScaleTest.py @@ -53,7 +53,7 @@ class SANSScaleTest(unittest.TestCase): height = 2.0 scale = 7.2 state = self._get_sample_state(width=width, height=height, thickness=3.0, scale=scale, - shape=SampleShape.Cylinder) + shape=SampleShape.CylinderAxisUp) serialized_state = state.property_manager scale_name = "SANSScale" scale_options = {"SANSState": serialized_state, diff --git a/scripts/SANS/sans/algorithm_detail/scale_helpers.py b/scripts/SANS/sans/algorithm_detail/scale_helpers.py index d4546d35289e310c5ba4c95cdc107f0f98233f65..2d136f994d154c739535740c97e3bedcc16a4ef1 100644 --- a/scripts/SANS/sans/algorithm_detail/scale_helpers.py +++ b/scripts/SANS/sans/algorithm_detail/scale_helpers.py @@ -56,15 +56,15 @@ class DivideByVolumeISIS(DivideByVolume): shape = scale_info.shape if scale_info.shape is not None else scale_info.shape_from_file # Now we calculate the volume - if shape is SampleShape.Cylinder: + if shape is SampleShape.CylinderAxisUp: # Volume = circle area * height # Factor of four comes from radius = width/2 volume = height * math.pi volume *= math.pow(width, 2) / 4.0 - elif shape is SampleShape.FlatPlate: + elif shape is SampleShape.Cuboid: # Flat plate sample volume = width * height * thickness - elif shape is SampleShape.Disc: + elif shape is SampleShape.CylinderAxisAlong: # Factor of four comes from radius = width/2 # Disc - where height is not used volume = thickness * math.pi diff --git a/scripts/SANS/sans/common/enums.py b/scripts/SANS/sans/common/enums.py index b545f858d84365969f7c7d3bbaa7c9c582fdc10f..fea27efe8aa8de78a83b0f9056119d21a029d007 100644 --- a/scripts/SANS/sans/common/enums.py +++ b/scripts/SANS/sans/common/enums.py @@ -283,7 +283,7 @@ class FitType(object): # SampleShape # -------------------------- @string_convertible -@serializable_enum("Cylinder", "FlatPlate", "Disk") +@serializable_enum("CylinderAxisUp", "Cuboid", "CylinderAxisAlong") class SampleShape(object): """ Defines the sample shape types @@ -297,11 +297,11 @@ def convert_int_to_shape(shape_int): use the string_convertible decorator. """ if shape_int == 1: - as_type = SampleShape.Cylinder + as_type = SampleShape.CylinderAxisUp elif shape_int == 2: - as_type = SampleShape.FlatPlate + as_type = SampleShape.Cuboid elif shape_int == 3: - as_type = SampleShape.Disc + as_type = SampleShape.CylinderAxisAlong else: raise ValueError("SampleShape: Cannot convert unknown sample shape integer: {0}".format(shape_int)) return as_type diff --git a/scripts/SANS/sans/common/file_information.py b/scripts/SANS/sans/common/file_information.py index 1f9539ac68fbdcfae938211584e3a77a7a9d5c68..5675ac3a29381d1d942abf40d0dcfc92d08abcd9 100644 --- a/scripts/SANS/sans/common/file_information.py +++ b/scripts/SANS/sans/common/file_information.py @@ -273,11 +273,11 @@ def convert_to_shape(shape_flag): :return: a shape object """ if shape_flag == 1: - shape = SampleShape.Cylinder + shape = SampleShape.CylinderAxisUp elif shape_flag == 2: - shape = SampleShape.FlatPlate + shape = SampleShape.Cuboid elif shape_flag == 3: - shape = SampleShape.Disc + shape = SampleShape.CylinderAxisAlong else: shape = None return shape @@ -407,11 +407,11 @@ def get_geometry_information_isis_nexus(file_name): thickness = float(sample[THICKNESS][0]) shape_as_string = sample[SHAPE][0].upper().decode("utf-8") if shape_as_string == CYLINDER: - shape = SampleShape.Cylinder + shape = SampleShape.CylinderAxisUp elif shape_as_string == FLAT_PLATE: - shape = SampleShape.FlatPlate + shape = SampleShape.Cuboid elif shape_as_string == DISC: - shape = SampleShape.Disc + shape = SampleShape.CylinderAxisAlong else: shape = None return height, width, thickness, shape diff --git a/scripts/SANS/sans/gui_logic/presenter/run_tab_presenter.py b/scripts/SANS/sans/gui_logic/presenter/run_tab_presenter.py index 92f54733fc079edfe9fb2e9fae27906303cd713c..4348ccb345233ea6aeecc88a667b50ef1af790bd 100644 --- a/scripts/SANS/sans/gui_logic/presenter/run_tab_presenter.py +++ b/scripts/SANS/sans/gui_logic/presenter/run_tab_presenter.py @@ -139,9 +139,9 @@ class RunTabPresenter(object): # Set the geometry options. This needs to include the option to read the sample shape from file. sample_shape = ["Read from file", - SampleShape.to_string(SampleShape.Cylinder), - SampleShape.to_string(SampleShape.FlatPlate), - SampleShape.to_string(SampleShape.Disc)] + SampleShape.to_string(SampleShape.CylinderAxisUp), + SampleShape.to_string(SampleShape.Cuboid), + SampleShape.to_string(SampleShape.CylinderAxisAlong)] self._view.sample_shape = sample_shape # Set the q range