From 8e3c57cb11200a251170095a9b57419cf93cb8a3 Mon Sep 17 00:00:00 2001 From: Owen Arnold Date: Fri, 7 Feb 2014 15:54:54 +0000 Subject: [PATCH] refs #8951. Params should be mandatory for algorithm. Since this algorithm could be used for workspaces in any units. Selecting a default step-size is bad, because for say TOF workspaces, 0.1 is a very very small step. --- .../PythonInterface/plugins/algorithms/Stitch1DMany.py | 2 +- .../test/python/plugins/algorithms/Stitch1DManyTest.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/Stitch1DMany.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/Stitch1DMany.py index 1e4244aaa2d6..6931de5fff51 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/Stitch1DMany.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/Stitch1DMany.py @@ -32,7 +32,7 @@ def PyInit(self): self.declareProperty(FloatArrayProperty(name="StartOverlaps", values=[]), doc="Overlap in Q.") self.declareProperty(FloatArrayProperty(name="EndOverlaps", values=[]), doc="End overlap in Q.") - self.declareProperty(FloatArrayProperty(name="Params", values=[0.1]), doc="Rebinning Parameters. See Rebin for format.") + self.declareProperty(FloatArrayProperty(name="Params", validator=FloatArrayMandatoryValidator()), doc="Rebinning Parameters. See Rebin for format.") self.declareProperty(name="ScaleRHSWorkspace", defaultValue=True, doc="Scaling either with respect to workspace 1 or workspace 2.") self.declareProperty(name="UseManualScaleFactor", defaultValue=False, doc="True to use a provided value for the scale factor.") self.declareProperty(name="ManualScaleFactor", defaultValue=1.0, doc="Provided value for the scale factor.") diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/Stitch1DManyTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/Stitch1DManyTest.py index 1356582fcc9a..1c6de8931dff 100644 --- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/Stitch1DManyTest.py +++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/Stitch1DManyTest.py @@ -58,6 +58,13 @@ def test_stitch_throws_with_wrong_number_of_End_overlaps(self): self.fail("Two end overlaps, but only two workspaces. Should have thrown.") except RuntimeError: pass + + def test_stich_throws_if_no_params(self): + try: + stitched = Stitch1DMany(InputWorkspaces='a, b') + self.fail("No Params given. Should have thrown.") + except RuntimeError: + pass #Cross-check that the result of using Stitch1DMany with two workspaces is the same as using Stitch1D.