From 4e79d47ebe56ed0a47ac343518e2afbfcf3d5249 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Wed, 11 Mar 2015 09:30:01 +0100 Subject: [PATCH 001/126] Refs #11043. Added PawleyFunction skeleton --- .../Framework/CurveFitting/CMakeLists.txt | 7 +- .../inc/MantidCurveFitting/PawleyFunction.h | 79 +++++++++++++++ .../CurveFitting/src/PawleyFunction.cpp | 73 ++++++++++++++ .../CurveFitting/test/PawleyFunctionTest.h | 95 +++++++++++++++++++ 4 files changed, 252 insertions(+), 2 deletions(-) create mode 100644 Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h create mode 100644 Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp create mode 100644 Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h diff --git a/Code/Mantid/Framework/CurveFitting/CMakeLists.txt b/Code/Mantid/Framework/CurveFitting/CMakeLists.txt index 6486b1f2e157..61d8ae0cdad0 100644 --- a/Code/Mantid/Framework/CurveFitting/CMakeLists.txt +++ b/Code/Mantid/Framework/CurveFitting/CMakeLists.txt @@ -67,6 +67,7 @@ set ( SRC_FILES src/NormaliseByPeakArea.cpp src/PRConjugateGradientMinimizer.cpp src/ParDomain.cpp + src/PawleyFunction.cpp src/PeakParameterFunction.cpp src/PlotPeakByLogValue.cpp src/Polynomial.cpp @@ -179,6 +180,7 @@ set ( INC_FILES inc/MantidCurveFitting/NormaliseByPeakArea.h inc/MantidCurveFitting/PRConjugateGradientMinimizer.h inc/MantidCurveFitting/ParDomain.h + inc/MantidCurveFitting/PawleyFunction.h inc/MantidCurveFitting/PeakParameterFunction.h inc/MantidCurveFitting/PlotPeakByLogValue.h inc/MantidCurveFitting/Polynomial.h @@ -257,14 +259,14 @@ set ( TEST_FILES FullprofPolynomialTest.h FunctionDomain1DSpectrumCreatorTest.h FunctionFactoryConstraintTest.h - FunctionParameterDecoratorFitTest.h + FunctionParameterDecoratorFitTest.h GSLMatrixTest.h GausDecayTest.h GausOscTest.h GaussianComptonProfileTest.h GaussianTest.h GramCharlierComptonProfileTest.h - IPeakFunctionCentreParameterNameTest.h + IPeakFunctionCentreParameterNameTest.h IPeakFunctionIntensityTest.h IkedaCarpenterPVTest.h LeBailFitTest.h @@ -282,6 +284,7 @@ set ( TEST_FILES NeutronBk2BkExpConvPVoigtTest.h NormaliseByPeakAreaTest.h PRConjugateGradientTest.h + PawleyFunctionTest.h PeakParameterFunctionTest.h PlotPeakByLogValueTest.h PolynomialTest.h diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h new file mode 100644 index 000000000000..af6a919893a3 --- /dev/null +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -0,0 +1,79 @@ +#ifndef MANTID_CURVEFITTING_PAWLEYFUNCTION_H_ +#define MANTID_CURVEFITTING_PAWLEYFUNCTION_H_ + +#include "MantidKernel/System.h" +#include "MantidAPI/IFunction1D.h" +#include "MantidAPI/ParamFunction.h" + +#include "MantidGeometry/Crystal/PointGroup.h" +#include "MantidGeometry/Crystal/UnitCell.h" + +namespace Mantid { +namespace CurveFitting { + +/** PawleyFunction + + The Pawley approach to obtain lattice parameters from a powder diffractogram + works by placing peak profiles at d-values (which result from the lattice + parameters and the Miller indices of each peak) and fitting the total profile + to the recorded diffractogram. + + Depending on the chosen crystal system, this function exposes the appropriate + lattice parameters as parameters, as well as profile parameters of the + individual peak functions, except the peak locations, which are a direct + result of their HKLs in combination with the unit cell. + + @author Michael Wedel, Paul Scherrer Institut - SINQ + @date 11/03/2015 + + Copyright © 2015 PSI-NXMM + + This file is part of Mantid. + + Mantid is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Mantid is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + File change history is stored at: + Code Documentation is available at: +*/ +class DLLExport PawleyFunction : public API::IFunction1D, + public API::ParamFunction { +public: + PawleyFunction(); + virtual ~PawleyFunction() {} + + std::string name() const { return "PawleyFunction"; } + + void setAttribute(const std::string &attName, const Attribute &attValue); + Geometry::PointGroup::CrystalSystem getCrystalSystem() const; + + void function1D(double *out, const double *xValues, const size_t nData) const; + + void functionDeriv1D(API::Jacobian *out, const double *xValues, + const size_t nData); + void functionDeriv(const API::FunctionDomain &domain, + API::Jacobian &jacobian); + +protected: + void init(); + + void setCrystalSystem(const std::string &crystalSystem); + + Geometry::PointGroup::CrystalSystem m_crystalSystem; + Geometry::UnitCell m_unitCell; +}; + +} // namespace CurveFitting +} // namespace Mantid + +#endif /* MANTID_CURVEFITTING_PAWLEYFUNCTION_H_ */ diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp new file mode 100644 index 000000000000..267b89f04e00 --- /dev/null +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -0,0 +1,73 @@ +#include "MantidCurveFitting/PawleyFunction.h" +#include + +namespace Mantid { +namespace CurveFitting { + +using namespace API; +using namespace Geometry; + +PawleyFunction::PawleyFunction() + : ParamFunction(), m_crystalSystem(PointGroup::Triclinic), m_unitCell() {} + +void PawleyFunction::setAttribute(const std::string &attName, + const Attribute &attValue) { + if (attName == "CrystalSystem") { + setCrystalSystem(attValue.asString()); + } + + ParamFunction::setAttribute(attName, attValue); +} + +PointGroup::CrystalSystem PawleyFunction::getCrystalSystem() const { + return m_crystalSystem; +} + +void PawleyFunction::function1D(double *out, const double *xValues, + const size_t nData) const { + UNUSED_ARG(out); + UNUSED_ARG(xValues); + UNUSED_ARG(nData); +} + +void PawleyFunction::functionDeriv1D(Jacobian *out, const double *xValues, + const size_t nData) { + UNUSED_ARG(out); + UNUSED_ARG(xValues); + UNUSED_ARG(nData); +} + +void PawleyFunction::functionDeriv(const FunctionDomain &domain, + Jacobian &jacobian) { + calNumericalDeriv(domain, jacobian); +} + +void PawleyFunction::init() { + declareAttribute("CrystalSystem", IFunction::Attribute("Triclinic")); +} + +void PawleyFunction::setCrystalSystem(const std::string &crystalSystem) { + std::string crystalSystemLC = boost::algorithm::to_lower_copy(crystalSystem); + + if (crystalSystemLC == "cubic") { + m_crystalSystem = PointGroup::Cubic; + } else if (crystalSystemLC == "tetragonal") { + m_crystalSystem = PointGroup::Tetragonal; + } else if (crystalSystemLC == "hexagonal") { + m_crystalSystem = PointGroup::Hexagonal; + } else if (crystalSystemLC == "trigonal") { + m_crystalSystem = PointGroup::Trigonal; + } else if (crystalSystemLC == "orthorhombic") { + m_crystalSystem = PointGroup::Orthorhombic; + } else if (crystalSystemLC == "monoclinic") { + m_crystalSystem = PointGroup::Monoclinic; + } else if (crystalSystemLC == "triclinic") { + m_crystalSystem = PointGroup::Triclinic; + } else { + throw std::invalid_argument("Not a valid crystal system: '" + + crystalSystem + "'."); + } +} + +} // namespace CurveFitting +} // namespace Mantid diff --git a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h new file mode 100644 index 000000000000..4143a4d4ea0c --- /dev/null +++ b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h @@ -0,0 +1,95 @@ +#ifndef MANTID_CURVEFITTING_PAWLEYFUNCTIONTEST_H_ +#define MANTID_CURVEFITTING_PAWLEYFUNCTIONTEST_H_ + +#include + +#include "MantidCurveFitting/PawleyFunction.h" +#include "MantidGeometry/Crystal/PointGroup.h" + +using Mantid::CurveFitting::PawleyFunction; +using namespace Mantid::API; +using namespace Mantid::Geometry; + +class PawleyFunctionTest : public CxxTest::TestSuite { +public: + // This pair of boilerplate methods prevent the suite being created statically + // This means the constructor isn't called when running other tests + static PawleyFunctionTest *createSuite() { return new PawleyFunctionTest(); } + static void destroySuite(PawleyFunctionTest *suite) { delete suite; } + + void testCrystalSystem() { + PawleyFunction fn; + fn.initialize(); + + TS_ASSERT(fn.hasAttribute("CrystalSystem")); + + // Cubic, check case insensitivity + TS_ASSERT_THROWS_NOTHING(fn.setAttributeValue("CrystalSystem", "cubic")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Cubic); + TS_ASSERT_THROWS_NOTHING(fn.setAttributeValue("CrystalSystem", "Cubic")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Cubic); + TS_ASSERT_THROWS_NOTHING(fn.setAttributeValue("CrystalSystem", "CUBIC")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Cubic); + + // Tetragonal + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "tetragonal")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Tetragonal); + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "Tetragonal")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Tetragonal); + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "TETRAGONAL")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Tetragonal); + + // Hexagonal + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "hexagonal")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Hexagonal); + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "Hexagonal")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Hexagonal); + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "HEXAGONAL")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Hexagonal); + + // Orthorhombic + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "orthorhombic")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Orthorhombic); + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "Orthorhombic")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Orthorhombic); + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "ORTHORHOMBIC")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Orthorhombic); + + // Monoclinic + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "monoclinic")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Monoclinic); + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "Monoclinic")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Monoclinic); + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "MONOCLINIC")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Monoclinic); + + // Triclinic + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "triclinic")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Triclinic); + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "Triclinic")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Triclinic); + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("CrystalSystem", "TRICLINIC")); + TS_ASSERT_EQUALS(fn.getCrystalSystem(), PointGroup::Triclinic); + + // invalid string + TS_ASSERT_THROWS(fn.setAttributeValue("CrystalSystem", "invalid"), + std::invalid_argument); + } +}; + +#endif /* MANTID_CURVEFITTING_PAWLEYFUNCTIONTEST_H_ */ From 1428773c4a35503a3ba52efc17b857cb52c00071 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Wed, 11 Mar 2015 12:59:48 +0100 Subject: [PATCH 002/126] Refs #11043. Renaming function, adding unit cell parameters --- .../inc/MantidCurveFitting/PawleyFunction.h | 22 ++- .../CurveFitting/src/PawleyFunction.cpp | 131 +++++++++++-- .../CurveFitting/test/PawleyFunctionTest.h | 176 +++++++++++++++++- 3 files changed, 297 insertions(+), 32 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h index af6a919893a3..757119d01442 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -46,21 +46,21 @@ namespace CurveFitting { File change history is stored at: Code Documentation is available at: */ -class DLLExport PawleyFunction : public API::IFunction1D, - public API::ParamFunction { +class DLLExport PawleyParameterFunction : virtual public API::IFunction, + virtual public API::ParamFunction { public: - PawleyFunction(); - virtual ~PawleyFunction() {} + PawleyParameterFunction(); + virtual ~PawleyParameterFunction() {} - std::string name() const { return "PawleyFunction"; } + std::string name() const { return "PawleyParameterFunction"; } void setAttribute(const std::string &attName, const Attribute &attValue); - Geometry::PointGroup::CrystalSystem getCrystalSystem() const; - void function1D(double *out, const double *xValues, const size_t nData) const; + Geometry::PointGroup::CrystalSystem getCrystalSystem() const; + Geometry::UnitCell getUnitCellFromParameters() const; - void functionDeriv1D(API::Jacobian *out, const double *xValues, - const size_t nData); + void function(const API::FunctionDomain &domain, + API::FunctionValues &values) const; void functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian); @@ -69,8 +69,10 @@ class DLLExport PawleyFunction : public API::IFunction1D, void setCrystalSystem(const std::string &crystalSystem); + void createCrystalSystemParameters( + Geometry::PointGroup::CrystalSystem crystalSystem); + Geometry::PointGroup::CrystalSystem m_crystalSystem; - Geometry::UnitCell m_unitCell; }; } // namespace CurveFitting diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp index 267b89f04e00..6535d147dc9f 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -7,11 +7,11 @@ namespace CurveFitting { using namespace API; using namespace Geometry; -PawleyFunction::PawleyFunction() - : ParamFunction(), m_crystalSystem(PointGroup::Triclinic), m_unitCell() {} +PawleyParameterFunction::PawleyParameterFunction() + : ParamFunction(), m_crystalSystem(PointGroup::Triclinic) {} -void PawleyFunction::setAttribute(const std::string &attName, - const Attribute &attValue) { +void PawleyParameterFunction::setAttribute(const std::string &attName, + const Attribute &attValue) { if (attName == "CrystalSystem") { setCrystalSystem(attValue.asString()); } @@ -19,34 +19,75 @@ void PawleyFunction::setAttribute(const std::string &attName, ParamFunction::setAttribute(attName, attValue); } -PointGroup::CrystalSystem PawleyFunction::getCrystalSystem() const { +PointGroup::CrystalSystem PawleyParameterFunction::getCrystalSystem() const { return m_crystalSystem; } -void PawleyFunction::function1D(double *out, const double *xValues, - const size_t nData) const { - UNUSED_ARG(out); - UNUSED_ARG(xValues); - UNUSED_ARG(nData); +UnitCell PawleyParameterFunction::getUnitCellFromParameters() const { + switch (m_crystalSystem) { + case PointGroup::Cubic: { + double a = getParameter("a"); + return UnitCell(a, a, a); + } + case PointGroup::Tetragonal: { + double a = getParameter("a"); + return UnitCell(a, a, getParameter("c")); + } + case PointGroup::Hexagonal: { + double a = getParameter("a"); + return UnitCell(a, a, getParameter("c"), 90, 90, 120); + } + case PointGroup::Trigonal: { + double a = getParameter("a"); + double alpha = getParameter("Alpha"); + return UnitCell(a, a, a, alpha, alpha, alpha); + } + case PointGroup::Orthorhombic: { + return UnitCell(getParameter("a"), getParameter("b"), getParameter("c")); + } + case PointGroup::Monoclinic: { + return UnitCell(getParameter("a"), getParameter("b"), getParameter("c"), 90, + getParameter("Beta"), 90); + } + case PointGroup::Triclinic: { + return UnitCell(getParameter("a"), getParameter("b"), getParameter("c"), + getParameter("Alpha"), getParameter("Beta"), + getParameter("Gamma")); + } + } + + return UnitCell(); } -void PawleyFunction::functionDeriv1D(Jacobian *out, const double *xValues, - const size_t nData) { - UNUSED_ARG(out); - UNUSED_ARG(xValues); - UNUSED_ARG(nData); +void PawleyParameterFunction::function(const FunctionDomain &domain, + FunctionValues &values) const { + UNUSED_ARG(domain); + UNUSED_ARG(values); } -void PawleyFunction::functionDeriv(const FunctionDomain &domain, - Jacobian &jacobian) { - calNumericalDeriv(domain, jacobian); +void PawleyParameterFunction::functionDeriv(const FunctionDomain &domain, + Jacobian &jacobian) { + UNUSED_ARG(domain) + UNUSED_ARG(jacobian); } -void PawleyFunction::init() { +void PawleyParameterFunction::init() { declareAttribute("CrystalSystem", IFunction::Attribute("Triclinic")); + declareAttribute("ProfileFunction", IFunction::Attribute("Gaussian")); + + declareParameter("a", 1.0); + declareParameter("b", 1.0); + declareParameter("c", 1.0); + + declareParameter("Alpha", 90.0); + declareParameter("Beta", 90.0); + declareParameter("Gamma", 90.0); + + declareParameter("ZeroShift", 0.0); } -void PawleyFunction::setCrystalSystem(const std::string &crystalSystem) { +void +PawleyParameterFunction::setCrystalSystem(const std::string &crystalSystem) { std::string crystalSystemLC = boost::algorithm::to_lower_copy(crystalSystem); if (crystalSystemLC == "cubic") { @@ -67,6 +108,56 @@ void PawleyFunction::setCrystalSystem(const std::string &crystalSystem) { throw std::invalid_argument("Not a valid crystal system: '" + crystalSystem + "'."); } + + createCrystalSystemParameters(m_crystalSystem); +} + +void PawleyParameterFunction::createCrystalSystemParameters( + PointGroup::CrystalSystem crystalSystem) { + + clearAllParameters(); + switch (crystalSystem) { + case PointGroup::Cubic: + declareParameter("a", 1.0); + break; + + case PointGroup::Hexagonal: + case PointGroup::Tetragonal: + declareParameter("a", 1.0); + declareParameter("c", 1.0); + break; + + case PointGroup::Orthorhombic: + declareParameter("a", 1.0); + declareParameter("b", 1.0); + declareParameter("c", 1.0); + break; + + case PointGroup::Monoclinic: + declareParameter("a", 1.0); + declareParameter("b", 1.0); + declareParameter("c", 1.0); + declareParameter("Beta", 90.0); + break; + + case PointGroup::Trigonal: + declareParameter("a", 1.0); + declareParameter("Alpha", 90.0); + break; + + default: + // triclinic + declareParameter("a", 1.0); + declareParameter("b", 1.0); + declareParameter("c", 1.0); + + declareParameter("Alpha", 90.0); + declareParameter("Beta", 90.0); + declareParameter("Gamma", 90.0); + break; + } + + declareParameter("ZeroShift", 0.0); } } // namespace CurveFitting diff --git a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h index 4143a4d4ea0c..fa798a0eed66 100644 --- a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h @@ -6,9 +6,10 @@ #include "MantidCurveFitting/PawleyFunction.h" #include "MantidGeometry/Crystal/PointGroup.h" -using Mantid::CurveFitting::PawleyFunction; +using Mantid::CurveFitting::PawleyParameterFunction; using namespace Mantid::API; using namespace Mantid::Geometry; +using namespace Mantid::Kernel; class PawleyFunctionTest : public CxxTest::TestSuite { public: @@ -18,7 +19,7 @@ class PawleyFunctionTest : public CxxTest::TestSuite { static void destroySuite(PawleyFunctionTest *suite) { delete suite; } void testCrystalSystem() { - PawleyFunction fn; + PawleyParameterFunction fn; fn.initialize(); TS_ASSERT(fn.hasAttribute("CrystalSystem")); @@ -90,6 +91,177 @@ class PawleyFunctionTest : public CxxTest::TestSuite { TS_ASSERT_THROWS(fn.setAttributeValue("CrystalSystem", "invalid"), std::invalid_argument); } + + void testCrystalSystemConstraintsCubic() { + PawleyParameterFunction fn; + fn.initialize(); + + fn.setAttributeValue("CrystalSystem", "Cubic"); + + TS_ASSERT_EQUALS(fn.nParams(), 2); + + fn.setParameter("a", 3.0); + TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0); + + TS_ASSERT_THROWS(fn.getParameter("b"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("c"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Alpha"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Beta"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Gamma"), std::invalid_argument); + + UnitCell cell = fn.getUnitCellFromParameters(); + cellParametersAre(cell, 3.0, 3.0, 3.0, 90.0, 90.0, 90.0); + } + + void testCrystalSystemConstraintsTetragonal() { + PawleyParameterFunction fn; + fn.initialize(); + + fn.setAttributeValue("CrystalSystem", "Tetragonal"); + + TS_ASSERT_EQUALS(fn.nParams(), 3); + + fn.setParameter("a", 3.0); + TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0); + fn.setParameter("c", 5.0); + TS_ASSERT_EQUALS(fn.getParameter("c"), 5.0); + + TS_ASSERT_THROWS(fn.getParameter("b"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Alpha"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Beta"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Gamma"), std::invalid_argument); + + UnitCell cell = fn.getUnitCellFromParameters(); + cellParametersAre(cell, 3.0, 3.0, 5.0, 90.0, 90.0, 90.0); + } + + void testCrystalSystemConstraintsHexagonal() { + PawleyParameterFunction fn; + fn.initialize(); + + fn.setAttributeValue("CrystalSystem", "Hexagonal"); + + TS_ASSERT_EQUALS(fn.nParams(), 3); + + fn.setParameter("a", 3.0); + TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0); + fn.setParameter("c", 5.0); + TS_ASSERT_EQUALS(fn.getParameter("c"), 5.0); + + TS_ASSERT_THROWS(fn.getParameter("b"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Alpha"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Beta"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Gamma"), std::invalid_argument); + + UnitCell cell = fn.getUnitCellFromParameters(); + cellParametersAre(cell, 3.0, 3.0, 5.0, 90.0, 90.0, 120.0); + } + + void testCrystalSystemConstraintsTrigonal() { + PawleyParameterFunction fn; + fn.initialize(); + + fn.setAttributeValue("CrystalSystem", "Trigonal"); + + TS_ASSERT_EQUALS(fn.nParams(), 3); + + fn.setParameter("a", 3.0); + TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0); + fn.setParameter("Alpha", 101.0); + TS_ASSERT_EQUALS(fn.getParameter("Alpha"), 101.0); + + TS_ASSERT_THROWS(fn.getParameter("b"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("c"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Beta"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Gamma"), std::invalid_argument); + + UnitCell cell = fn.getUnitCellFromParameters(); + cellParametersAre(cell, 3.0, 3.0, 3.0, 101.0, 101.0, 101.0); + } + + void testCrystalSystemConstraintsOrthorhombic() { + PawleyParameterFunction fn; + fn.initialize(); + + fn.setAttributeValue("CrystalSystem", "Orthorhombic"); + + TS_ASSERT_EQUALS(fn.nParams(), 4); + + fn.setParameter("a", 3.0); + TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0); + fn.setParameter("b", 4.0); + TS_ASSERT_EQUALS(fn.getParameter("b"), 4.0); + fn.setParameter("c", 5.0); + TS_ASSERT_EQUALS(fn.getParameter("c"), 5.0); + + TS_ASSERT_THROWS(fn.getParameter("Alpha"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Beta"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Gamma"), std::invalid_argument); + + UnitCell cell = fn.getUnitCellFromParameters(); + cellParametersAre(cell, 3.0, 4.0, 5.0, 90.0, 90.0, 90.0); + } + + void testCrystalSystemConstraintsMonoclinic() { + PawleyParameterFunction fn; + fn.initialize(); + + fn.setAttributeValue("CrystalSystem", "Monoclinic"); + + TS_ASSERT_EQUALS(fn.nParams(), 5); + + fn.setParameter("a", 3.0); + TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0); + fn.setParameter("b", 4.0); + TS_ASSERT_EQUALS(fn.getParameter("b"), 4.0); + fn.setParameter("c", 5.0); + TS_ASSERT_EQUALS(fn.getParameter("c"), 5.0); + fn.setParameter("Beta", 101.0); + TS_ASSERT_EQUALS(fn.getParameter("Beta"), 101.0); + + TS_ASSERT_THROWS(fn.getParameter("Alpha"), std::invalid_argument); + TS_ASSERT_THROWS(fn.getParameter("Gamma"), std::invalid_argument); + + UnitCell cell = fn.getUnitCellFromParameters(); + cellParametersAre(cell, 3.0, 4.0, 5.0, 90.0, 101.0, 90.0); + } + + void testCrystalSystemConstraintsTriclinic() { + PawleyParameterFunction fn; + fn.initialize(); + + fn.setAttributeValue("CrystalSystem", "Triclinic"); + + TS_ASSERT_EQUALS(fn.nParams(), 7); + + fn.setParameter("a", 3.0); + TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0); + fn.setParameter("b", 4.0); + TS_ASSERT_EQUALS(fn.getParameter("b"), 4.0); + fn.setParameter("c", 5.0); + TS_ASSERT_EQUALS(fn.getParameter("c"), 5.0); + fn.setParameter("Alpha", 101.0); + TS_ASSERT_EQUALS(fn.getParameter("Alpha"), 101.0); + fn.setParameter("Beta", 111.0); + TS_ASSERT_EQUALS(fn.getParameter("Beta"), 111.0); + fn.setParameter("Gamma", 103.0); + TS_ASSERT_EQUALS(fn.getParameter("Gamma"), 103.0); + + UnitCell cell = fn.getUnitCellFromParameters(); + cellParametersAre(cell, 3.0, 4.0, 5.0, 101.0, 111.0, 103.0); + } + +private: + void cellParametersAre(const UnitCell &cell, double a, double b, double c, double alpha, + double beta, double gamma) { + TS_ASSERT_DELTA(cell.a(), a, 1e-9); + TS_ASSERT_DELTA(cell.b(), b, 1e-9); + TS_ASSERT_DELTA(cell.c(), c, 1e-9); + + TS_ASSERT_DELTA(cell.alpha(), alpha, 1e-9); + TS_ASSERT_DELTA(cell.beta(), beta, 1e-9); + TS_ASSERT_DELTA(cell.gamma(), gamma, 1e-9); + } }; #endif /* MANTID_CURVEFITTING_PAWLEYFUNCTIONTEST_H_ */ From 95581851a106ac9db694364434c9a78ead086c8c Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Wed, 11 Mar 2015 14:10:20 +0100 Subject: [PATCH 003/126] Refs #11043. Adding actual PawleyFunction --- .../inc/MantidCurveFitting/PawleyFunction.h | 70 ++++++++++++----- .../CurveFitting/src/PawleyFunction.cpp | 77 +++++++++++++++++++ .../CurveFitting/test/PawleyFunctionTest.h | 28 ++++++- 3 files changed, 153 insertions(+), 22 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h index 757119d01442..948dd31ac103 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -2,6 +2,8 @@ #define MANTID_CURVEFITTING_PAWLEYFUNCTION_H_ #include "MantidKernel/System.h" +#include "MantidAPI/CompositeFunction.h" +#include "MantidAPI/FunctionParameterDecorator.h" #include "MantidAPI/IFunction1D.h" #include "MantidAPI/ParamFunction.h" @@ -11,6 +13,37 @@ namespace Mantid { namespace CurveFitting { +class DLLExport PawleyParameterFunction : virtual public API::IFunction, + virtual public API::ParamFunction { +public: + PawleyParameterFunction(); + virtual ~PawleyParameterFunction() {} + + std::string name() const { return "PawleyParameterFunction"; } + + void setAttribute(const std::string &attName, const Attribute &attValue); + + Geometry::PointGroup::CrystalSystem getCrystalSystem() const; + Geometry::UnitCell getUnitCellFromParameters() const; + + void function(const API::FunctionDomain &domain, + API::FunctionValues &values) const; + void functionDeriv(const API::FunctionDomain &domain, + API::Jacobian &jacobian); + +protected: + void init(); + + void setCrystalSystem(const std::string &crystalSystem); + + void createCrystalSystemParameters( + Geometry::PointGroup::CrystalSystem crystalSystem); + + Geometry::PointGroup::CrystalSystem m_crystalSystem; +}; + +typedef boost::shared_ptr PawleyParameterFunction_sptr; + /** PawleyFunction The Pawley approach to obtain lattice parameters from a powder diffractogram @@ -46,35 +79,34 @@ namespace CurveFitting { File change history is stored at: Code Documentation is available at: */ -class DLLExport PawleyParameterFunction : virtual public API::IFunction, - virtual public API::ParamFunction { +class PawleyFunction : public API::IFunction1D, + public API::FunctionParameterDecorator { public: - PawleyParameterFunction(); - virtual ~PawleyParameterFunction() {} - - std::string name() const { return "PawleyParameterFunction"; } + virtual ~PawleyFunction() {} - void setAttribute(const std::string &attName, const Attribute &attValue); + std::string name() const { return "PawleyFunction"; } - Geometry::PointGroup::CrystalSystem getCrystalSystem() const; - Geometry::UnitCell getUnitCellFromParameters() const; + void setCrystalSystem(const std::string &crystalSystem); + void setProfileFunction(const std::string &profileFunction); - void function(const API::FunctionDomain &domain, - API::FunctionValues &values) const; + void function1D(double *out, const double *xValues, const size_t nData) const; + void functionDeriv1D(API::Jacobian *out, const double *xValues, + const size_t nData); void functionDeriv(const API::FunctionDomain &domain, - API::Jacobian &jacobian); + API::Jacobian &jacobian) { + calNumericalDeriv(domain, jacobian); + } + + void addPeak(); protected: void init(); + void beforeDecoratedFunctionSet(const API::IFunction_sptr &fn); - void setCrystalSystem(const std::string &crystalSystem); - - void createCrystalSystemParameters( - Geometry::PointGroup::CrystalSystem crystalSystem); - - Geometry::PointGroup::CrystalSystem m_crystalSystem; + API::CompositeFunction_sptr m_compositeFunction; + PawleyParameterFunction_sptr m_pawleyParameterFunction; + API::CompositeFunction_sptr m_peakProfileComposite; }; - } // namespace CurveFitting } // namespace Mantid diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp index 6535d147dc9f..d729affefced 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -1,9 +1,15 @@ #include "MantidCurveFitting/PawleyFunction.h" + +#include "MantidAPI/FunctionFactory.h" + #include +#include namespace Mantid { namespace CurveFitting { +DECLARE_FUNCTION(PawleyParameterFunction) + using namespace API; using namespace Geometry; @@ -160,5 +166,76 @@ void PawleyParameterFunction::createCrystalSystemParameters( declareParameter("ZeroShift", 0.0); } +void PawleyFunction::setCrystalSystem(const std::string &crystalSystem) { + m_pawleyParameterFunction->setAttributeValue("CrystalSystem", crystalSystem); + m_compositeFunction->checkFunction(); +} + +void PawleyFunction::setProfileFunction(const std::string &profileFunction) { + m_pawleyParameterFunction->setAttributeValue("ProfileFunction", + profileFunction); + m_compositeFunction->checkFunction(); +} + +void PawleyFunction::function1D(double *out, const double *xValues, + const size_t nData) const { + UNUSED_ARG(out); + UNUSED_ARG(xValues); + UNUSED_ARG(nData); +} + +void PawleyFunction::functionDeriv1D(API::Jacobian *out, const double *xValues, + const size_t nData) { + UNUSED_ARG(out); + UNUSED_ARG(xValues); + UNUSED_ARG(nData); +} + +void PawleyFunction::addPeak() { + m_peakProfileComposite->addFunction( + FunctionFactory::Instance().createFunction("Gaussian")); +} + +void PawleyFunction::init() { + setDecoratedFunction("CompositeFunction"); + + if (!m_compositeFunction) { + throw std::runtime_error( + "PawleyFunction could not construct internal CompositeFunction."); + } +} + +void PawleyFunction::beforeDecoratedFunctionSet(const API::IFunction_sptr &fn) { + CompositeFunction_sptr composite = + boost::dynamic_pointer_cast(fn); + + if (!composite) { + throw std::invalid_argument("PawleyFunction only works with " + "CompositeFunction. Selecting another " + "decorated function is not possible."); + } + + m_compositeFunction = composite; + + if (m_compositeFunction->nFunctions() == 0) { + m_peakProfileComposite = boost::dynamic_pointer_cast( + FunctionFactory::Instance().createFunction("CompositeFunction")); + + m_pawleyParameterFunction = + boost::dynamic_pointer_cast( + FunctionFactory::Instance().createFunction( + "PawleyParameterFunction")); + + m_compositeFunction->addFunction(m_pawleyParameterFunction); + m_compositeFunction->addFunction(m_peakProfileComposite); + } else { + m_pawleyParameterFunction = + boost::dynamic_pointer_cast( + m_compositeFunction->getFunction(0)); + m_peakProfileComposite = boost::dynamic_pointer_cast( + m_compositeFunction->getFunction(1)); + } +} + } // namespace CurveFitting } // namespace Mantid diff --git a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h index fa798a0eed66..0086d7a9c699 100644 --- a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h @@ -6,7 +6,7 @@ #include "MantidCurveFitting/PawleyFunction.h" #include "MantidGeometry/Crystal/PointGroup.h" -using Mantid::CurveFitting::PawleyParameterFunction; +using namespace Mantid::CurveFitting; using namespace Mantid::API; using namespace Mantid::Geometry; using namespace Mantid::Kernel; @@ -251,9 +251,31 @@ class PawleyFunctionTest : public CxxTest::TestSuite { cellParametersAre(cell, 3.0, 4.0, 5.0, 101.0, 111.0, 103.0); } + void testPawleyFunctionInitialization() { + PawleyFunction fn; + fn.initialize(); + + TS_ASSERT(boost::dynamic_pointer_cast( + fn.getDecoratedFunction())); + + // The base parameters of PawleyParameterFunction + TS_ASSERT_EQUALS(fn.nParams(), 7); + } + + void testPawleyFunctionSetCrystalSystem() { + PawleyFunction fn; + fn.initialize(); + + TS_ASSERT_EQUALS(fn.nParams(), 7); + + fn.setCrystalSystem("Cubic"); + + TS_ASSERT_EQUALS(fn.nParams(), 2); + } + private: - void cellParametersAre(const UnitCell &cell, double a, double b, double c, double alpha, - double beta, double gamma) { + void cellParametersAre(const UnitCell &cell, double a, double b, double c, + double alpha, double beta, double gamma) { TS_ASSERT_DELTA(cell.a(), a, 1e-9); TS_ASSERT_DELTA(cell.b(), b, 1e-9); TS_ASSERT_DELTA(cell.c(), c, 1e-9); From 492aff6d156bc1f4a38c8bffef85609c2996ad29 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Wed, 11 Mar 2015 16:54:27 +0100 Subject: [PATCH 004/126] Refs #11043. Correcting parameter behavior, adding peaks. --- .../inc/MantidCurveFitting/PawleyFunction.h | 22 +++++- .../CurveFitting/src/PawleyFunction.cpp | 78 ++++++++++++++++--- .../CurveFitting/test/PawleyFunctionTest.h | 36 +++++++-- 3 files changed, 118 insertions(+), 18 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h index 948dd31ac103..f7b795c82098 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -5,6 +5,7 @@ #include "MantidAPI/CompositeFunction.h" #include "MantidAPI/FunctionParameterDecorator.h" #include "MantidAPI/IFunction1D.h" +#include "MantidAPI/IPeakFunction.h" #include "MantidAPI/ParamFunction.h" #include "MantidGeometry/Crystal/PointGroup.h" @@ -26,6 +27,14 @@ class DLLExport PawleyParameterFunction : virtual public API::IFunction, Geometry::PointGroup::CrystalSystem getCrystalSystem() const; Geometry::UnitCell getUnitCellFromParameters() const; + std::string getProfileFunctionName() const { + return getAttribute("ProfileFunction").asString(); + } + + std::string getProfileFunctionCenterParameterName() const { + return m_profileFunctionCenterParameterName; + } + void function(const API::FunctionDomain &domain, API::FunctionValues &values) const; void functionDeriv(const API::FunctionDomain &domain, @@ -34,12 +43,16 @@ class DLLExport PawleyParameterFunction : virtual public API::IFunction, protected: void init(); + void setProfileFunction(const std::string &profileFunction); void setCrystalSystem(const std::string &crystalSystem); void createCrystalSystemParameters( Geometry::PointGroup::CrystalSystem crystalSystem); + void setCenterParameterNameFromFunction( + const API::IPeakFunction_sptr &profileFunction); Geometry::PointGroup::CrystalSystem m_crystalSystem; + std::string m_profileFunctionCenterParameterName; }; typedef boost::shared_ptr PawleyParameterFunction_sptr; @@ -82,6 +95,7 @@ typedef boost::shared_ptr PawleyParameterFunction_sptr; class PawleyFunction : public API::IFunction1D, public API::FunctionParameterDecorator { public: + PawleyFunction(); virtual ~PawleyFunction() {} std::string name() const { return "PawleyFunction"; } @@ -94,10 +108,12 @@ class PawleyFunction : public API::IFunction1D, const size_t nData); void functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian) { - calNumericalDeriv(domain, jacobian); + calNumericalDeriv(domain, jacobian); } - void addPeak(); + void addPeak(const Kernel::V3D &hkl, double centre, double fwhm, + double height); + API::IPeakFunction_sptr getPeak(size_t i) const; protected: void init(); @@ -106,6 +122,8 @@ class PawleyFunction : public API::IFunction1D, API::CompositeFunction_sptr m_compositeFunction; PawleyParameterFunction_sptr m_pawleyParameterFunction; API::CompositeFunction_sptr m_peakProfileComposite; + + std::vector m_hkls; }; } // namespace CurveFitting } // namespace Mantid diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp index d729affefced..6fbed58fa980 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -14,12 +14,15 @@ using namespace API; using namespace Geometry; PawleyParameterFunction::PawleyParameterFunction() - : ParamFunction(), m_crystalSystem(PointGroup::Triclinic) {} + : ParamFunction(), m_crystalSystem(PointGroup::Triclinic), + m_profileFunctionCenterParameterName() {} void PawleyParameterFunction::setAttribute(const std::string &attName, const Attribute &attValue) { if (attName == "CrystalSystem") { setCrystalSystem(attValue.asString()); + } else if (attName == "ProfileFunction") { + setProfileFunction(attValue.asString()); } ParamFunction::setAttribute(attName, attValue); @@ -81,15 +84,21 @@ void PawleyParameterFunction::init() { declareAttribute("CrystalSystem", IFunction::Attribute("Triclinic")); declareAttribute("ProfileFunction", IFunction::Attribute("Gaussian")); - declareParameter("a", 1.0); - declareParameter("b", 1.0); - declareParameter("c", 1.0); + setCrystalSystem("Triclinic"); + setProfileFunction("Gaussian"); +} - declareParameter("Alpha", 90.0); - declareParameter("Beta", 90.0); - declareParameter("Gamma", 90.0); +void PawleyParameterFunction::setProfileFunction( + const std::string &profileFunction) { + IPeakFunction_sptr peakFunction = boost::dynamic_pointer_cast( + FunctionFactory::Instance().createFunction(profileFunction)); - declareParameter("ZeroShift", 0.0); + if (!peakFunction) { + throw std::invalid_argument("PawleyFunction can only use IPeakFunctions to " + "calculate peak profiles."); + } + + setCenterParameterNameFromFunction(peakFunction); } void @@ -166,6 +175,19 @@ void PawleyParameterFunction::createCrystalSystemParameters( declareParameter("ZeroShift", 0.0); } +void PawleyParameterFunction::setCenterParameterNameFromFunction( + const IPeakFunction_sptr &profileFunction) { + m_profileFunctionCenterParameterName.clear(); + if (profileFunction) { + m_profileFunctionCenterParameterName = + profileFunction->getCentreParameterName(); + } +} + +PawleyFunction::PawleyFunction() + : FunctionParameterDecorator(), m_compositeFunction(), + m_pawleyParameterFunction(), m_peakProfileComposite(), m_hkls() {} + void PawleyFunction::setCrystalSystem(const std::string &crystalSystem) { m_pawleyParameterFunction->setAttributeValue("CrystalSystem", crystalSystem); m_compositeFunction->checkFunction(); @@ -174,6 +196,23 @@ void PawleyFunction::setCrystalSystem(const std::string &crystalSystem) { void PawleyFunction::setProfileFunction(const std::string &profileFunction) { m_pawleyParameterFunction->setAttributeValue("ProfileFunction", profileFunction); + + // At this point PawleyParameterFunction guarantees that it's an IPeakFunction + for (size_t i = 0; i < m_peakProfileComposite->nFunctions(); ++i) { + IPeakFunction_sptr oldFunction = boost::dynamic_pointer_cast( + m_peakProfileComposite->getFunction(i)); + + IPeakFunction_sptr newFunction = boost::dynamic_pointer_cast( + FunctionFactory::Instance().createFunction( + m_pawleyParameterFunction->getProfileFunctionName())); + + newFunction->setCentre(oldFunction->centre()); + newFunction->setFwhm(oldFunction->fwhm()); + newFunction->setHeight(oldFunction->height()); + + m_peakProfileComposite->replaceFunction(i, newFunction); + } + m_compositeFunction->checkFunction(); } @@ -191,9 +230,26 @@ void PawleyFunction::functionDeriv1D(API::Jacobian *out, const double *xValues, UNUSED_ARG(nData); } -void PawleyFunction::addPeak() { - m_peakProfileComposite->addFunction( - FunctionFactory::Instance().createFunction("Gaussian")); +void PawleyFunction::addPeak(const Kernel::V3D &hkl, double centre, double fwhm, + double height) { + m_hkls.push_back(hkl); + + IPeakFunction_sptr peak = boost::dynamic_pointer_cast( + FunctionFactory::Instance().createFunction( + m_pawleyParameterFunction->getProfileFunctionName())); + + peak->setCentre(centre); + peak->setFwhm(fwhm); + peak->setHeight(height); + + m_peakProfileComposite->addFunction(peak); + + m_compositeFunction->checkFunction(); +} + +IPeakFunction_sptr PawleyFunction::getPeak(size_t i) const { + return boost::dynamic_pointer_cast( + m_peakProfileComposite->getFunction(i)); } void PawleyFunction::init() { diff --git a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h index 0086d7a9c699..7942404e49e1 100644 --- a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h @@ -263,14 +263,40 @@ class PawleyFunctionTest : public CxxTest::TestSuite { } void testPawleyFunctionSetCrystalSystem() { - PawleyFunction fn; - fn.initialize(); + PawleyFunction fn; + fn.initialize(); + + TS_ASSERT_EQUALS(fn.nParams(), 7); + + fn.setCrystalSystem("Cubic"); + + TS_ASSERT_EQUALS(fn.nParams(), 2); + } + + void testPawleyFunctionAddPeak() { + PawleyFunction fn; + fn.initialize(); + + TS_ASSERT_EQUALS(fn.nParams(), 7); + + fn.addPeak(V3D(), 2.0, 3.0, 4.0); + + TS_ASSERT_EQUALS(fn.nParams(), 10); + } + + void testPawleyFunctionSetProfileFunction() { + PawleyFunction fn; + fn.initialize(); + + TS_ASSERT_EQUALS(fn.nParams(), 7); + + fn.addPeak(V3D(), 2.0, 3.0, 4.0); - TS_ASSERT_EQUALS(fn.nParams(), 7); + TS_ASSERT_EQUALS(fn.nParams(), 10); - fn.setCrystalSystem("Cubic"); + fn.setProfileFunction("PseudoVoigt"); - TS_ASSERT_EQUALS(fn.nParams(), 2); + TS_ASSERT_EQUALS(fn.nParams(), 11); } private: From 881cf622a1e209c568bc8c9b7c7f317fd50dbaff Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Wed, 11 Mar 2015 16:06:47 +0000 Subject: [PATCH 005/126] Inital commit of apply corr algorithm Refs #10753 --- .../ApplyPaalmanPingsCorrection.py | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py new file mode 100644 index 000000000000..c01614768828 --- /dev/null +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py @@ -0,0 +1,136 @@ +from mantid.simpleapi import * +from mantid.api import PythonAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, WorkspaceGroupProperty, \ + FileProperty, FileAction, PropertyMode +from mantid.kernel import StringListValidator, StringMandatoryValidator, Direction, logger +from mantid import config +import math, os.path, numpy as np + +class ApplyPaalmanPingsCorrection(PythonAlgorithm): + + _sample_ws_name = None + _corrections_ws_name = None + _usecan = False + _can_ws_name = None + _can_corrections = False + _scale_can = False + _scale_factor = 1.0 + _output_ws_name = None + + def category(self): + return "Workflow\\MIDAS;PythonAlgorithms" + + def PyInit(self): + self.declareProperty(MatrixWorkspaceProperty('SampleWorkspace', '', direction=Direction.Input), + doc="Name for the input Sample workspace.") + self.declareProperty(WorkspaceGroupProperty('CorrectionsWorkspace', '', optional=PropertyMode.Optional, + direction=Direction.Input),doc="Name for the input Corrections workspace.") + + self.declareProperty(MatrixWorkspaceProperty('CanWorkspace', '', optional=PropertyMode.Optional, + direction=Direction.Input),doc="Name for the input Can workspace.") + self.declareProperty(name='CanScaleFactor', defaultValue='', doc = 'Factor to scale the can data') + + self.declareProperty(MatrixWorkspaceProperty('OutputWorkspace', '', direction=Direction.Output), + doc='The output corrections workspace.') + + def PyExec(self): + + workdir = config['defaultsave.directory'] + self._setup() + instrument = mtd[self._sample_ws_name].getInstrument() + axis = mtd[self._sample_ws_name].getAxis(0) + unit = axis.getUnit() + logger.information('x-unit is ' + unit.unitID()) +# this temporary WS is needed because ConvertUnits does not like named WS in a Group + self._corrections = '__converted_corrections' + + if self._usecan: + if unit.unitID() != 'Wavelength': + if unit.unitID() == 'dSpacing': + self._emode = 'Elastic' + target = 'dSpacing' + self._efixed = 0.0 + elif unit.unitID() == 'DeltaE': + self._emode = 'Indirect' + target = 'DeltaE' + self._efixed = instrument.getNumberParameter("efixed-val")[0] + else: + raise ValueError('Unit ' + unit.unitID() + ' is not supported') + ConvertUnits(InputWorkspace=self._corrections_ws_name, OutputWorkspace=self._corrections, + Target=target, EMode=self._emode, EFixed=self._efixed) + else: + CloneWorkspace(InputWorkspace=self._corrections_ws_name, OutputWorkspace=self._corrections) + + self._scaled_container = "__scaled_container" + if self.scale_can: + # Use temp workspace so we don't modify original data + Scale(InputWorkspace=self._can_ws_name, OutputWorkspace=self._scaled_container, + Factor=factor, Operation='Multiply') + logger.information('Container scaled by %f' % factor) + + else: + CloneWorkspace(InputWorkspace=self._can_ws_name, OutputWorkspace=self._scaled_container) + + if self._can_corrections: + self._correctSampleCan() + else: + self._subtract() + + else: + self._correctSample() + self.setPropertyValue('OutputWorkspace', self._output_ws_name) + + def _setup(self): + self._sample_ws_name = self.getPropertyValue('SampleWorkspace') + logger.information('Sample is ' + self._sample_ws_name) + self._corrections_ws_name = self.getPropertyValue('CorrectionsWorkspace') + if self._corrections_ws_name == '': + self._can_corrections = False + logger.information('NO corrections') + else: + self._can_corrections = True + logger.information('Corrections is ' + self._corrections_ws_name) + self._can_ws_name = self.getPropertyValue('CanWorkspace') + if self._can_ws_name == '': + self._usecan = False + logger.information('NO can') + else: + self._usecan = True + logger.information('Can is ' + self._can_ws_name) + if self._usecan: + scale_factor = float(self.getProperty('CanScaleFactor').value) + if scale_factor == 1.0: + self.scale_can = False + else: + self.scale_can = True + + if self._usecan == False and self._can_corrections == False: + raise ValueError('Nothing to do!') + + self._output_ws_name = self.getPropertyValue('OutputWorkspace') + + def _subtract(self): + Minus(LHSWorkspace=self._sample_ws_name, RHSWorkspace=self._scaled_container, + OutputWorkspace=self._output_ws_name) + + def _correctSample(self): +# Ass is group 1 + Divide(LHSWorkspace=self._sample_ws_name, RHSWorkspace=self._corrections+'_1', + OutputWorkspace=self._output_ws_name) + + def _correctSampleCan(self): + CorrectedCanWS = '__corrected_can' +# Acc is group 4 + Divide(LHSWorkspace=self._scaled_container, RHSWorkspace=self._corrections+'_4', + OutputWorkspace=CorrectedCanWS) +# Acsc is group 3 + Multiply(LHSWorkspace=CorrectedCanWS, RHSWorkspace=self._corrections+'_3', + OutputWorkspace=CorrectedCanWS) + Minus(LHSWorkspace=self._sample_ws_name, RHSWorkspace=CorrectedCanWS, + OutputWorkspace=self._output_ws_name) +# Assc is group 2 + Divide(LHSWorkspace=self._output_ws_name, RHSWorkspace=self._corrections+'_2', + OutputWorkspace=self._output_ws_name) + +# Register algorithm with Mantid +AlgorithmFactory.subscribe(ApplyPaalmanPingsCorrection) +# From 4ad731913a3c89af32bfbeca7b7215022b754231 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Sun, 15 Mar 2015 13:42:45 +0100 Subject: [PATCH 006/126] Refs #11043. Implementing function --- .../inc/MantidCurveFitting/PawleyFunction.h | 9 +++---- .../CurveFitting/src/PawleyFunction.cpp | 25 +++++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h index f7b795c82098..eba039cf0a51 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -4,7 +4,6 @@ #include "MantidKernel/System.h" #include "MantidAPI/CompositeFunction.h" #include "MantidAPI/FunctionParameterDecorator.h" -#include "MantidAPI/IFunction1D.h" #include "MantidAPI/IPeakFunction.h" #include "MantidAPI/ParamFunction.h" @@ -92,8 +91,7 @@ typedef boost::shared_ptr PawleyParameterFunction_sptr; File change history is stored at: Code Documentation is available at: */ -class PawleyFunction : public API::IFunction1D, - public API::FunctionParameterDecorator { +class PawleyFunction : public API::FunctionParameterDecorator { public: PawleyFunction(); virtual ~PawleyFunction() {} @@ -103,9 +101,8 @@ class PawleyFunction : public API::IFunction1D, void setCrystalSystem(const std::string &crystalSystem); void setProfileFunction(const std::string &profileFunction); - void function1D(double *out, const double *xValues, const size_t nData) const; - void functionDeriv1D(API::Jacobian *out, const double *xValues, - const size_t nData); + void function(const API::FunctionDomain &domain, + API::FunctionValues &values) const; void functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian) { calNumericalDeriv(domain, jacobian); diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp index 6fbed58fa980..48169a064bbb 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -184,6 +184,8 @@ void PawleyParameterFunction::setCenterParameterNameFromFunction( } } +DECLARE_FUNCTION(PawleyFunction) + PawleyFunction::PawleyFunction() : FunctionParameterDecorator(), m_compositeFunction(), m_pawleyParameterFunction(), m_peakProfileComposite(), m_hkls() {} @@ -216,18 +218,19 @@ void PawleyFunction::setProfileFunction(const std::string &profileFunction) { m_compositeFunction->checkFunction(); } -void PawleyFunction::function1D(double *out, const double *xValues, - const size_t nData) const { - UNUSED_ARG(out); - UNUSED_ARG(xValues); - UNUSED_ARG(nData); -} +void PawleyFunction::function(const FunctionDomain &domain, + FunctionValues &values) const { + UnitCell cell = m_pawleyParameterFunction->getUnitCellFromParameters(); + double zeroShift = m_pawleyParameterFunction->getParameter("ZeroShift"); + + for (size_t i = 0; i < m_hkls.size(); ++i) { + double d = cell.d(m_hkls[i]) + zeroShift; + m_peakProfileComposite->getFunction(i)->setParameter( + m_pawleyParameterFunction->getProfileFunctionCenterParameterName(), + d + zeroShift); + } -void PawleyFunction::functionDeriv1D(API::Jacobian *out, const double *xValues, - const size_t nData) { - UNUSED_ARG(out); - UNUSED_ARG(xValues); - UNUSED_ARG(nData); + m_peakProfileComposite->function(domain, values); } void PawleyFunction::addPeak(const Kernel::V3D &hkl, double centre, double fwhm, From c7cc0cea5bbb0eefbfb35ac957e50a83eed77759 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Mon, 16 Mar 2015 06:59:40 +0100 Subject: [PATCH 007/126] Refs #11043. PawleyFit-skeleton --- .../Framework/CurveFitting/CMakeLists.txt | 3 ++ .../inc/MantidCurveFitting/PawleyFit.h | 54 +++++++++++++++++++ .../Framework/CurveFitting/src/PawleyFit.cpp | 53 ++++++++++++++++++ .../CurveFitting/test/PawleyFitTest.h | 29 ++++++++++ 4 files changed, 139 insertions(+) create mode 100644 Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h create mode 100644 Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp create mode 100644 Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h diff --git a/Code/Mantid/Framework/CurveFitting/CMakeLists.txt b/Code/Mantid/Framework/CurveFitting/CMakeLists.txt index 61d8ae0cdad0..8f4a6046556b 100644 --- a/Code/Mantid/Framework/CurveFitting/CMakeLists.txt +++ b/Code/Mantid/Framework/CurveFitting/CMakeLists.txt @@ -67,6 +67,7 @@ set ( SRC_FILES src/NormaliseByPeakArea.cpp src/PRConjugateGradientMinimizer.cpp src/ParDomain.cpp + src/PawleyFit.cpp src/PawleyFunction.cpp src/PeakParameterFunction.cpp src/PlotPeakByLogValue.cpp @@ -180,6 +181,7 @@ set ( INC_FILES inc/MantidCurveFitting/NormaliseByPeakArea.h inc/MantidCurveFitting/PRConjugateGradientMinimizer.h inc/MantidCurveFitting/ParDomain.h + inc/MantidCurveFitting/PawleyFit.h inc/MantidCurveFitting/PawleyFunction.h inc/MantidCurveFitting/PeakParameterFunction.h inc/MantidCurveFitting/PlotPeakByLogValue.h @@ -284,6 +286,7 @@ set ( TEST_FILES NeutronBk2BkExpConvPVoigtTest.h NormaliseByPeakAreaTest.h PRConjugateGradientTest.h + PawleyFitTest.h PawleyFunctionTest.h PeakParameterFunctionTest.h PlotPeakByLogValueTest.h diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h new file mode 100644 index 000000000000..19f688288c00 --- /dev/null +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h @@ -0,0 +1,54 @@ +#ifndef MANTID_CURVEFITTING_PAWLEYFIT_H_ +#define MANTID_CURVEFITTING_PAWLEYFIT_H_ + +#include "MantidKernel/System.h" +#include "MantidAPI/Algorithm.h" + +namespace Mantid { +namespace CurveFitting { + +/** PawleyFit + + This algorithm uses the Pawley-method to refine lattice parameters using a + powder diffractogram and a list of unique Miller indices. From the initial + lattice parameters, theoretical reflection positions are calculated. Each + reflection is described by the peak profile function supplied by the user and + all parameters except the one for location of the reflection are freely + refined. Available lattice parameters depend on the selected crystal system. + + @author Michael Wedel, Paul Scherrer Institut - SINQ + @date 15/03/2015 + + Copyright © 2015 PSI-NXMM + + This file is part of Mantid. + + Mantid is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Mantid is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + File change history is stored at: + Code Documentation is available at: +*/ +class DLLExport PawleyFit : public API::Algorithm { +public: + virtual ~PawleyFit() {} + +protected: + void init(); + void exec(); +}; + +} // namespace CurveFitting +} // namespace Mantid + +#endif /* MANTID_CURVEFITTING_PAWLEYFIT_H_ */ diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp new file mode 100644 index 000000000000..68c835f8fd9c --- /dev/null +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -0,0 +1,53 @@ +#include "MantidCurveFitting/PawleyFit.h" + +#include "MantidKernel/ListValidator.h" + +namespace Mantid { +namespace CurveFitting { + +using namespace API; +using namespace Kernel; + +void PawleyFit::init() { + declareProperty(new WorkspaceProperty("InputWorkspace", "", + Direction::Input), + "Input workspace that contains the spectrum on which to " + "perform the Pawley fit."); + + std::vector crystalSystems; + crystalSystems.push_back("Cubic"); + crystalSystems.push_back("Tetragonal"); + crystalSystems.push_back("Hexagonal"); + crystalSystems.push_back("Trigonal"); + crystalSystems.push_back("Orthorhombic"); + crystalSystems.push_back("Monoclinic"); + crystalSystems.push_back("Triclinic"); + + auto crystalSystemValidator = + boost::make_shared(crystalSystems); + + declareProperty("CrystalSystem", crystalSystems.back(), + crystalSystemValidator, + "Crystal system to use for refinement."); + + declareProperty("InitialCell", "1.0 1.0 1.0 90.0 90.0 90.0", + "Specification of initial unit cell, given as 'a, b, c, " + "alpha, beta, gamma'."); + + declareProperty("MillerIndices", "[1,0,0];[1,1,0]", + "Semi-colon separated list of Miller indices given in the " + "format '[h,k,l]'."); + + // declareProperty(new WorkspaceProperty("OutputWorkspace", + // "", + // Direction::Output), + // "Workspace that contains measured spectrum, calculated " + // "spectrum and difference curve."); +} + +void exec() { + +} + +} // namespace CurveFitting +} // namespace Mantid diff --git a/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h b/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h new file mode 100644 index 000000000000..0d1049578f03 --- /dev/null +++ b/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h @@ -0,0 +1,29 @@ +#ifndef MANTID_CURVEFITTING_PAWLEYFITTEST_H_ +#define MANTID_CURVEFITTING_PAWLEYFITTEST_H_ + +#include + +#include "MantidCurveFitting/PawleyFit.h" + +using Mantid::CurveFitting::PawleyFit; +using namespace Mantid::API; + +class PawleyFitTest : public CxxTest::TestSuite +{ +public: + // This pair of boilerplate methods prevent the suite being created statically + // This means the constructor isn't called when running other tests + static PawleyFitTest *createSuite() { return new PawleyFitTest(); } + static void destroySuite( PawleyFitTest *suite ) { delete suite; } + + + void test_Something() + { + TSM_ASSERT( "You forgot to write a test!", 0); + } + + +}; + + +#endif /* MANTID_CURVEFITTING_PAWLEYFITTEST_H_ */ \ No newline at end of file From 0da4a984e4849ca38c2d176d1473cbfa08949342 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Mon, 16 Mar 2015 11:34:03 +0000 Subject: [PATCH 008/126] Further refactoring of algorithm Refs #10753 --- .../ApplyPaalmanPingsCorrection.py | 258 ++++++++++++------ 1 file changed, 168 insertions(+), 90 deletions(-) diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py index c01614768828..00891964587c 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py @@ -1,136 +1,214 @@ from mantid.simpleapi import * from mantid.api import PythonAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, WorkspaceGroupProperty, \ - FileProperty, FileAction, PropertyMode -from mantid.kernel import StringListValidator, StringMandatoryValidator, Direction, logger -from mantid import config -import math, os.path, numpy as np + PropertyMode +from mantid.kernel import Direction, logger + class ApplyPaalmanPingsCorrection(PythonAlgorithm): _sample_ws_name = None _corrections_ws_name = None - _usecan = False + _use_can = False _can_ws_name = None - _can_corrections = False + _use_corrections = False + _can_scale_factor = 1.0 _scale_can = False - _scale_factor = 1.0 _output_ws_name = None + _corrections = None + _scaled_container = None + def category(self): return "Workflow\\MIDAS;PythonAlgorithms" + + def summary(self): + return "Applies a calculated absorption correction in the Paalman and Pings factor style." + + def PyInit(self): - self.declareProperty(MatrixWorkspaceProperty('SampleWorkspace', '', direction=Direction.Input), - doc="Name for the input Sample workspace.") - self.declareProperty(WorkspaceGroupProperty('CorrectionsWorkspace', '', optional=PropertyMode.Optional, - direction=Direction.Input),doc="Name for the input Corrections workspace.") + self.declareProperty(MatrixWorkspaceProperty('SampleWorkspace', '', + direction=Direction.Input), + doc='Name for the input Sample workspace.') + + self.declareProperty(WorkspaceGroupProperty('CorrectionsWorkspace', '', + optional=PropertyMode.Optional, direction=Direction.Input), + doc='Name for the input Corrections workspace.') + + self.declareProperty(MatrixWorkspaceProperty('CanWorkspace', '', + optional=PropertyMode.Optional, direction=Direction.Input), + doc='Name for the input Can workspace.') - self.declareProperty(MatrixWorkspaceProperty('CanWorkspace', '', optional=PropertyMode.Optional, - direction=Direction.Input),doc="Name for the input Can workspace.") - self.declareProperty(name='CanScaleFactor', defaultValue='', doc = 'Factor to scale the can data') + self.declareProperty(name='CanScaleFactor', defaultValue=1.0, + doc='Factor to scale the can data') - self.declareProperty(MatrixWorkspaceProperty('OutputWorkspace', '', direction=Direction.Output), + self.declareProperty(MatrixWorkspaceProperty('OutputWorkspace', '', + direction=Direction.Output), doc='The output corrections workspace.') - def PyExec(self): - workdir = config['defaultsave.directory'] + def PyExec(self): self._setup() - instrument = mtd[self._sample_ws_name].getInstrument() - axis = mtd[self._sample_ws_name].getAxis(0) - unit = axis.getUnit() - logger.information('x-unit is ' + unit.unitID()) -# this temporary WS is needed because ConvertUnits does not like named WS in a Group - self._corrections = '__converted_corrections' - if self._usecan: - if unit.unitID() != 'Wavelength': - if unit.unitID() == 'dSpacing': - self._emode = 'Elastic' - target = 'dSpacing' - self._efixed = 0.0 - elif unit.unitID() == 'DeltaE': - self._emode = 'Indirect' - target = 'DeltaE' - self._efixed = instrument.getNumberParameter("efixed-val")[0] - else: - raise ValueError('Unit ' + unit.unitID() + ' is not supported') - ConvertUnits(InputWorkspace=self._corrections_ws_name, OutputWorkspace=self._corrections, - Target=target, EMode=self._emode, EFixed=self._efixed) - else: - CloneWorkspace(InputWorkspace=self._corrections_ws_name, OutputWorkspace=self._corrections) + if not self._use_corrections: + logger.information('Not using corrections') + if not self._use_can: + logger.information('Not using container') - self._scaled_container = "__scaled_container" - if self.scale_can: - # Use temp workspace so we don't modify original data - Scale(InputWorkspace=self._can_ws_name, OutputWorkspace=self._scaled_container, - Factor=factor, Operation='Multiply') - logger.information('Container scaled by %f' % factor) + instrument = mtd[self._sample_ws_name].getInstrument() + unit_id = mtd[self._sample_ws_name].getAxis(0).getUnit().unitID() + logger.information('x-unit is ' + unit_id) + + # Apply container scale factor if needed + if self._use_can: + if self._scale_can: + # Use temp workspace so we don't modify original data + Scale(InputWorkspace=self._can_ws_name, + OutputWorkspace=self._scaled_container, + Factor=self._can_scale_factor, + Operation='Multiply') + logger.information('Container scaled by %f' % self._can_scale_factor) + else: + CloneWorkspace(InputWorkspace=self._can_ws_name, + OutputWorkspace=self._scaled_container) + + if self._use_corrections: + # If the sample is not in wavelength then convert the corrections to + # whatever units the sample is in + if unit_id != 'Wavelength': + target = unit_id + if unit_id == 'dSpacing': + emode = 'Elastic' + efixed = 0.0 + elif unit_id == 'DeltaE': + emode = 'Indirect' + efixed = instrument.getNumberParameter('efixed-val')[0] + else: + raise ValueError('Unit %s in sample workspace is not supported' % unit_id) + ConvertUnits(InputWorkspace=self._corrections_ws_name, + OutputWorkspace=self._corrections, + Target=target, + EMode=emode, + EFixed=efixed) else: - CloneWorkspace(InputWorkspace=self._can_ws_name, OutputWorkspace=self._scaled_container) + CloneWorkspace(InputWorkspace=self._corrections_ws_name, + OutputWorkspace=self._corrections) - if self._can_corrections: - self._correctSampleCan() + if self._use_can: + # Use container factors + self._correct_sample_can() else: - self._subtract() + # Use sample factor only + self._correct_sample() else: - self._correctSample() + # Do simple subtraction + self._subtract() + self.setPropertyValue('OutputWorkspace', self._output_ws_name) + + def validateInputs(self): + """ + Validate user input. + """ + + self._setup() + issues = dict() + + # Need something to get corrections from + if not (self._use_can or self._use_corrections): + error_msg = 'Must provide either CorrectionsWorkspace or CanWorkspace or both' + issues['CorrectionsWorkspace'] = error_msg + issues['CanWorkspace'] = error_msg + + sample_unit_id = mtd[self._sample_ws_name].getAxis(0).getUnit().unitID() + + # Check sample and container X axis units match + if self._use_can: + can_unit_id = mtd[self._can_ws_name].getAxis(0).getUnit().unitID() + if can_unit_id != sample_unit_id: + issues['CanWorkspace'] = 'X axis unit must match SampleWorkspace' + + return issues + + def _setup(self): + """ + Get properties and setup instance variables. + """ + self._sample_ws_name = self.getPropertyValue('SampleWorkspace') - logger.information('Sample is ' + self._sample_ws_name) + self._output_ws_name = self.getPropertyValue('OutputWorkspace') + + # Get corrections workspace self._corrections_ws_name = self.getPropertyValue('CorrectionsWorkspace') - if self._corrections_ws_name == '': - self._can_corrections = False - logger.information('NO corrections') - else: - self._can_corrections = True - logger.information('Corrections is ' + self._corrections_ws_name) + self._use_corrections = self._corrections_ws_name != '' + + # Get container workspace self._can_ws_name = self.getPropertyValue('CanWorkspace') - if self._can_ws_name == '': - self._usecan = False - logger.information('NO can') - else: - self._usecan = True - logger.information('Can is ' + self._can_ws_name) - if self._usecan: - scale_factor = float(self.getProperty('CanScaleFactor').value) - if scale_factor == 1.0: - self.scale_can = False - else: - self.scale_can = True + self._use_can = self._can_ws_name != '' - if self._usecan == False and self._can_corrections == False: - raise ValueError('Nothing to do!') + self._can_scale_factor = self.getProperty('CanScaleFactor').value + self._scale_can = self._can_scale_factor != 1.0 + + # This temporary WS is needed because ConvertUnits does not like named WS in a Group + self._corrections = '__converted_corrections' + self._scaled_container = '__scaled_container' - self._output_ws_name = self.getPropertyValue('OutputWorkspace') def _subtract(self): - Minus(LHSWorkspace=self._sample_ws_name, RHSWorkspace=self._scaled_container, - OutputWorkspace=self._output_ws_name) + """ + Do a simple container subtraction (when no corrections are given). + """ - def _correctSample(self): -# Ass is group 1 - Divide(LHSWorkspace=self._sample_ws_name, RHSWorkspace=self._corrections+'_1', - OutputWorkspace=self._output_ws_name) + logger.information('Using simple container subtraction') - def _correctSampleCan(self): - CorrectedCanWS = '__corrected_can' -# Acc is group 4 - Divide(LHSWorkspace=self._scaled_container, RHSWorkspace=self._corrections+'_4', - OutputWorkspace=CorrectedCanWS) -# Acsc is group 3 - Multiply(LHSWorkspace=CorrectedCanWS, RHSWorkspace=self._corrections+'_3', - OutputWorkspace=CorrectedCanWS) - Minus(LHSWorkspace=self._sample_ws_name, RHSWorkspace=CorrectedCanWS, + Minus(LHSWorkspace=self._sample_ws_name, + RHSWorkspace=self._scaled_container, OutputWorkspace=self._output_ws_name) -# Assc is group 2 - Divide(LHSWorkspace=self._output_ws_name, RHSWorkspace=self._corrections+'_2', + + + def _correct_sample(self): + """ + Correct for sample only (when no container is given). + """ + + logger.information('Correcting sample') + + # Ass + Divide(LHSWorkspace=self._sample_ws_name, + RHSWorkspace=self._corrections + '_ass', + OutputWorkspace=self._output_ws_name) + + + def _correct_sample_can(self): + """ + Correct for sample and container. + """ + + logger.information('Correcting sample and container') + corrected_can_ws = '__corrected_can' + + # Acc + Divide(LHSWorkspace=self._scaled_container, + RHSWorkspace=self._corrections + '_acc', + OutputWorkspace=corrected_can_ws) + + # Acsc + Multiply(LHSWorkspace=corrected_can_ws, + RHSWorkspace=self._corrections + '_acsc', + OutputWorkspace=corrected_can_ws) + Minus(LHSWorkspace=self._sample_ws_name, + RHSWorkspace=corrected_can_ws, OutputWorkspace=self._output_ws_name) + # Assc + Divide(LHSWorkspace=self._output_ws_name, + RHSWorkspace=self._corrections + '_assc', + OutputWorkspace=self._output_ws_name) + + # Register algorithm with Mantid AlgorithmFactory.subscribe(ApplyPaalmanPingsCorrection) -# From 38fde9f9ea800a9c0a9c1d37dd66379c8f458d08 Mon Sep 17 00:00:00 2001 From: Federico Montesino Pouzols Date: Mon, 16 Mar 2015 12:45:20 +0000 Subject: [PATCH 009/126] Added IRemoteJobManager interface, re #11123 --- Code/Mantid/Framework/Kernel/CMakeLists.txt | 1 + .../inc/MantidKernel/IRemoteJobManager.h | 276 ++++++++++++++++++ 2 files changed, 277 insertions(+) create mode 100644 Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h diff --git a/Code/Mantid/Framework/Kernel/CMakeLists.txt b/Code/Mantid/Framework/Kernel/CMakeLists.txt index 887bba027157..6f70ef56c341 100644 --- a/Code/Mantid/Framework/Kernel/CMakeLists.txt +++ b/Code/Mantid/Framework/Kernel/CMakeLists.txt @@ -165,6 +165,7 @@ set ( INC_FILES inc/MantidKernel/InstrumentInfo.h inc/MantidKernel/InternetHelper.h inc/MantidKernel/Interpolation.h + inc/MantidKernel/IRemoteJobManager.h inc/MantidKernel/LibraryManager.h inc/MantidKernel/LibraryWrapper.h inc/MantidKernel/ListValidator.h diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h new file mode 100644 index 000000000000..99372b058fdd --- /dev/null +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h @@ -0,0 +1,276 @@ +#ifndef IREMOTEJOBMANAGER_H +#define IREMOTEJOBMANAGER_H + +#include "MantidKernel/DllConfig.h" + +namespace Mantid { +namespace Kernel { +/** +Common interface to different remote job managers (job schedulers, web +services, etc. such as MOAB, Platform LSF, or SLURM). + +IremoteJobManager objects are (in principle) created via the +RemoteJobManagerFactory. There are several "remote algorithms" in +Mantid: Authenticate, SubmitRemoteJob, QueryRemoteJobStatus, +etc. These algorithms are meant to use this interface to the different +specific implementations. Or, from the opposite angle, the methods of +this interface provide the functionality required by the remote +algorithms in a generic way (with respect to different job schedulers +or underlying mechanisms to handle remote jobs). So-called remote job +manager classes can implement this interface to provide +specialisations for Platform LSF, SLURM, MOAB, the Mantid web service +API, etc. + +A typical sequence of calls when you use this interface would be: + +1) Authenticate/log-in (authenticate()) +2) Do transactions + +Where the sequence of calls within a transaction is: + +2.1) Start transaction (startRemoteTransaction()) +2.2) Do actions +2.3) Stop transaction (stopRemoteTransaction()) + +In 2.2, several types of actions are possible: +- Submit a job to run on the (remote) compute resource (submitRemoteJob()). +- Get status info for one or all jobs (queryRemoteJob() and +queryAllRemoteJobs()). +- Cancel a job (abortRemoteJob()). +- Get list of available files for a transaction on the compute resource +(queryRemoteFile()) +- Upload / download files ( uploadRemoteFile() and downloadRemoteFile()). + + +Copyright © 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge +National Laboratory & European Spallation Source + +This file is part of Mantid. + +Mantid is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +Mantid is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +File change history is stored at: . +Code Documentation is available at: +*/ +class MANTID_KERNEL_DLL IRemoteJobManager { +public: + virtual ~IRemoteJobManager(){}; + + /** + * Status and general information about jobs running on (remote) + * compute resources. + */ + struct RemoteJobInfo { + /// Job ID, usually assigned by a job scheduler as an integer + /// number or similar. + std::string id; + /// name of the job, whether given by the user or automatically + /// assigned by the job scheduler + std::string name; + /// Name of the script or executable. Depending on the specific + /// implementation, job scheduler, etc. this can be an + /// 'application' name, a script name or different ways of + /// specifying what is run + std::string runnableName; + /// Last status retrieved (typically: Pending, Running, Exited, + /// etc.). The values are implementation/job scheduler dependent. + std::string status; + /// ID of the transaction where this job is included + std::string transactionID; + /// Date-time of submission. No particular format can be assumed + std::string submitDate; + /// Date-time the job actually started running. No particular + /// format can be assumed + std::string startDate; + /// Date-time the job finished. No particular format can be + /// assumed + std::string completionTime; + }; + + /** + * Authenticate or log-in, previous to submitting jobs, up/downloading, etc. + * + * @param username User name or credentials + * + * @param password Password (or other type of authentication token) + * string. + * + * @throws std::invalid_argument If any of the inputs is not set + * properly. + * @throws std::runtime_error If authentication fails + */ + virtual void authenticate(std::string &username, std::string &password) = 0; + + /** + * Submit a job (and implicitly request to start it) within a + * transaction. + * + * @param transactionID ID obtained from a startRemoteTransaction() + * + * @param runnable Name of the script or executable for the + * job. This can be a name or path to a file (implementation + * dependent). + * + * @param param Parameters for the job. This is implementation + * dependent and may be a list of command line options, the name of + * a script or configuration file, the contents of a script to run + * or configuration template, etc. For example, for the Mantid web + * service API, this is the content of a python script. + * + * @param taskName (optional) human readable name for this job. + * + * @param numNodes number of nodes to use (optional and dependent on + * implementation and compute resource) + * + * @parm coresPerNode number of cores to use in each node (optional + * and dependent on implemenation and compute resource) + * + * @return jobID string for the job started (if successful). + * + * @throws std::invalid_argument If any of the inputs is not set + * properly. + * @throws std::runtime_error if job submission fails. + */ + virtual std::string + submitRemoteJob(const std::string &transactionID, const std::string &runnable, + const std::string ¶m, const std::string &taskName = "", + const int numNodes = 1, const int coresPerNode = 1) = 0; + + /** + * Get/download a file from the (remote) compute resource. + * + * @param transactionID ID obtained from a startRemoteTransaction() + * + * @param remoteFileName Name of file on the (remote) compute + * resource. This can be a full or relative path or a simple file + * name, depending on implementation. + * + * @param localFileName Where to place the downloaded file on the + * local machine. + * + * @throws std::invalid_argument If any of the inputs is not set + * properly. + * @throws std::runtime_error If the download operation fails + */ + virtual void downloadRemoteFile(const std::string &transactionID, + const std::string &remoteFileName, + const std::string &localFileName) = 0; + + /** + * Get information (status etc.) for all running jobs on the remote + * compute resource + * + * @return Status and general info for all the jobs found on the + * (remote) compute resource. Each of them should come identified by + * its ID. + * + * @throws std::runtime_error If the query fails + */ + virtual std::vector queryAllRemoteJobs() = 0; + + /** + * Get the list of files available for a transaction at the (remote) + * compute resource. + * + * @param transactionID ID obtained from startRemoteTransaction() + * + * @return The names of all the available files + * + * @throws std::invalid_argument If there's an issue with the + * transaction ID + * + * @throws std::runtime_error If the query fails + */ + virtual std::vector + queryRemoteFile(const std::string &transactionID) = 0; + + /** + * Get information (status etc.) for an (in principle) running job + * + * @param jobID ID of a job as obtained from submitRemoteJob() + * + * @return Status and general info for the job requested + * + * @throws std::invalid_argument If there's an issue with the + * job ID + * + * @throws std::runtime_error If the query fails + */ + virtual RemoteJobInfo queryRemoteJob(const std::string &jobID) = 0; + + /** + * Start a transaction before up/downloading files and submitting + * jobs + * + * @return ID of the transaction as produced by the job scheduler + * and/or remote job manager. + * + * @throws std::runtime_error If the transaction creation fails + */ + virtual std::string startRemoteTransaction() = 0; + + /** + * Finish a transaction. This implicitly can cancel all the + * operations (jobs) associated with this transaction. + * + * @param transactionID An Id of a transaction, as returned by + * startRemoteTransaction() + * + * @throws std::invalid_argument If there's an issue with the + * transaction ID + * + * @throws std::runtime_error If the stop operation fails + */ + virtual void stopRemoteTransaction(const std::string &transactionID) = 0; + + /** + * Cancel a job (expected to be currently running on the remote resource) + * + * @param jobID ID for a job in a transaction, as returned by + * submitRemoteJob() + * + * @throws std::invalid_argument If there's an issue with the + * job ID + * @throws std::runtime_error If the abort/cancel operation fails + */ + virtual void abortRemoteJob(const std::string &jobID) = 0; + + /** + * Upload file for a transaction on the rmeote compute resource + * + * @param transactionID ID, as you get them from + * startRemoteTransaction() + * + * @param remoteFileName Name of file on the (remote) compute + * resource. This can be a full or relative path or a simple file + * name, depending on implementation. + * + * @param localFileName Path to the file to upload + * + * @throws std::invalid_argument If there's an issue with the + * arguments passed + * @throws std::runtime_error If the upload fails + */ + virtual void uploadRemoteFile(const std::string &transactionID, + const std::string &remoteFileName, + const std::string &localFileName) = 0; +}; + +// shared pointer type for the IRemoteJobManager +typedef boost::shared_ptr IRemoteJobManager_sptr; + +} // namespace Kernel +} // namespace Mantid + +#endif // IREMOTEJOBMANAGER_H From 5bbc66e0524630201da57955e446e3efef6cd995 Mon Sep 17 00:00:00 2001 From: Federico Montesino Pouzols Date: Mon, 16 Mar 2015 12:58:07 +0000 Subject: [PATCH 010/126] Make the clear-cut const methods const, re #11123 --- .../Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h index 99372b058fdd..0314198e6dfc 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h @@ -177,7 +177,7 @@ class MANTID_KERNEL_DLL IRemoteJobManager { * * @throws std::runtime_error If the query fails */ - virtual std::vector queryAllRemoteJobs() = 0; + virtual std::vector queryAllRemoteJobs() const = 0; /** * Get the list of files available for a transaction at the (remote) @@ -193,7 +193,7 @@ class MANTID_KERNEL_DLL IRemoteJobManager { * @throws std::runtime_error If the query fails */ virtual std::vector - queryRemoteFile(const std::string &transactionID) = 0; + queryRemoteFile(const std::string &transactionID) const = 0; /** * Get information (status etc.) for an (in principle) running job @@ -207,7 +207,7 @@ class MANTID_KERNEL_DLL IRemoteJobManager { * * @throws std::runtime_error If the query fails */ - virtual RemoteJobInfo queryRemoteJob(const std::string &jobID) = 0; + virtual RemoteJobInfo queryRemoteJob(const std::string &jobID) const = 0; /** * Start a transaction before up/downloading files and submitting From 75d80b49011baa5d313258fc15010537c9ac01e7 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Mon, 16 Mar 2015 17:23:49 +0100 Subject: [PATCH 011/126] Refs #11043. Extending peak handling in PawleyFunction --- .../inc/MantidCurveFitting/PawleyFunction.h | 13 +++- .../CurveFitting/src/PawleyFunction.cpp | 68 ++++++++++++++++++- .../CurveFitting/test/PawleyFunctionTest.h | 2 +- 3 files changed, 76 insertions(+), 7 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h index eba039cf0a51..67f10961999d 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -25,6 +25,7 @@ class DLLExport PawleyParameterFunction : virtual public API::IFunction, Geometry::PointGroup::CrystalSystem getCrystalSystem() const; Geometry::UnitCell getUnitCellFromParameters() const; + void setParametersFromUnitCell(const Geometry::UnitCell &cell); std::string getProfileFunctionName() const { return getAttribute("ProfileFunction").asString(); @@ -100,6 +101,7 @@ class PawleyFunction : public API::FunctionParameterDecorator { void setCrystalSystem(const std::string &crystalSystem); void setProfileFunction(const std::string &profileFunction); + void setUnitCell(const std::string &unitCellString); void function(const API::FunctionDomain &domain, API::FunctionValues &values) const; @@ -108,9 +110,14 @@ class PawleyFunction : public API::FunctionParameterDecorator { calNumericalDeriv(domain, jacobian); } - void addPeak(const Kernel::V3D &hkl, double centre, double fwhm, - double height); - API::IPeakFunction_sptr getPeak(size_t i) const; + void setPeaks(const std::vector &hkls, double fwhm, + double height); + + void clearPeaks(); + + void addPeak(const Kernel::V3D &hkl, double fwhm, double height); + API::IPeakFunction_sptr getPeakFunction(size_t i) const; + Kernel::V3D getPeakHKL(size_t i) const; protected: void init(); diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp index 48169a064bbb..409e83489e7a 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -68,6 +68,44 @@ UnitCell PawleyParameterFunction::getUnitCellFromParameters() const { return UnitCell(); } +void PawleyParameterFunction::setParametersFromUnitCell(const UnitCell &cell) { + // Parameter "a" exists in all crystal systems. + setParameter("a", cell.a()); + + try { + setParameter("b", cell.b()); + } + catch (std::invalid_argument) { + // do nothing. + } + + try { + setParameter("c", cell.c()); + } + catch (std::invalid_argument) { + // do nothing + } + + try { + setParameter("Alpha", cell.alpha()); + } + catch (std::invalid_argument) { + // do nothing. + } + try { + setParameter("Beta", cell.beta()); + } + catch (std::invalid_argument) { + // do nothing. + } + try { + setParameter("Gamma", cell.gamma()); + } + catch (std::invalid_argument) { + // do nothing. + } +} + void PawleyParameterFunction::function(const FunctionDomain &domain, FunctionValues &values) const { UNUSED_ARG(domain); @@ -218,6 +256,11 @@ void PawleyFunction::setProfileFunction(const std::string &profileFunction) { m_compositeFunction->checkFunction(); } +void PawleyFunction::setUnitCell(const std::string &unitCellString) { + m_pawleyParameterFunction->setParametersFromUnitCell( + strToUnitCell(unitCellString)); +} + void PawleyFunction::function(const FunctionDomain &domain, FunctionValues &values) const { UnitCell cell = m_pawleyParameterFunction->getUnitCellFromParameters(); @@ -233,7 +276,23 @@ void PawleyFunction::function(const FunctionDomain &domain, m_peakProfileComposite->function(domain, values); } -void PawleyFunction::addPeak(const Kernel::V3D &hkl, double centre, double fwhm, +void PawleyFunction::clearPeaks() { + m_peakProfileComposite = boost::dynamic_pointer_cast( + FunctionFactory::Instance().createFunction("CompositeFunction")); + m_compositeFunction->replaceFunction(1, m_peakProfileComposite); + m_hkls.clear(); +} + +void PawleyFunction::setPeaks(const std::vector &hkls, double fwhm, + double height) { + clearPeaks(); + + for (size_t i = 0; i < hkls.size(); ++i) { + addPeak(hkls[i], fwhm, height); + } +} + +void PawleyFunction::addPeak(const Kernel::V3D &hkl, double fwhm, double height) { m_hkls.push_back(hkl); @@ -241,7 +300,8 @@ void PawleyFunction::addPeak(const Kernel::V3D &hkl, double centre, double fwhm, FunctionFactory::Instance().createFunction( m_pawleyParameterFunction->getProfileFunctionName())); - peak->setCentre(centre); + peak->fix(peak->parameterIndex( + m_pawleyParameterFunction->getProfileFunctionCenterParameterName())); peak->setFwhm(fwhm); peak->setHeight(height); @@ -250,11 +310,13 @@ void PawleyFunction::addPeak(const Kernel::V3D &hkl, double centre, double fwhm, m_compositeFunction->checkFunction(); } -IPeakFunction_sptr PawleyFunction::getPeak(size_t i) const { +IPeakFunction_sptr PawleyFunction::getPeakFunction(size_t i) const { return boost::dynamic_pointer_cast( m_peakProfileComposite->getFunction(i)); } +Kernel::V3D PawleyFunction::getPeakHKL(size_t i) const { return m_hkls[i]; } + void PawleyFunction::init() { setDecoratedFunction("CompositeFunction"); diff --git a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h index 7942404e49e1..438671f17778 100644 --- a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h @@ -279,7 +279,7 @@ class PawleyFunctionTest : public CxxTest::TestSuite { TS_ASSERT_EQUALS(fn.nParams(), 7); - fn.addPeak(V3D(), 2.0, 3.0, 4.0); + fn.addPeak(V3D(), 3.0, 4.0); TS_ASSERT_EQUALS(fn.nParams(), 10); } From 65a71b5abf27fe86e417b66bfe2ac8d495da9bfa Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Mon, 16 Mar 2015 17:24:13 +0100 Subject: [PATCH 012/126] Refs #11043. First working version of PawleyFit --- .../inc/MantidCurveFitting/PawleyFit.h | 7 ++ .../Framework/CurveFitting/src/PawleyFit.cpp | 70 +++++++++++++++++-- 2 files changed, 71 insertions(+), 6 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h index 19f688288c00..b6e58cbb79c7 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h @@ -43,7 +43,14 @@ class DLLExport PawleyFit : public API::Algorithm { public: virtual ~PawleyFit() {} + const std::string name() const { return "PawleyFit"; } + int version() const { return 1; } + const std::string summary() const; + protected: + + std::vector hklsFromString(const std::string &hklString) const; + void init(); void exec(); }; diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index 68c835f8fd9c..9118bddbfba2 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -1,12 +1,38 @@ #include "MantidCurveFitting/PawleyFit.h" +#include "MantidAPI/FunctionFactory.h" +#include "MantidCurveFitting/PawleyFunction.h" + +#include "MantidGeometry/Crystal/UnitCell.h" #include "MantidKernel/ListValidator.h" +#include + namespace Mantid { namespace CurveFitting { using namespace API; using namespace Kernel; +using namespace Geometry; + +DECLARE_ALGORITHM(PawleyFit); + +const std::string PawleyFit::summary() const { + return "This algorithm performs a Pawley-fit on the supplied workspace."; +} + +std::vector PawleyFit::hklsFromString(const std::string &hklString) const { + std::vector hklStrings; + boost::split(hklStrings, hklString, boost::is_any_of(";")); + + std::vector hkls(hklStrings.size()); + for (size_t i = 0; i < hkls.size(); ++i) { + std::istringstream strm(hklStrings[i]); + strm >> hkls[i]; + } + + return hkls; +} void PawleyFit::init() { declareProperty(new WorkspaceProperty("InputWorkspace", "", @@ -14,6 +40,9 @@ void PawleyFit::init() { "Input workspace that contains the spectrum on which to " "perform the Pawley fit."); + declareProperty("WorkspaceIndex", 0, + "Spectrum on which the fit should be performed."); + std::vector crystalSystems; crystalSystems.push_back("Cubic"); crystalSystems.push_back("Tetragonal"); @@ -38,15 +67,44 @@ void PawleyFit::init() { "Semi-colon separated list of Miller indices given in the " "format '[h,k,l]'."); - // declareProperty(new WorkspaceProperty("OutputWorkspace", - // "", - // Direction::Output), - // "Workspace that contains measured spectrum, calculated " - // "spectrum and difference curve."); + declareProperty(new WorkspaceProperty("OutputWorkspace", "", + Direction::Output), + "Workspace that contains measured spectrum, calculated " + "spectrum and difference curve."); } -void exec() { +void PawleyFit::exec() { + boost::shared_ptr pawleyFn = + boost::dynamic_pointer_cast( + FunctionFactory::Instance().createFunction("PawleyFunction")); + + //pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift")); + + pawleyFn->setCrystalSystem(getProperty("CrystalSystem")); + pawleyFn->setUnitCell(getProperty("InitialCell")); + + std::vector hkls = hklsFromString(getProperty("MillerIndices")); + + pawleyFn->setPeaks(hkls, 0.002, 20000.0); + + Algorithm_sptr fit = createChildAlgorithm("Fit"); + fit->setProperty("Function", boost::static_pointer_cast(pawleyFn)); + + MatrixWorkspace_sptr ws = getProperty("InputWorkspace"); + + fit->setProperty("InputWorkspace", ws); + fit->setProperty("CreateOutput", true); + + fit->execute(); + + for (size_t i = 0; i < pawleyFn->nParams(); ++i) { + std::cout << i << " " << pawleyFn->parameterName(i) << " " + << pawleyFn->getParameter(i) << " " << pawleyFn->getError(i) + << std::endl; + } + MatrixWorkspace_sptr output = fit->getProperty("OutputWorkspace"); + setProperty("OutputWorkspace", output); } } // namespace CurveFitting From d3e3c0d10cb51fdcea89d6c4e41b150b5356239d Mon Sep 17 00:00:00 2001 From: Federico Montesino Pouzols Date: Mon, 16 Mar 2015 17:00:24 +0000 Subject: [PATCH 013/126] more specific header define, re #11123 --- .../Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h index 0314198e6dfc..359619a09de1 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h @@ -1,5 +1,5 @@ -#ifndef IREMOTEJOBMANAGER_H -#define IREMOTEJOBMANAGER_H +#ifndef MANTID_KERNEL_IREMOTEJOBMANAGER_H +#define MANTID_KERNEL_IREMOTEJOBMANAGER_H #include "MantidKernel/DllConfig.h" @@ -273,4 +273,4 @@ typedef boost::shared_ptr IRemoteJobManager_sptr; } // namespace Kernel } // namespace Mantid -#endif // IREMOTEJOBMANAGER_H +#endif // MANTID_KERNEL_IREMOTEJOBMANAGER_H From d4330d2487d522d11269d68a7327f9789bf4b5e9 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Mon, 16 Mar 2015 23:43:12 +0100 Subject: [PATCH 014/126] Refs #11043. Additional option. --- .../Framework/CurveFitting/src/PawleyFit.cpp | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index 9118bddbfba2..d8e0d9d784e1 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -67,6 +67,10 @@ void PawleyFit::init() { "Semi-colon separated list of Miller indices given in the " "format '[h,k,l]'."); + declareProperty("RefineZeroShift", false, "If checked, a zero-shift with the " + "same unit as the spectrum is " + "refined."); + declareProperty(new WorkspaceProperty("OutputWorkspace", "", Direction::Output), "Workspace that contains measured spectrum, calculated " @@ -78,21 +82,27 @@ void PawleyFit::exec() { boost::dynamic_pointer_cast( FunctionFactory::Instance().createFunction("PawleyFunction")); - //pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift")); + bool refineZeroShift = getProperty("RefineZeroShift"); + if(!refineZeroShift) { + pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift")); + } + pawleyFn->setProfileFunction("PseudoVoigt"); pawleyFn->setCrystalSystem(getProperty("CrystalSystem")); pawleyFn->setUnitCell(getProperty("InitialCell")); std::vector hkls = hklsFromString(getProperty("MillerIndices")); - pawleyFn->setPeaks(hkls, 0.002, 20000.0); + MatrixWorkspace_sptr ws = getProperty("InputWorkspace"); + int wsIndex = getProperty("WorkspaceIndex"); + + const MantidVec &data = ws->readY(static_cast(wsIndex)); + pawleyFn->setPeaks(hkls, 0.008, *(std::max_element(data.begin(), data.end()))); Algorithm_sptr fit = createChildAlgorithm("Fit"); fit->setProperty("Function", boost::static_pointer_cast(pawleyFn)); - - MatrixWorkspace_sptr ws = getProperty("InputWorkspace"); - fit->setProperty("InputWorkspace", ws); + fit->setProperty("WorkspaceIndex", wsIndex); fit->setProperty("CreateOutput", true); fit->execute(); From 0628fc061434e13c44cc811c391eb99f9854b60e Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Tue, 17 Mar 2015 07:24:33 +0100 Subject: [PATCH 015/126] Refs #11043. Fixing parameter at right place, profile function name --- .../Framework/CurveFitting/src/PawleyFit.cpp | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index d8e0d9d784e1..127ac4324c6c 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -71,6 +71,12 @@ void PawleyFit::init() { "same unit as the spectrum is " "refined."); + auto peakFunctionValidator = boost::make_shared( + FunctionFactory::Instance().getFunctionNames()); + + declareProperty("PeakProfileFunction", "Gaussian", peakFunctionValidator, + "Profile function that is used for each peak."); + declareProperty(new WorkspaceProperty("OutputWorkspace", "", Direction::Output), "Workspace that contains measured spectrum, calculated " @@ -82,12 +88,7 @@ void PawleyFit::exec() { boost::dynamic_pointer_cast( FunctionFactory::Instance().createFunction("PawleyFunction")); - bool refineZeroShift = getProperty("RefineZeroShift"); - if(!refineZeroShift) { - pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift")); - } - - pawleyFn->setProfileFunction("PseudoVoigt"); + pawleyFn->setProfileFunction(getProperty("PeakProfileFunction")); pawleyFn->setCrystalSystem(getProperty("CrystalSystem")); pawleyFn->setUnitCell(getProperty("InitialCell")); @@ -97,7 +98,13 @@ void PawleyFit::exec() { int wsIndex = getProperty("WorkspaceIndex"); const MantidVec &data = ws->readY(static_cast(wsIndex)); - pawleyFn->setPeaks(hkls, 0.008, *(std::max_element(data.begin(), data.end()))); + pawleyFn->setPeaks(hkls, 0.008, + *(std::max_element(data.begin(), data.end()))); + + bool refineZeroShift = getProperty("RefineZeroShift"); + if (!refineZeroShift) { + pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift")); + } Algorithm_sptr fit = createChildAlgorithm("Fit"); fit->setProperty("Function", boost::static_pointer_cast(pawleyFn)); From e8676f9b5480f969a1fa2cfffe2ffc3a1d82d453 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Tue, 17 Mar 2015 09:14:17 +0100 Subject: [PATCH 016/126] Refs #11043. Add setWorkspace to FunctionParameterDecorator The setWorkspace and setMatrixWorkspace methods were not implemented in FunctionParameterDecorator --- .../MantidAPI/FunctionParameterDecorator.h | 5 ++++ .../API/src/FunctionParameterDecorator.cpp | 23 +++++++++++--- .../API/test/FunctionParameterDecoratorTest.h | 30 ++++++++++++++++++- 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/FunctionParameterDecorator.h b/Code/Mantid/Framework/API/inc/MantidAPI/FunctionParameterDecorator.h index 533c9942cdd2..78fd23781cbf 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/FunctionParameterDecorator.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/FunctionParameterDecorator.h @@ -50,6 +50,11 @@ class MANTID_API_DLL FunctionParameterDecorator : virtual public IFunction { IFunction_sptr clone() const; + virtual void setWorkspace(boost::shared_ptr ws); + virtual void + setMatrixWorkspace(boost::shared_ptr workspace, + size_t wi, double startX, double endX); + /// Set i-th parameter of decorated function. virtual void setParameter(size_t i, const double &value, bool explicitlySet = true); diff --git a/Code/Mantid/Framework/API/src/FunctionParameterDecorator.cpp b/Code/Mantid/Framework/API/src/FunctionParameterDecorator.cpp index 9c1a1e80045a..0f953040eaee 100644 --- a/Code/Mantid/Framework/API/src/FunctionParameterDecorator.cpp +++ b/Code/Mantid/Framework/API/src/FunctionParameterDecorator.cpp @@ -37,6 +37,21 @@ IFunction_sptr FunctionParameterDecorator::clone() const { return cloned; } +void FunctionParameterDecorator::setWorkspace( + boost::shared_ptr ws) { + throwIfNoFunctionSet(); + + m_wrappedFunction->setWorkspace(ws); +} + +void FunctionParameterDecorator::setMatrixWorkspace( + boost::shared_ptr workspace, size_t wi, + double startX, double endX) { + throwIfNoFunctionSet(); + + m_wrappedFunction->setMatrixWorkspace(workspace, wi, startX, endX); +} + void FunctionParameterDecorator::setParameter(size_t i, const double &value, bool explicitlySet) { throwIfNoFunctionSet(); @@ -91,8 +106,8 @@ double FunctionParameterDecorator::getParameter(const std::string &name) const { } size_t FunctionParameterDecorator::nParams() const { - if(!m_wrappedFunction) { - return 0; + if (!m_wrappedFunction) { + return 0; } return m_wrappedFunction->nParams(); @@ -161,8 +176,8 @@ size_t FunctionParameterDecorator::getParameterIndex( } size_t FunctionParameterDecorator::nAttributes() const { - if(!m_wrappedFunction) { - return 0; + if (!m_wrappedFunction) { + return 0; } return m_wrappedFunction->nAttributes(); diff --git a/Code/Mantid/Framework/API/test/FunctionParameterDecoratorTest.h b/Code/Mantid/Framework/API/test/FunctionParameterDecoratorTest.h index 4cea527b1a51..a586f2481d8d 100644 --- a/Code/Mantid/Framework/API/test/FunctionParameterDecoratorTest.h +++ b/Code/Mantid/Framework/API/test/FunctionParameterDecoratorTest.h @@ -6,7 +6,9 @@ #include "MantidAPI/FunctionParameterDecorator.h" #include "MantidAPI/ParamFunction.h" #include "MantidAPI/FunctionFactory.h" +#include "MantidAPI/WorkspaceGroup.h" #include "MantidKernel/Exception.h" + #include #include @@ -48,7 +50,7 @@ DECLARE_FUNCTION(TestableFunctionParameterDecorator); class FunctionWithParameters : public ParamFunction { public: - FunctionWithParameters() : ParamFunction() {} + FunctionWithParameters() : ParamFunction(), m_workspace() {} std::string name() const { return "FunctionWithParameters"; } @@ -63,6 +65,13 @@ class FunctionWithParameters : public ParamFunction { UNUSED_ARG(values); // Does nothing, not required for this test. } + + void setWorkspace(boost::shared_ptr ws) { m_workspace = ws; } + + Workspace_const_sptr getWorkspace() const { return m_workspace; } + +private: + Workspace_const_sptr m_workspace; }; DECLARE_FUNCTION(FunctionWithParameters); @@ -349,6 +358,25 @@ class FunctionParameterDecoratorTest : public CxxTest::TestSuite { TS_ASSERT_EQUALS(cloned->getParameter("Sigma"), 0.3); } + void testSetWorkspace() { + // using WorkspaceGroup because it is in API + Workspace_const_sptr ws = boost::make_shared(); + + TestableFunctionParameterDecorator invalidFn; + TS_ASSERT_THROWS(invalidFn.setWorkspace(ws), std::runtime_error); + + FunctionParameterDecorator_sptr fn = + getFunctionParameterDecoratorGaussian(); + + TS_ASSERT_THROWS_NOTHING(fn->setWorkspace(ws)); + + boost::shared_ptr decorated = + boost::dynamic_pointer_cast( + fn->getDecoratedFunction()); + + TS_ASSERT_EQUALS(decorated->getWorkspace(), ws); + } + private: FunctionParameterDecorator_sptr getFunctionParameterDecoratorGaussian() { FunctionParameterDecorator_sptr fn = From 5db3ba1563a1ef036f674744fdf5e0199c9aaef0 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Tue, 17 Mar 2015 13:43:19 +0100 Subject: [PATCH 017/126] Refs #11043. Adapting PoldiPeakSearch to work with different units. --- .../SINQ/inc/MantidSINQ/PoldiPeakSearch.h | 3 +- .../Framework/SINQ/src/PoldiPeakSearch.cpp | 35 ++++++++++++++++--- .../Framework/SINQ/test/PoldiPeakSearchTest.h | 4 ++- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h b/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h index 7c28a976d888..d3f1a83bf817 100644 --- a/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h +++ b/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h @@ -4,6 +4,7 @@ #include "MantidSINQ/DllConfig.h" #include "MantidKernel/System.h" +#include "MantidKernel/Unit.h" #include "MantidKernel/V2D.h" #include "MantidAPI/Algorithm.h" @@ -97,7 +98,7 @@ class MANTID_SINQ_DLL PoldiPeakSearch : public API::Algorithm { getPeaks(const MantidVec::const_iterator &baseListStart, const MantidVec::const_iterator &baseListEnd, std::list peakPositions, - const MantidVec &xData) const; + const MantidVec &xData, const Kernel::Unit_sptr &unit) const; double getFWHMEstimate(const MantidVec::const_iterator &baseListStart, const MantidVec::const_iterator &baseListEnd, MantidVec::const_iterator peakPosition, diff --git a/Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp b/Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp index 5c202387a0e5..de2e104c3dd2 100644 --- a/Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp +++ b/Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp @@ -3,6 +3,8 @@ #include "MantidAPI/WorkspaceProperty.h" #include "MantidAPI/WorkspaceFactory.h" #include "MantidKernel/BoundedValidator.h" +#include "MantidKernel/UnitFactory.h" +#include "MantidKernel/UnitConversion.h" #include "MantidKernel/V2D.h" #include "MantidDataObjects/Workspace2D.h" @@ -214,7 +216,7 @@ std::vector PoldiPeakSearch::getPeaks(const MantidVec::const_iterator &baseListStart, const MantidVec::const_iterator &baseListEnd, std::list peakPositions, - const MantidVec &xData) const { + const MantidVec &xData, const Unit_sptr &unit) const { std::vector peakData; peakData.reserve(peakPositions.size()); @@ -223,11 +225,21 @@ PoldiPeakSearch::getPeaks(const MantidVec::const_iterator &baseListStart, peak != peakPositions.end(); ++peak) { size_t index = std::distance(baseListStart, *peak); - PoldiPeak_sptr newPeak = - PoldiPeak::create(UncertainValue(xData[index]), UncertainValue(**peak)); + double xDataD = 0.0; + if (boost::dynamic_pointer_cast(unit)) { + xDataD = xData[index]; + } else { + Unit_sptr dUnit = UnitFactory::Instance().create("dSpacing"); + xDataD = UnitConversion::run((*unit), (*dUnit), xData[index], 0, 0, 0, + DeltaEMode::Elastic, 0.0); + } + double fwhmEstimate = getFWHMEstimate(baseListStart, baseListEnd, *peak, xData); - newPeak->setFwhm(UncertainValue(fwhmEstimate)); + UncertainValue fwhm(fwhmEstimate / xData[index]); + + PoldiPeak_sptr newPeak = PoldiPeak::create( + MillerIndices(), UncertainValue(xDataD), UncertainValue(**peak), fwhm); peakData.push_back(newPeak); } @@ -536,6 +548,19 @@ void PoldiPeakSearch::exec() { MantidVec correlatedCounts = correlationWorkspace->readY(0); g_log.information() << " Auto-correlation data read." << std::endl; + Unit_sptr xUnit = correlationWorkspace->getAxis(0)->unit(); + + if (xUnit->caption() == "") { + g_log.information() + << " Workspace does not have unit, defaulting to MomentumTransfer." + << std::endl; + + xUnit = UnitFactory::Instance().create("MomentumTransfer"); + } else { + g_log.information() << " Unit of workspace is " << xUnit->caption() << "." + << std::endl; + } + setMinimumDistance(getProperty("MinimumPeakSeparation")); setMinimumPeakHeight(getProperty("MinimumPeakHeight")); setMaximumPeakNumber(getProperty("MaximumPeakNumber")); @@ -576,7 +601,7 @@ void PoldiPeakSearch::exec() { */ std::vector peakCoordinates = getPeaks(correlatedCounts.begin(), correlatedCounts.end(), - peakPositionsCorrelation, correlationQValues); + peakPositionsCorrelation, correlationQValues, xUnit); g_log.information() << " Extracted peak positions in Q and intensity guesses." << std::endl; diff --git a/Code/Mantid/Framework/SINQ/test/PoldiPeakSearchTest.h b/Code/Mantid/Framework/SINQ/test/PoldiPeakSearchTest.h index 0674bd4c6375..17e0deeedab2 100644 --- a/Code/Mantid/Framework/SINQ/test/PoldiPeakSearchTest.h +++ b/Code/Mantid/Framework/SINQ/test/PoldiPeakSearchTest.h @@ -6,6 +6,7 @@ #include "MantidSINQ/PoldiPeakSearch.h" #include "MantidSINQ/PoldiUtilities/PoldiPeak.h" #include "MantidSINQ/PoldiUtilities/UncertainValue.h" +#include "MantidKernel/UnitFactory.h" using Mantid::Poldi::PoldiPeakSearch; using namespace Mantid::Poldi; @@ -133,7 +134,8 @@ class PoldiPeakSearchTest : public CxxTest::TestSuite maxima.sort(); - std::vector peaks = poldiPeakSearch.getPeaks(baseData.begin(), baseData.end(), maxima, testXData); + Unit_sptr qUnit = UnitFactory::Instance().create("MomentumTransfer"); + std::vector peaks = poldiPeakSearch.getPeaks(baseData.begin(), baseData.end(), maxima, testXData, qUnit); TS_ASSERT_EQUALS(peaks.size(), 4); From d02719ab0f55af1d4251ceff5deff23b7cf0abaf Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Tue, 17 Mar 2015 13:45:02 +0100 Subject: [PATCH 018/126] Refs #11043. Adding more unit tests. --- .../inc/MantidCurveFitting/PawleyFunction.h | 2 +- .../CurveFitting/src/PawleyFunction.cpp | 18 +++++- .../CurveFitting/test/PawleyFunctionTest.h | 55 ++++++++++++++++++- 3 files changed, 71 insertions(+), 4 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h index 67f10961999d..040d82ffb40e 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -112,10 +112,10 @@ class PawleyFunction : public API::FunctionParameterDecorator { void setPeaks(const std::vector &hkls, double fwhm, double height); - void clearPeaks(); void addPeak(const Kernel::V3D &hkl, double fwhm, double height); + size_t getPeakCount() const; API::IPeakFunction_sptr getPeakFunction(size_t i) const; Kernel::V3D getPeakHKL(size_t i) const; diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp index 409e83489e7a..07d83d2b22a7 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -247,7 +247,12 @@ void PawleyFunction::setProfileFunction(const std::string &profileFunction) { m_pawleyParameterFunction->getProfileFunctionName())); newFunction->setCentre(oldFunction->centre()); - newFunction->setFwhm(oldFunction->fwhm()); + try { + newFunction->setFwhm(oldFunction->fwhm()); + } + catch (...) { + // do nothing. + } newFunction->setHeight(oldFunction->height()); m_peakProfileComposite->replaceFunction(i, newFunction); @@ -302,7 +307,14 @@ void PawleyFunction::addPeak(const Kernel::V3D &hkl, double fwhm, peak->fix(peak->parameterIndex( m_pawleyParameterFunction->getProfileFunctionCenterParameterName())); - peak->setFwhm(fwhm); + + try { + peak->setFwhm(fwhm); + } + catch (...) { + // do nothing. + } + peak->setHeight(height); m_peakProfileComposite->addFunction(peak); @@ -310,6 +322,8 @@ void PawleyFunction::addPeak(const Kernel::V3D &hkl, double fwhm, m_compositeFunction->checkFunction(); } +size_t PawleyFunction::getPeakCount() const { return m_hkls.size(); } + IPeakFunction_sptr PawleyFunction::getPeakFunction(size_t i) const { return boost::dynamic_pointer_cast( m_peakProfileComposite->getFunction(i)); diff --git a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h index 438671f17778..b13a4e93b2ac 100644 --- a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h @@ -251,6 +251,47 @@ class PawleyFunctionTest : public CxxTest::TestSuite { cellParametersAre(cell, 3.0, 4.0, 5.0, 101.0, 111.0, 103.0); } + void testSetParametersFromUnitCell() { + PawleyParameterFunction fn; + fn.initialize(); + + fn.setAttributeValue("CrystalSystem", "Triclinic"); + + UnitCell cell(3., 4., 5., 101., 111., 103.); + + TS_ASSERT_THROWS_NOTHING(fn.setParametersFromUnitCell(cell)); + + TS_ASSERT_EQUALS(fn.getParameter("a"), 3.0); + TS_ASSERT_EQUALS(fn.getParameter("b"), 4.0); + TS_ASSERT_EQUALS(fn.getParameter("c"), 5.0); + TS_ASSERT_EQUALS(fn.getParameter("Alpha"), 101.0); + TS_ASSERT_EQUALS(fn.getParameter("Beta"), 111.0); + TS_ASSERT_EQUALS(fn.getParameter("Gamma"), 103.0); + + fn.setAttributeValue("CrystalSystem", "Cubic"); + + cell.seta(5.43); + TS_ASSERT_THROWS_NOTHING(fn.setParametersFromUnitCell(cell)); + + TS_ASSERT_EQUALS(fn.getParameter("a"), 5.43); + } + + void testProfileFunctionName() { + PawleyParameterFunction fn; + fn.initialize(); + + TS_ASSERT_THROWS_NOTHING( + fn.setAttributeValue("ProfileFunction", "Gaussian")); + TS_ASSERT_EQUALS(fn.getProfileFunctionName(), "Gaussian"); + + // works only with IPeakFunctions + TS_ASSERT_THROWS(fn.setAttributeValue("ProfileFunction", "Chebyshev"), + std::invalid_argument); + + TS_ASSERT_THROWS(fn.setAttributeValue("ProfileFunction", "DoesNotExist"), + Exception::NotFoundError); + } + void testPawleyFunctionInitialization() { PawleyFunction fn; fn.initialize(); @@ -276,12 +317,24 @@ class PawleyFunctionTest : public CxxTest::TestSuite { void testPawleyFunctionAddPeak() { PawleyFunction fn; fn.initialize(); + TS_ASSERT_EQUALS(fn.getPeakCount(), 0); TS_ASSERT_EQUALS(fn.nParams(), 7); fn.addPeak(V3D(), 3.0, 4.0); TS_ASSERT_EQUALS(fn.nParams(), 10); + TS_ASSERT_EQUALS(fn.getPeakCount(), 1); + } + + void testPawleyFunctionClearPeaks() { + PawleyFunction fn; + fn.initialize(); + + fn.addPeak(V3D(), 3.0, 4.0); + TS_ASSERT_EQUALS(fn.getPeakCount(), 1); + TS_ASSERT_THROWS_NOTHING(fn.clearPeaks()); + TS_ASSERT_EQUALS(fn.getPeakCount(), 0); } void testPawleyFunctionSetProfileFunction() { @@ -290,7 +343,7 @@ class PawleyFunctionTest : public CxxTest::TestSuite { TS_ASSERT_EQUALS(fn.nParams(), 7); - fn.addPeak(V3D(), 2.0, 3.0, 4.0); + fn.addPeak(V3D(), 3.0, 4.0); TS_ASSERT_EQUALS(fn.nParams(), 10); From 32d5876300b65788ac8be0f0f3b7f7ace812a1d8 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Tue, 17 Mar 2015 17:01:45 +0000 Subject: [PATCH 019/126] Work in progress adding corrections for can Refs #10753 --- .../ApplyPaalmanPingsCorrection.py | 107 ++++++++++++------ 1 file changed, 75 insertions(+), 32 deletions(-) diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py index 00891964587c..86247e8c91e4 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py @@ -1,6 +1,6 @@ from mantid.simpleapi import * from mantid.api import PythonAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty, WorkspaceGroupProperty, \ - PropertyMode + PropertyMode, MatrixWorkspace from mantid.kernel import Direction, logger @@ -55,10 +55,6 @@ def PyExec(self): if not self._use_can: logger.information('Not using container') - instrument = mtd[self._sample_ws_name].getInstrument() - unit_id = mtd[self._sample_ws_name].getAxis(0).getUnit().unitID() - logger.information('x-unit is ' + unit_id) - # Apply container scale factor if needed if self._use_can: if self._scale_can: @@ -73,27 +69,7 @@ def PyExec(self): OutputWorkspace=self._scaled_container) if self._use_corrections: - # If the sample is not in wavelength then convert the corrections to - # whatever units the sample is in - if unit_id != 'Wavelength': - target = unit_id - if unit_id == 'dSpacing': - emode = 'Elastic' - efixed = 0.0 - elif unit_id == 'DeltaE': - emode = 'Indirect' - efixed = instrument.getNumberParameter('efixed-val')[0] - else: - raise ValueError('Unit %s in sample workspace is not supported' % unit_id) - - ConvertUnits(InputWorkspace=self._corrections_ws_name, - OutputWorkspace=self._corrections, - Target=target, - EMode=emode, - EFixed=efixed) - else: - CloneWorkspace(InputWorkspace=self._corrections_ws_name, - OutputWorkspace=self._corrections) + self._pre_process_corrections() if self._use_can: # Use container factors @@ -123,13 +99,21 @@ def validateInputs(self): issues['CorrectionsWorkspace'] = error_msg issues['CanWorkspace'] = error_msg - sample_unit_id = mtd[self._sample_ws_name].getAxis(0).getUnit().unitID() + sample_ws = mtd[self._sample_ws_name] + if isinstance(sample_ws, MatrixWorkspace): + sample_unit_id = sample_ws.getAxis(0).getUnit().unitID() - # Check sample and container X axis units match - if self._use_can: - can_unit_id = mtd[self._can_ws_name].getAxis(0).getUnit().unitID() - if can_unit_id != sample_unit_id: - issues['CanWorkspace'] = 'X axis unit must match SampleWorkspace' + # Check sample and container X axis units match + if self._use_can: + can_ws = mtd[self._can_ws_name] + if isinstance(can_ws, MatrixWorkspace): + can_unit_id = can_ws.getAxis(0).getUnit().unitID() + if can_unit_id != sample_unit_id: + issues['CanWorkspace'] = 'X axis unit must match SampleWorkspace' + else: + issues['CanWorkspace'] = 'Must be a MatrixWorkspace' + else: + issues['SampleWorkspace'] = 'Must be a MatrixWorkspace' return issues @@ -158,6 +142,65 @@ def _setup(self): self._scaled_container = '__scaled_container' + def _get_correction_factor_ws_name(self, factor_type): + """ + Gets the full name for a correction factor workspace given the correction type. + + @param factor_type Factory type (ass, acc, acsc, assc) + @return Full name of workspace (None if not found) + """ + + corrections_ws = mtd[self._corrections_ws_name] + + for ws_name in corrections_ws.getNames(): + if factor_type in ws_name: + return ws_name + + return None + + + def _pre_process_corrections(self): + """ + If the sample is not in wavelength then convert the corrections to + whatever units the sample is in. + """ + + instrument = mtd[self._sample_ws_name].getInstrument() + unit_id = mtd[self._sample_ws_name].getAxis(0).getUnit().unitID() + logger.information('x-unit is ' + unit_id) + + factor_types = ['ass'] + if self._use_can: + factor_types.extend(['acc', 'acsc', 'assc']) + + for factor_type in factor_types: + input_name = self._get_correction_factor_ws_name(factor_type) + output_name = self._corrections + '_' + factor_type + + if unit_id != 'Wavelength': + # Configure conversion + if unit_id == 'dSpacing': + emode = 'Elastic' + efixed = 0.0 + elif unit_id == 'DeltaE': + emode = 'Indirect' + efixed = instrument.getNumberParameter('efixed-val')[0] + else: + raise ValueError('Unit %s in sample workspace is not supported' % unit_id) + + # Do conversion + ConvertUnits(InputWorkspace=input_name, + OutputWorkspace=output_name, + Target=unit_id, + EMode=emode, + EFixed=efixed) + + else: + # No need to convert + CloneWorkspace(InputWorkspace=input_name, + OutputWorkspace=output_name) + + def _subtract(self): """ Do a simple container subtraction (when no corrections are given). From 38ed821ae8059c5d2970e1de8c994719cbb9b4ef Mon Sep 17 00:00:00 2001 From: Mathieu Doucet Date: Tue, 17 Mar 2015 14:27:25 -0400 Subject: [PATCH 020/126] Re #11387 Update REFL_Parameter files --- Code/Mantid/instrument/REF_L_Parameters.xml | 4 ++-- .../REF_L_Parameters_after_10102014.xml | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 Code/Mantid/instrument/REF_L_Parameters_after_10102014.xml diff --git a/Code/Mantid/instrument/REF_L_Parameters.xml b/Code/Mantid/instrument/REF_L_Parameters.xml index 5330d332c4f8..cfd379a1b9be 100644 --- a/Code/Mantid/instrument/REF_L_Parameters.xml +++ b/Code/Mantid/instrument/REF_L_Parameters.xml @@ -1,7 +1,7 @@ - + - + diff --git a/Code/Mantid/instrument/REF_L_Parameters_after_10102014.xml b/Code/Mantid/instrument/REF_L_Parameters_after_10102014.xml new file mode 100644 index 000000000000..b6884401adb4 --- /dev/null +++ b/Code/Mantid/instrument/REF_L_Parameters_after_10102014.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + From 159e2fe7866be51778f13869c1c249c92925a13a Mon Sep 17 00:00:00 2001 From: Mathieu Doucet Date: Tue, 17 Mar 2015 14:32:06 -0400 Subject: [PATCH 021/126] Re #11387 Clean up file while we're at it... --- Code/Mantid/instrument/REF_L_Parameters.xml | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Code/Mantid/instrument/REF_L_Parameters.xml b/Code/Mantid/instrument/REF_L_Parameters.xml index cfd379a1b9be..3cf57dceaa45 100644 --- a/Code/Mantid/instrument/REF_L_Parameters.xml +++ b/Code/Mantid/instrument/REF_L_Parameters.xml @@ -1,17 +1,17 @@ - - - - - - - - - - - + + + + + + + + + + + From 7151e2cc576d2898816843813d7cb0545e3e2e65 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Wed, 18 Mar 2015 08:06:47 +0100 Subject: [PATCH 022/126] Refs #11043. Get reflections from table --- .../inc/MantidCurveFitting/PawleyFit.h | 12 ++-- .../inc/MantidCurveFitting/PawleyFunction.h | 3 + .../Framework/CurveFitting/src/PawleyFit.cpp | 71 +++++++++++++++++-- .../CurveFitting/src/PawleyFunction.cpp | 4 +- 4 files changed, 77 insertions(+), 13 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h index b6e58cbb79c7..70b5e0837f3f 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h @@ -3,6 +3,7 @@ #include "MantidKernel/System.h" #include "MantidAPI/Algorithm.h" +#include "MantidCurveFitting/PawleyFunction.h" namespace Mantid { namespace CurveFitting { @@ -43,13 +44,16 @@ class DLLExport PawleyFit : public API::Algorithm { public: virtual ~PawleyFit() {} - const std::string name() const { return "PawleyFit"; } - int version() const { return 1; } - const std::string summary() const; + const std::string name() const { return "PawleyFit"; } + int version() const { return 1; } + const std::string summary() const; protected: - std::vector hklsFromString(const std::string &hklString) const; + void addHKLsToFunction(PawleyFunction_sptr &pawleyFn, + const API::ITableWorkspace_sptr &tableWs) const; + + Kernel::V3D getHkl(const std::string &hklString) const; void init(); void exec(); diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h index 040d82ffb40e..78041eca1f07 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -129,6 +129,9 @@ class PawleyFunction : public API::FunctionParameterDecorator { std::vector m_hkls; }; + +typedef boost::shared_ptr PawleyFunction_sptr; + } // namespace CurveFitting } // namespace Mantid diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index 127ac4324c6c..ed0a094b30ed 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -2,6 +2,7 @@ #include "MantidAPI/FunctionFactory.h" #include "MantidCurveFitting/PawleyFunction.h" +#include "MantidAPI/TableRow.h" #include "MantidGeometry/Crystal/UnitCell.h" #include "MantidKernel/ListValidator.h" @@ -34,6 +35,45 @@ std::vector PawleyFit::hklsFromString(const std::string &hklString) const { return hkls; } +void PawleyFit::addHKLsToFunction(PawleyFunction_sptr &pawleyFn, + const ITableWorkspace_sptr &tableWs) const { + if (!tableWs || !pawleyFn) { + throw std::invalid_argument("Can only process non-null function & table."); + } + + pawleyFn->clearPeaks(); + + for (size_t i = 0; i < tableWs->rowCount(); ++i) { + TableRow currentRow = tableWs->getRow(i); + + try { + V3D hkl = getHkl(currentRow.String(0)); + double height = boost::lexical_cast(currentRow.String(3)); + + pawleyFn->addPeak(hkl, 0.006, height); + } + catch (...) { + // do nothing. + } + } +} + +V3D PawleyFit::getHkl(const std::string &hklString) const { + std::vector indicesStr; + boost::split(indicesStr, hklString, boost::is_any_of(" ")); + + if (indicesStr.size() != 3) { + throw std::invalid_argument("Input string cannot be parsed as HKL."); + } + + V3D hkl; + hkl.setX(boost::lexical_cast(indicesStr[0])); + hkl.setY(boost::lexical_cast(indicesStr[1])); + hkl.setZ(boost::lexical_cast(indicesStr[2])); + + return hkl; +} + void PawleyFit::init() { declareProperty(new WorkspaceProperty("InputWorkspace", "", Direction::Input), @@ -67,6 +107,12 @@ void PawleyFit::init() { "Semi-colon separated list of Miller indices given in the " "format '[h,k,l]'."); + declareProperty( + new WorkspaceProperty("PeakTable", "", Direction::Input, + PropertyMode::Optional), + "Table with peak information. Can be used instead of " + "supplying a list of indices for better starting parameters."); + declareProperty("RefineZeroShift", false, "If checked, a zero-shift with the " "same unit as the spectrum is " "refined."); @@ -92,23 +138,34 @@ void PawleyFit::exec() { pawleyFn->setCrystalSystem(getProperty("CrystalSystem")); pawleyFn->setUnitCell(getProperty("InitialCell")); - std::vector hkls = hklsFromString(getProperty("MillerIndices")); - - MatrixWorkspace_sptr ws = getProperty("InputWorkspace"); + MatrixWorkspace_const_sptr ws = getProperty("InputWorkspace"); int wsIndex = getProperty("WorkspaceIndex"); - const MantidVec &data = ws->readY(static_cast(wsIndex)); - pawleyFn->setPeaks(hkls, 0.008, - *(std::max_element(data.begin(), data.end()))); + Property *peakTableProperty = getPointerToProperty("PeakTable"); + if (!peakTableProperty->isDefault()) { + ITableWorkspace_sptr peakTable = getProperty("PeakTable"); + addHKLsToFunction(pawleyFn, peakTable); + } else { + std::vector hkls = hklsFromString(getProperty("MillerIndices")); + + const MantidVec &data = ws->readY(static_cast(wsIndex)); + pawleyFn->setPeaks(hkls, 0.008, + *(std::max_element(data.begin(), data.end()))); + } bool refineZeroShift = getProperty("RefineZeroShift"); if (!refineZeroShift) { pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift")); } + const MantidVec &xData = ws->readX(static_cast(wsIndex)); + pawleyFn->setMatrixWorkspace(ws, static_cast(wsIndex), xData.front(), + xData.back()); + Algorithm_sptr fit = createChildAlgorithm("Fit"); fit->setProperty("Function", boost::static_pointer_cast(pawleyFn)); - fit->setProperty("InputWorkspace", ws); + fit->setProperty("InputWorkspace", + boost::const_pointer_cast(ws)); fit->setProperty("WorkspaceIndex", wsIndex); fit->setProperty("CreateOutput", true); diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp index 07d83d2b22a7..3a6adb248a55 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -273,9 +273,9 @@ void PawleyFunction::function(const FunctionDomain &domain, for (size_t i = 0; i < m_hkls.size(); ++i) { double d = cell.d(m_hkls[i]) + zeroShift; + m_peakProfileComposite->getFunction(i)->setParameter( - m_pawleyParameterFunction->getProfileFunctionCenterParameterName(), - d + zeroShift); + m_pawleyParameterFunction->getProfileFunctionCenterParameterName(), d); } m_peakProfileComposite->function(domain, values); From 9452f4e3fa28be1f94d8236fb1bd8e51615c1c30 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Wed, 18 Mar 2015 09:06:52 +0100 Subject: [PATCH 023/126] Refs #11043. Generating output tables --- .../inc/MantidCurveFitting/PawleyFit.h | 5 ++ .../inc/MantidCurveFitting/PawleyFunction.h | 2 + .../Framework/CurveFitting/src/PawleyFit.cpp | 85 +++++++++++++++++-- .../CurveFitting/src/PawleyFunction.cpp | 5 ++ 4 files changed, 88 insertions(+), 9 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h index 70b5e0837f3f..e6bef5331e31 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h @@ -55,6 +55,11 @@ class DLLExport PawleyFit : public API::Algorithm { Kernel::V3D getHkl(const std::string &hklString) const; + API::ITableWorkspace_sptr + getLatticeFromFunction(const PawleyFunction_sptr &pawleyFn) const; + API::ITableWorkspace_sptr + getPeakParametersFromFunction(const PawleyFunction_sptr &pawleyFn) const; + void init(); void exec(); }; diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h index 78041eca1f07..4d5903e94bc4 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -119,6 +119,8 @@ class PawleyFunction : public API::FunctionParameterDecorator { API::IPeakFunction_sptr getPeakFunction(size_t i) const; Kernel::V3D getPeakHKL(size_t i) const; + PawleyParameterFunction_sptr getPawleyParameterFunction() const; + protected: void init(); void beforeDecoratedFunctionSet(const API::IFunction_sptr &fn); diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index ed0a094b30ed..b4baddb06361 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -48,9 +48,11 @@ void PawleyFit::addHKLsToFunction(PawleyFunction_sptr &pawleyFn, try { V3D hkl = getHkl(currentRow.String(0)); + double d = boost::lexical_cast(currentRow.String(1)); double height = boost::lexical_cast(currentRow.String(3)); + double fwhm = boost::lexical_cast(currentRow.String(4)) * d; - pawleyFn->addPeak(hkl, 0.006, height); + pawleyFn->addPeak(hkl, fwhm, height); } catch (...) { // do nothing. @@ -74,6 +76,65 @@ V3D PawleyFit::getHkl(const std::string &hklString) const { return hkl; } +ITableWorkspace_sptr +PawleyFit::getLatticeFromFunction(const PawleyFunction_sptr &pawleyFn) const { + if (!pawleyFn) { + throw std::invalid_argument( + "Cannot extract lattice parameters from null function."); + } + + ITableWorkspace_sptr latticeParameterTable = + WorkspaceFactory::Instance().createTable(); + + latticeParameterTable->addColumn("str", "Parameter"); + latticeParameterTable->addColumn("double", "Value"); + latticeParameterTable->addColumn("double", "Error"); + + PawleyParameterFunction_sptr parameters = + pawleyFn->getPawleyParameterFunction(); + + for (size_t i = 0; i < parameters->nParams(); ++i) { + TableRow newRow = latticeParameterTable->appendRow(); + newRow << parameters->parameterName(i) << parameters->getParameter(i) + << parameters->getError(i); + } + + return latticeParameterTable; +} + +ITableWorkspace_sptr PawleyFit::getPeakParametersFromFunction( + const PawleyFunction_sptr &pawleyFn) const { + if (!pawleyFn) { + throw std::invalid_argument( + "Cannot extract peak parameters from null function."); + } + + ITableWorkspace_sptr peakParameterTable = + WorkspaceFactory::Instance().createTable(); + + peakParameterTable->addColumn("int", "Peak"); + peakParameterTable->addColumn("V3D", "HKL"); + peakParameterTable->addColumn("str", "Parameter"); + peakParameterTable->addColumn("double", "Value"); + peakParameterTable->addColumn("double", "Error"); + + for (size_t i = 0; i < pawleyFn->getPeakCount(); ++i) { + + IPeakFunction_sptr currentPeak = pawleyFn->getPeakFunction(i); + + int peakNumber = static_cast(i + 1); + V3D peakHKL = pawleyFn->getPeakHKL(i); + + for (size_t j = 0; j < currentPeak->nParams(); ++j) { + TableRow newRow = peakParameterTable->appendRow(); + newRow << peakNumber << peakHKL << currentPeak->parameterName(j) + << currentPeak->getParameter(j) << currentPeak->getError(j); + } + } + + return peakParameterTable; +} + void PawleyFit::init() { declareProperty(new WorkspaceProperty("InputWorkspace", "", Direction::Input), @@ -127,6 +188,16 @@ void PawleyFit::init() { Direction::Output), "Workspace that contains measured spectrum, calculated " "spectrum and difference curve."); + + declareProperty( + new WorkspaceProperty("RefinedCellTable", "", + Direction::Output), + "TableWorkspace with refined lattice parameters, including errors."); + + declareProperty( + new WorkspaceProperty("RefinedPeakParameterTable", "", + Direction::Output), + "TableWorkspace with refined peak parameters, including errors."); } void PawleyFit::exec() { @@ -149,7 +220,7 @@ void PawleyFit::exec() { std::vector hkls = hklsFromString(getProperty("MillerIndices")); const MantidVec &data = ws->readY(static_cast(wsIndex)); - pawleyFn->setPeaks(hkls, 0.008, + pawleyFn->setPeaks(hkls, 0.005, *(std::max_element(data.begin(), data.end()))); } @@ -168,17 +239,13 @@ void PawleyFit::exec() { boost::const_pointer_cast(ws)); fit->setProperty("WorkspaceIndex", wsIndex); fit->setProperty("CreateOutput", true); - fit->execute(); - for (size_t i = 0; i < pawleyFn->nParams(); ++i) { - std::cout << i << " " << pawleyFn->parameterName(i) << " " - << pawleyFn->getParameter(i) << " " << pawleyFn->getError(i) - << std::endl; - } - MatrixWorkspace_sptr output = fit->getProperty("OutputWorkspace"); setProperty("OutputWorkspace", output); + setProperty("RefinedCellTable", getLatticeFromFunction(pawleyFn)); + setProperty("RefinedPeakParameterTable", + getPeakParametersFromFunction(pawleyFn)); } } // namespace CurveFitting diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp index 3a6adb248a55..cbd04581aee8 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -331,6 +331,11 @@ IPeakFunction_sptr PawleyFunction::getPeakFunction(size_t i) const { Kernel::V3D PawleyFunction::getPeakHKL(size_t i) const { return m_hkls[i]; } +PawleyParameterFunction_sptr +PawleyFunction::getPawleyParameterFunction() const { + return m_pawleyParameterFunction; +} + void PawleyFunction::init() { setDecoratedFunction("CompositeFunction"); From 3a887d3728e1865e97610151799f7628b69c3690 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Wed, 18 Mar 2015 11:21:04 +0000 Subject: [PATCH 024/126] Add the can scale factor to smaple logs Refs #10753 --- .../WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py index 86247e8c91e4..854a81e1009f 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py @@ -82,6 +82,13 @@ def PyExec(self): # Do simple subtraction self._subtract() + # Record the container scale factor + if self._use_can and self._scale_can: + AddSampleLog(Workspace=self._output_ws_name, + LogName='apply_corr_can_scale_factor', + LogType='Number', + LogText=str(self._can_scale_factor)) + self.setPropertyValue('OutputWorkspace', self._output_ws_name) From c230d44e7edcc0229c1efd3b2c9e87b8b229b2ee Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Wed, 18 Mar 2015 14:30:50 +0100 Subject: [PATCH 025/126] Refs #11043. Adding unit tests for PawleyFunction --- .../CurveFitting/test/PawleyFunctionTest.h | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) diff --git a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h index b13a4e93b2ac..141f4d008e47 100644 --- a/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/PawleyFunctionTest.h @@ -5,6 +5,10 @@ #include "MantidCurveFitting/PawleyFunction.h" #include "MantidGeometry/Crystal/PointGroup.h" +#include "MantidAPI/AlgorithmManager.h" +#include "MantidAPI/FunctionFactory.h" +#include "MantidAPI/WorkspaceFactory.h" +#include "MantidTestHelpers/WorkspaceCreationHelper.h" using namespace Mantid::CurveFitting; using namespace Mantid::API; @@ -337,6 +341,28 @@ class PawleyFunctionTest : public CxxTest::TestSuite { TS_ASSERT_EQUALS(fn.getPeakCount(), 0); } + void testPawleyFunctionGetPeakHKL() { + PawleyFunction fn; + fn.initialize(); + + fn.addPeak(V3D(1, 1, 1), 3.0, 4.0); + TS_ASSERT_EQUALS(fn.getPeakCount(), 1); + TS_ASSERT_EQUALS(fn.getPeakHKL(0), V3D(1, 1, 1)); + } + + void testPawleyFunctionGetPeakFunction() { + PawleyFunction fn; + fn.initialize(); + + fn.addPeak(V3D(1, 1, 1), 3.0, 4.0); + TS_ASSERT_EQUALS(fn.getPeakCount(), 1); + + IPeakFunction_sptr peak = fn.getPeakFunction(0); + TS_ASSERT(peak); + TS_ASSERT_EQUALS(peak->fwhm(), 3.0); + TS_ASSERT_EQUALS(peak->height(), 4.0); + } + void testPawleyFunctionSetProfileFunction() { PawleyFunction fn; fn.initialize(); @@ -352,7 +378,136 @@ class PawleyFunctionTest : public CxxTest::TestSuite { TS_ASSERT_EQUALS(fn.nParams(), 11); } + void testPawleyFunctionGetParameterFunction() { + PawleyFunction fn; + fn.initialize(); + + TS_ASSERT(fn.getPawleyParameterFunction()); + } + + void testPawleyFunctionSetUnitCell() { + PawleyFunction fn; + fn.initialize(); + + TS_ASSERT_THROWS_NOTHING(fn.setUnitCell("1.0 2.0 3.0 90 91 92")); + + PawleyParameterFunction_sptr parameters = fn.getPawleyParameterFunction(); + TS_ASSERT_EQUALS(parameters->getParameter("a"), 1.0); + TS_ASSERT_EQUALS(parameters->getParameter("b"), 2.0); + TS_ASSERT_EQUALS(parameters->getParameter("c"), 3.0); + TS_ASSERT_EQUALS(parameters->getParameter("Alpha"), 90.0); + TS_ASSERT_EQUALS(parameters->getParameter("Beta"), 91.0); + TS_ASSERT_EQUALS(parameters->getParameter("Gamma"), 92.0); + + TS_ASSERT_THROWS_NOTHING(fn.setUnitCell("2.0 3.0 4.0")); + + TS_ASSERT_EQUALS(parameters->getParameter("a"), 2.0); + TS_ASSERT_EQUALS(parameters->getParameter("b"), 3.0); + TS_ASSERT_EQUALS(parameters->getParameter("c"), 4.0); + TS_ASSERT_EQUALS(parameters->getParameter("Alpha"), 90.0); + TS_ASSERT_EQUALS(parameters->getParameter("Beta"), 90.0); + TS_ASSERT_EQUALS(parameters->getParameter("Gamma"), 90.0); + } + + void testFunctionFitSi() { + /* This example generates a spectrum with the first two reflections + * of Silicon with lattice parameter a = 5.4311946 Angstr. + * hkl d height fwhm + * 1 1 1 3.13570 40.0 0.006 + * 2 2 0 1.92022 110.0 0.004 + */ + auto ws = getWorkspace( + "name=Gaussian,PeakCentre=3.13570166,Height=40.0,Sigma=0.003;name=" + "Gaussian,PeakCentre=1.92021727,Height=110.0,Sigma=0.002", + 1.85, 3.2, 400); + + PawleyFunction_sptr pawleyFn = boost::make_shared(); + pawleyFn->initialize(); + pawleyFn->setCrystalSystem("Cubic"); + pawleyFn->addPeak(V3D(1, 1, 1), 0.0065, 35.0); + pawleyFn->addPeak(V3D(2, 2, 0), 0.0045, 110.0); + pawleyFn->setUnitCell("5.4295 5.4295 5.4295"); + + // fix ZeroShift + pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift")); + + IAlgorithm_sptr fit = AlgorithmManager::Instance().create("Fit"); + fit->setProperty("Function", + boost::dynamic_pointer_cast(pawleyFn)); + fit->setProperty("InputWorkspace", ws); + fit->execute(); + + PawleyParameterFunction_sptr parameters = + pawleyFn->getPawleyParameterFunction(); + + TS_ASSERT_DELTA(parameters->getParameter("a"), 5.4311946, 1e-6); + } + + void testFunctionFitSiZeroShift() { + /* This example generates a spectrum with the first three reflections + * of Silicon with lattice parameter a = 5.4311946 Angstr. + * hkl d height ca. fwhm + * 1 1 1 3.13570 40.0 0.006 + * 2 2 0 1.92022 110.0 0.004 + * 3 1 1 1.63757 101.0 0.003 + */ + auto ws = getWorkspace( + "name=Gaussian,PeakCentre=3.13870166,Height=40.0,Sigma=0.003;name=" + "Gaussian,PeakCentre=1.92321727,Height=110.0,Sigma=0.002;name=Gaussian," + "PeakCentre=1.6405667,Height=105.0,Sigma=0.0016", + 1.6, 3.2, 800); + + PawleyFunction_sptr pawleyFn = boost::make_shared(); + pawleyFn->initialize(); + pawleyFn->setCrystalSystem("Cubic"); + pawleyFn->addPeak(V3D(1, 1, 1), 0.0065, 35.0); + pawleyFn->addPeak(V3D(2, 2, 0), 0.0045, 115.0); + pawleyFn->addPeak(V3D(3, 1, 1), 0.0035, 115.0); + pawleyFn->setUnitCell("5.433 5.433 5.433"); + pawleyFn->setParameter("f0.ZeroShift", 0.001); + + IAlgorithm_sptr fit = AlgorithmManager::Instance().create("Fit"); + fit->setProperty("Function", + boost::dynamic_pointer_cast(pawleyFn)); + fit->setProperty("InputWorkspace", ws); + fit->execute(); + + PawleyParameterFunction_sptr parameters = + pawleyFn->getPawleyParameterFunction(); + + TS_ASSERT_DELTA(parameters->getParameter("a"), 5.4311946, 1e-5); + TS_ASSERT_DELTA(parameters->getParameter("ZeroShift"), 0.003, 1e-4); + } + private: + MatrixWorkspace_sptr getWorkspace(const std::string &functionString, + double xMin, double xMax, size_t n) { + IFunction_sptr siFn = + FunctionFactory::Instance().createInitialized(functionString); + + auto ws = WorkspaceFactory::Instance().create("Workspace2D", 1, n, n); + + FunctionDomain1DVector xValues(xMin, xMax, n); + FunctionValues yValues(xValues); + std::vector eValues(n, 1.0); + + siFn->function(xValues, yValues); + + std::vector &xData = ws->dataX(0); + std::vector &yData = ws->dataY(0); + std::vector &eData = ws->dataE(0); + + for (size_t i = 0; i < n; ++i) { + xData[i] = xValues[i]; + yData[i] = yValues[i]; + eData[i] = eValues[i]; + } + + WorkspaceCreationHelper::addNoise(ws, 0, -0.1, 0.1); + + return ws; + } + void cellParametersAre(const UnitCell &cell, double a, double b, double c, double alpha, double beta, double gamma) { TS_ASSERT_DELTA(cell.a(), a, 1e-9); From 581e3808f275a58e6036ffb8595ed470293f8fa3 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Wed, 18 Mar 2015 15:41:44 +0100 Subject: [PATCH 026/126] Refs #11043. Documentation for PawleyFunction --- .../inc/MantidCurveFitting/PawleyFunction.h | 18 ++++- .../CurveFitting/src/PawleyFunction.cpp | 81 ++++++++++++++++++- 2 files changed, 96 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h index 4d5903e94bc4..4bd4beb2d83d 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -13,12 +13,23 @@ namespace Mantid { namespace CurveFitting { +/** @class PawleyParameterFunction + + This function is used internally by PawleyFunction to hold the unit cell + parameters as well as the ZeroShift parameter. The function and functionDeriv- + methods have been implemented to do nothing, the calculation of the spectrum + that results from the unit cell is calculated in PawleyFunction. + + Additionally it stores the crystal system and the name of the profile function + that is used to model the Bragg peaks as attributes. +*/ class DLLExport PawleyParameterFunction : virtual public API::IFunction, virtual public API::ParamFunction { public: PawleyParameterFunction(); virtual ~PawleyParameterFunction() {} + /// Returns the function name std::string name() const { return "PawleyParameterFunction"; } void setAttribute(const std::string &attName, const Attribute &attValue); @@ -27,10 +38,12 @@ class DLLExport PawleyParameterFunction : virtual public API::IFunction, Geometry::UnitCell getUnitCellFromParameters() const; void setParametersFromUnitCell(const Geometry::UnitCell &cell); + /// Returns the stored profile function name std::string getProfileFunctionName() const { return getAttribute("ProfileFunction").asString(); } + /// Returns the name of the stored function's center parameter std::string getProfileFunctionCenterParameterName() const { return m_profileFunctionCenterParameterName; } @@ -57,7 +70,7 @@ class DLLExport PawleyParameterFunction : virtual public API::IFunction, typedef boost::shared_ptr PawleyParameterFunction_sptr; -/** PawleyFunction +/** @class PawleyFunction The Pawley approach to obtain lattice parameters from a powder diffractogram works by placing peak profiles at d-values (which result from the lattice @@ -97,6 +110,7 @@ class PawleyFunction : public API::FunctionParameterDecorator { PawleyFunction(); virtual ~PawleyFunction() {} + /// Returns the name of the function. std::string name() const { return "PawleyFunction"; } void setCrystalSystem(const std::string &crystalSystem); @@ -105,6 +119,8 @@ class PawleyFunction : public API::FunctionParameterDecorator { void function(const API::FunctionDomain &domain, API::FunctionValues &values) const; + + /// Derivates are calculated numerically. void functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian) { calNumericalDeriv(domain, jacobian); diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp index cbd04581aee8..25f6476ac0e3 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -13,10 +13,20 @@ DECLARE_FUNCTION(PawleyParameterFunction) using namespace API; using namespace Geometry; +/// Constructor PawleyParameterFunction::PawleyParameterFunction() : ParamFunction(), m_crystalSystem(PointGroup::Triclinic), m_profileFunctionCenterParameterName() {} +/** + * @brief Sets the supplied attribute value + * + * The function calls ParamFunction::setAttribute, but performs additional + * actions for CrystalSystem and ProfileFunction. + * + * @param attName :: Name of the attribute + * @param attValue :: Value of the attribute + */ void PawleyParameterFunction::setAttribute(const std::string &attName, const Attribute &attValue) { if (attName == "CrystalSystem") { @@ -28,10 +38,12 @@ void PawleyParameterFunction::setAttribute(const std::string &attName, ParamFunction::setAttribute(attName, attValue); } +/// Returns the crystal system PointGroup::CrystalSystem PawleyParameterFunction::getCrystalSystem() const { return m_crystalSystem; } +/// Returns a UnitCell object constructed from the function's parameters. UnitCell PawleyParameterFunction::getUnitCellFromParameters() const { switch (m_crystalSystem) { case PointGroup::Cubic: { @@ -68,6 +80,7 @@ UnitCell PawleyParameterFunction::getUnitCellFromParameters() const { return UnitCell(); } +/// Sets the function's parameters from the supplied UnitCell. void PawleyParameterFunction::setParametersFromUnitCell(const UnitCell &cell) { // Parameter "a" exists in all crystal systems. setParameter("a", cell.a()); @@ -106,18 +119,21 @@ void PawleyParameterFunction::setParametersFromUnitCell(const UnitCell &cell) { } } +/// This method does nothing. void PawleyParameterFunction::function(const FunctionDomain &domain, FunctionValues &values) const { UNUSED_ARG(domain); UNUSED_ARG(values); } +/// This method does nothing. void PawleyParameterFunction::functionDeriv(const FunctionDomain &domain, Jacobian &jacobian) { UNUSED_ARG(domain) UNUSED_ARG(jacobian); } +/// Declares attributes and generates parameters based on the defaults. void PawleyParameterFunction::init() { declareAttribute("CrystalSystem", IFunction::Attribute("Triclinic")); declareAttribute("ProfileFunction", IFunction::Attribute("Gaussian")); @@ -126,6 +142,15 @@ void PawleyParameterFunction::init() { setProfileFunction("Gaussian"); } +/** + * Sets the profile function + * + * This method takes a function name and tries to create the corresponding + * function through FunctionFactory. Then it checks whether the function + * inherits from IPeakFunction and determines the centre parameter to store it. + * + * @param profileFunction :: Name of an IPeakFunction implementation. + */ void PawleyParameterFunction::setProfileFunction( const std::string &profileFunction) { IPeakFunction_sptr peakFunction = boost::dynamic_pointer_cast( @@ -139,6 +164,16 @@ void PawleyParameterFunction::setProfileFunction( setCenterParameterNameFromFunction(peakFunction); } +/** + * Assigns the crystal system + * + * This method takes the name of a crystal system (case insensitive) and stores + * it. Furthermore it creates the necessary parameters, which means that after + * calling this function, PawleyParameterFunction potentially exposes a + * different number of parameters. + * + * @param crystalSystem :: Crystal system, case insensitive. + */ void PawleyParameterFunction::setCrystalSystem(const std::string &crystalSystem) { std::string crystalSystemLC = boost::algorithm::to_lower_copy(crystalSystem); @@ -165,6 +200,8 @@ PawleyParameterFunction::setCrystalSystem(const std::string &crystalSystem) { createCrystalSystemParameters(m_crystalSystem); } +/// This method clears all parameters and declares parameters according to the +/// supplied crystal system. void PawleyParameterFunction::createCrystalSystemParameters( PointGroup::CrystalSystem crystalSystem) { @@ -213,6 +250,7 @@ void PawleyParameterFunction::createCrystalSystemParameters( declareParameter("ZeroShift", 0.0); } +/// Tries to extract and store the center parameter name from the function. void PawleyParameterFunction::setCenterParameterNameFromFunction( const IPeakFunction_sptr &profileFunction) { m_profileFunctionCenterParameterName.clear(); @@ -224,20 +262,27 @@ void PawleyParameterFunction::setCenterParameterNameFromFunction( DECLARE_FUNCTION(PawleyFunction) +/// Constructor PawleyFunction::PawleyFunction() : FunctionParameterDecorator(), m_compositeFunction(), m_pawleyParameterFunction(), m_peakProfileComposite(), m_hkls() {} +/// Sets the crystal system on the internal parameter function and updates the +/// exposed parameters void PawleyFunction::setCrystalSystem(const std::string &crystalSystem) { m_pawleyParameterFunction->setAttributeValue("CrystalSystem", crystalSystem); m_compositeFunction->checkFunction(); } +/// Sets the profile function and replaces already existing functions in the +/// internally stored CompositeFunction. void PawleyFunction::setProfileFunction(const std::string &profileFunction) { m_pawleyParameterFunction->setAttributeValue("ProfileFunction", profileFunction); - // At this point PawleyParameterFunction guarantees that it's an IPeakFunction + /* At this point PawleyParameterFunction guarantees that it's an IPeakFunction + * and all existing profile functions are replaced. + */ for (size_t i = 0; i < m_peakProfileComposite->nFunctions(); ++i) { IPeakFunction_sptr oldFunction = boost::dynamic_pointer_cast( m_peakProfileComposite->getFunction(i)); @@ -258,14 +303,28 @@ void PawleyFunction::setProfileFunction(const std::string &profileFunction) { m_peakProfileComposite->replaceFunction(i, newFunction); } + // Update exposed parameters. m_compositeFunction->checkFunction(); } +/// Sets the unit cell from a string with either 6 or 3 space-separated numbers. void PawleyFunction::setUnitCell(const std::string &unitCellString) { m_pawleyParameterFunction->setParametersFromUnitCell( strToUnitCell(unitCellString)); } +/** + * Calculates the function values on the supplied domain + * + * This function is the core of PawleyFunction. It calculates the d-value for + * each stored HKL from the unit cell that is the result of the parameters + * stored in the internal PawleyParameterFunction and adds the ZeroShift + * parameter. The value is set as center parameter on the internally stored + * PeakFunctions. + * + * @param domain :: Function domain. + * @param values :: Function values. + */ void PawleyFunction::function(const FunctionDomain &domain, FunctionValues &values) const { UnitCell cell = m_pawleyParameterFunction->getUnitCellFromParameters(); @@ -281,6 +340,7 @@ void PawleyFunction::function(const FunctionDomain &domain, m_peakProfileComposite->function(domain, values); } +/// Removes all peaks from the function. void PawleyFunction::clearPeaks() { m_peakProfileComposite = boost::dynamic_pointer_cast( FunctionFactory::Instance().createFunction("CompositeFunction")); @@ -288,6 +348,8 @@ void PawleyFunction::clearPeaks() { m_hkls.clear(); } +/// Clears peaks and adds a peak for each hkl, all with the same FWHM and +/// height. void PawleyFunction::setPeaks(const std::vector &hkls, double fwhm, double height) { clearPeaks(); @@ -297,6 +359,7 @@ void PawleyFunction::setPeaks(const std::vector &hkls, double fwhm, } } +/// Adds a peak with the supplied FWHM and height. void PawleyFunction::addPeak(const Kernel::V3D &hkl, double fwhm, double height) { m_hkls.push_back(hkl); @@ -322,15 +385,28 @@ void PawleyFunction::addPeak(const Kernel::V3D &hkl, double fwhm, m_compositeFunction->checkFunction(); } +/// Returns the number of peaks that are stored in the function. size_t PawleyFunction::getPeakCount() const { return m_hkls.size(); } IPeakFunction_sptr PawleyFunction::getPeakFunction(size_t i) const { + if (i >= m_hkls.size()) { + throw std::out_of_range("Peak index out of range."); + } + return boost::dynamic_pointer_cast( m_peakProfileComposite->getFunction(i)); } -Kernel::V3D PawleyFunction::getPeakHKL(size_t i) const { return m_hkls[i]; } +/// Return the HKL of the i-th peak. +Kernel::V3D PawleyFunction::getPeakHKL(size_t i) const { + if (i >= m_hkls.size()) { + throw std::out_of_range("Peak index out of range."); + } + + return m_hkls[i]; +} +/// Returns the internally stored PawleyParameterFunction. PawleyParameterFunction_sptr PawleyFunction::getPawleyParameterFunction() const { return m_pawleyParameterFunction; @@ -345,6 +421,7 @@ void PawleyFunction::init() { } } +/// Checks that the decorated function has the correct structure. void PawleyFunction::beforeDecoratedFunctionSet(const API::IFunction_sptr &fn) { CompositeFunction_sptr composite = boost::dynamic_pointer_cast(fn); From f1f22ee4e5f1bf9f4bbc36092971d17c1cc2c6e5 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Wed, 18 Mar 2015 22:15:49 +0100 Subject: [PATCH 027/126] Refs #11043. PawleyFunction uses Unit --- .../inc/MantidCurveFitting/PawleyFunction.h | 8 +++++ .../CurveFitting/src/PawleyFunction.cpp | 35 +++++++++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h index 4bd4beb2d83d..953cdd6ac127 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -4,6 +4,7 @@ #include "MantidKernel/System.h" #include "MantidAPI/CompositeFunction.h" #include "MantidAPI/FunctionParameterDecorator.h" +#include "MantidAPI/MatrixWorkspace.h" #include "MantidAPI/IPeakFunction.h" #include "MantidAPI/ParamFunction.h" @@ -113,6 +114,10 @@ class PawleyFunction : public API::FunctionParameterDecorator { /// Returns the name of the function. std::string name() const { return "PawleyFunction"; } + void + setMatrixWorkspace(boost::shared_ptr workspace, + size_t wi, double startX, double endX); + void setCrystalSystem(const std::string &crystalSystem); void setProfileFunction(const std::string &profileFunction); void setUnitCell(const std::string &unitCellString); @@ -146,6 +151,9 @@ class PawleyFunction : public API::FunctionParameterDecorator { API::CompositeFunction_sptr m_peakProfileComposite; std::vector m_hkls; + + Kernel::Unit_sptr m_dUnit; + Kernel::Unit_sptr m_wsUnit; }; typedef boost::shared_ptr PawleyFunction_sptr; diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp index 25f6476ac0e3..08d0157ea213 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -1,6 +1,8 @@ #include "MantidCurveFitting/PawleyFunction.h" #include "MantidAPI/FunctionFactory.h" +#include "MantidKernel/UnitConversion.h" +#include "MantidKernel/UnitFactory.h" #include #include @@ -12,6 +14,7 @@ DECLARE_FUNCTION(PawleyParameterFunction) using namespace API; using namespace Geometry; +using namespace Kernel; /// Constructor PawleyParameterFunction::PawleyParameterFunction() @@ -265,7 +268,27 @@ DECLARE_FUNCTION(PawleyFunction) /// Constructor PawleyFunction::PawleyFunction() : FunctionParameterDecorator(), m_compositeFunction(), - m_pawleyParameterFunction(), m_peakProfileComposite(), m_hkls() {} + m_pawleyParameterFunction(), m_peakProfileComposite(), m_hkls(), + m_dUnit(), m_wsUnit() {} + +void PawleyFunction::setMatrixWorkspace( + boost::shared_ptr workspace, size_t wi, + double startX, double endX) { + if (workspace) { + Axis *xAxis = workspace->getAxis(0); + + Kernel::Unit_sptr wsUnit = xAxis->unit(); + + double factor, power; + if (wsUnit->quickConversion(*m_dUnit, factor, power)) { + m_wsUnit = wsUnit; + } else { + throw std::invalid_argument("Can not use quick conversion for unit."); + } + } + + m_wrappedFunction->setMatrixWorkspace(workspace, wi, startX, endX); +} /// Sets the crystal system on the internal parameter function and updates the /// exposed parameters @@ -331,10 +354,14 @@ void PawleyFunction::function(const FunctionDomain &domain, double zeroShift = m_pawleyParameterFunction->getParameter("ZeroShift"); for (size_t i = 0; i < m_hkls.size(); ++i) { - double d = cell.d(m_hkls[i]) + zeroShift; + double d = cell.d(m_hkls[i]); + + double centre = UnitConversion::run(*m_dUnit, *m_wsUnit, d, 0, 0, 0, + DeltaEMode::Elastic, 0); m_peakProfileComposite->getFunction(i)->setParameter( - m_pawleyParameterFunction->getProfileFunctionCenterParameterName(), d); + m_pawleyParameterFunction->getProfileFunctionCenterParameterName(), + centre + zeroShift); } m_peakProfileComposite->function(domain, values); @@ -419,6 +446,8 @@ void PawleyFunction::init() { throw std::runtime_error( "PawleyFunction could not construct internal CompositeFunction."); } + + m_dUnit = UnitFactory::Instance().create("dSpacing"); } /// Checks that the decorated function has the correct structure. From 77d662a993610c047ff4cf64542cf31a432ecbde Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Wed, 18 Mar 2015 22:16:03 +0100 Subject: [PATCH 028/126] Refs #11043. PawleyFit uses Unit --- .../inc/MantidCurveFitting/PawleyFit.h | 8 ++- .../Framework/CurveFitting/src/PawleyFit.cpp | 56 ++++++++++++++++--- 2 files changed, 54 insertions(+), 10 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h index e6bef5331e31..f5b9802fb8d0 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h @@ -4,6 +4,7 @@ #include "MantidKernel/System.h" #include "MantidAPI/Algorithm.h" #include "MantidCurveFitting/PawleyFunction.h" +#include "MantidKernel/Unit.h" namespace Mantid { namespace CurveFitting { @@ -42,16 +43,19 @@ namespace CurveFitting { */ class DLLExport PawleyFit : public API::Algorithm { public: + PawleyFit(); virtual ~PawleyFit() {} const std::string name() const { return "PawleyFit"; } int version() const { return 1; } const std::string summary() const; + const std::string category() const { return "Diffraction"; } protected: std::vector hklsFromString(const std::string &hklString) const; void addHKLsToFunction(PawleyFunction_sptr &pawleyFn, - const API::ITableWorkspace_sptr &tableWs) const; + const API::ITableWorkspace_sptr &tableWs, + const Kernel::Unit_sptr &unit) const; Kernel::V3D getHkl(const std::string &hklString) const; @@ -62,6 +66,8 @@ class DLLExport PawleyFit : public API::Algorithm { void init(); void exec(); + + Kernel::Unit_sptr m_dUnit; }; } // namespace CurveFitting diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index b4baddb06361..12b61a486741 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -6,6 +6,8 @@ #include "MantidGeometry/Crystal/UnitCell.h" #include "MantidKernel/ListValidator.h" +#include "MantidKernel/UnitFactory.h" +#include "MantidKernel/UnitConversion.h" #include @@ -18,6 +20,8 @@ using namespace Geometry; DECLARE_ALGORITHM(PawleyFit); +PawleyFit::PawleyFit() : Algorithm(), m_dUnit() {} + const std::string PawleyFit::summary() const { return "This algorithm performs a Pawley-fit on the supplied workspace."; } @@ -36,7 +40,8 @@ std::vector PawleyFit::hklsFromString(const std::string &hklString) const { } void PawleyFit::addHKLsToFunction(PawleyFunction_sptr &pawleyFn, - const ITableWorkspace_sptr &tableWs) const { + const ITableWorkspace_sptr &tableWs, + const Unit_sptr &unit) const { if (!tableWs || !pawleyFn) { throw std::invalid_argument("Can only process non-null function & table."); } @@ -48,9 +53,13 @@ void PawleyFit::addHKLsToFunction(PawleyFunction_sptr &pawleyFn, try { V3D hkl = getHkl(currentRow.String(0)); + double d = boost::lexical_cast(currentRow.String(1)); + double center = UnitConversion::run(*m_dUnit, *unit, d, 0, 0, 0, + DeltaEMode::Elastic, 0); + double fwhm = boost::lexical_cast(currentRow.String(4)) * center; + double height = boost::lexical_cast(currentRow.String(3)); - double fwhm = boost::lexical_cast(currentRow.String(4)) * d; pawleyFn->addPeak(hkl, fwhm, height); } @@ -144,6 +153,9 @@ void PawleyFit::init() { declareProperty("WorkspaceIndex", 0, "Spectrum on which the fit should be performed."); + declareProperty("StartX", 0, "Lower border of fitted data range."); + declareProperty("EndX", 0, "Upper border of fitted data range."); + std::vector crystalSystems; crystalSystems.push_back("Cubic"); crystalSystems.push_back("Tetragonal"); @@ -198,24 +210,32 @@ void PawleyFit::init() { new WorkspaceProperty("RefinedPeakParameterTable", "", Direction::Output), "TableWorkspace with refined peak parameters, including errors."); + + m_dUnit = UnitFactory::Instance().create("dSpacing"); } void PawleyFit::exec() { - boost::shared_ptr pawleyFn = - boost::dynamic_pointer_cast( - FunctionFactory::Instance().createFunction("PawleyFunction")); + // Setup PawleyFunction with cell from input parameters + PawleyFunction_sptr pawleyFn = boost::dynamic_pointer_cast( + FunctionFactory::Instance().createFunction("PawleyFunction")); pawleyFn->setProfileFunction(getProperty("PeakProfileFunction")); pawleyFn->setCrystalSystem(getProperty("CrystalSystem")); pawleyFn->setUnitCell(getProperty("InitialCell")); + // Get the input workspace with the data MatrixWorkspace_const_sptr ws = getProperty("InputWorkspace"); int wsIndex = getProperty("WorkspaceIndex"); + // and also the peak table, if there is one Property *peakTableProperty = getPointerToProperty("PeakTable"); if (!peakTableProperty->isDefault()) { ITableWorkspace_sptr peakTable = getProperty("PeakTable"); - addHKLsToFunction(pawleyFn, peakTable); + + Axis *xAxis = ws->getAxis(0); + Unit_sptr xUnit = xAxis->unit(); + + addHKLsToFunction(pawleyFn, peakTable, xUnit); } else { std::vector hkls = hklsFromString(getProperty("MillerIndices")); @@ -224,16 +244,33 @@ void PawleyFit::exec() { *(std::max_element(data.begin(), data.end()))); } + // Determine if zero-shift should be refined bool refineZeroShift = getProperty("RefineZeroShift"); if (!refineZeroShift) { pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift")); } + // Get x-range start and end values, depending on user input const MantidVec &xData = ws->readX(static_cast(wsIndex)); - pawleyFn->setMatrixWorkspace(ws, static_cast(wsIndex), xData.front(), - xData.back()); + double startX = xData.front(); + double endX = xData.back(); + + Property *startXProperty = getPointerToProperty("StartX"); + if (!startXProperty->isDefault()) { + double startXInput = getProperty("StartX"); + startX = std::max(startX, startXInput); + } + + Property *endXProperty = getPointerToProperty("EndX"); + if (!endXProperty->isDefault()) { + double endXInput = getProperty("EndX"); + endX = std::max(endX, endXInput); + } + + pawleyFn->setMatrixWorkspace(ws, static_cast(wsIndex), startX, endX); - Algorithm_sptr fit = createChildAlgorithm("Fit"); + // Generate Fit-algorithm with required properties. + Algorithm_sptr fit = createChildAlgorithm("Fit", -1, -1, true); fit->setProperty("Function", boost::static_pointer_cast(pawleyFn)); fit->setProperty("InputWorkspace", boost::const_pointer_cast(ws)); @@ -241,6 +278,7 @@ void PawleyFit::exec() { fit->setProperty("CreateOutput", true); fit->execute(); + // Create output MatrixWorkspace_sptr output = fit->getProperty("OutputWorkspace"); setProperty("OutputWorkspace", output); setProperty("RefinedCellTable", getLatticeFromFunction(pawleyFn)); From 307851998d525ee5af922077773db6fcf5650558 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Wed, 18 Mar 2015 22:17:19 +0100 Subject: [PATCH 029/126] Refs #11043. Fixing validation problem in PoldiIndexKnownCompound This was a very annoying problem which was caused by too strict validation. --- .../SINQ/src/PoldiIndexKnownCompounds.cpp | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/Code/Mantid/Framework/SINQ/src/PoldiIndexKnownCompounds.cpp b/Code/Mantid/Framework/SINQ/src/PoldiIndexKnownCompounds.cpp index ee0bf9f4dd06..80eb0093d737 100644 --- a/Code/Mantid/Framework/SINQ/src/PoldiIndexKnownCompounds.cpp +++ b/Code/Mantid/Framework/SINQ/src/PoldiIndexKnownCompounds.cpp @@ -201,19 +201,25 @@ std::vector PoldiIndexKnownCompounds::getWorkspaces( std::vector workspaces; for (auto it = workspaceNames.begin(); it != workspaceNames.end(); ++it) { - Workspace_sptr currentWorkspace = - AnalysisDataService::Instance().retrieveWS(*it); - - WorkspaceGroup_sptr groupTest = - boost::dynamic_pointer_cast(currentWorkspace); - if (groupTest) { - std::vector workspacesNextLevel = - getWorkspaces(groupTest->getNames()); - - workspaces.insert(workspaces.end(), workspacesNextLevel.begin(), - workspacesNextLevel.end()); - } else { - workspaces.insert(workspaces.end(), currentWorkspace); + try { + Workspace_sptr currentWorkspace = + AnalysisDataService::Instance().retrieveWS(*it); + + WorkspaceGroup_sptr groupTest = + boost::dynamic_pointer_cast(currentWorkspace); + if (groupTest) { + std::vector workspacesNextLevel = + getWorkspaces(groupTest->getNames()); + + workspaces.insert(workspaces.end(), workspacesNextLevel.begin(), + workspacesNextLevel.end()); + } else { + workspaces.insert(workspaces.end(), currentWorkspace); + } + } + catch (Kernel::Exception::NotFoundError) { + Workspace_sptr invalid; + workspaces.insert(workspaces.end(), invalid); } } @@ -719,8 +725,8 @@ void PoldiIndexKnownCompounds::assignPeakIndex(const IndexCandidatePair &candidate) { candidate.observed->setHKL(candidate.candidate->hkl()); - m_indexedPeaks[candidate.candidateCollectionIndex]->addPeak( - candidate.observed); + m_indexedPeaks[candidate.candidateCollectionIndex] + ->addPeak(candidate.observed); } PoldiPeakCollection_sptr From 5523b29587446bc5f5936cd4ec73cbb95ab5ade6 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Wed, 18 Mar 2015 17:20:01 -0400 Subject: [PATCH 030/126] Refs #1140. Added -pedantic to CFLAGS. --- Code/Mantid/Build/CMake/DarwinSetup.cmake | 2 +- Code/Mantid/Build/CMake/GNUSetup.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/Build/CMake/DarwinSetup.cmake b/Code/Mantid/Build/CMake/DarwinSetup.cmake index 59a5d0a6be29..9821a44e261d 100644 --- a/Code/Mantid/Build/CMake/DarwinSetup.cmake +++ b/Code/Mantid/Build/CMake/DarwinSetup.cmake @@ -80,7 +80,7 @@ endif () # Force 64-bit compiler as that's all we support ########################################################################### -set ( CLANG_WARNINGS "-Wall -Wextra -Winit-self -Wpointer-arith -Wcast-qual -fno-common -Wno-deprecated-register") +set ( CLANG_WARNINGS "-Wall -Wextra -pedantic -Winit-self -Wpointer-arith -Wcast-qual -fno-common -Wno-deprecated-register") set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 ${CLANG_WARNINGS}" ) set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=c++0x" ) diff --git a/Code/Mantid/Build/CMake/GNUSetup.cmake b/Code/Mantid/Build/CMake/GNUSetup.cmake index 37d6f9bc32db..aa1eac0b7912 100644 --- a/Code/Mantid/Build/CMake/GNUSetup.cmake +++ b/Code/Mantid/Build/CMake/GNUSetup.cmake @@ -15,7 +15,7 @@ elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) endif() # Global warning flags. -set( GNUFLAGS "-Wall -Wextra -Wconversion -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -fno-common" ) +set( GNUFLAGS "-Wall -Wextra -pedantic -Wconversion -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -fno-common" ) # Disable some warnings about deprecated headers and type conversions that # we can't do anything about # -Wno-deprecated: Do not warn about use of deprecated headers. From 3e626a056b936b282cdaa299e534b24afc9d54a2 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Wed, 18 Mar 2015 18:04:08 -0400 Subject: [PATCH 031/126] Refs #11400. Fix all warning on OSX 10.9 --- .../Framework/API/inc/MantidAPI/DomainCreatorFactory.h | 2 +- .../Framework/API/inc/MantidAPI/ScopedWorkspace.h | 2 +- .../MantidCurveFitting/AugmentedLagrangianOptimizer.h | 4 ++-- .../DataHandling/inc/MantidDataHandling/ISISRunLogs.h | 2 +- .../inc/MantidDataHandling/LoadSINQFocus.h | 1 - Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp | 10 ++++++++++ .../Framework/Kernel/inc/MantidKernel/FileDescriptor.h | 4 ++-- .../inc/MantidKernel/FilteredTimeSeriesProperty.h | 2 +- .../Framework/Kernel/inc/MantidKernel/LogFilter.h | 4 ++-- .../Kernel/inc/MantidKernel/MagneticFormFactorTable.h | 4 ++-- .../MantidKernel/Math/Optimization/SLSQPMinimizer.h | 4 ++-- .../Kernel/inc/MantidKernel/MersenneTwister.h | 4 ++-- .../inc/MantidKernel/NDPseudoRandomNumberGenerator.h | 4 ++-- .../Kernel/inc/MantidKernel/NDRandomNumberGenerator.h | 4 ++-- .../Kernel/inc/MantidKernel/NexusDescriptor.h | 4 ++-- .../inc/MantidKernel/PseudoRandomNumberGenerator.h | 2 +- .../Framework/Kernel/inc/MantidKernel/SobolSequence.h | 4 ++-- .../Framework/Kernel/inc/MantidKernel/UnitLabel.h | 2 +- .../Quantification/CachedExperimentInfo.h | 4 ++-- .../Quantification/ForegroundModel.h | 2 +- .../Quantification/ForegroundModelFactory.h | 2 +- .../Quantification/MDResolutionConvolution.h | 2 +- .../Quantification/MDResolutionConvolutionFactory.h | 2 +- .../Resolution/ModeratorChopperResolution.h | 4 ++-- .../Quantification/Resolution/TobyFitResolutionModel.h | 2 +- .../api/FitFunctions/IFunction1DAdapter.h | 4 ++-- .../api/FitFunctions/IFunctionAdapter.h | 4 ++-- .../api/FitFunctions/IPeakFunctionAdapter.h | 4 ++-- .../api/PythonAlgorithm/AlgorithmAdapter.h | 4 ++-- .../api/PythonAlgorithm/DataProcessorAdapter.h | 4 ++-- Code/Mantid/MantidPlot/src/PlotDialog.h | 4 ++-- Code/Mantid/MantidPlot/src/PythonScript.cpp | 2 +- Code/Mantid/MantidPlot/src/PythonThreading.h | 2 +- Code/Mantid/MantidPlot/src/ScriptFileInterpreter.h | 2 +- Code/Mantid/MantidQt/API/inc/MantidQtAPI/PlotAxis.h | 2 +- .../MantidQt/API/inc/MantidQtAPI/QtSignalChannel.h | 2 +- Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h | 2 +- Code/Mantid/MantidQt/API/inc/MantidQtAPI/SignalRange.h | 2 +- .../inc/MantidQtCustomDialogs/SampleShapeHelpers.h | 2 +- .../inc/MantidQtMantidWidgets/MessageDisplay.h | 4 ++-- .../inc/MantidQtMantidWidgets/ScriptEditor.h | 2 +- .../Mantid/MantidQt/MantidWidgets/src/pqHelpWindow.cxx | 2 +- .../PeakOverlayViewFactorySelector.h | 2 +- 43 files changed, 70 insertions(+), 61 deletions(-) diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/DomainCreatorFactory.h b/Code/Mantid/Framework/API/inc/MantidAPI/DomainCreatorFactory.h index 09f4ab0100b4..0b232c59f0d8 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/DomainCreatorFactory.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/DomainCreatorFactory.h @@ -59,7 +59,7 @@ class MANTID_API_DLL DomainCreatorFactoryImpl /// Private Constructor for singleton class DomainCreatorFactoryImpl(); /// No copying - DISABLE_COPY_AND_ASSIGN(DomainCreatorFactoryImpl); + DISABLE_COPY_AND_ASSIGN(DomainCreatorFactoryImpl) /// Private Destructor for singleton virtual ~DomainCreatorFactoryImpl(); diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/ScopedWorkspace.h b/Code/Mantid/Framework/API/inc/MantidAPI/ScopedWorkspace.h index e379a04431fb..50595222e3f2 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/ScopedWorkspace.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/ScopedWorkspace.h @@ -74,7 +74,7 @@ class DLLExport ScopedWorkspace { void set(Workspace_sptr newWS); private: - DISABLE_COPY_AND_ASSIGN(ScopedWorkspace); + DISABLE_COPY_AND_ASSIGN(ScopedWorkspace) /// ADS name of the workspace const std::string m_name; diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/AugmentedLagrangianOptimizer.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/AugmentedLagrangianOptimizer.h index ae06a79fe7bf..8bbc05dd38b5 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/AugmentedLagrangianOptimizer.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/AugmentedLagrangianOptimizer.h @@ -154,8 +154,8 @@ class MANTID_CURVEFITTING_DLL AugmentedLagrangianOptimizer { void minimize(std::vector &xv) const; private: - DISABLE_DEFAULT_CONSTRUCT(AugmentedLagrangianOptimizer); - DISABLE_COPY_AND_ASSIGN(AugmentedLagrangianOptimizer); + DISABLE_DEFAULT_CONSTRUCT(AugmentedLagrangianOptimizer) + DISABLE_COPY_AND_ASSIGN(AugmentedLagrangianOptimizer) friend class UnconstrainedCostFunction; /// Using gradient optimizer to perform limited optimization of current set diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/ISISRunLogs.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/ISISRunLogs.h index f1e2f3064e39..a939a0aa63dc 100644 --- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/ISISRunLogs.h +++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/ISISRunLogs.h @@ -54,7 +54,7 @@ class DLLExport ISISRunLogs { void addPeriodLogs(const int period, API::Run &exptRun); private: - DISABLE_DEFAULT_CONSTRUCT(ISISRunLogs); + DISABLE_DEFAULT_CONSTRUCT(ISISRunLogs) /// A LogParser object boost::scoped_ptr m_logParser; diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadSINQFocus.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadSINQFocus.h index caa363519fdd..10e6588a8a0d 100644 --- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadSINQFocus.h +++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadSINQFocus.h @@ -77,7 +77,6 @@ class DLLExport LoadSINQFocus std::vector m_supportedInstruments; std::string m_instrumentName; std::string m_instrumentPath; - ; API::MatrixWorkspace_sptr m_localWorkspace; size_t m_numberOfTubes; // number of tubes - X size_t m_numberOfPixelsPerTube; // number of pixels per tube - Y diff --git a/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp b/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp index 772c86749749..25dd7c0b6e3c 100644 --- a/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp @@ -25,11 +25,21 @@ DECLARE_ALGORITHM(SaveSPE) * @throws std::runtime_error :: throws when there is a problem writing to disk, * usually disk space or permissions based */ + +#if __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif + #define FPRINTF_WITH_EXCEPTION(stream, format, ...) \ if (fprintf(stream, format, ##__VA_ARGS__) <= 0) { \ throw std::runtime_error( \ "Error writing to file. Check folder permissions and disk space."); \ } + +#if __clang__ +#pragma clang diagnostic pop +#endif using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/FileDescriptor.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/FileDescriptor.h index bb5a73ee5e12..ec76acae46bb 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/FileDescriptor.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/FileDescriptor.h @@ -78,8 +78,8 @@ class MANTID_KERNEL_DLL FileDescriptor { void resetStreamToStart(); private: - DISABLE_DEFAULT_CONSTRUCT(FileDescriptor); - DISABLE_COPY_AND_ASSIGN(FileDescriptor); + DISABLE_DEFAULT_CONSTRUCT(FileDescriptor) + DISABLE_COPY_AND_ASSIGN(FileDescriptor) /// Open the file and cache description elements void initialize(const std::string &filename); diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/FilteredTimeSeriesProperty.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/FilteredTimeSeriesProperty.h index 74a31555811d..6c4d23a45cab 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/FilteredTimeSeriesProperty.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/FilteredTimeSeriesProperty.h @@ -49,7 +49,7 @@ class DLLExport FilteredTimeSeriesProperty const TimeSeriesProperty *unfiltered() const; private: - DISABLE_DEFAULT_CONSTRUCT(FilteredTimeSeriesProperty); + DISABLE_DEFAULT_CONSTRUCT(FilteredTimeSeriesProperty) /// The original unfiltered property as an owned pointer const TimeSeriesProperty *m_unfiltered; diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/LogFilter.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/LogFilter.h index e9384a4ea1aa..7f5b755c6219 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/LogFilter.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/LogFilter.h @@ -68,8 +68,8 @@ class MANTID_KERNEL_DLL LogFilter { void clear(); private: - DISABLE_DEFAULT_CONSTRUCT(LogFilter); - DISABLE_COPY_AND_ASSIGN(LogFilter); + DISABLE_DEFAULT_CONSTRUCT(LogFilter) + DISABLE_COPY_AND_ASSIGN(LogFilter) /// Converts the given property to a TimeSeriesProperty, throws if /// invalid. diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MagneticFormFactorTable.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MagneticFormFactorTable.h index 0e21199f3fed..00bd8c8e67bd 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MagneticFormFactorTable.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MagneticFormFactorTable.h @@ -45,8 +45,8 @@ class MANTID_KERNEL_DLL MagneticFormFactorTable { double value(const double qsqr) const; private: - DISABLE_DEFAULT_CONSTRUCT(MagneticFormFactorTable); - DISABLE_COPY_AND_ASSIGN(MagneticFormFactorTable); + DISABLE_DEFAULT_CONSTRUCT(MagneticFormFactorTable) + DISABLE_COPY_AND_ASSIGN(MagneticFormFactorTable) /// Setup the table with the values void setup(const MagneticIon &ion, const uint16_t j, const uint16_t l); diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h index f536e4caebba..193b623fcfc4 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h @@ -106,8 +106,8 @@ class DLLExport SLSQPMinimizer { std::vector minimize(const std::vector &x0) const; private: - DISABLE_DEFAULT_CONSTRUCT(SLSQPMinimizer); - DISABLE_COPY_AND_ASSIGN(SLSQPMinimizer); + DISABLE_DEFAULT_CONSTRUCT(SLSQPMinimizer) + DISABLE_COPY_AND_ASSIGN(SLSQPMinimizer) /** * Compute the value of the objective function diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MersenneTwister.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MersenneTwister.h index 3b08e05e46c4..5764a762678e 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MersenneTwister.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MersenneTwister.h @@ -80,8 +80,8 @@ class MANTID_KERNEL_DLL MersenneTwister : public PseudoRandomNumberGenerator { virtual void restore(); private: - DISABLE_DEFAULT_CONSTRUCT(MersenneTwister); - DISABLE_COPY_AND_ASSIGN(MersenneTwister); + DISABLE_DEFAULT_CONSTRUCT(MersenneTwister) + DISABLE_COPY_AND_ASSIGN(MersenneTwister) /// The boost Mersenne Twister generator boost::mt19937 m_generator; diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDPseudoRandomNumberGenerator.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDPseudoRandomNumberGenerator.h index b75134878895..29066b78b3b7 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDPseudoRandomNumberGenerator.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDPseudoRandomNumberGenerator.h @@ -65,8 +65,8 @@ class DLLExport NDPseudoRandomNumberGenerator : public NDRandomNumberGenerator { void restore(); private: - DISABLE_DEFAULT_CONSTRUCT(NDPseudoRandomNumberGenerator); - DISABLE_COPY_AND_ASSIGN(NDPseudoRandomNumberGenerator); + DISABLE_DEFAULT_CONSTRUCT(NDPseudoRandomNumberGenerator) + DISABLE_COPY_AND_ASSIGN(NDPseudoRandomNumberGenerator) /// The single value generator SingleValueGenerator m_singleValueGen; diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDRandomNumberGenerator.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDRandomNumberGenerator.h index 4d62f842c950..cbeae096e625 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDRandomNumberGenerator.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/NDRandomNumberGenerator.h @@ -72,8 +72,8 @@ class MANTID_KERNEL_DLL NDRandomNumberGenerator { inline std::vector &getNextPointCache() { return m_nextPoint; } private: - DISABLE_DEFAULT_CONSTRUCT(NDRandomNumberGenerator); - DISABLE_COPY_AND_ASSIGN(NDRandomNumberGenerator); + DISABLE_DEFAULT_CONSTRUCT(NDRandomNumberGenerator) + DISABLE_COPY_AND_ASSIGN(NDRandomNumberGenerator) /// The number of dimensions const unsigned int m_ndims; diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h index 5ae344033873..f46774eebf53 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h @@ -98,8 +98,8 @@ class MANTID_KERNEL_DLL NexusDescriptor { bool classTypeExists(const std::string &classType) const; private: - DISABLE_DEFAULT_CONSTRUCT(NexusDescriptor); - DISABLE_COPY_AND_ASSIGN(NexusDescriptor); + DISABLE_DEFAULT_CONSTRUCT(NexusDescriptor) + DISABLE_COPY_AND_ASSIGN(NexusDescriptor) /// Initialize object with filename void initialize(const std::string &filename); diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/PseudoRandomNumberGenerator.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/PseudoRandomNumberGenerator.h index c6c1805f4938..06d1c067c571 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/PseudoRandomNumberGenerator.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/PseudoRandomNumberGenerator.h @@ -51,7 +51,7 @@ class MANTID_KERNEL_DLL PseudoRandomNumberGenerator virtual void generateNextPoint(); private: - DISABLE_COPY_AND_ASSIGN(PseudoRandomNumberGenerator); + DISABLE_COPY_AND_ASSIGN(PseudoRandomNumberGenerator) }; } } diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/SobolSequence.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/SobolSequence.h index 4d0be933d00f..b45ed71c2dee 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/SobolSequence.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/SobolSequence.h @@ -57,8 +57,8 @@ class MANTID_KERNEL_DLL SobolSequence : public QuasiRandomNumberSequence { void restore(); private: - DISABLE_DEFAULT_CONSTRUCT(SobolSequence); - DISABLE_COPY_AND_ASSIGN(SobolSequence); + DISABLE_DEFAULT_CONSTRUCT(SobolSequence) + DISABLE_COPY_AND_ASSIGN(SobolSequence) /// Set the number of dimensions void setNumberOfDimensions(const unsigned int ndims); diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/UnitLabel.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/UnitLabel.h index 6cb1eb6cdc35..0cd9829df37d 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/UnitLabel.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/UnitLabel.h @@ -80,7 +80,7 @@ class MANTID_KERNEL_DLL UnitLabel { operator std::string() const; private: - DISABLE_DEFAULT_CONSTRUCT(UnitLabel); + DISABLE_DEFAULT_CONSTRUCT(UnitLabel) /// Value of plain-text label std::string m_ascii; diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/CachedExperimentInfo.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/CachedExperimentInfo.h index a4a590186b0c..22d7b317caca 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/CachedExperimentInfo.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/CachedExperimentInfo.h @@ -78,8 +78,8 @@ class DLLExport CachedExperimentInfo { const Kernel::DblMatrix &sampleToDetectorTransform() const; private: - DISABLE_DEFAULT_CONSTRUCT(CachedExperimentInfo); - DISABLE_COPY_AND_ASSIGN(CachedExperimentInfo); + DISABLE_DEFAULT_CONSTRUCT(CachedExperimentInfo) + DISABLE_COPY_AND_ASSIGN(CachedExperimentInfo) /// Cache frequently used values void initCaches(const Geometry::Instrument_const_sptr &instrument, diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModel.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModel.h index a7e03768a32f..29a258d31bf3 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModel.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModel.h @@ -107,7 +107,7 @@ class DLLExport ForegroundModel : public API::ParamFunction { double &arlu2, double &arlu3); private: - DISABLE_COPY_AND_ASSIGN(ForegroundModel); + DISABLE_COPY_AND_ASSIGN(ForegroundModel) /// Required by the interface void function(const Mantid::API::FunctionDomain &, diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModelFactory.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModelFactory.h index 7a2ce0cf3e36..5bb9e80788bd 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModelFactory.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModelFactory.h @@ -57,7 +57,7 @@ class MANTID_MDALGORITHMS_DLL ForegroundModelFactoryImpl friend struct Kernel::CreateUsingNew; /// Default constructor ForegroundModelFactoryImpl(); - DISABLE_COPY_AND_ASSIGN(ForegroundModelFactoryImpl); + DISABLE_COPY_AND_ASSIGN(ForegroundModelFactoryImpl) // Do not allow the default create & createUnwrapped to be called using BaseClass::create; diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolution.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolution.h index 5e2184882dc6..3be84661565f 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolution.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolution.h @@ -117,7 +117,7 @@ class DLLExport MDResolutionConvolution : public API::ParamFunction { const API::IFunctionMD &getFittingFunction() const; private: - DISABLE_COPY_AND_ASSIGN(MDResolutionConvolution); + DISABLE_COPY_AND_ASSIGN(MDResolutionConvolution) /// Required for function interface void function(const Mantid::API::FunctionDomain &, diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolutionFactory.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolutionFactory.h index 1c3d66d59226..005d9af1314d 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolutionFactory.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolutionFactory.h @@ -56,7 +56,7 @@ class MANTID_MDALGORITHMS_DLL MDResolutionConvolutionFactoryImpl friend struct Kernel::CreateUsingNew; /// Default constructor. Private for singleton holder MDResolutionConvolutionFactoryImpl(); - DISABLE_COPY_AND_ASSIGN(MDResolutionConvolutionFactoryImpl); + DISABLE_COPY_AND_ASSIGN(MDResolutionConvolutionFactoryImpl) // Do not allow the default create & createUnwrapped to be called using BaseClass::create; diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/ModeratorChopperResolution.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/ModeratorChopperResolution.h index 27fea7faefba..429d7b56bf15 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/ModeratorChopperResolution.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/ModeratorChopperResolution.h @@ -57,8 +57,8 @@ class DLLExport ModeratorChopperResolution { double energyWidth(const double deltaE) const; private: - DISABLE_DEFAULT_CONSTRUCT(ModeratorChopperResolution); - DISABLE_COPY_AND_ASSIGN(ModeratorChopperResolution); + DISABLE_DEFAULT_CONSTRUCT(ModeratorChopperResolution) + DISABLE_COPY_AND_ASSIGN(ModeratorChopperResolution) /// Store required cached variables void initCaches(); diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitResolutionModel.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitResolutionModel.h index 11822cc28d30..df512cf7df71 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitResolutionModel.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitResolutionModel.h @@ -77,7 +77,7 @@ class DLLExport TobyFitResolutionModel : public MDResolutionConvolution { const size_t eventIndex) const; private: - DISABLE_COPY_AND_ASSIGN(TobyFitResolutionModel); + DISABLE_COPY_AND_ASSIGN(TobyFitResolutionModel) friend class TobyFitYVector; diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunction1DAdapter.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunction1DAdapter.h index f8eb459d600f..4dfd15fa5952 100644 --- a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunction1DAdapter.h +++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunction1DAdapter.h @@ -62,8 +62,8 @@ class IFunction1DAdapter : public virtual API::ParamFunction, private: /// The PyObject must be supplied to construct the object - DISABLE_DEFAULT_CONSTRUCT(IFunction1DAdapter); - DISABLE_COPY_AND_ASSIGN(IFunction1DAdapter); + DISABLE_DEFAULT_CONSTRUCT(IFunction1DAdapter) + DISABLE_COPY_AND_ASSIGN(IFunction1DAdapter) /// Flag if the functionDeriv1D method is overridden (avoids multiple checks) bool m_derivOveridden; diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunctionAdapter.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunctionAdapter.h index 791e261ac94a..30479217d156 100644 --- a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunctionAdapter.h +++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IFunctionAdapter.h @@ -106,8 +106,8 @@ class IFunctionAdapter : virtual public API::IFunction { private: /// The PyObject must be supplied to construct the object - DISABLE_DEFAULT_CONSTRUCT(IFunctionAdapter); - DISABLE_COPY_AND_ASSIGN(IFunctionAdapter); + DISABLE_DEFAULT_CONSTRUCT(IFunctionAdapter) + DISABLE_COPY_AND_ASSIGN(IFunctionAdapter) /// The name of the function std::string m_name; diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IPeakFunctionAdapter.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IPeakFunctionAdapter.h index 73a5d5a485bc..a9e32e733de2 100644 --- a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IPeakFunctionAdapter.h +++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/FitFunctions/IPeakFunctionAdapter.h @@ -87,8 +87,8 @@ class IPeakFunctionAdapter : public virtual API::IPeakFunction, private: /// The PyObject must be supplied to construct the object - DISABLE_DEFAULT_CONSTRUCT(IPeakFunctionAdapter); - DISABLE_COPY_AND_ASSIGN(IPeakFunctionAdapter); + DISABLE_DEFAULT_CONSTRUCT(IPeakFunctionAdapter) + DISABLE_COPY_AND_ASSIGN(IPeakFunctionAdapter) }; } } diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/AlgorithmAdapter.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/AlgorithmAdapter.h index 8da49cf8c2fc..4ff4e6147e71 100644 --- a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/AlgorithmAdapter.h +++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/AlgorithmAdapter.h @@ -123,8 +123,8 @@ class AlgorithmAdapter : public BaseAlgorithm { private: /// The PyObject must be supplied to construct the object - DISABLE_DEFAULT_CONSTRUCT(AlgorithmAdapter); - DISABLE_COPY_AND_ASSIGN(AlgorithmAdapter); + DISABLE_DEFAULT_CONSTRUCT(AlgorithmAdapter) + DISABLE_COPY_AND_ASSIGN(AlgorithmAdapter) /// Private init for this algorithm virtual void init(); diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/DataProcessorAdapter.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/DataProcessorAdapter.h index f635b0bd4651..56d0093b0a8e 100644 --- a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/DataProcessorAdapter.h +++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/api/PythonAlgorithm/DataProcessorAdapter.h @@ -100,8 +100,8 @@ class DataProcessorAdapter private: /// The PyObject must be supplied to construct the object - DISABLE_DEFAULT_CONSTRUCT(DataProcessorAdapter); - DISABLE_COPY_AND_ASSIGN(DataProcessorAdapter); + DISABLE_DEFAULT_CONSTRUCT(DataProcessorAdapter) + DISABLE_COPY_AND_ASSIGN(DataProcessorAdapter) }; } } diff --git a/Code/Mantid/MantidPlot/src/PlotDialog.h b/Code/Mantid/MantidPlot/src/PlotDialog.h index f5e1d9017a55..bd58dfa8dfaa 100644 --- a/Code/Mantid/MantidPlot/src/PlotDialog.h +++ b/Code/Mantid/MantidPlot/src/PlotDialog.h @@ -181,7 +181,7 @@ protected slots: ColorMapEditor *colorMapEditor; QPushButton* mSelectColormap; QString mCurrentColorMap; - QWidget *curvePlotTypeBox, *layerPage, *layerGeometryPage, *piePage, *fontsPage, *printPage, *contourLinesPage;; + QWidget *curvePlotTypeBox, *layerPage, *layerGeometryPage, *piePage, *fontsPage, *printPage, *contourLinesPage; QTreeWidget* listBox; QCheckBox *boxAntialiasing, *boxAll, *boxScaleLayers, *boxPrintCrops; ColorButton *boxBorderColor, *boxBackgroundColor, *boxCanvasColor, *boxCanvasFrameColor; @@ -236,7 +236,7 @@ protected slots: QLabel *boxRangeLabel, *whiskerCntLabel, *boxCntLabel; QGroupBox *GroupBoxVectEnd; QComboBox *vectPosBox, *boxXAxis, *boxYAxis, *colorScaleBox;//, *boxContourStyle; - PenStyleBox *penContourStyle,*boxContourStyle;; + PenStyleBox *penContourStyle,*boxContourStyle; QSpinBox *levelsBox, *colorScaleWidthBox; DoubleSpinBox *contourWidthBox; QGroupBox *levelsGroupBox, *axisScaleBox, *imageGroupBox; diff --git a/Code/Mantid/MantidPlot/src/PythonScript.cpp b/Code/Mantid/MantidPlot/src/PythonScript.cpp index 990bcbf2ab77..6396aef2af39 100644 --- a/Code/Mantid/MantidPlot/src/PythonScript.cpp +++ b/Code/Mantid/MantidPlot/src/PythonScript.cpp @@ -686,7 +686,7 @@ namespace } private: InstallTrace(); - Q_DISABLE_COPY(InstallTrace); + Q_DISABLE_COPY(InstallTrace) PyObject *m_sipWrappedScript; }; } diff --git a/Code/Mantid/MantidPlot/src/PythonThreading.h b/Code/Mantid/MantidPlot/src/PythonThreading.h index 663b68568f40..83a659aa76fc 100644 --- a/Code/Mantid/MantidPlot/src/PythonThreading.h +++ b/Code/Mantid/MantidPlot/src/PythonThreading.h @@ -18,7 +18,7 @@ struct GlobalInterpreterLock PyGILState_Release(m_state); } private: - Q_DISABLE_COPY(GlobalInterpreterLock); + Q_DISABLE_COPY(GlobalInterpreterLock) /// Current GIL state PyGILState_STATE m_state; }; diff --git a/Code/Mantid/MantidPlot/src/ScriptFileInterpreter.h b/Code/Mantid/MantidPlot/src/ScriptFileInterpreter.h index 785f6119a25f..705efe9a4ebe 100644 --- a/Code/Mantid/MantidPlot/src/ScriptFileInterpreter.h +++ b/Code/Mantid/MantidPlot/src/ScriptFileInterpreter.h @@ -123,7 +123,7 @@ private slots: void setStoppedStatus(); private: - Q_DISABLE_COPY(ScriptFileInterpreter); + Q_DISABLE_COPY(ScriptFileInterpreter) void setupChildWidgets(); void setupEditor(const ScriptingEnv & environ, const QString & identifier); diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/PlotAxis.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/PlotAxis.h index 6da97440087d..6cf577e0b7c7 100644 --- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/PlotAxis.h +++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/PlotAxis.h @@ -50,7 +50,7 @@ namespace MantidQt QString title() const; private: - DISABLE_DEFAULT_CONSTRUCT(PlotAxis); + DISABLE_DEFAULT_CONSTRUCT(PlotAxis) /// Creates a title suitable for an axis attached to the given index void titleFromIndex(const Mantid::API::IMDWorkspace & workspace, diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/QtSignalChannel.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/QtSignalChannel.h index 50dfe80ca77d..b598204b47d0 100644 --- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/QtSignalChannel.h +++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/QtSignalChannel.h @@ -66,7 +66,7 @@ namespace MantidQt void messageReceived(const Message & msg); private: - Q_DISABLE_COPY(QtSignalChannel); + Q_DISABLE_COPY(QtSignalChannel) /// Optional source (use std::string to avoid conversion in comparison) QString m_source; diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h index 8ecc05547ef1..cd4cd846ea52 100644 --- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h +++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h @@ -223,7 +223,7 @@ const QString DELETABLEENTRY = "deletable"; /// auxiliary method to help populating the model RepoItem * getParent(const QString & folder, QList&parents); - Q_DISABLE_COPY(RepoModel); + Q_DISABLE_COPY(RepoModel) /// auxiliary method to deal with exceptions void handleExceptions(const Mantid::API::ScriptRepoException & ex, diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/SignalRange.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/SignalRange.h index 5e8cf13d9277..99a9ebba7ea6 100644 --- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/SignalRange.h +++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/SignalRange.h @@ -47,7 +47,7 @@ namespace MantidQt QwtDoubleInterval interval() const; private: - DISABLE_DEFAULT_CONSTRUCT(SignalRange); + DISABLE_DEFAULT_CONSTRUCT(SignalRange) /// Find the min/max signal values in the entire workspace void findFullRange(const Mantid::API::IMDWorkspace & workspace, diff --git a/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/SampleShapeHelpers.h b/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/SampleShapeHelpers.h index 4a774a9bfdf3..a83e99cb3bcb 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/SampleShapeHelpers.h +++ b/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/SampleShapeHelpers.h @@ -34,7 +34,7 @@ class ShapeDetails; */ class PointGroupBox : public QGroupBox { - Q_OBJECT; + Q_OBJECT public: //Default constructor diff --git a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MessageDisplay.h b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MessageDisplay.h index 5b5a1393bcb9..11d940adb38f 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MessageDisplay.h +++ b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MessageDisplay.h @@ -41,7 +41,7 @@ namespace MantidQt class EXPORT_OPT_MANTIDQT_MANTIDWIDGETS MessageDisplay : public QWidget { Q_OBJECT - Q_PROPERTY(QString source READ source WRITE setSource); + Q_PROPERTY(QString source READ source WRITE setSource) public: /// Controls whether the display is allowed to set the log levels @@ -106,7 +106,7 @@ namespace MantidQt void setGlobalLogLevel(int priority); private: - Q_DISABLE_COPY(MessageDisplay); + Q_DISABLE_COPY(MessageDisplay) /// Setup the actions void initActions(); /// Initialize the text formats diff --git a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/ScriptEditor.h b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/ScriptEditor.h index db4b9699f40a..357f91374e03 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/ScriptEditor.h +++ b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/ScriptEditor.h @@ -81,7 +81,7 @@ struct EXPORT_OPT_MANTIDQT_MANTIDWIDGETS CommandHistory class EXPORT_OPT_MANTIDQT_MANTIDWIDGETS ScriptEditor : public QsciScintilla { // Qt macro - Q_OBJECT; + Q_OBJECT public: /** diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/pqHelpWindow.cxx b/Code/Mantid/MantidQt/MantidWidgets/src/pqHelpWindow.cxx index d1254e69fec2..82bb4d84743c 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/src/pqHelpWindow.cxx +++ b/Code/Mantid/MantidQt/MantidWidgets/src/pqHelpWindow.cxx @@ -170,7 +170,7 @@ class pqHelpWindow::pqNetworkAccessManager : public QNetworkAccessManager } private: - Q_DISABLE_COPY(pqNetworkAccessManager); + Q_DISABLE_COPY(pqNetworkAccessManager) }; // **************************************************************************** diff --git a/Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeakOverlayViewFactorySelector.h b/Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeakOverlayViewFactorySelector.h index bdd50ce73d42..e4b413e2f8a9 100644 --- a/Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeakOverlayViewFactorySelector.h +++ b/Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/PeakOverlayViewFactorySelector.h @@ -21,7 +21,7 @@ namespace MantidQt private: typedef std::set PeakOverlayViewFactorySet; PeakOverlayViewFactorySet m_candidates; - DISABLE_COPY_AND_ASSIGN(PeakOverlayViewFactorySelector); + DISABLE_COPY_AND_ASSIGN(PeakOverlayViewFactorySelector) public: PeakOverlayViewFactorySelector(); ~PeakOverlayViewFactorySelector(); From 5c107da2b5f089025418ca14338a11c47e141e38 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Wed, 18 Mar 2015 18:20:43 -0400 Subject: [PATCH 032/126] Refs #11400. fix warning in tests. [ci skip] --- Code/Mantid/Framework/API/test/VectorParameterParserTest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Mantid/Framework/API/test/VectorParameterParserTest.h b/Code/Mantid/Framework/API/test/VectorParameterParserTest.h index ece3e673a302..305353f12e64 100644 --- a/Code/Mantid/Framework/API/test/VectorParameterParserTest.h +++ b/Code/Mantid/Framework/API/test/VectorParameterParserTest.h @@ -94,7 +94,7 @@ class VectorParameterParserTest : public CxxTest::TestSuite TSM_ASSERT_THROWS("No successor, so should throw!", parser.createParameter(pRootElem), std::runtime_error); } - DECLARE_VECTOR_PARAMETER(SucessorVectorParameter, double); + DECLARE_VECTOR_PARAMETER(SucessorVectorParameter, double) void testChainOfResponsibility() { From ca17e372098ba1fbdd86c7b9b8ab7e4fb259555f Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Thu, 19 Mar 2015 09:14:53 +0100 Subject: [PATCH 033/126] Refs #11043. Make unit transformation in PoldiPeakSearch more clear --- .../SINQ/inc/MantidSINQ/PoldiPeakSearch.h | 4 +++ .../Framework/SINQ/src/PoldiPeakSearch.cpp | 29 ++++++++++++++----- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h b/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h index d3f1a83bf817..fd87762b5bc5 100644 --- a/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h +++ b/Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h @@ -94,11 +94,15 @@ class MANTID_SINQ_DLL PoldiPeakSearch : public API::Algorithm { double minimumPeakHeightFromBackground(UncertainValue backgroundWithSigma) const; + + double getTransformedCenter(double value, + const Kernel::Unit_sptr &unit) const; std::vector getPeaks(const MantidVec::const_iterator &baseListStart, const MantidVec::const_iterator &baseListEnd, std::list peakPositions, const MantidVec &xData, const Kernel::Unit_sptr &unit) const; + double getFWHMEstimate(const MantidVec::const_iterator &baseListStart, const MantidVec::const_iterator &baseListEnd, MantidVec::const_iterator peakPosition, diff --git a/Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp b/Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp index de2e104c3dd2..384743a58340 100644 --- a/Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp +++ b/Code/Mantid/Framework/SINQ/src/PoldiPeakSearch.cpp @@ -199,6 +199,26 @@ PoldiPeakSearch::mapPeakPositionsToCorrelationData( return transformedIndices; } +/// Converts the value-parameter to d-spacing. Assumes unit to be Q if empty. +double PoldiPeakSearch::getTransformedCenter(double value, + const Unit_sptr &unit) const { + if (boost::dynamic_pointer_cast(unit)) { + return value; + } + + // This is required to preserve default behavior which assumes Q. + Unit_sptr transformUnit = unit; + + if (!unit || boost::dynamic_pointer_cast(unit)) { + transformUnit = UnitFactory::Instance().create("MomentumTransfer"); + } + + // Transform value to d-spacing. + Unit_sptr dUnit = UnitFactory::Instance().create("dSpacing"); + return UnitConversion::run((*transformUnit), (*dUnit), value, 0, 0, 0, + DeltaEMode::Elastic, 0.0); +} + /** Creates PoldiPeak-objects from peak position iterators * * In this method, PoldiPeak objects are created from the raw peak position @@ -225,14 +245,7 @@ PoldiPeakSearch::getPeaks(const MantidVec::const_iterator &baseListStart, peak != peakPositions.end(); ++peak) { size_t index = std::distance(baseListStart, *peak); - double xDataD = 0.0; - if (boost::dynamic_pointer_cast(unit)) { - xDataD = xData[index]; - } else { - Unit_sptr dUnit = UnitFactory::Instance().create("dSpacing"); - xDataD = UnitConversion::run((*unit), (*dUnit), xData[index], 0, 0, 0, - DeltaEMode::Elastic, 0.0); - } + double xDataD = getTransformedCenter(xData[index], unit); double fwhmEstimate = getFWHMEstimate(baseListStart, baseListEnd, *peak, xData); From 42323ede4b9c5b54d20564fb0921d16e55532088 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Thu, 19 Mar 2015 10:28:26 +0100 Subject: [PATCH 034/126] Refs #11043. Unit conversion in PawleyFunction more robust --- .../inc/MantidCurveFitting/PawleyFunction.h | 2 ++ .../CurveFitting/src/PawleyFunction.cpp | 30 ++++++++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h index 953cdd6ac127..b8d26a9786ac 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -143,6 +143,8 @@ class PawleyFunction : public API::FunctionParameterDecorator { PawleyParameterFunction_sptr getPawleyParameterFunction() const; protected: + double getTransformedCenter(double d) const; + void init(); void beforeDecoratedFunctionSet(const API::IFunction_sptr &fn); diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp index 08d0157ea213..3567a1497224 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -275,15 +275,19 @@ void PawleyFunction::setMatrixWorkspace( boost::shared_ptr workspace, size_t wi, double startX, double endX) { if (workspace) { - Axis *xAxis = workspace->getAxis(0); - + Axis *xAxis = workspace->getAxis(wi); Kernel::Unit_sptr wsUnit = xAxis->unit(); - double factor, power; - if (wsUnit->quickConversion(*m_dUnit, factor, power)) { - m_wsUnit = wsUnit; + if (boost::dynamic_pointer_cast(wsUnit) || + boost::dynamic_pointer_cast(wsUnit)) { + m_wsUnit = m_dUnit; } else { - throw std::invalid_argument("Can not use quick conversion for unit."); + double factor, power; + if (wsUnit->quickConversion(*m_dUnit, factor, power)) { + m_wsUnit = wsUnit; + } else { + throw std::invalid_argument("Can not use quick conversion for unit."); + } } } @@ -336,6 +340,15 @@ void PawleyFunction::setUnitCell(const std::string &unitCellString) { strToUnitCell(unitCellString)); } +double PawleyFunction::getTransformedCenter(double d) const { + if ((m_dUnit && m_wsUnit) && m_dUnit != m_wsUnit) { + return UnitConversion::run(*m_dUnit, *m_wsUnit, d, 0, 0, 0, + DeltaEMode::Elastic, 0); + } + + return d; +} + /** * Calculates the function values on the supplied domain * @@ -354,10 +367,7 @@ void PawleyFunction::function(const FunctionDomain &domain, double zeroShift = m_pawleyParameterFunction->getParameter("ZeroShift"); for (size_t i = 0; i < m_hkls.size(); ++i) { - double d = cell.d(m_hkls[i]); - - double centre = UnitConversion::run(*m_dUnit, *m_wsUnit, d, 0, 0, 0, - DeltaEMode::Elastic, 0); + double centre = getTransformedCenter(cell.d(m_hkls[i])); m_peakProfileComposite->getFunction(i)->setParameter( m_pawleyParameterFunction->getProfileFunctionCenterParameterName(), From 8bae0e8486334d844ad137afabf1a52cd6b290fa Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Thu, 19 Mar 2015 10:36:45 +0100 Subject: [PATCH 035/126] Refs #11043. Fixing CodeConventions system test --- .../Testing/SystemTests/tests/analysis/CodeConventions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Code/Mantid/Testing/SystemTests/tests/analysis/CodeConventions.py b/Code/Mantid/Testing/SystemTests/tests/analysis/CodeConventions.py index ceb618874de1..b87cc677be76 100644 --- a/Code/Mantid/Testing/SystemTests/tests/analysis/CodeConventions.py +++ b/Code/Mantid/Testing/SystemTests/tests/analysis/CodeConventions.py @@ -53,7 +53,9 @@ "f0_Xoffset", "f0_Yoffset", "f0_Zoffset", "f0_Xrot", "f0_Yrot", "f0_Zrot", "l0", "t0"), - "StretchedExpFT":("height", "tau", "beta") + "StretchedExpFT":("height", "tau", "beta"), + "PawleyParameterFunction":("a","b","c"), + "PawleyFunction":("f0.a","f0.b","f0.c", "f0.Alpha", "f0.Beta", "f0.Gamma", "f0.ZeroShift"), } class Algorithms(stresstesting.MantidStressTest): From 840401c283320f44cdc5498e7c3e1fa6da782614 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Thu, 19 Mar 2015 11:22:28 +0100 Subject: [PATCH 036/126] Refs #11043. Making PawleyFit more flexible regarding table columns --- .../inc/MantidCurveFitting/PawleyFit.h | 2 + .../Framework/CurveFitting/src/PawleyFit.cpp | 52 +++++++++++++------ .../CurveFitting/src/PawleyFunction.cpp | 1 + 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h index f5b9802fb8d0..2279c54ae3b8 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h @@ -51,6 +51,8 @@ class DLLExport PawleyFit : public API::Algorithm { const std::string summary() const; const std::string category() const { return "Diffraction"; } + double getTransformedCenter(const Kernel::Unit_sptr &unit, double d) const; + protected: std::vector hklsFromString(const std::string &hklString) const; void addHKLsToFunction(PawleyFunction_sptr &pawleyFn, diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index 12b61a486741..155c2ae5d3e9 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -39,6 +39,16 @@ std::vector PawleyFit::hklsFromString(const std::string &hklString) const { return hkls; } +double PawleyFit::getTransformedCenter(const Unit_sptr &unit, double d) const { + if (boost::dynamic_pointer_cast(unit) || + boost::dynamic_pointer_cast(unit)) { + return d; + } + + return UnitConversion::run(*m_dUnit, *unit, d, 0, 0, 0, DeltaEMode::Elastic, + 0); +} + void PawleyFit::addHKLsToFunction(PawleyFunction_sptr &pawleyFn, const ITableWorkspace_sptr &tableWs, const Unit_sptr &unit) const { @@ -48,25 +58,33 @@ void PawleyFit::addHKLsToFunction(PawleyFunction_sptr &pawleyFn, pawleyFn->clearPeaks(); - for (size_t i = 0; i < tableWs->rowCount(); ++i) { - TableRow currentRow = tableWs->getRow(i); - - try { - V3D hkl = getHkl(currentRow.String(0)); - - double d = boost::lexical_cast(currentRow.String(1)); - double center = UnitConversion::run(*m_dUnit, *unit, d, 0, 0, 0, - DeltaEMode::Elastic, 0); - double fwhm = boost::lexical_cast(currentRow.String(4)) * center; - - double height = boost::lexical_cast(currentRow.String(3)); - - pawleyFn->addPeak(hkl, fwhm, height); - } - catch (...) { - // do nothing. + try { + Column_const_sptr hklColumn = tableWs->getColumn("HKL"); + Column_const_sptr dColumn = tableWs->getColumn("d"); + Column_const_sptr intensityColumn = tableWs->getColumn("Intensity"); + Column_const_sptr fwhmColumn = tableWs->getColumn("FWHM (rel.)"); + + for (size_t i = 0; i < tableWs->rowCount(); ++i) { + try { + V3D hkl = getHkl(hklColumn->cell(i)); + + double d = (*dColumn)[i]; + double center = getTransformedCenter(unit, d); + double fwhm = (*fwhmColumn)[i] * center; + double height = (*intensityColumn)[i]; + + pawleyFn->addPeak(hkl, fwhm, height); + } + catch (...) { + // do nothing. + } } } + catch (std::runtime_error) { + // Column does not exist + throw std::runtime_error("Can not process table, the following columns are " + "required: HKL, d, Intensity, FWHM (rel.)"); + } } V3D PawleyFit::getHkl(const std::string &hklString) const { diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp index 3567a1497224..58f597657779 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFunction.cpp @@ -340,6 +340,7 @@ void PawleyFunction::setUnitCell(const std::string &unitCellString) { strToUnitCell(unitCellString)); } +/// Transform d value to workspace unit double PawleyFunction::getTransformedCenter(double d) const { if ((m_dUnit && m_wsUnit) && m_dUnit != m_wsUnit) { return UnitConversion::run(*m_dUnit, *m_wsUnit, d, 0, 0, 0, From 0d34aeab8084d732dfb1a7aac1256c21b4f0656e Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Thu, 19 Mar 2015 11:22:58 +0100 Subject: [PATCH 037/126] Refs #11043. Adding background to PawleyFit --- .../inc/MantidCurveFitting/PawleyFit.h | 3 ++ .../Framework/CurveFitting/src/PawleyFit.cpp | 28 ++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h index 2279c54ae3b8..45f0d1e82775 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h @@ -66,6 +66,9 @@ class DLLExport PawleyFit : public API::Algorithm { API::ITableWorkspace_sptr getPeakParametersFromFunction(const PawleyFunction_sptr &pawleyFn) const; + API::IFunction_sptr + getCompositeFunction(const PawleyFunction_sptr &pawleyFn) const; + void init(); void exec(); diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index 155c2ae5d3e9..3deb7b08f575 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -162,6 +162,24 @@ ITableWorkspace_sptr PawleyFit::getPeakParametersFromFunction( return peakParameterTable; } +IFunction_sptr +PawleyFit::getCompositeFunction(const PawleyFunction_sptr &pawleyFn) const { + CompositeFunction_sptr composite = boost::make_shared(); + composite->addFunction(pawleyFn); + + bool enableChebyshev = getProperty("EnableChebyshevBackground"); + if (enableChebyshev) { + int degree = getProperty("ChebyshevBackgroundDegree"); + IFunction_sptr chebyshev = + FunctionFactory::Instance().createFunction("Chebyshev"); + chebyshev->setAttributeValue("n", degree); + + composite->addFunction(chebyshev); + } + + return composite; +} + void PawleyFit::init() { declareProperty(new WorkspaceProperty("InputWorkspace", "", Direction::Input), @@ -214,6 +232,14 @@ void PawleyFit::init() { declareProperty("PeakProfileFunction", "Gaussian", peakFunctionValidator, "Profile function that is used for each peak."); + declareProperty("EnableChebyshevBackground", false, + "If checked, a Chebyshev " + "polynomial will be added " + "to model the background."); + + declareProperty("ChebyshevBackgroundDegree", 0, + "Degree of the Chebyshev polynomial, if used as background."); + declareProperty(new WorkspaceProperty("OutputWorkspace", "", Direction::Output), "Workspace that contains measured spectrum, calculated " @@ -289,7 +315,7 @@ void PawleyFit::exec() { // Generate Fit-algorithm with required properties. Algorithm_sptr fit = createChildAlgorithm("Fit", -1, -1, true); - fit->setProperty("Function", boost::static_pointer_cast(pawleyFn)); + fit->setProperty("Function", getCompositeFunction(pawleyFn)); fit->setProperty("InputWorkspace", boost::const_pointer_cast(ws)); fit->setProperty("WorkspaceIndex", wsIndex); From 9fd8d1b1407aee651602e7ba5a32bab2094d8039 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Thu, 19 Mar 2015 09:46:31 +0000 Subject: [PATCH 038/126] Refs #11400 Fix extra ';' warnings --- .../API/inc/MantidAPI/ScriptRepository.h | 4 +-- Code/Mantid/Framework/API/src/LinearScale.cpp | 2 +- Code/Mantid/Framework/API/src/LogManager.cpp | 14 ++++---- .../Framework/API/src/LogarithmScale.cpp | 2 +- .../API/test/CostFunctionFactoryTest.h | 2 +- .../API/test/FuncMinimizerFactoryTest.h | 2 +- .../Framework/API/test/FunctionFactoryTest.h | 8 ++--- .../API/test/FunctionParameterDecoratorTest.h | 6 ++-- .../Framework/API/test/FunctionPropertyTest.h | 2 +- .../API/test/ImmutableCompositeFunctionTest.h | 4 +-- .../Framework/API/test/MatrixWorkspaceTest.h | 2 +- .../API/test/MultiDomainFunctionTest.h | 2 +- .../Algorithms/src/AppendSpectra.cpp | 4 +-- .../Algorithms/src/AverageLogData.cpp | 4 +-- .../Algorithms/src/CalculateDIFC.cpp | 4 +-- .../Algorithms/src/CalculateResolution.cpp | 6 ++-- .../Algorithms/src/CalculateSlits.cpp | 6 ++-- .../Algorithms/src/ChangeLogTime.cpp | 2 +- .../src/ClearInstrumentParameters.cpp | 4 +-- .../Algorithms/src/ClearMaskFlag.cpp | 4 +-- .../Algorithms/src/ConvertAxesToRealSpace.cpp | 4 +-- .../Algorithms/src/ConvertEmptyToTof.cpp | 4 +-- .../Algorithms/src/ConvertToHistogram.cpp | 2 +- .../Algorithms/src/ConvertToPointData.cpp | 2 +- .../Framework/Algorithms/src/CopyLogs.cpp | 4 +-- .../src/CreateFlatEventWorkspace.cpp | 4 +-- .../Algorithms/src/CreateSampleWorkspace.cpp | 4 +-- .../src/CreateTransmissionWorkspace.cpp | 4 +-- .../Algorithms/src/DeleteWorkspace.cpp | 2 +- .../Algorithms/src/DetectorDiagnostic.cpp | 2 +- .../src/DetectorEfficiencyCorUser.cpp | 4 +-- .../Algorithms/src/FilterByXValue.cpp | 4 +-- .../Algorithms/src/GroupWorkspaces.cpp | 2 +- .../Algorithms/src/IntegrateByComponent.cpp | 4 +-- .../Algorithms/src/LorentzCorrection.cpp | 4 +-- .../Algorithms/src/MedianDetectorTest.cpp | 2 +- .../Algorithms/src/ModeratorTzero.cpp | 2 +- .../Algorithms/src/MuonGroupDetectors.cpp | 4 +-- .../Algorithms/src/NormaliseByDetector.cpp | 6 ++-- .../Mantid/Framework/Algorithms/src/Pause.cpp | 4 +-- .../Algorithms/src/PerformIndexOperations.cpp | 4 +-- .../Algorithms/src/PolarizationCorrection.cpp | 4 +-- .../Algorithms/src/RebinByPulseTimes.cpp | 4 +-- .../Algorithms/src/RebinByTimeAtSample.cpp | 2 +- .../src/ReflectometryReductionOne.cpp | 4 +-- .../src/ReflectometryReductionOneAuto.cpp | 6 ++-- .../Algorithms/src/RemoveBackground.cpp | 2 +- .../Algorithms/src/RemoveWorkspaceHistory.cpp | 6 ++-- .../src/ResizeRectangularDetector.cpp | 4 +-- .../Framework/Algorithms/src/RingProfile.cpp | 4 +-- .../Framework/Algorithms/src/SassenaFFT.cpp | 2 +- .../Algorithms/src/SetInstrumentParameter.cpp | 4 +-- .../Algorithms/src/SignalOverError.cpp | 4 +-- .../src/SpecularReflectionCalculateTheta.cpp | 4 +-- .../src/SpecularReflectionPositionCorrect.cpp | 4 +-- .../Algorithms/src/SumEventsByLogValue.cpp | 2 +- .../Algorithms/src/UpdateScriptRepository.cpp | 4 +-- .../src/WeightedMeanOfWorkspace.cpp | 4 +-- .../Algorithms/src/WeightingStrategy.cpp | 4 +-- .../Framework/Algorithms/src/WienerSmooth.cpp | 4 +-- .../Framework/Crystal/src/AddPeakHKL.cpp | 4 +-- .../Crystal/src/CalculatePeaksHKL.cpp | 4 +-- Code/Mantid/Framework/Crystal/src/ClearUB.cpp | 4 +-- .../Crystal/src/CombinePeaksWorkspaces.cpp | 4 +-- .../Crystal/src/DiffPeaksWorkspaces.cpp | 4 +-- .../Framework/Crystal/src/FilterPeaks.cpp | 4 +-- .../Crystal/src/FindClusterFaces.cpp | 4 +-- Code/Mantid/Framework/Crystal/src/HasUB.cpp | 4 +-- .../Crystal/src/IntegratePeaksHybrid.cpp | 4 +-- .../src/IntegratePeaksUsingClusters.cpp | 4 +-- .../Framework/Crystal/src/LoadIsawPeaks.cpp | 2 +- .../Crystal/src/PeakIntensityVsRadius.cpp | 4 +-- .../Framework/Crystal/src/PeaksInRegion.cpp | 4 +-- .../Framework/Crystal/src/PeaksOnSurface.cpp | 4 +-- .../Crystal/src/SetSpecialCoordinates.cpp | 4 +-- .../Crystal/src/SortPeaksWorkspace.cpp | 4 +-- .../src/CalculateGammaBackground.cpp | 2 +- .../Framework/CurveFitting/src/Chebyshev.cpp | 2 +- .../CurveFitting/src/ComptonPeakProfile.cpp | 2 +- .../src/ComptonScatteringCountRate.cpp | 2 +- .../CurveFitting/src/ConvertToYSpace.cpp | 2 +- .../CurveFitting/src/CubicSpline.cpp | 2 +- .../src/DiffRotDiscreteCircle.cpp | 6 ++-- .../Framework/CurveFitting/src/DiffSphere.cpp | 6 ++-- .../CurveFitting/src/EstimatePeakErrors.cpp | 2 +- .../src/GaussianComptonProfile.cpp | 2 +- .../src/GramCharlierComptonProfile.cpp | 2 +- .../CurveFitting/src/IkedaCarpenterPV.cpp | 10 +++--- .../Framework/CurveFitting/src/Lorentzian.cpp | 2 +- .../CurveFitting/src/PseudoVoigt.cpp | 2 +- .../CurveFitting/src/SplineInterpolation.cpp | 2 +- .../CurveFitting/src/SplineSmoothing.cpp | 6 ++-- .../CurveFitting/src/VesuvioResolution.cpp | 2 +- .../Framework/CurveFitting/src/Voigt.cpp | 2 +- .../CurveFitting/test/CompositeFunctionTest.h | 4 +-- .../CurveFitting/test/ConvolutionTest.h | 6 ++-- .../test/FunctionFactoryConstraintTest.h | 8 ++--- .../test/FunctionParameterDecoratorFitTest.h | 2 +- .../CurveFitting/test/GaussianTest.h | 2 +- .../CurveFitting/test/ProductFunctionTest.h | 4 +-- .../CurveFitting/test/ResolutionTest.h | 2 +- .../DataHandling/src/CreateChopperModel.cpp | 6 ++-- .../src/CreateChunkingFromInstrument.cpp | 4 +-- .../DataHandling/src/CreateModeratorModel.cpp | 4 +-- .../src/CreateSimulationWorkspace.cpp | 6 ++-- .../DataHandling/src/DeleteTableRows.cpp | 2 +- .../src/ExtractMonitorWorkspace.cpp | 4 +-- .../DataHandling/src/FindDetectorsPar.cpp | 4 +-- .../DataHandling/src/ISISDataArchive.cpp | 2 +- .../Framework/DataHandling/src/Load.cpp | 2 +- .../Framework/DataHandling/src/LoadAscii.cpp | 2 +- .../Framework/DataHandling/src/LoadAscii2.cpp | 2 +- .../Framework/DataHandling/src/LoadBBY.cpp | 2 +- .../DataHandling/src/LoadCanSAS1D.cpp | 2 +- .../DataHandling/src/LoadCanSAS1D2.cpp | 2 +- .../DataHandling/src/LoadDaveGrp.cpp | 2 +- .../DataHandling/src/LoadEventPreNexus.cpp | 2 +- .../Framework/DataHandling/src/LoadFITS.cpp | 2 +- .../Framework/DataHandling/src/LoadILL.cpp | 2 +- .../DataHandling/src/LoadILLIndirect.cpp | 6 ++-- .../DataHandling/src/LoadILLReflectometry.cpp | 6 ++-- .../DataHandling/src/LoadILLSANS.cpp | 4 +-- .../DataHandling/src/LoadISISNexus2.cpp | 2 +- .../Framework/DataHandling/src/LoadLLB.cpp | 6 ++-- .../Framework/DataHandling/src/LoadMcStas.cpp | 6 ++-- .../DataHandling/src/LoadMcStasNexus.cpp | 6 ++-- .../DataHandling/src/LoadMuonNexus1.cpp | 2 +- .../DataHandling/src/LoadMuonNexus2.cpp | 2 +- .../Framework/DataHandling/src/LoadNXSPE.cpp | 2 +- .../DataHandling/src/LoadNexusProcessed.cpp | 2 +- .../DataHandling/src/LoadPDFgetNFile.cpp | 2 +- .../DataHandling/src/LoadPreNexus.cpp | 2 +- .../Framework/DataHandling/src/LoadQKK.cpp | 2 +- .../Framework/DataHandling/src/LoadRKH.cpp | 2 +- .../Framework/DataHandling/src/LoadRaw3.cpp | 2 +- .../DataHandling/src/LoadReflTBL.cpp | 2 +- .../DataHandling/src/LoadSINQFocus.cpp | 6 ++-- .../DataHandling/src/LoadSNSspec.cpp | 2 +- .../Framework/DataHandling/src/LoadSPE.cpp | 2 +- .../DataHandling/src/LoadSassena.cpp | 2 +- .../DataHandling/src/LoadSavuTomoConfig.cpp | 2 +- .../DataHandling/src/LoadSpice2D.cpp | 2 +- .../DataHandling/src/LoadTOFRawNexus.cpp | 2 +- .../DataHandling/src/NexusTester.cpp | 4 +-- .../src/PDLoadCharacterizations.cpp | 4 +-- .../DataHandling/src/SNSDataArchive.cpp | 2 +- .../Framework/DataHandling/src/SavePAR.cpp | 2 +- .../Framework/DataHandling/src/SavePHX.cpp | 2 +- .../DataHandling/src/SaveParameterFile.cpp | 4 +-- .../DataHandling/src/SortTableWorkspace.cpp | 4 +-- .../inc/MantidDataObjects/VectorColumn.h | 2 +- .../Framework/DataObjects/src/PeakColumn.cpp | 2 +- .../DataObjects/src/PeaksWorkspace.cpp | 2 +- .../DataObjects/src/TableWorkspace.cpp | 2 +- .../src/Crystal/SymmetryElementFactory.cpp | 10 +++--- .../ISISLiveData/src/FakeISISEventDAE.cpp | 2 +- .../Kernel/inc/MantidKernel/ChecksumHelper.h | 2 +- .../inc/MantidKernel/PropertyWithValue.h | 8 ++--- .../Kernel/src/FilteredTimeSeriesProperty.cpp | 20 +++++------ .../Framework/Kernel/src/IPropertyManager.cpp | 34 +++++++++---------- .../Framework/Kernel/src/MatrixProperty.cpp | 6 ++-- .../Kernel/src/PropertyWithValue.cpp | 20 +++++------ .../Framework/Kernel/src/Statistics.cpp | 16 ++++----- .../Kernel/src/TimeSeriesProperty.cpp | 20 +++++------ Code/Mantid/Framework/Kernel/src/Unit.cpp | 4 +-- .../Kernel/test/TypedValidatorTest.h | 6 ++-- .../LiveData/src/MonitorLiveData.cpp | 4 +-- .../LiveData/src/SNSLiveEventDataListener.cpp | 2 +- .../Framework/LiveData/src/StartLiveData.cpp | 4 +-- .../Framework/MDAlgorithms/src/AndMD.cpp | 4 +-- .../MDAlgorithms/src/BinaryOperationMD.cpp | 4 +-- .../src/BooleanBinaryOperationMD.cpp | 4 +-- .../MDAlgorithms/src/CalculateCoverageDGS.cpp | 4 +-- .../MDAlgorithms/src/CompareMDWorkspaces.cpp | 4 +-- .../src/ConvertToDetectorFaceMD.cpp | 4 +-- .../src/ConvertToMDMinMaxGlobal.cpp | 4 +-- .../src/CreateMDHistoWorkspace.cpp | 4 +-- .../Framework/MDAlgorithms/src/DivideMD.cpp | 4 +-- .../Framework/MDAlgorithms/src/EqualToMD.cpp | 4 +-- .../MDAlgorithms/src/EvaluateMDFunction.cpp | 4 +-- .../MDAlgorithms/src/ExponentialMD.cpp | 4 +-- .../MDAlgorithms/src/GreaterThanMD.cpp | 4 +-- .../MDAlgorithms/src/IntegrateFlux.cpp | 4 +-- .../Framework/MDAlgorithms/src/LessThanMD.cpp | 4 +-- .../MDAlgorithms/src/LoadILLAscii.cpp | 4 +-- .../Framework/MDAlgorithms/src/LoadMD.cpp | 2 +- .../Framework/MDAlgorithms/src/LoadSQW.cpp | 2 +- .../MDAlgorithms/src/LogarithmMD.cpp | 4 +-- .../Framework/MDAlgorithms/src/MaskMD.cpp | 4 +-- .../Framework/MDAlgorithms/src/MergeMD.cpp | 4 +-- .../Framework/MDAlgorithms/src/MinusMD.cpp | 4 +-- .../Framework/MDAlgorithms/src/MultiplyMD.cpp | 4 +-- .../Framework/MDAlgorithms/src/NotMD.cpp | 4 +-- .../Framework/MDAlgorithms/src/OrMD.cpp | 4 +-- .../Framework/MDAlgorithms/src/PowerMD.cpp | 4 +-- .../src/PreprocessDetectorsToMD.cpp | 2 +- .../FitResolutionConvolvedModel.cpp | 2 +- .../Quantification/Models/MullerAnsatz.cpp | 2 +- .../src/Quantification/Models/QCoordinate.cpp | 2 +- .../Quantification/Models/Strontium122.cpp | 2 +- .../Resolution/TobyFitResolutionModel.cpp | 2 +- .../ResolutionConvolvedCrossSection.cpp | 2 +- .../SimulateResolutionConvolvedModel.cpp | 2 +- .../Framework/MDAlgorithms/src/SaveZODS.cpp | 4 +-- .../MDAlgorithms/src/SetMDUsingMask.cpp | 4 +-- .../MDAlgorithms/src/ThresholdMD.cpp | 4 +-- .../MDAlgorithms/src/TransformMD.cpp | 4 +-- .../MDAlgorithms/src/UnaryOperationMD.cpp | 4 +-- .../Framework/MDAlgorithms/src/XorMD.cpp | 4 +-- .../MantidMDEvents/CoordTransformAligned.h | 6 ++-- .../MantidMDEvents/CoordTransformDistance.h | 4 +-- .../Framework/MDEvents/src/ConvToMDBase.cpp | 2 +- .../MDEvents/src/ConvertToReflectometryQ.cpp | 4 +-- Code/Mantid/Framework/MDEvents/src/FitMD.cpp | 2 +- .../MDEvents/src/ImportMDEventWorkspace.cpp | 4 +-- .../MDEvents/src/ImportMDHistoWorkspace.cpp | 4 +-- Code/Mantid/Framework/MDEvents/src/MDBox.cpp | 4 +-- .../Framework/MDEvents/src/MDTransfModQ.cpp | 2 +- .../Framework/MDEvents/src/MDTransfNoQ.cpp | 4 +-- .../Framework/MDEvents/src/MDTransfQ3D.cpp | 2 +- .../MDEvents/src/MDWSDescription.cpp | 2 +- .../MDEvents/src/UnitsConversionHelper.cpp | 2 +- .../Framework/MDEvents/src/UserFunctionMD.cpp | 2 +- .../mantid/api/src/Exports/Algorithm.cpp | 6 ++-- .../api/src/Exports/AlgorithmFactory.cpp | 2 +- .../api/src/Exports/AlgorithmManager.cpp | 4 +-- .../mantid/api/src/Exports/Axis.cpp | 2 +- .../mantid/api/src/Exports/ExperimentInfo.cpp | 2 +- .../mantid/api/src/Exports/IFunction.cpp | 4 +-- .../mantid/api/src/Exports/Workspace.cpp | 2 +- .../api/src/Exports/WorkspaceFactory.cpp | 6 ++-- .../mantid/geometry/src/Exports/Component.cpp | 18 +++++----- .../geometry/src/Exports/Goniometer.cpp | 2 +- .../kernel/src/Converters/CloneToNumpy.cpp | 18 +++++----- .../kernel/src/Converters/NDArrayToVector.cpp | 18 +++++----- .../src/Converters/NDArrayTypeIndex.cpp | 18 +++++----- .../kernel/src/Converters/WrapWithNumpy.cpp | 16 ++++----- .../kernel/src/Exports/ConfigService.cpp | 4 +-- .../mantid/kernel/src/Exports/Statistics.cpp | 10 +++--- .../kernel/src/Exports/TimeSeriesProperty.cpp | 1 - .../src/Registry/SequenceTypeHandler.cpp | 18 +++++----- .../WorkspaceCreationHelperModule.cpp | 6 ++-- .../ScriptRepositoryImpl.h | 4 +-- .../src/ScriptRepositoryImpl.cpp | 2 +- .../TestHelpers/src/ScopedFileHelper.cpp | 4 +-- .../src/DgsAbsoluteUnitsReduction.cpp | 4 +-- .../src/DgsConvertToEnergyTransfer.cpp | 4 +-- .../WorkflowAlgorithms/src/DgsDiagnose.cpp | 4 +-- .../src/DgsPreprocessData.cpp | 4 +-- .../WorkflowAlgorithms/src/DgsReduction.cpp | 4 +-- .../WorkflowAlgorithms/src/DgsRemap.cpp | 4 +-- .../src/MuonCalculateAsymmetry.cpp | 4 +-- .../WorkflowAlgorithms/src/MuonLoad.cpp | 4 +-- .../WorkflowAlgorithms/src/StepScan.cpp | 4 +-- Code/Mantid/MantidPlot/src/ExpDecayDialog.cpp | 4 +-- Code/Mantid/MantidPlot/src/FFTDialog.cpp | 6 ++-- Code/Mantid/MantidPlot/src/FilterDialog.cpp | 2 +- Code/Mantid/MantidPlot/src/FitDialog.cpp | 4 +-- Code/Mantid/MantidPlot/src/Graph.h | 2 +- .../MantidPlot/src/InterpolationDialog.cpp | 4 +-- .../InstrumentWidget/InstrumentTreeWidget.cpp | 2 +- .../Mantid/MantidPlot/src/Mantid/MantidUI.cpp | 2 +- Code/Mantid/MantidPlot/src/MdiSubWindow.cpp | 2 +- Code/Mantid/MantidPlot/src/MultiLayer.h | 2 +- Code/Mantid/MantidPlot/src/Plot3DDialog.cpp | 2 +- .../MantidPlot/src/PolynomFitDialog.cpp | 4 +-- .../MantidQt/API/inc/MantidQtAPI/Message.h | 2 +- .../MantidQt/API/inc/MantidQtAPI/RepoModel.h | 4 +-- Code/Mantid/MantidQt/API/src/MdConstants.cpp | 4 +-- .../MantidQt/API/src/PropertyWidget.cpp | 2 +- Code/Mantid/MantidQt/API/src/RepoModel.cpp | 16 ++++----- .../MantidQt/API/src/ScriptRepositoryView.cpp | 2 +- .../src/CatalogPublishDialog.cpp | 2 +- .../ConvertTableToMatrixWorkspaceDialog.cpp | 2 +- .../src/CreateSampleShapeDialog.cpp | 2 +- .../MantidQt/CustomDialogs/src/FitDialog.cpp | 2 +- .../src/LOQScriptInputDialog.cpp | 2 +- .../MantidQt/CustomDialogs/src/LoadDialog.cpp | 2 +- .../src/LoadInstrumentDialog.cpp | 2 +- .../src/SortTableWorkspaceDialog.cpp | 2 +- .../CustomDialogs/src/StartLiveDataDialog.cpp | 2 +- .../CustomInterfaces/src/DataComparison.cpp | 2 +- .../src/DirectConvertToEnergy.cpp | 2 +- .../src/Indirect/IndirectBayes.cpp | 2 +- .../src/Indirect/IndirectDataAnalysis.cpp | 2 +- .../src/Indirect/IndirectDataReduction.cpp | 2 +- .../Indirect/IndirectDiffractionReduction.cpp | 2 +- .../src/Indirect/IndirectSimulation.cpp | 2 +- .../src/Indirect/IndirectTools.cpp | 2 +- .../CustomInterfaces/src/MantidEV.cpp | 2 +- .../CustomInterfaces/src/MultiDatasetFit.cpp | 2 +- .../src/Muon/ALCInterface.cpp | 2 +- .../src/Muon/MuonAnalysis.cpp | 2 +- .../CustomInterfaces/src/QtReflMainView.cpp | 2 +- .../CustomInterfaces/src/SANSRunWindow.cpp | 2 +- .../src/SampleTransmission.cpp | 2 +- .../CustomInterfaces/src/StepScan.cpp | 2 +- .../src/SlicingAlgorithmDialog.cpp | 4 +-- .../PeaksFilter/vtkPeaksFilter.cxx | 2 +- .../ScaleWorkspace/vtkScaleWorkspace.cxx | 2 +- .../SplatterPlot/vtkSplatterPlot.cxx | 2 +- .../EventNexusReader/vtkEventNexusReader.cxx | 2 +- .../MDEWNexusReader/vtkMDEWNexusReader.cxx | 2 +- .../MDHWNexusReader/vtkMDHWNexusReader.cxx | 2 +- .../NexusPeaksReader/vtkNexusPeaksReader.cxx | 2 +- .../PeaksReader/vtkPeaksReader.cxx | 2 +- .../SQWEventReader/vtkSQWEventReader.cxx | 2 +- .../MDEWSource/vtkMDEWSource.cxx | 2 +- .../MDHWSource/vtkMDHWSource.cxx | 2 +- .../PeaksSource/vtkPeaksSource.cxx | 2 +- .../vtkSinglePeakMarkerSource.cxx | 2 +- Code/Mantid/Vates/VatesAPI/src/LoadVTK.cpp | 2 +- .../src/AutoScaleRangeGenerator.cpp | 2 +- .../ViewWidgets/src/BackgroundRgbProvider.cpp | 4 +-- 314 files changed, 614 insertions(+), 615 deletions(-) diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h b/Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h index b528bdb6e709..9e5b8ba6b7fb 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h @@ -610,7 +610,7 @@ class MANTID_API_DLL ScriptRepository { /// shared pointer to the function base class typedef boost::shared_ptr ScriptRepository_sptr; -}; -}; +} +} #endif // MANTID_API_SCRIPTREPOSITORY_H_ diff --git a/Code/Mantid/Framework/API/src/LinearScale.cpp b/Code/Mantid/Framework/API/src/LinearScale.cpp index 14d1ff6820db..4d11c0fb9627 100644 --- a/Code/Mantid/Framework/API/src/LinearScale.cpp +++ b/Code/Mantid/Framework/API/src/LinearScale.cpp @@ -9,7 +9,7 @@ namespace Mantid { namespace API { -DECLARE_TRANSFORMSCALE(LinearScale); +DECLARE_TRANSFORMSCALE(LinearScale) /* Transform the grid to adopt a linear scale * @param gd a grid object diff --git a/Code/Mantid/Framework/API/src/LogManager.cpp b/Code/Mantid/Framework/API/src/LogManager.cpp index 572043d93032..ae405738634e 100644 --- a/Code/Mantid/Framework/API/src/LogManager.cpp +++ b/Code/Mantid/Framework/API/src/LogManager.cpp @@ -434,13 +434,13 @@ void LogManager::clearLogs() { m_manager.clear(); } template MANTID_API_DLL TYPE \ LogManager::getPropertyValueAsType(const std::string &) const; -INSTANTIATE(double); -INSTANTIATE(int); -INSTANTIATE(long); -INSTANTIATE(uint32_t); -INSTANTIATE(uint64_t); -INSTANTIATE(std::string); -INSTANTIATE(bool); +INSTANTIATE(double) +INSTANTIATE(int) +INSTANTIATE(long) +INSTANTIATE(uint32_t) +INSTANTIATE(uint64_t) +INSTANTIATE(std::string) +INSTANTIATE(bool) template MANTID_API_DLL uint16_t LogManager::getPropertyValueAsType(const std::string &) const; diff --git a/Code/Mantid/Framework/API/src/LogarithmScale.cpp b/Code/Mantid/Framework/API/src/LogarithmScale.cpp index 1ecb35a5d533..1e4abfdd83cf 100644 --- a/Code/Mantid/Framework/API/src/LogarithmScale.cpp +++ b/Code/Mantid/Framework/API/src/LogarithmScale.cpp @@ -16,7 +16,7 @@ namespace { Kernel::Logger g_log("LogarithmScale"); } -DECLARE_TRANSFORMSCALE(LogarithmScale); +DECLARE_TRANSFORMSCALE(LogarithmScale) void LogarithmScale::setBase(double &base) { if (base <= 0) { diff --git a/Code/Mantid/Framework/API/test/CostFunctionFactoryTest.h b/Code/Mantid/Framework/API/test/CostFunctionFactoryTest.h index c0c567cc8b22..d54b9807c852 100644 --- a/Code/Mantid/Framework/API/test/CostFunctionFactoryTest.h +++ b/Code/Mantid/Framework/API/test/CostFunctionFactoryTest.h @@ -38,7 +38,7 @@ class CostFunctionFactoryTest_A: public ICostFunction }; -DECLARE_COSTFUNCTION(CostFunctionFactoryTest_A, nedtur); +DECLARE_COSTFUNCTION(CostFunctionFactoryTest_A, nedtur) class CostFunctionFactoryTest : public CxxTest::TestSuite diff --git a/Code/Mantid/Framework/API/test/FuncMinimizerFactoryTest.h b/Code/Mantid/Framework/API/test/FuncMinimizerFactoryTest.h index 640b7345c483..2cef42deca31 100644 --- a/Code/Mantid/Framework/API/test/FuncMinimizerFactoryTest.h +++ b/Code/Mantid/Framework/API/test/FuncMinimizerFactoryTest.h @@ -33,7 +33,7 @@ class FuncMinimizerFactoryTest_A: public IFuncMinimizer } }; -DECLARE_FUNCMINIMIZER(FuncMinimizerFactoryTest_A, nedtur); +DECLARE_FUNCMINIMIZER(FuncMinimizerFactoryTest_A, nedtur) class FuncMinimizerFactoryTest : public CxxTest::TestSuite diff --git a/Code/Mantid/Framework/API/test/FunctionFactoryTest.h b/Code/Mantid/Framework/API/test/FunctionFactoryTest.h index 0654f99aca5c..131988e174f3 100644 --- a/Code/Mantid/Framework/API/test/FunctionFactoryTest.h +++ b/Code/Mantid/Framework/API/test/FunctionFactoryTest.h @@ -134,10 +134,10 @@ class FunctionFactoryTest_CompFunctB: public CompositeFunction }; -DECLARE_FUNCTION(FunctionFactoryTest_FunctA); -DECLARE_FUNCTION(FunctionFactoryTest_FunctB); -DECLARE_FUNCTION(FunctionFactoryTest_CompFunctA); -DECLARE_FUNCTION(FunctionFactoryTest_CompFunctB); +DECLARE_FUNCTION(FunctionFactoryTest_FunctA) +DECLARE_FUNCTION(FunctionFactoryTest_FunctB) +DECLARE_FUNCTION(FunctionFactoryTest_CompFunctA) +DECLARE_FUNCTION(FunctionFactoryTest_CompFunctB) class FunctionFactoryTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/API/test/FunctionParameterDecoratorTest.h b/Code/Mantid/Framework/API/test/FunctionParameterDecoratorTest.h index 4cea527b1a51..3a02a1c81385 100644 --- a/Code/Mantid/Framework/API/test/FunctionParameterDecoratorTest.h +++ b/Code/Mantid/Framework/API/test/FunctionParameterDecoratorTest.h @@ -44,7 +44,7 @@ class TestableFunctionParameterDecorator : public FunctionParameterDecorator { } }; -DECLARE_FUNCTION(TestableFunctionParameterDecorator); +DECLARE_FUNCTION(TestableFunctionParameterDecorator) class FunctionWithParameters : public ParamFunction { public: @@ -64,7 +64,7 @@ class FunctionWithParameters : public ParamFunction { // Does nothing, not required for this test. } }; -DECLARE_FUNCTION(FunctionWithParameters); +DECLARE_FUNCTION(FunctionWithParameters) class FunctionWithAttributes : public ParamFunction { public: @@ -88,7 +88,7 @@ class FunctionWithAttributes : public ParamFunction { } }; -DECLARE_FUNCTION(FunctionWithAttributes); +DECLARE_FUNCTION(FunctionWithAttributes) class FunctionParameterDecoratorTest : public CxxTest::TestSuite { public: diff --git a/Code/Mantid/Framework/API/test/FunctionPropertyTest.h b/Code/Mantid/Framework/API/test/FunctionPropertyTest.h index ee488c5a7cdb..4618e0e2c89c 100644 --- a/Code/Mantid/Framework/API/test/FunctionPropertyTest.h +++ b/Code/Mantid/Framework/API/test/FunctionPropertyTest.h @@ -23,7 +23,7 @@ class FunctionPropertyTest_Function: public virtual ParamFunction, public virtua virtual void function(const FunctionDomain&,FunctionValues&)const {} }; -DECLARE_FUNCTION(FunctionPropertyTest_Function); +DECLARE_FUNCTION(FunctionPropertyTest_Function) class FunctionPropertyTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/API/test/ImmutableCompositeFunctionTest.h b/Code/Mantid/Framework/API/test/ImmutableCompositeFunctionTest.h index cf4287e72d71..b3299c9b3567 100644 --- a/Code/Mantid/Framework/API/test/ImmutableCompositeFunctionTest.h +++ b/Code/Mantid/Framework/API/test/ImmutableCompositeFunctionTest.h @@ -67,7 +67,7 @@ class ImmutableCompositeFunctionTest_Function: public ImmutableCompositeFunction std::string name()const {return "ImmutableCompositeFunctionTest_Function";} }; -DECLARE_FUNCTION(ImmutableCompositeFunctionTest_Function); +DECLARE_FUNCTION(ImmutableCompositeFunctionTest_Function) //--------------------------------------------------------------------------------- class ImmutableCompositeFunctionTest_FunctionWithTies: public ImmutableCompositeFunction @@ -95,7 +95,7 @@ class ImmutableCompositeFunctionTest_FunctionWithTies: public ImmutableComposite std::string name()const {return "ImmutableCompositeFunctionTest_FunctionWithTies";} }; -DECLARE_FUNCTION(ImmutableCompositeFunctionTest_FunctionWithTies); +DECLARE_FUNCTION(ImmutableCompositeFunctionTest_FunctionWithTies) //--------------------------------------------------------------------------------- class ImmutableCompositeFunctionTest_FunctionThrow: public ImmutableCompositeFunction diff --git a/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h b/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h index 38aedd753411..d3dbf1389014 100644 --- a/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h +++ b/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h @@ -26,7 +26,7 @@ using namespace testing; // Declare into the factory. -DECLARE_WORKSPACE(WorkspaceTester); +DECLARE_WORKSPACE(WorkspaceTester) /** Create a workspace with numSpectra, with * each spectrum having one detector, at id = workspace index. diff --git a/Code/Mantid/Framework/API/test/MultiDomainFunctionTest.h b/Code/Mantid/Framework/API/test/MultiDomainFunctionTest.h index adf7b610d247..4e7b1870ec6e 100644 --- a/Code/Mantid/Framework/API/test/MultiDomainFunctionTest.h +++ b/Code/Mantid/Framework/API/test/MultiDomainFunctionTest.h @@ -49,7 +49,7 @@ class MultiDomainFunctionTest_Function: public virtual IFunction1D, public virtu } }; -DECLARE_FUNCTION(MultiDomainFunctionTest_Function); +DECLARE_FUNCTION(MultiDomainFunctionTest_Function) namespace { diff --git a/Code/Mantid/Framework/Algorithms/src/AppendSpectra.cpp b/Code/Mantid/Framework/Algorithms/src/AppendSpectra.cpp index 6567ccf080c3..7c37d7c6e2cb 100644 --- a/Code/Mantid/Framework/Algorithms/src/AppendSpectra.cpp +++ b/Code/Mantid/Framework/Algorithms/src/AppendSpectra.cpp @@ -23,10 +23,10 @@ AppendSpectra::AppendSpectra() : WorkspaceJoiners() {} AppendSpectra::~AppendSpectra() {} /// Algorithm's name for identification. @see Algorithm::name -const std::string AppendSpectra::name() const { return "AppendSpectra"; }; +const std::string AppendSpectra::name() const { return "AppendSpectra"; } /// Algorithm's version for identification. @see Algorithm::version -int AppendSpectra::version() const { return 1; }; +int AppendSpectra::version() const { return 1; } /** Initialize the algorithm's properties. */ diff --git a/Code/Mantid/Framework/Algorithms/src/AverageLogData.cpp b/Code/Mantid/Framework/Algorithms/src/AverageLogData.cpp index 40fa96ee2e9f..7430a5f108bc 100644 --- a/Code/Mantid/Framework/Algorithms/src/AverageLogData.cpp +++ b/Code/Mantid/Framework/Algorithms/src/AverageLogData.cpp @@ -20,10 +20,10 @@ AverageLogData::~AverageLogData() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string AverageLogData::name() const { return "AverageLogData"; }; +const std::string AverageLogData::name() const { return "AverageLogData"; } /// Algorithm's version for identification. @see Algorithm::version -int AverageLogData::version() const { return 1; }; +int AverageLogData::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string AverageLogData::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/CalculateDIFC.cpp b/Code/Mantid/Framework/Algorithms/src/CalculateDIFC.cpp index a77fb56a1968..8b7b1fcbf156 100644 --- a/Code/Mantid/Framework/Algorithms/src/CalculateDIFC.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CalculateDIFC.cpp @@ -35,7 +35,7 @@ const std::string CalculateDIFC::name() const { return "CalculateDIFC"; } /// Algorithm's version for identification. @see Algorithm::version int CalculateDIFC::version() const { return 1; -}; +} /// Algorithm's category for identification. @see Algorithm::category const std::string CalculateDIFC::category() const { @@ -45,7 +45,7 @@ const std::string CalculateDIFC::category() const { /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary const std::string CalculateDIFC::summary() const { return "Calculate the DIFC for every pixel"; -}; +} //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/Algorithms/src/CalculateResolution.cpp b/Code/Mantid/Framework/Algorithms/src/CalculateResolution.cpp index 51eac3c536bc..a0a898096641 100644 --- a/Code/Mantid/Framework/Algorithms/src/CalculateResolution.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CalculateResolution.cpp @@ -34,10 +34,10 @@ CalculateResolution::~CalculateResolution() {} /// Algorithm's name for identification. @see Algorithm::name const std::string CalculateResolution::name() const { return "CalculateResolution"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CalculateResolution::version() const { return 1; }; +int CalculateResolution::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CalculateResolution::category() const { @@ -48,7 +48,7 @@ const std::string CalculateResolution::category() const { const std::string CalculateResolution::summary() const { return "Calculates the reflectometry resolution (dQ/Q) for a given " "workspace."; -}; +} //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/Algorithms/src/CalculateSlits.cpp b/Code/Mantid/Framework/Algorithms/src/CalculateSlits.cpp index 7808595add88..b3e4872292cd 100644 --- a/Code/Mantid/Framework/Algorithms/src/CalculateSlits.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CalculateSlits.cpp @@ -28,10 +28,10 @@ CalculateSlits::~CalculateSlits() {} /// Algorithm's name for identification. @see Algorithm::name const std::string CalculateSlits::name() const { return "CalculateSlits"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CalculateSlits::version() const { return 1; }; +int CalculateSlits::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CalculateSlits::category() const { @@ -41,7 +41,7 @@ const std::string CalculateSlits::category() const { /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary const std::string CalculateSlits::summary() const { return "Calculates appropriate slit widths for reflectometry instruments."; -}; +} //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/Algorithms/src/ChangeLogTime.cpp b/Code/Mantid/Framework/Algorithms/src/ChangeLogTime.cpp index 8663e0a329e6..a42d58d76769 100644 --- a/Code/Mantid/Framework/Algorithms/src/ChangeLogTime.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ChangeLogTime.cpp @@ -7,7 +7,7 @@ namespace Mantid { namespace Algorithms { // Register the algorithm into the AlgorithmFactory -DECLARE_ALGORITHM(ChangeLogTime); +DECLARE_ALGORITHM(ChangeLogTime) using std::string; using std::stringstream; diff --git a/Code/Mantid/Framework/Algorithms/src/ClearInstrumentParameters.cpp b/Code/Mantid/Framework/Algorithms/src/ClearInstrumentParameters.cpp index 74fc77c9e1d3..04c3f06953c4 100644 --- a/Code/Mantid/Framework/Algorithms/src/ClearInstrumentParameters.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ClearInstrumentParameters.cpp @@ -29,7 +29,7 @@ ClearInstrumentParameters::~ClearInstrumentParameters() {} /// Algorithm's name for identification. @see Algorithm::name const std::string ClearInstrumentParameters::name() const { return "ClearInstrumentParameters"; -}; +} /// Summary of the algorithm's purpose. @see Algorithm::summary const std::string ClearInstrumentParameters::summary() const { @@ -37,7 +37,7 @@ const std::string ClearInstrumentParameters::summary() const { } /// Algorithm's version for identification. @see Algorithm::version -int ClearInstrumentParameters::version() const { return 1; }; +int ClearInstrumentParameters::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ClearInstrumentParameters::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/ClearMaskFlag.cpp b/Code/Mantid/Framework/Algorithms/src/ClearMaskFlag.cpp index 71b53a9b1d99..ba16cd12b7f8 100644 --- a/Code/Mantid/Framework/Algorithms/src/ClearMaskFlag.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ClearMaskFlag.cpp @@ -21,10 +21,10 @@ ClearMaskFlag::~ClearMaskFlag() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string ClearMaskFlag::name() const { return "ClearMaskFlag"; }; +const std::string ClearMaskFlag::name() const { return "ClearMaskFlag"; } /// Algorithm's version for identification. @see Algorithm::version -int ClearMaskFlag::version() const { return 1; }; +int ClearMaskFlag::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ClearMaskFlag::category() const { return "Utility"; } diff --git a/Code/Mantid/Framework/Algorithms/src/ConvertAxesToRealSpace.cpp b/Code/Mantid/Framework/Algorithms/src/ConvertAxesToRealSpace.cpp index 6ef693883bb5..0305cd928470 100644 --- a/Code/Mantid/Framework/Algorithms/src/ConvertAxesToRealSpace.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ConvertAxesToRealSpace.cpp @@ -35,7 +35,7 @@ const std::string ConvertAxesToRealSpace::name() const { } /// Algorithm's version for identification. @see Algorithm::version -int ConvertAxesToRealSpace::version() const { return 1; }; +int ConvertAxesToRealSpace::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ConvertAxesToRealSpace::category() const { @@ -46,7 +46,7 @@ const std::string ConvertAxesToRealSpace::category() const { const std::string ConvertAxesToRealSpace::summary() const { return "Converts the spectrum and TOF axes to real space values, integrating " "the data in the process"; -}; +} //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/Algorithms/src/ConvertEmptyToTof.cpp b/Code/Mantid/Framework/Algorithms/src/ConvertEmptyToTof.cpp index 28bbd9076ecb..144171a08a4d 100644 --- a/Code/Mantid/Framework/Algorithms/src/ConvertEmptyToTof.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ConvertEmptyToTof.cpp @@ -39,10 +39,10 @@ ConvertEmptyToTof::~ConvertEmptyToTof() {} /// Algorithm's name for identification. @see Algorithm::name const std::string ConvertEmptyToTof::name() const { return "ConvertEmptyToTof"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int ConvertEmptyToTof::version() const { return 1; }; +int ConvertEmptyToTof::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ConvertEmptyToTof::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/ConvertToHistogram.cpp b/Code/Mantid/Framework/Algorithms/src/ConvertToHistogram.cpp index 3b87dc49dbe5..37acbb1439ea 100644 --- a/Code/Mantid/Framework/Algorithms/src/ConvertToHistogram.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ConvertToHistogram.cpp @@ -7,7 +7,7 @@ namespace Mantid { namespace Algorithms { -DECLARE_ALGORITHM(ConvertToHistogram); +DECLARE_ALGORITHM(ConvertToHistogram) using API::MatrixWorkspace_sptr; using Mantid::MantidVec; diff --git a/Code/Mantid/Framework/Algorithms/src/ConvertToPointData.cpp b/Code/Mantid/Framework/Algorithms/src/ConvertToPointData.cpp index ccc2e8ac79b5..739ca37a9109 100644 --- a/Code/Mantid/Framework/Algorithms/src/ConvertToPointData.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ConvertToPointData.cpp @@ -7,7 +7,7 @@ namespace Mantid { namespace Algorithms { -DECLARE_ALGORITHM(ConvertToPointData); +DECLARE_ALGORITHM(ConvertToPointData) using API::MatrixWorkspace_sptr; using Mantid::MantidVec; diff --git a/Code/Mantid/Framework/Algorithms/src/CopyLogs.cpp b/Code/Mantid/Framework/Algorithms/src/CopyLogs.cpp index f7aadd28a094..c250b7077847 100644 --- a/Code/Mantid/Framework/Algorithms/src/CopyLogs.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CopyLogs.cpp @@ -23,10 +23,10 @@ CopyLogs::~CopyLogs() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string CopyLogs::name() const { return "CopyLogs"; }; +const std::string CopyLogs::name() const { return "CopyLogs"; } /// Algorithm's version for identification. @see Algorithm::version -int CopyLogs::version() const { return 1; }; +int CopyLogs::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CopyLogs::category() const { return "Utility\\Workspaces"; } diff --git a/Code/Mantid/Framework/Algorithms/src/CreateFlatEventWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/CreateFlatEventWorkspace.cpp index f2dc26c177f6..525c556bfca6 100644 --- a/Code/Mantid/Framework/Algorithms/src/CreateFlatEventWorkspace.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CreateFlatEventWorkspace.cpp @@ -25,10 +25,10 @@ CreateFlatEventWorkspace::~CreateFlatEventWorkspace() {} /// Algorithm's name for identification. @see Algorithm::name const std::string CreateFlatEventWorkspace::name() const { return "CreateFlatEventWorkspace"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CreateFlatEventWorkspace::version() const { return 1; }; +int CreateFlatEventWorkspace::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CreateFlatEventWorkspace::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp index 0b665c471eb4..0c08dda844cb 100644 --- a/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp @@ -47,10 +47,10 @@ CreateSampleWorkspace::~CreateSampleWorkspace() { delete m_randGen; } /// Algorithm's name for identification. @see Algorithm::name const std::string CreateSampleWorkspace::name() const { return "CreateSampleWorkspace"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CreateSampleWorkspace::version() const { return 1; }; +int CreateSampleWorkspace::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CreateSampleWorkspace::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp index ac913604c97f..2b7b6da12275 100644 --- a/Code/Mantid/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp @@ -32,10 +32,10 @@ CreateTransmissionWorkspace::~CreateTransmissionWorkspace() {} /// Algorithm's name for identification. @see Algorithm::name const std::string CreateTransmissionWorkspace::name() const { return "CreateTransmissionWorkspace"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CreateTransmissionWorkspace::version() const { return 1; }; +int CreateTransmissionWorkspace::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CreateTransmissionWorkspace::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/DeleteWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/DeleteWorkspace.cpp index 329b737da192..7cb53d9b5af4 100644 --- a/Code/Mantid/Framework/Algorithms/src/DeleteWorkspace.cpp +++ b/Code/Mantid/Framework/Algorithms/src/DeleteWorkspace.cpp @@ -8,7 +8,7 @@ namespace Mantid { namespace Algorithms { // Register the algorithm -DECLARE_ALGORITHM(DeleteWorkspace); +DECLARE_ALGORITHM(DeleteWorkspace) //-------------------------------------------------------------------------- // Private member functions diff --git a/Code/Mantid/Framework/Algorithms/src/DetectorDiagnostic.cpp b/Code/Mantid/Framework/Algorithms/src/DetectorDiagnostic.cpp index 2b6ab8e2618e..35dafe442d11 100644 --- a/Code/Mantid/Framework/Algorithms/src/DetectorDiagnostic.cpp +++ b/Code/Mantid/Framework/Algorithms/src/DetectorDiagnostic.cpp @@ -737,6 +737,6 @@ double DetectorDiagnostic::advanceProgress(double toAdd) { void DetectorDiagnostic::failProgress(RunTime aborted) { advanceProgress(-aborted); m_TotalTime -= aborted; -}; +} } } diff --git a/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCorUser.cpp b/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCorUser.cpp index 4c92103f327c..559a747688bc 100644 --- a/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCorUser.cpp +++ b/Code/Mantid/Framework/Algorithms/src/DetectorEfficiencyCorUser.cpp @@ -29,10 +29,10 @@ DetectorEfficiencyCorUser::~DetectorEfficiencyCorUser() {} /// Algorithm's name for identification. @see Algorithm::name const std::string DetectorEfficiencyCorUser::name() const { return "DetectorEfficiencyCorUser"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int DetectorEfficiencyCorUser::version() const { return 1; }; +int DetectorEfficiencyCorUser::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string DetectorEfficiencyCorUser::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/FilterByXValue.cpp b/Code/Mantid/Framework/Algorithms/src/FilterByXValue.cpp index a73f536d6edf..29a8be14083c 100644 --- a/Code/Mantid/Framework/Algorithms/src/FilterByXValue.cpp +++ b/Code/Mantid/Framework/Algorithms/src/FilterByXValue.cpp @@ -17,9 +17,9 @@ FilterByXValue::FilterByXValue() {} FilterByXValue::~FilterByXValue() {} /// Algorithm's name for identification. @see Algorithm::name -const std::string FilterByXValue::name() const { return "FilterByXValue"; }; +const std::string FilterByXValue::name() const { return "FilterByXValue"; } /// Algorithm's version for identification. @see Algorithm::version -int FilterByXValue::version() const { return 1; }; +int FilterByXValue::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string FilterByXValue::category() const { return "Events\\EventFiltering"; diff --git a/Code/Mantid/Framework/Algorithms/src/GroupWorkspaces.cpp b/Code/Mantid/Framework/Algorithms/src/GroupWorkspaces.cpp index fd55a82efa03..110b07a9e15a 100644 --- a/Code/Mantid/Framework/Algorithms/src/GroupWorkspaces.cpp +++ b/Code/Mantid/Framework/Algorithms/src/GroupWorkspaces.cpp @@ -7,7 +7,7 @@ namespace Mantid { namespace Algorithms { -DECLARE_ALGORITHM(GroupWorkspaces); +DECLARE_ALGORITHM(GroupWorkspaces) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/Algorithms/src/IntegrateByComponent.cpp b/Code/Mantid/Framework/Algorithms/src/IntegrateByComponent.cpp index f5e1a98e61b3..3736939ef44d 100644 --- a/Code/Mantid/Framework/Algorithms/src/IntegrateByComponent.cpp +++ b/Code/Mantid/Framework/Algorithms/src/IntegrateByComponent.cpp @@ -25,10 +25,10 @@ IntegrateByComponent::~IntegrateByComponent() {} /// Algorithm's name for identification. @see Algorithm::name const std::string IntegrateByComponent::name() const { return "IntegrateByComponent"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int IntegrateByComponent::version() const { return 1; }; +int IntegrateByComponent::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string IntegrateByComponent::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/LorentzCorrection.cpp b/Code/Mantid/Framework/Algorithms/src/LorentzCorrection.cpp index 0100a0000efc..2d42cd4b7ccf 100644 --- a/Code/Mantid/Framework/Algorithms/src/LorentzCorrection.cpp +++ b/Code/Mantid/Framework/Algorithms/src/LorentzCorrection.cpp @@ -31,7 +31,7 @@ LorentzCorrection::~LorentzCorrection() {} //---------------------------------------------------------------------------------------------- /// Algorithm's version for identification. @see Algorithm::version -int LorentzCorrection::version() const { return 1; }; +int LorentzCorrection::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string LorentzCorrection::category() const { return "Crystal"; } @@ -39,7 +39,7 @@ const std::string LorentzCorrection::category() const { return "Crystal"; } /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary const std::string LorentzCorrection::summary() const { return "Performs a white beam Lorentz Correction"; -}; +} const std::string LorentzCorrection::name() const { return "LorentzCorrection"; diff --git a/Code/Mantid/Framework/Algorithms/src/MedianDetectorTest.cpp b/Code/Mantid/Framework/Algorithms/src/MedianDetectorTest.cpp index db2e7c678a22..a6798977247c 100644 --- a/Code/Mantid/Framework/Algorithms/src/MedianDetectorTest.cpp +++ b/Code/Mantid/Framework/Algorithms/src/MedianDetectorTest.cpp @@ -19,7 +19,7 @@ using namespace Geometry; MedianDetectorTest::MedianDetectorTest() : DetectorDiagnostic(), m_inputWS(), m_loFrac(0.1), m_hiFrac(1.5), m_minSpec(0), m_maxSpec(EMPTY_INT()), m_rangeLower(0.0), - m_rangeUpper(0.0){}; + m_rangeUpper(0.0){} const std::string MedianDetectorTest::category() const { return "Diagnostics"; } diff --git a/Code/Mantid/Framework/Algorithms/src/ModeratorTzero.cpp b/Code/Mantid/Framework/Algorithms/src/ModeratorTzero.cpp index 36224d81a0e9..c7a22c2a1632 100644 --- a/Code/Mantid/Framework/Algorithms/src/ModeratorTzero.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ModeratorTzero.cpp @@ -14,7 +14,7 @@ namespace Mantid { namespace Algorithms { // Register the algorithm into the AlgorithmFactory -DECLARE_ALGORITHM(ModeratorTzero); +DECLARE_ALGORITHM(ModeratorTzero) using namespace Mantid::Kernel; using namespace Mantid::API; diff --git a/Code/Mantid/Framework/Algorithms/src/MuonGroupDetectors.cpp b/Code/Mantid/Framework/Algorithms/src/MuonGroupDetectors.cpp index b1d711f7e208..105188cee04e 100644 --- a/Code/Mantid/Framework/Algorithms/src/MuonGroupDetectors.cpp +++ b/Code/Mantid/Framework/Algorithms/src/MuonGroupDetectors.cpp @@ -26,10 +26,10 @@ MuonGroupDetectors::~MuonGroupDetectors() {} /// Algorithm's name for identification. @see Algorithm::name const std::string MuonGroupDetectors::name() const { return "MuonGroupDetectors"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int MuonGroupDetectors::version() const { return 1; }; +int MuonGroupDetectors::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string MuonGroupDetectors::category() const { return "Muon"; } diff --git a/Code/Mantid/Framework/Algorithms/src/NormaliseByDetector.cpp b/Code/Mantid/Framework/Algorithms/src/NormaliseByDetector.cpp index 3c4cfc0867cd..97e2ee6a72ee 100644 --- a/Code/Mantid/Framework/Algorithms/src/NormaliseByDetector.cpp +++ b/Code/Mantid/Framework/Algorithms/src/NormaliseByDetector.cpp @@ -39,10 +39,10 @@ NormaliseByDetector::~NormaliseByDetector() {} /// Algorithm's name for identification. @see Algorithm::name const std::string NormaliseByDetector::name() const { return "NormaliseByDetector"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int NormaliseByDetector::version() const { return 1; }; +int NormaliseByDetector::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string NormaliseByDetector::category() const { @@ -199,7 +199,7 @@ NormaliseByDetector::processHistograms(MatrixWorkspace_sptr inWS) { } return denominatorWS; -}; +} //---------------------------------------------------------------------------------------------- /** Execute the algorithm. diff --git a/Code/Mantid/Framework/Algorithms/src/Pause.cpp b/Code/Mantid/Framework/Algorithms/src/Pause.cpp index 007f5e10f8dd..170559caff20 100644 --- a/Code/Mantid/Framework/Algorithms/src/Pause.cpp +++ b/Code/Mantid/Framework/Algorithms/src/Pause.cpp @@ -24,10 +24,10 @@ Pause::~Pause() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string Pause::name() const { return "Pause"; }; +const std::string Pause::name() const { return "Pause"; } /// Algorithm's version for identification. @see Algorithm::version -int Pause::version() const { return 1; }; +int Pause::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string Pause::category() const { return "Utility\\Development"; } diff --git a/Code/Mantid/Framework/Algorithms/src/PerformIndexOperations.cpp b/Code/Mantid/Framework/Algorithms/src/PerformIndexOperations.cpp index 3a8fb0f7dd75..a3d760f3e67e 100644 --- a/Code/Mantid/Framework/Algorithms/src/PerformIndexOperations.cpp +++ b/Code/Mantid/Framework/Algorithms/src/PerformIndexOperations.cpp @@ -268,10 +268,10 @@ PerformIndexOperations::~PerformIndexOperations() {} /// Algorithm's name for identification. @see Algorithm::name const std::string PerformIndexOperations::name() const { return "PerformIndexOperations"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int PerformIndexOperations::version() const { return 1; }; +int PerformIndexOperations::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string PerformIndexOperations::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/PolarizationCorrection.cpp b/Code/Mantid/Framework/Algorithms/src/PolarizationCorrection.cpp index b2a1760dd6fc..4a9ef9b303a1 100644 --- a/Code/Mantid/Framework/Algorithms/src/PolarizationCorrection.cpp +++ b/Code/Mantid/Framework/Algorithms/src/PolarizationCorrection.cpp @@ -119,10 +119,10 @@ PolarizationCorrection::~PolarizationCorrection() {} /// Algorithm's name for identification. @see Algorithm::name const std::string PolarizationCorrection::name() const { return "PolarizationCorrection"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int PolarizationCorrection::version() const { return 1; }; +int PolarizationCorrection::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string PolarizationCorrection::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/RebinByPulseTimes.cpp b/Code/Mantid/Framework/Algorithms/src/RebinByPulseTimes.cpp index 2bbe560658f4..fce9355eb4d9 100644 --- a/Code/Mantid/Framework/Algorithms/src/RebinByPulseTimes.cpp +++ b/Code/Mantid/Framework/Algorithms/src/RebinByPulseTimes.cpp @@ -29,10 +29,10 @@ RebinByPulseTimes::~RebinByPulseTimes() {} /// Algorithm's name for identification. @see Algorithm::name const std::string RebinByPulseTimes::name() const { return "RebinByPulseTimes"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int RebinByPulseTimes::version() const { return 1; }; +int RebinByPulseTimes::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string RebinByPulseTimes::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/RebinByTimeAtSample.cpp b/Code/Mantid/Framework/Algorithms/src/RebinByTimeAtSample.cpp index c7d3f0491c98..ff2234d2fec9 100644 --- a/Code/Mantid/Framework/Algorithms/src/RebinByTimeAtSample.cpp +++ b/Code/Mantid/Framework/Algorithms/src/RebinByTimeAtSample.cpp @@ -28,7 +28,7 @@ RebinByTimeAtSample::~RebinByTimeAtSample() {} //---------------------------------------------------------------------------------------------- /// Algorithm's version for identification. @see Algorithm::version -int RebinByTimeAtSample::version() const { return 1; }; +int RebinByTimeAtSample::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string RebinByTimeAtSample::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp b/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp index ab6ebf78f1ac..dfb1a2932196 100644 --- a/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp @@ -95,10 +95,10 @@ ReflectometryReductionOne::~ReflectometryReductionOne() {} /// Algorithm's name for identification. @see Algorithm::name const std::string ReflectometryReductionOne::name() const { return "ReflectometryReductionOne"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int ReflectometryReductionOne::version() const { return 1; }; +int ReflectometryReductionOne::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ReflectometryReductionOne::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOneAuto.cpp b/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOneAuto.cpp index f29229096e23..884848559d96 100644 --- a/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOneAuto.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOneAuto.cpp @@ -31,10 +31,10 @@ ReflectometryReductionOneAuto::~ReflectometryReductionOneAuto() {} /// Algorithm's name for identification. @see Algorithm::name const std::string ReflectometryReductionOneAuto::name() const { return "ReflectometryReductionOneAuto"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int ReflectometryReductionOneAuto::version() const { return 1; }; +int ReflectometryReductionOneAuto::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ReflectometryReductionOneAuto::category() const { @@ -45,7 +45,7 @@ const std::string ReflectometryReductionOneAuto::category() const { const std::string ReflectometryReductionOneAuto::summary() const { return "Reduces a single TOF/Lambda reflectometry run into a mod Q vs I/I0 " "workspace. Performs transmission corrections."; -}; +} //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/Algorithms/src/RemoveBackground.cpp b/Code/Mantid/Framework/Algorithms/src/RemoveBackground.cpp index 706570edca10..8601d1e2c38e 100644 --- a/Code/Mantid/Framework/Algorithms/src/RemoveBackground.cpp +++ b/Code/Mantid/Framework/Algorithms/src/RemoveBackground.cpp @@ -150,7 +150,7 @@ void RemoveBackground::exec() { BackgroundHelper::BackgroundHelper() : m_WSUnit(), m_bgWs(), m_wkWS(), m_pgLog(NULL), m_inPlace(true), m_singleValueBackground(false), m_NBg(0), m_dtBg(1), // m_ErrSq(0), - m_Emode(0), m_L1(0), m_Efix(0), m_Sample(){}; + m_Emode(0), m_L1(0), m_Efix(0), m_Sample(){} /// Destructor BackgroundHelper::~BackgroundHelper() { this->deleteUnitsConverters(); } diff --git a/Code/Mantid/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp b/Code/Mantid/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp index 8d30c4fa14d1..4d6ecc74b7c0 100644 --- a/Code/Mantid/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp +++ b/Code/Mantid/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp @@ -24,10 +24,10 @@ RemoveWorkspaceHistory::~RemoveWorkspaceHistory() {} /// Algorithm's name for identification. @see Algorithm::name const std::string RemoveWorkspaceHistory::name() const { return "RemoveWorkspaceHistory"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int RemoveWorkspaceHistory::version() const { return 1; }; +int RemoveWorkspaceHistory::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string RemoveWorkspaceHistory::category() const { return "Utility"; } @@ -35,7 +35,7 @@ const std::string RemoveWorkspaceHistory::category() const { return "Utility"; } /// Algorithm's summary for identification. @see Algorithm::summary const std::string RemoveWorkspaceHistory::summary() const { return "Removes all algorithm history records from a given workspace."; -}; +} //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/Algorithms/src/ResizeRectangularDetector.cpp b/Code/Mantid/Framework/Algorithms/src/ResizeRectangularDetector.cpp index bb719da64251..d5c40de7a071 100644 --- a/Code/Mantid/Framework/Algorithms/src/ResizeRectangularDetector.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ResizeRectangularDetector.cpp @@ -30,10 +30,10 @@ ResizeRectangularDetector::~ResizeRectangularDetector() {} /// Algorithm's name for identification. @see Algorithm::name const std::string ResizeRectangularDetector::name() const { return "ResizeRectangularDetector"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int ResizeRectangularDetector::version() const { return 1; }; +int ResizeRectangularDetector::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ResizeRectangularDetector::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/RingProfile.cpp b/Code/Mantid/Framework/Algorithms/src/RingProfile.cpp index b558c1a8584d..21be96faae17 100644 --- a/Code/Mantid/Framework/Algorithms/src/RingProfile.cpp +++ b/Code/Mantid/Framework/Algorithms/src/RingProfile.cpp @@ -582,7 +582,7 @@ void RingProfile::getBinForPixel(const API::MatrixWorkspace_sptr ws, // call fromAngleToBin (radians) bins_pos[i] = fromAngleToBin(angle, false); } -}; +} /* Return the bin position for a given angle. * @@ -618,7 +618,7 @@ int RingProfile::fromAngleToBin(double angle, bool degree) { angle /= bin_size; return (int)angle; -}; +} } // namespace Algorithms } // namespace Mantid diff --git a/Code/Mantid/Framework/Algorithms/src/SassenaFFT.cpp b/Code/Mantid/Framework/Algorithms/src/SassenaFFT.cpp index c51071190ef9..bd0e048fd713 100644 --- a/Code/Mantid/Framework/Algorithms/src/SassenaFFT.cpp +++ b/Code/Mantid/Framework/Algorithms/src/SassenaFFT.cpp @@ -13,7 +13,7 @@ namespace Mantid { namespace Algorithms { // Register the class into the algorithm factory -DECLARE_ALGORITHM(SassenaFFT); +DECLARE_ALGORITHM(SassenaFFT) /// Override Algorithm::checkGroups bool SassenaFFT::checkGroups() { return false; } diff --git a/Code/Mantid/Framework/Algorithms/src/SetInstrumentParameter.cpp b/Code/Mantid/Framework/Algorithms/src/SetInstrumentParameter.cpp index 487d95665918..e06d9b1f72eb 100644 --- a/Code/Mantid/Framework/Algorithms/src/SetInstrumentParameter.cpp +++ b/Code/Mantid/Framework/Algorithms/src/SetInstrumentParameter.cpp @@ -30,10 +30,10 @@ SetInstrumentParameter::~SetInstrumentParameter() {} /// Algorithm's name for identification. @see Algorithm::name const std::string SetInstrumentParameter::name() const { return "SetInstrumentParameter"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int SetInstrumentParameter::version() const { return 1; }; +int SetInstrumentParameter::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string SetInstrumentParameter::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/SignalOverError.cpp b/Code/Mantid/Framework/Algorithms/src/SignalOverError.cpp index 2354d0369c33..9d36340512c7 100644 --- a/Code/Mantid/Framework/Algorithms/src/SignalOverError.cpp +++ b/Code/Mantid/Framework/Algorithms/src/SignalOverError.cpp @@ -25,10 +25,10 @@ SignalOverError::~SignalOverError() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string SignalOverError::name() const { return "SignalOverError"; }; +const std::string SignalOverError::name() const { return "SignalOverError"; } /// Algorithm's version for identification. @see Algorithm::version -int SignalOverError::version() const { return 1; }; +int SignalOverError::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string SignalOverError::category() const { return "Arithmetic"; } diff --git a/Code/Mantid/Framework/Algorithms/src/SpecularReflectionCalculateTheta.cpp b/Code/Mantid/Framework/Algorithms/src/SpecularReflectionCalculateTheta.cpp index 917f3aa741e1..ac7c575361fc 100644 --- a/Code/Mantid/Framework/Algorithms/src/SpecularReflectionCalculateTheta.cpp +++ b/Code/Mantid/Framework/Algorithms/src/SpecularReflectionCalculateTheta.cpp @@ -35,10 +35,10 @@ SpecularReflectionCalculateTheta::~SpecularReflectionCalculateTheta() {} /// Algorithm's name for identification. @see Algorithm::name const std::string SpecularReflectionCalculateTheta::name() const { return "SpecularReflectionCalculateTheta"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int SpecularReflectionCalculateTheta::version() const { return 1; }; +int SpecularReflectionCalculateTheta::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string SpecularReflectionCalculateTheta::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/SpecularReflectionPositionCorrect.cpp b/Code/Mantid/Framework/Algorithms/src/SpecularReflectionPositionCorrect.cpp index b69a6128a5e1..3497a23d437b 100644 --- a/Code/Mantid/Framework/Algorithms/src/SpecularReflectionPositionCorrect.cpp +++ b/Code/Mantid/Framework/Algorithms/src/SpecularReflectionPositionCorrect.cpp @@ -70,10 +70,10 @@ SpecularReflectionPositionCorrect::~SpecularReflectionPositionCorrect() {} /// Algorithm's name for identification. @see Algorithm::name const std::string SpecularReflectionPositionCorrect::name() const { return "SpecularReflectionPositionCorrect"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int SpecularReflectionPositionCorrect::version() const { return 1; }; +int SpecularReflectionPositionCorrect::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string SpecularReflectionPositionCorrect::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/SumEventsByLogValue.cpp b/Code/Mantid/Framework/Algorithms/src/SumEventsByLogValue.cpp index 7829bd0452a0..48f47cff4a6f 100644 --- a/Code/Mantid/Framework/Algorithms/src/SumEventsByLogValue.cpp +++ b/Code/Mantid/Framework/Algorithms/src/SumEventsByLogValue.cpp @@ -10,7 +10,7 @@ namespace Mantid { namespace Algorithms { // Register the class into the algorithm factory -DECLARE_ALGORITHM(SumEventsByLogValue); +DECLARE_ALGORITHM(SumEventsByLogValue) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/Algorithms/src/UpdateScriptRepository.cpp b/Code/Mantid/Framework/Algorithms/src/UpdateScriptRepository.cpp index b56a1c0be37f..45e620542ce1 100644 --- a/Code/Mantid/Framework/Algorithms/src/UpdateScriptRepository.cpp +++ b/Code/Mantid/Framework/Algorithms/src/UpdateScriptRepository.cpp @@ -22,10 +22,10 @@ UpdateScriptRepository::~UpdateScriptRepository() {} /// Algorithm's name for identification. @see Algorithm::name const std::string UpdateScriptRepository::name() const { return "UpdateScriptRepository"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int UpdateScriptRepository::version() const { return 1; }; +int UpdateScriptRepository::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string UpdateScriptRepository::category() const { return "Utility"; } diff --git a/Code/Mantid/Framework/Algorithms/src/WeightedMeanOfWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/WeightedMeanOfWorkspace.cpp index baf8f5094140..4703eb91d2f8 100644 --- a/Code/Mantid/Framework/Algorithms/src/WeightedMeanOfWorkspace.cpp +++ b/Code/Mantid/Framework/Algorithms/src/WeightedMeanOfWorkspace.cpp @@ -28,10 +28,10 @@ WeightedMeanOfWorkspace::~WeightedMeanOfWorkspace() {} /// Algorithm's name for identification. @see Algorithm::name const std::string WeightedMeanOfWorkspace::name() const { return "WeightedMeanOfWorkspace"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int WeightedMeanOfWorkspace::version() const { return 1; }; +int WeightedMeanOfWorkspace::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string WeightedMeanOfWorkspace::category() const { diff --git a/Code/Mantid/Framework/Algorithms/src/WeightingStrategy.cpp b/Code/Mantid/Framework/Algorithms/src/WeightingStrategy.cpp index f09fd1e66583..17af7d37dede 100644 --- a/Code/Mantid/Framework/Algorithms/src/WeightingStrategy.cpp +++ b/Code/Mantid/Framework/Algorithms/src/WeightingStrategy.cpp @@ -15,10 +15,10 @@ namespace Algorithms { Constructor @param cutOff : radius cutoff */ -WeightingStrategy::WeightingStrategy(const double cutOff) : m_cutOff(cutOff){}; +WeightingStrategy::WeightingStrategy(const double cutOff) : m_cutOff(cutOff){} /// Constructor -WeightingStrategy::WeightingStrategy() : m_cutOff(0){}; +WeightingStrategy::WeightingStrategy() : m_cutOff(0){} /// Destructor WeightingStrategy::~WeightingStrategy() {} diff --git a/Code/Mantid/Framework/Algorithms/src/WienerSmooth.cpp b/Code/Mantid/Framework/Algorithms/src/WienerSmooth.cpp index e4baaba6d2b0..f8762cd5a566 100644 --- a/Code/Mantid/Framework/Algorithms/src/WienerSmooth.cpp +++ b/Code/Mantid/Framework/Algorithms/src/WienerSmooth.cpp @@ -38,7 +38,7 @@ WienerSmooth::~WienerSmooth() {} //---------------------------------------------------------------------------------------------- /// Algorithm's version for identification. @see Algorithm::version -int WienerSmooth::version() const { return 1; }; +int WienerSmooth::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string WienerSmooth::category() const { @@ -48,7 +48,7 @@ const std::string WienerSmooth::category() const { /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary const std::string WienerSmooth::summary() const { return "Smooth spectra using Wiener filter."; -}; +} //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/Crystal/src/AddPeakHKL.cpp b/Code/Mantid/Framework/Crystal/src/AddPeakHKL.cpp index 78c563d096e9..2e770043c2b4 100644 --- a/Code/Mantid/Framework/Crystal/src/AddPeakHKL.cpp +++ b/Code/Mantid/Framework/Crystal/src/AddPeakHKL.cpp @@ -39,13 +39,13 @@ namespace Crystal const std::string AddPeakHKL::name() const { return "AddPeakHKL"; } /// Algorithm's version for identification. @see Algorithm::version - int AddPeakHKL::version() const { return 1;}; + int AddPeakHKL::version() const { return 1;} /// Algorithm's category for identification. @see Algorithm::category const std::string AddPeakHKL::category() const { return "Crystal";} /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary - const std::string AddPeakHKL::summary() const { return "Add a peak in the hkl frame";}; + const std::string AddPeakHKL::summary() const { return "Add a peak in the hkl frame";} //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/Crystal/src/CalculatePeaksHKL.cpp b/Code/Mantid/Framework/Crystal/src/CalculatePeaksHKL.cpp index 46cac8737cdf..10dc1653c945 100644 --- a/Code/Mantid/Framework/Crystal/src/CalculatePeaksHKL.cpp +++ b/Code/Mantid/Framework/Crystal/src/CalculatePeaksHKL.cpp @@ -30,10 +30,10 @@ CalculatePeaksHKL::~CalculatePeaksHKL() {} /// Algorithm's name for identification. @see Algorithm::name const std::string CalculatePeaksHKL::name() const { return "CalculatePeaksHKL"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CalculatePeaksHKL::version() const { return 1; }; +int CalculatePeaksHKL::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CalculatePeaksHKL::category() const { return "Crystal"; } diff --git a/Code/Mantid/Framework/Crystal/src/ClearUB.cpp b/Code/Mantid/Framework/Crystal/src/ClearUB.cpp index fdcefa2a8939..54f27de7e263 100644 --- a/Code/Mantid/Framework/Crystal/src/ClearUB.cpp +++ b/Code/Mantid/Framework/Crystal/src/ClearUB.cpp @@ -22,10 +22,10 @@ ClearUB::~ClearUB() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string ClearUB::name() const { return "ClearUB"; }; +const std::string ClearUB::name() const { return "ClearUB"; } /// Algorithm's version for identification. @see Algorithm::version -int ClearUB::version() const { return 1; }; +int ClearUB::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ClearUB::category() const { return "Crystal"; } diff --git a/Code/Mantid/Framework/Crystal/src/CombinePeaksWorkspaces.cpp b/Code/Mantid/Framework/Crystal/src/CombinePeaksWorkspaces.cpp index f59b28b0a0af..e4e518348f73 100644 --- a/Code/Mantid/Framework/Crystal/src/CombinePeaksWorkspaces.cpp +++ b/Code/Mantid/Framework/Crystal/src/CombinePeaksWorkspaces.cpp @@ -27,9 +27,9 @@ CombinePeaksWorkspaces::~CombinePeaksWorkspaces() {} /// Algorithm's name for identification. @see Algorithm::name const std::string CombinePeaksWorkspaces::name() const { return "CombinePeaksWorkspaces"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CombinePeaksWorkspaces::version() const { return 1; }; +int CombinePeaksWorkspaces::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CombinePeaksWorkspaces::category() const { return "Crystal"; } diff --git a/Code/Mantid/Framework/Crystal/src/DiffPeaksWorkspaces.cpp b/Code/Mantid/Framework/Crystal/src/DiffPeaksWorkspaces.cpp index 00a3cb839e66..34337d74f916 100644 --- a/Code/Mantid/Framework/Crystal/src/DiffPeaksWorkspaces.cpp +++ b/Code/Mantid/Framework/Crystal/src/DiffPeaksWorkspaces.cpp @@ -25,9 +25,9 @@ DiffPeaksWorkspaces::~DiffPeaksWorkspaces() {} /// Algorithm's name for identification. @see Algorithm::name const std::string DiffPeaksWorkspaces::name() const { return "DiffPeaksWorkspaces"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int DiffPeaksWorkspaces::version() const { return 1; }; +int DiffPeaksWorkspaces::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string DiffPeaksWorkspaces::category() const { return "Crystal"; } diff --git a/Code/Mantid/Framework/Crystal/src/FilterPeaks.cpp b/Code/Mantid/Framework/Crystal/src/FilterPeaks.cpp index efecf7a037a3..86ff9a78ccc8 100644 --- a/Code/Mantid/Framework/Crystal/src/FilterPeaks.cpp +++ b/Code/Mantid/Framework/Crystal/src/FilterPeaks.cpp @@ -40,9 +40,9 @@ FilterPeaks::FilterPeaks() {} FilterPeaks::~FilterPeaks() {} /// Algorithm's name for identification. @see Algorithm::name -const std::string FilterPeaks::name() const { return "FilterPeaks"; }; +const std::string FilterPeaks::name() const { return "FilterPeaks"; } /// Algorithm's version for identification. @see Algorithm::version -int FilterPeaks::version() const { return 1; }; +int FilterPeaks::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string FilterPeaks::category() const { return "Crystal"; } diff --git a/Code/Mantid/Framework/Crystal/src/FindClusterFaces.cpp b/Code/Mantid/Framework/Crystal/src/FindClusterFaces.cpp index fe9266df134f..2332de051847 100644 --- a/Code/Mantid/Framework/Crystal/src/FindClusterFaces.cpp +++ b/Code/Mantid/Framework/Crystal/src/FindClusterFaces.cpp @@ -270,10 +270,10 @@ FindClusterFaces::~FindClusterFaces() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string FindClusterFaces::name() const { return "FindClusterFaces"; }; +const std::string FindClusterFaces::name() const { return "FindClusterFaces"; } /// Algorithm's version for identification. @see Algorithm::version -int FindClusterFaces::version() const { return 1; }; +int FindClusterFaces::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string FindClusterFaces::category() const { return "Crystal"; } diff --git a/Code/Mantid/Framework/Crystal/src/HasUB.cpp b/Code/Mantid/Framework/Crystal/src/HasUB.cpp index fcc9477ff9ff..2bf028caa4c0 100644 --- a/Code/Mantid/Framework/Crystal/src/HasUB.cpp +++ b/Code/Mantid/Framework/Crystal/src/HasUB.cpp @@ -21,10 +21,10 @@ HasUB::~HasUB() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string HasUB::name() const { return "HasUB"; }; +const std::string HasUB::name() const { return "HasUB"; } /// Algorithm's version for identification. @see Algorithm::version -int HasUB::version() const { return 1; }; +int HasUB::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string HasUB::category() const { return "Crystal"; } diff --git a/Code/Mantid/Framework/Crystal/src/IntegratePeaksHybrid.cpp b/Code/Mantid/Framework/Crystal/src/IntegratePeaksHybrid.cpp index 83c00772d38c..c7d2f6fd8ede 100644 --- a/Code/Mantid/Framework/Crystal/src/IntegratePeaksHybrid.cpp +++ b/Code/Mantid/Framework/Crystal/src/IntegratePeaksHybrid.cpp @@ -101,10 +101,10 @@ IntegratePeaksHybrid::~IntegratePeaksHybrid() {} /// Algorithm's name for identification. @see Algorithm::name const std::string IntegratePeaksHybrid::name() const { return "IntegratePeaksHybrid"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int IntegratePeaksHybrid::version() const { return 1; }; +int IntegratePeaksHybrid::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string IntegratePeaksHybrid::category() const { diff --git a/Code/Mantid/Framework/Crystal/src/IntegratePeaksUsingClusters.cpp b/Code/Mantid/Framework/Crystal/src/IntegratePeaksUsingClusters.cpp index 84843b0b2b34..5b6aeeb76773 100644 --- a/Code/Mantid/Framework/Crystal/src/IntegratePeaksUsingClusters.cpp +++ b/Code/Mantid/Framework/Crystal/src/IntegratePeaksUsingClusters.cpp @@ -48,10 +48,10 @@ IntegratePeaksUsingClusters::~IntegratePeaksUsingClusters() {} /// Algorithm's name for identification. @see Algorithm::name const std::string IntegratePeaksUsingClusters::name() const { return "IntegratePeaksUsingClusters"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int IntegratePeaksUsingClusters::version() const { return 1; }; +int IntegratePeaksUsingClusters::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string IntegratePeaksUsingClusters::category() const { diff --git a/Code/Mantid/Framework/Crystal/src/LoadIsawPeaks.cpp b/Code/Mantid/Framework/Crystal/src/LoadIsawPeaks.cpp index 1e4e7a331a11..9612ce7b2638 100644 --- a/Code/Mantid/Framework/Crystal/src/LoadIsawPeaks.cpp +++ b/Code/Mantid/Framework/Crystal/src/LoadIsawPeaks.cpp @@ -28,7 +28,7 @@ using Mantid::Kernel::Units::Wavelength; namespace Mantid { namespace Crystal { -DECLARE_FILELOADER_ALGORITHM(LoadIsawPeaks); +DECLARE_FILELOADER_ALGORITHM(LoadIsawPeaks) using namespace Mantid::Kernel; using namespace Mantid::API; diff --git a/Code/Mantid/Framework/Crystal/src/PeakIntensityVsRadius.cpp b/Code/Mantid/Framework/Crystal/src/PeakIntensityVsRadius.cpp index 53ccf36f9059..e1381d541dab 100644 --- a/Code/Mantid/Framework/Crystal/src/PeakIntensityVsRadius.cpp +++ b/Code/Mantid/Framework/Crystal/src/PeakIntensityVsRadius.cpp @@ -29,10 +29,10 @@ PeakIntensityVsRadius::~PeakIntensityVsRadius() {} /// Algorithm's name for identification. @see Algorithm::name const std::string PeakIntensityVsRadius::name() const { return "PeakIntensityVsRadius"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int PeakIntensityVsRadius::version() const { return 1; }; +int PeakIntensityVsRadius::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string PeakIntensityVsRadius::category() const { return "Crystal"; } diff --git a/Code/Mantid/Framework/Crystal/src/PeaksInRegion.cpp b/Code/Mantid/Framework/Crystal/src/PeaksInRegion.cpp index b8b112cb7a46..dc590f5b4c62 100644 --- a/Code/Mantid/Framework/Crystal/src/PeaksInRegion.cpp +++ b/Code/Mantid/Framework/Crystal/src/PeaksInRegion.cpp @@ -26,10 +26,10 @@ PeaksInRegion::~PeaksInRegion() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string PeaksInRegion::name() const { return "PeaksInRegion"; }; +const std::string PeaksInRegion::name() const { return "PeaksInRegion"; } /// Algorithm's version for identification. @see Algorithm::version -int PeaksInRegion::version() const { return 1; }; +int PeaksInRegion::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string PeaksInRegion::category() const { return "Crystal"; } diff --git a/Code/Mantid/Framework/Crystal/src/PeaksOnSurface.cpp b/Code/Mantid/Framework/Crystal/src/PeaksOnSurface.cpp index f0dded52a842..3bd6da8e03fd 100644 --- a/Code/Mantid/Framework/Crystal/src/PeaksOnSurface.cpp +++ b/Code/Mantid/Framework/Crystal/src/PeaksOnSurface.cpp @@ -25,10 +25,10 @@ PeaksOnSurface::~PeaksOnSurface() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string PeaksOnSurface::name() const { return "PeaksOnSurface"; }; +const std::string PeaksOnSurface::name() const { return "PeaksOnSurface"; } /// Algorithm's version for identification. @see Algorithm::version -int PeaksOnSurface::version() const { return 1; }; +int PeaksOnSurface::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string PeaksOnSurface::category() const { return "Crystal"; } diff --git a/Code/Mantid/Framework/Crystal/src/SetSpecialCoordinates.cpp b/Code/Mantid/Framework/Crystal/src/SetSpecialCoordinates.cpp index 784d7244d529..61ecc88afb96 100644 --- a/Code/Mantid/Framework/Crystal/src/SetSpecialCoordinates.cpp +++ b/Code/Mantid/Framework/Crystal/src/SetSpecialCoordinates.cpp @@ -56,10 +56,10 @@ SetSpecialCoordinates::~SetSpecialCoordinates() {} /// Algorithm's name for identification. @see Algorithm::name const std::string SetSpecialCoordinates::name() const { return "SetSpecialCoordinates"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int SetSpecialCoordinates::version() const { return 1; }; +int SetSpecialCoordinates::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string SetSpecialCoordinates::category() const { return "Crystal"; } diff --git a/Code/Mantid/Framework/Crystal/src/SortPeaksWorkspace.cpp b/Code/Mantid/Framework/Crystal/src/SortPeaksWorkspace.cpp index d9422413e6c5..2045ca8d73f8 100644 --- a/Code/Mantid/Framework/Crystal/src/SortPeaksWorkspace.cpp +++ b/Code/Mantid/Framework/Crystal/src/SortPeaksWorkspace.cpp @@ -29,10 +29,10 @@ SortPeaksWorkspace::~SortPeaksWorkspace() {} /// Algorithm's name for identification. @see Algorithm::name const std::string SortPeaksWorkspace::name() const { return "SortPeaksWorkspace"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int SortPeaksWorkspace::version() const { return 1; }; +int SortPeaksWorkspace::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string SortPeaksWorkspace::category() const { return "Crystal"; } diff --git a/Code/Mantid/Framework/CurveFitting/src/CalculateGammaBackground.cpp b/Code/Mantid/Framework/CurveFitting/src/CalculateGammaBackground.cpp index 6e1ab71224a5..d4dfeb2503d7 100644 --- a/Code/Mantid/Framework/CurveFitting/src/CalculateGammaBackground.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/CalculateGammaBackground.cpp @@ -21,7 +21,7 @@ using namespace Kernel; using namespace std; // Subscription -DECLARE_ALGORITHM(CalculateGammaBackground); +DECLARE_ALGORITHM(CalculateGammaBackground) namespace { /// Number of elements in theta direction integration diff --git a/Code/Mantid/Framework/CurveFitting/src/Chebyshev.cpp b/Code/Mantid/Framework/CurveFitting/src/Chebyshev.cpp index eb0330594383..7da4e1d0b883 100644 --- a/Code/Mantid/Framework/CurveFitting/src/Chebyshev.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/Chebyshev.cpp @@ -20,7 +20,7 @@ Chebyshev::Chebyshev() : m_n(0), m_StartX(-1.), m_EndX(1.) { declareAttribute("n", Attribute(m_n)); declareAttribute("StartX", Attribute(m_StartX)); declareAttribute("EndX", Attribute(m_EndX)); -}; +} void Chebyshev::function1D(double *out, const double *xValues, const size_t nData) const { diff --git a/Code/Mantid/Framework/CurveFitting/src/ComptonPeakProfile.cpp b/Code/Mantid/Framework/CurveFitting/src/ComptonPeakProfile.cpp index 45de68597850..92328afbcff1 100644 --- a/Code/Mantid/Framework/CurveFitting/src/ComptonPeakProfile.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/ComptonPeakProfile.cpp @@ -8,7 +8,7 @@ namespace Mantid { namespace CurveFitting { -DECLARE_FUNCTION(ComptonPeakProfile); +DECLARE_FUNCTION(ComptonPeakProfile) namespace { ///@cond diff --git a/Code/Mantid/Framework/CurveFitting/src/ComptonScatteringCountRate.cpp b/Code/Mantid/Framework/CurveFitting/src/ComptonScatteringCountRate.cpp index 7bb7dd9b2a53..c0862428093e 100644 --- a/Code/Mantid/Framework/CurveFitting/src/ComptonScatteringCountRate.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/ComptonScatteringCountRate.cpp @@ -20,7 +20,7 @@ const char *BKGD_ORDER_ATTR_NAME = "BackgroundOrderAttr"; Logger g_log("ComptonScatteringCountRate"); } -DECLARE_FUNCTION(ComptonScatteringCountRate); +DECLARE_FUNCTION(ComptonScatteringCountRate) //---------------------------------------------------------------------------------------------- /** Constructor diff --git a/Code/Mantid/Framework/CurveFitting/src/ConvertToYSpace.cpp b/Code/Mantid/Framework/CurveFitting/src/ConvertToYSpace.cpp index 456d7355884f..5cb55c3d2aa4 100644 --- a/Code/Mantid/Framework/CurveFitting/src/ConvertToYSpace.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/ConvertToYSpace.cpp @@ -10,7 +10,7 @@ namespace Mantid { namespace CurveFitting { // Register the algorithm into the AlgorithmFactory -DECLARE_ALGORITHM(ConvertToYSpace); +DECLARE_ALGORITHM(ConvertToYSpace) using namespace API; using namespace Kernel; diff --git a/Code/Mantid/Framework/CurveFitting/src/CubicSpline.cpp b/Code/Mantid/Framework/CurveFitting/src/CubicSpline.cpp index 893e0f59420f..6b0d2815989e 100644 --- a/Code/Mantid/Framework/CurveFitting/src/CubicSpline.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/CubicSpline.cpp @@ -41,7 +41,7 @@ CubicSpline::CubicSpline() declareParameter("y0", 0); declareParameter("y1", 0); declareParameter("y2", 0); -}; +} /** Execute the function * diff --git a/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp b/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp index 1c2042fbdeef..0ba4b041a6f1 100644 --- a/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp @@ -11,9 +11,9 @@ namespace Mantid { namespace CurveFitting { -DECLARE_FUNCTION(ElasticDiffRotDiscreteCircle); -DECLARE_FUNCTION(InelasticDiffRotDiscreteCircle); -DECLARE_FUNCTION(DiffRotDiscreteCircle); +DECLARE_FUNCTION(ElasticDiffRotDiscreteCircle) +DECLARE_FUNCTION(InelasticDiffRotDiscreteCircle) +DECLARE_FUNCTION(DiffRotDiscreteCircle) ElasticDiffRotDiscreteCircle::ElasticDiffRotDiscreteCircle() { // declareParameter("Height", 1.0); //parameter "Height" already declared in diff --git a/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp b/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp index aafd90d88c51..32f8f1c44cee 100644 --- a/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp @@ -16,9 +16,9 @@ namespace CurveFitting { using namespace Kernel; using namespace API; -DECLARE_FUNCTION(ElasticDiffSphere); -DECLARE_FUNCTION(InelasticDiffSphere); -DECLARE_FUNCTION(DiffSphere); +DECLARE_FUNCTION(ElasticDiffSphere) +DECLARE_FUNCTION(InelasticDiffSphere) +DECLARE_FUNCTION(DiffSphere) ElasticDiffSphere::ElasticDiffSphere() { // declareParameter("Height", 1.0); //parameter "Height" already declared in diff --git a/Code/Mantid/Framework/CurveFitting/src/EstimatePeakErrors.cpp b/Code/Mantid/Framework/CurveFitting/src/EstimatePeakErrors.cpp index b2d70ca84b52..a57f7e2cfd20 100644 --- a/Code/Mantid/Framework/CurveFitting/src/EstimatePeakErrors.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/EstimatePeakErrors.cpp @@ -17,7 +17,7 @@ using namespace Kernel; using namespace std; // Subscription -DECLARE_ALGORITHM(EstimatePeakErrors); +DECLARE_ALGORITHM(EstimatePeakErrors) //-------------------------------------------------------------------------------------------------------- // Public members diff --git a/Code/Mantid/Framework/CurveFitting/src/GaussianComptonProfile.cpp b/Code/Mantid/Framework/CurveFitting/src/GaussianComptonProfile.cpp index f1600c26fc8a..b77daafba109 100644 --- a/Code/Mantid/Framework/CurveFitting/src/GaussianComptonProfile.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/GaussianComptonProfile.cpp @@ -6,7 +6,7 @@ namespace Mantid { namespace CurveFitting { -DECLARE_FUNCTION(GaussianComptonProfile); +DECLARE_FUNCTION(GaussianComptonProfile) const char *WIDTH_PARAM = "Width"; const char *AMP_PARAM = "Intensity"; diff --git a/Code/Mantid/Framework/CurveFitting/src/GramCharlierComptonProfile.cpp b/Code/Mantid/Framework/CurveFitting/src/GramCharlierComptonProfile.cpp index c6a64b0fbb44..fe20a841b141 100644 --- a/Code/Mantid/Framework/CurveFitting/src/GramCharlierComptonProfile.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/GramCharlierComptonProfile.cpp @@ -14,7 +14,7 @@ namespace Mantid { namespace CurveFitting { // Register into factory -DECLARE_FUNCTION(GramCharlierComptonProfile); +DECLARE_FUNCTION(GramCharlierComptonProfile) namespace { ///@cond diff --git a/Code/Mantid/Framework/CurveFitting/src/IkedaCarpenterPV.cpp b/Code/Mantid/Framework/CurveFitting/src/IkedaCarpenterPV.cpp index e9d8a908511a..527a9c396980 100644 --- a/Code/Mantid/Framework/CurveFitting/src/IkedaCarpenterPV.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/IkedaCarpenterPV.cpp @@ -49,7 +49,7 @@ void IkedaCarpenterPV::setHeight(const double h) { // The intensity is then estimated to be h/h0 setParameter("I", h / h0); -}; +} double IkedaCarpenterPV::height() const { // return the function value at centre() @@ -59,7 +59,7 @@ double IkedaCarpenterPV::height() const { toCentre[0] = centre(); constFunction(h0, toCentre, 1); return h0[0]; -}; +} double IkedaCarpenterPV::fwhm() const { double sigmaSquared = getParameter("SigmaSquared"); @@ -83,14 +83,14 @@ double IkedaCarpenterPV::fwhm() const { ; } return sqrt(8.0 * M_LN2 * sigmaSquared) + gamma; -}; +} void IkedaCarpenterPV::setFwhm(const double w) { setParameter("SigmaSquared", w * w / (32.0 * M_LN2)); // used 4.0 * 8.0 = 32.0 setParameter("Gamma", w / 2.0); -}; +} -void IkedaCarpenterPV::setCentre(const double c) { setParameter("X0", c); }; +void IkedaCarpenterPV::setCentre(const double c) { setParameter("X0", c); } void IkedaCarpenterPV::init() { declareParameter("I", 0.0, "The integrated intensity of the peak. I.e. " diff --git a/Code/Mantid/Framework/CurveFitting/src/Lorentzian.cpp b/Code/Mantid/Framework/CurveFitting/src/Lorentzian.cpp index 7791d92f6eab..8d58c9a3915b 100644 --- a/Code/Mantid/Framework/CurveFitting/src/Lorentzian.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/Lorentzian.cpp @@ -11,7 +11,7 @@ namespace CurveFitting { using namespace Kernel; using namespace API; -DECLARE_FUNCTION(Lorentzian); +DECLARE_FUNCTION(Lorentzian) void Lorentzian::init() { declareParameter("Amplitude", 1.0, "Intensity scaling"); diff --git a/Code/Mantid/Framework/CurveFitting/src/PseudoVoigt.cpp b/Code/Mantid/Framework/CurveFitting/src/PseudoVoigt.cpp index 585d1d6eb8b0..a492df6add65 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PseudoVoigt.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PseudoVoigt.cpp @@ -9,7 +9,7 @@ namespace CurveFitting { using namespace API; -DECLARE_FUNCTION(PseudoVoigt); +DECLARE_FUNCTION(PseudoVoigt) void PseudoVoigt::functionLocal(double *out, const double *xValues, const size_t nData) const { diff --git a/Code/Mantid/Framework/CurveFitting/src/SplineInterpolation.cpp b/Code/Mantid/Framework/CurveFitting/src/SplineInterpolation.cpp index 266f44f7e919..d476c8013e8a 100644 --- a/Code/Mantid/Framework/CurveFitting/src/SplineInterpolation.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/SplineInterpolation.cpp @@ -7,7 +7,7 @@ namespace Mantid { namespace CurveFitting { // Register the algorithm into the AlgorithmFactory -DECLARE_ALGORITHM(SplineInterpolation); +DECLARE_ALGORITHM(SplineInterpolation) using namespace API; using namespace Kernel; diff --git a/Code/Mantid/Framework/CurveFitting/src/SplineSmoothing.cpp b/Code/Mantid/Framework/CurveFitting/src/SplineSmoothing.cpp index 0d1f3d560a03..cd8f927f1b60 100644 --- a/Code/Mantid/Framework/CurveFitting/src/SplineSmoothing.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/SplineSmoothing.cpp @@ -12,7 +12,7 @@ namespace Mantid { namespace CurveFitting { // Register the algorithm into the AlgorithmFactory -DECLARE_ALGORITHM(SplineSmoothing); +DECLARE_ALGORITHM(SplineSmoothing) using namespace API; using namespace Kernel; @@ -32,10 +32,10 @@ SplineSmoothing::~SplineSmoothing() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string SplineSmoothing::name() const { return "SplineSmoothing"; }; +const std::string SplineSmoothing::name() const { return "SplineSmoothing"; } /// Algorithm's version for identification. @see Algorithm::version -int SplineSmoothing::version() const { return 1; }; +int SplineSmoothing::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string SplineSmoothing::category() const { diff --git a/Code/Mantid/Framework/CurveFitting/src/VesuvioResolution.cpp b/Code/Mantid/Framework/CurveFitting/src/VesuvioResolution.cpp index d13a8297536c..fac486c744a4 100644 --- a/Code/Mantid/Framework/CurveFitting/src/VesuvioResolution.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/VesuvioResolution.cpp @@ -17,7 +17,7 @@ const double STDDEV_TO_HWHM = std::sqrt(std::log(4.0)); } // Register into factory -DECLARE_FUNCTION(VesuvioResolution); +DECLARE_FUNCTION(VesuvioResolution) //--------------------------------------------------------------------------- // Static functions diff --git a/Code/Mantid/Framework/CurveFitting/src/Voigt.cpp b/Code/Mantid/Framework/CurveFitting/src/Voigt.cpp index fd5205345589..9e006da4d314 100644 --- a/Code/Mantid/Framework/CurveFitting/src/Voigt.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/Voigt.cpp @@ -9,7 +9,7 @@ namespace Mantid { namespace CurveFitting { -DECLARE_FUNCTION(Voigt); +DECLARE_FUNCTION(Voigt) namespace { /// @cond diff --git a/Code/Mantid/Framework/CurveFitting/test/CompositeFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/CompositeFunctionTest.h index ec353f5b2a61..678334f2bd19 100644 --- a/Code/Mantid/Framework/CurveFitting/test/CompositeFunctionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/CompositeFunctionTest.h @@ -135,8 +135,8 @@ class CurveFittingLinear: public ParamFunction, public IFunction1D }; -DECLARE_FUNCTION(CurveFittingLinear); -DECLARE_FUNCTION(CurveFittingGauss); +DECLARE_FUNCTION(CurveFittingLinear) +DECLARE_FUNCTION(CurveFittingGauss) class CompositeFunctionTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/CurveFitting/test/ConvolutionTest.h b/Code/Mantid/Framework/CurveFitting/test/ConvolutionTest.h index afc285cfb1c4..c548fc161273 100644 --- a/Code/Mantid/Framework/CurveFitting/test/ConvolutionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/ConvolutionTest.h @@ -191,9 +191,9 @@ class ConvolutionTest_Linear: public ParamFunction, public IFunction1D }; -DECLARE_FUNCTION(ConvolutionTest_Gauss); -DECLARE_FUNCTION(ConvolutionTest_Lorentz); -DECLARE_FUNCTION(ConvolutionTest_Linear); +DECLARE_FUNCTION(ConvolutionTest_Gauss) +DECLARE_FUNCTION(ConvolutionTest_Lorentz) +DECLARE_FUNCTION(ConvolutionTest_Linear) class ConvolutionTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/CurveFitting/test/FunctionFactoryConstraintTest.h b/Code/Mantid/Framework/CurveFitting/test/FunctionFactoryConstraintTest.h index af5617975a9b..16b1c76cc47f 100644 --- a/Code/Mantid/Framework/CurveFitting/test/FunctionFactoryConstraintTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/FunctionFactoryConstraintTest.h @@ -134,10 +134,10 @@ class FunctionFactoryConstraintTest_CompFunctB: public CompositeFunction }; -DECLARE_FUNCTION(FunctionFactoryConstraintTest_FunctA); -DECLARE_FUNCTION(FunctionFactoryConstraintTest_FunctB); -DECLARE_FUNCTION(FunctionFactoryConstraintTest_CompFunctA); -DECLARE_FUNCTION(FunctionFactoryConstraintTest_CompFunctB); +DECLARE_FUNCTION(FunctionFactoryConstraintTest_FunctA) +DECLARE_FUNCTION(FunctionFactoryConstraintTest_FunctB) +DECLARE_FUNCTION(FunctionFactoryConstraintTest_CompFunctA) +DECLARE_FUNCTION(FunctionFactoryConstraintTest_CompFunctB) class FunctionFactoryConstraintTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/CurveFitting/test/FunctionParameterDecoratorFitTest.h b/Code/Mantid/Framework/CurveFitting/test/FunctionParameterDecoratorFitTest.h index 47cc259f3558..592a90b7305f 100644 --- a/Code/Mantid/Framework/CurveFitting/test/FunctionParameterDecoratorFitTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/FunctionParameterDecoratorFitTest.h @@ -46,7 +46,7 @@ class SimpleFunctionParameterDecorator : public FunctionParameterDecorator { } }; -DECLARE_FUNCTION(SimpleFunctionParameterDecorator); +DECLARE_FUNCTION(SimpleFunctionParameterDecorator) class FunctionParameterDecoratorFitTest : public CxxTest::TestSuite { public: diff --git a/Code/Mantid/Framework/CurveFitting/test/GaussianTest.h b/Code/Mantid/Framework/CurveFitting/test/GaussianTest.h index 40a9a43251b5..dcbddf65af1e 100644 --- a/Code/Mantid/Framework/CurveFitting/test/GaussianTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/GaussianTest.h @@ -51,7 +51,7 @@ class SimplexGaussian : public Gaussian } }; -DECLARE_FUNCTION(SimplexGaussian); +DECLARE_FUNCTION(SimplexGaussian) class GaussianTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/CurveFitting/test/ProductFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/ProductFunctionTest.h index 3232dc248cbc..22833a6a4bf1 100644 --- a/Code/Mantid/Framework/CurveFitting/test/ProductFunctionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/ProductFunctionTest.h @@ -121,8 +121,8 @@ class ProductFunctionMWTest_Linear: public Mantid::API::ParamFunction, public Ma }; -DECLARE_FUNCTION(ProductFunctionMWTest_Gauss); -DECLARE_FUNCTION(ProductFunctionMWTest_Linear); +DECLARE_FUNCTION(ProductFunctionMWTest_Gauss) +DECLARE_FUNCTION(ProductFunctionMWTest_Linear) class ProductFunctionTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/CurveFitting/test/ResolutionTest.h b/Code/Mantid/Framework/CurveFitting/test/ResolutionTest.h index ea03a3aa0123..e4df7ce1a5ca 100644 --- a/Code/Mantid/Framework/CurveFitting/test/ResolutionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/ResolutionTest.h @@ -99,7 +99,7 @@ class ResolutionTest_Jacobian: public Jacobian } }; -DECLARE_FUNCTION(ResolutionTest_Gauss); +DECLARE_FUNCTION(ResolutionTest_Gauss) class ResolutionTest : public CxxTest::TestSuite { diff --git a/Code/Mantid/Framework/DataHandling/src/CreateChopperModel.cpp b/Code/Mantid/Framework/DataHandling/src/CreateChopperModel.cpp index b3284c6ee7f1..48274f1aa5f6 100644 --- a/Code/Mantid/Framework/DataHandling/src/CreateChopperModel.cpp +++ b/Code/Mantid/Framework/DataHandling/src/CreateChopperModel.cpp @@ -7,7 +7,7 @@ namespace Mantid { namespace DataHandling { // Register the algorithm into the AlgorithmFactory -DECLARE_ALGORITHM(CreateChopperModel); +DECLARE_ALGORITHM(CreateChopperModel) using Kernel::Direction; using API::WorkspaceProperty; @@ -21,10 +21,10 @@ using Kernel::MandatoryValidator; /// Algorithm's name for identification. @see Algorithm::name const std::string CreateChopperModel::name() const { return "CreateChopperModel"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CreateChopperModel::version() const { return 1; }; +int CreateChopperModel::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CreateChopperModel::category() const { diff --git a/Code/Mantid/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp b/Code/Mantid/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp index d19f7f04c25a..49ef716f071d 100644 --- a/Code/Mantid/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp +++ b/Code/Mantid/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp @@ -57,10 +57,10 @@ CreateChunkingFromInstrument::~CreateChunkingFromInstrument() {} /// Algorithm's name for identification. @see Algorithm::name const string CreateChunkingFromInstrument::name() const { return "CreateChunkingFromInstrument"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CreateChunkingFromInstrument::version() const { return 1; }; +int CreateChunkingFromInstrument::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const string CreateChunkingFromInstrument::category() const { diff --git a/Code/Mantid/Framework/DataHandling/src/CreateModeratorModel.cpp b/Code/Mantid/Framework/DataHandling/src/CreateModeratorModel.cpp index a1f51bbddd71..d2008b1d47e5 100644 --- a/Code/Mantid/Framework/DataHandling/src/CreateModeratorModel.cpp +++ b/Code/Mantid/Framework/DataHandling/src/CreateModeratorModel.cpp @@ -19,10 +19,10 @@ DECLARE_ALGORITHM(CreateModeratorModel) /// Algorithm's name for identification. @see Algorithm::name const std::string CreateModeratorModel::name() const { return "CreateModeratorModel"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CreateModeratorModel::version() const { return 1; }; +int CreateModeratorModel::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CreateModeratorModel::category() const { diff --git a/Code/Mantid/Framework/DataHandling/src/CreateSimulationWorkspace.cpp b/Code/Mantid/Framework/DataHandling/src/CreateSimulationWorkspace.cpp index 3652a1d48ce0..512b02efd72c 100644 --- a/Code/Mantid/Framework/DataHandling/src/CreateSimulationWorkspace.cpp +++ b/Code/Mantid/Framework/DataHandling/src/CreateSimulationWorkspace.cpp @@ -19,7 +19,7 @@ namespace Mantid { namespace DataHandling { // Register the algorithm into the AlgorithmFactory -DECLARE_ALGORITHM(CreateSimulationWorkspace); +DECLARE_ALGORITHM(CreateSimulationWorkspace) using namespace API; @@ -27,10 +27,10 @@ using namespace API; /// Algorithm's name for identification. @see Algorithm::name const std::string CreateSimulationWorkspace::name() const { return "CreateSimulationWorkspace"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CreateSimulationWorkspace::version() const { return 1; }; +int CreateSimulationWorkspace::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CreateSimulationWorkspace::category() const { diff --git a/Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp b/Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp index 84502532b0a1..3a9b1c3bbb4c 100644 --- a/Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp +++ b/Code/Mantid/Framework/DataHandling/src/DeleteTableRows.cpp @@ -13,7 +13,7 @@ namespace Mantid { namespace DataHandling { // Register the algorithm into the algorithm factory -DECLARE_ALGORITHM(DeleteTableRows); +DECLARE_ALGORITHM(DeleteTableRows) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp b/Code/Mantid/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp index ca9a49e80fee..3461ebea7d90 100644 --- a/Code/Mantid/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp +++ b/Code/Mantid/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp @@ -15,10 +15,10 @@ ExtractMonitorWorkspace::~ExtractMonitorWorkspace() {} /// Algorithm's name for identification. @see Algorithm::name const std::string ExtractMonitorWorkspace::name() const { return "ExtractMonitorWorkspace"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int ExtractMonitorWorkspace::version() const { return 1; }; +int ExtractMonitorWorkspace::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ExtractMonitorWorkspace::category() const { diff --git a/Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp b/Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp index a0babedbc04b..0a01cab4a09f 100644 --- a/Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp +++ b/Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp @@ -23,8 +23,8 @@ DECLARE_ALGORITHM(FindDetectorsPar) using namespace Kernel; using namespace API; // nothing here according to mantid -FindDetectorsPar::FindDetectorsPar() : m_SizesAreLinear(false){}; -FindDetectorsPar::~FindDetectorsPar(){}; +FindDetectorsPar::FindDetectorsPar() : m_SizesAreLinear(false){} +FindDetectorsPar::~FindDetectorsPar(){} void FindDetectorsPar::init() { auto wsValidator = boost::make_shared(); diff --git a/Code/Mantid/Framework/DataHandling/src/ISISDataArchive.cpp b/Code/Mantid/Framework/DataHandling/src/ISISDataArchive.cpp index df3faa501c68..4e5f2d69d3f2 100644 --- a/Code/Mantid/Framework/DataHandling/src/ISISDataArchive.cpp +++ b/Code/Mantid/Framework/DataHandling/src/ISISDataArchive.cpp @@ -21,7 +21,7 @@ namespace { Kernel::Logger g_log("ISISDataArchive"); } -DECLARE_ARCHIVESEARCH(ISISDataArchive, ISISDataSearch); +DECLARE_ARCHIVESEARCH(ISISDataArchive, ISISDataSearch) namespace { #ifdef _WIN32 diff --git a/Code/Mantid/Framework/DataHandling/src/Load.cpp b/Code/Mantid/Framework/DataHandling/src/Load.cpp index 9ca1b7ac270d..cc23bd0ae14b 100644 --- a/Code/Mantid/Framework/DataHandling/src/Load.cpp +++ b/Code/Mantid/Framework/DataHandling/src/Load.cpp @@ -85,7 +85,7 @@ flattenVecOfVec(std::vector> vecOfVec) { namespace Mantid { namespace DataHandling { // Register the algorithm into the algorithm factory -DECLARE_ALGORITHM(Load); +DECLARE_ALGORITHM(Load) // The mutex Poco::Mutex Load::m_mutex; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadAscii.cpp b/Code/Mantid/Framework/DataHandling/src/LoadAscii.cpp index 6beb06f3fbfb..747bd5422b98 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadAscii.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadAscii.cpp @@ -18,7 +18,7 @@ namespace Mantid { namespace DataHandling { -DECLARE_FILELOADER_ALGORITHM(LoadAscii); +DECLARE_FILELOADER_ALGORITHM(LoadAscii) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadAscii2.cpp b/Code/Mantid/Framework/DataHandling/src/LoadAscii2.cpp index 37dc4a4e6436..3d603570fc4d 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadAscii2.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadAscii2.cpp @@ -19,7 +19,7 @@ namespace Mantid { namespace DataHandling { -DECLARE_FILELOADER_ALGORITHM(LoadAscii2); +DECLARE_FILELOADER_ALGORITHM(LoadAscii2) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadBBY.cpp b/Code/Mantid/Framework/DataHandling/src/LoadBBY.cpp index 6794b27e1190..daddef4a35dc 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadBBY.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadBBY.cpp @@ -14,7 +14,7 @@ namespace Mantid { namespace DataHandling { // register the algorithm into the AlgorithmFactory -DECLARE_FILELOADER_ALGORITHM(LoadBBY); +DECLARE_FILELOADER_ALGORITHM(LoadBBY) // consts static const size_t HISTO_BINS_X = 240; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D.cpp b/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D.cpp index 1d07a5bb7525..b30663623408 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D.cpp @@ -35,7 +35,7 @@ using namespace Mantid::DataObjects; namespace Mantid { namespace DataHandling { -DECLARE_FILELOADER_ALGORITHM(LoadCanSAS1D); +DECLARE_FILELOADER_ALGORITHM(LoadCanSAS1D) /// constructor LoadCanSAS1D::LoadCanSAS1D() : m_groupNumber(0) {} diff --git a/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D2.cpp b/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D2.cpp index 7dff9888a52e..378569dbbbb0 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D2.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadCanSAS1D2.cpp @@ -33,7 +33,7 @@ using namespace Mantid::DataObjects; namespace Mantid { namespace DataHandling { -DECLARE_FILELOADER_ALGORITHM(LoadCanSAS1D2); +DECLARE_FILELOADER_ALGORITHM(LoadCanSAS1D2) /// constructor LoadCanSAS1D2::LoadCanSAS1D2() : LoadCanSAS1D() {} diff --git a/Code/Mantid/Framework/DataHandling/src/LoadDaveGrp.cpp b/Code/Mantid/Framework/DataHandling/src/LoadDaveGrp.cpp index 8ceabc67d964..45ddef1b6dcf 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadDaveGrp.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadDaveGrp.cpp @@ -12,7 +12,7 @@ namespace Mantid { namespace DataHandling { -DECLARE_FILELOADER_ALGORITHM(LoadDaveGrp); +DECLARE_FILELOADER_ALGORITHM(LoadDaveGrp) LoadDaveGrp::LoadDaveGrp() : ifile(), line(), nGroups(0), xLength(0) {} diff --git a/Code/Mantid/Framework/DataHandling/src/LoadEventPreNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadEventPreNexus.cpp index d8d0ab699c66..6fa76790f671 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadEventPreNexus.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadEventPreNexus.cpp @@ -36,7 +36,7 @@ namespace Mantid { namespace DataHandling { -DECLARE_FILELOADER_ALGORITHM(LoadEventPreNexus); +DECLARE_FILELOADER_ALGORITHM(LoadEventPreNexus) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadFITS.cpp b/Code/Mantid/Framework/DataHandling/src/LoadFITS.cpp index 5d21f759abc3..86df82bf489c 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadFITS.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadFITS.cpp @@ -38,7 +38,7 @@ bool IsNotFits(std::string s) { namespace Mantid { namespace DataHandling { // Register the algorithm into the AlgorithmFactory -DECLARE_FILELOADER_ALGORITHM(LoadFITS); +DECLARE_FILELOADER_ALGORITHM(LoadFITS) /** * Constructor. Just initialize everything to prevent issues. diff --git a/Code/Mantid/Framework/DataHandling/src/LoadILL.cpp b/Code/Mantid/Framework/DataHandling/src/LoadILL.cpp index 783927212fdd..0f84c252a6f8 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadILL.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadILL.cpp @@ -25,7 +25,7 @@ using namespace Kernel; using namespace API; using namespace NeXus; -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILL); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILL) //--------------------------------------------------- // Private member functions diff --git a/Code/Mantid/Framework/DataHandling/src/LoadILLIndirect.cpp b/Code/Mantid/Framework/DataHandling/src/LoadILLIndirect.cpp index 8309a686e68a..37e810ffae28 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadILLIndirect.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadILLIndirect.cpp @@ -18,7 +18,7 @@ using namespace API; using namespace NeXus; // Register the algorithm into the AlgorithmFactory -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLIndirect); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLIndirect) //---------------------------------------------------------------------------------------------- /** Constructor @@ -37,10 +37,10 @@ LoadILLIndirect::~LoadILLIndirect() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string LoadILLIndirect::name() const { return "LoadILLIndirect"; }; +const std::string LoadILLIndirect::name() const { return "LoadILLIndirect"; } /// Algorithm's version for identification. @see Algorithm::version -int LoadILLIndirect::version() const { return 1; }; +int LoadILLIndirect::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string LoadILLIndirect::category() const { return "DataHandling"; } diff --git a/Code/Mantid/Framework/DataHandling/src/LoadILLReflectometry.cpp b/Code/Mantid/Framework/DataHandling/src/LoadILLReflectometry.cpp index 331795f61c3f..739c5f9a6f6c 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadILLReflectometry.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadILLReflectometry.cpp @@ -23,7 +23,7 @@ using namespace API; using namespace NeXus; // Register the algorithm into the AlgorithmFactory -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLReflectometry); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLReflectometry) //---------------------------------------------------------------------------------------------- /** Constructor @@ -47,10 +47,10 @@ LoadILLReflectometry::~LoadILLReflectometry() {} /// Algorithm's name for identification. @see Algorithm::name const std::string LoadILLReflectometry::name() const { return "LoadILLReflectometry"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int LoadILLReflectometry::version() const { return 1; }; +int LoadILLReflectometry::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string LoadILLReflectometry::category() const { diff --git a/Code/Mantid/Framework/DataHandling/src/LoadILLSANS.cpp b/Code/Mantid/Framework/DataHandling/src/LoadILLSANS.cpp index 6c3b96b5807b..b29c361ef19f 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadILLSANS.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadILLSANS.cpp @@ -30,10 +30,10 @@ LoadILLSANS::~LoadILLSANS() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string LoadILLSANS::name() const { return "LoadILLSANS"; }; +const std::string LoadILLSANS::name() const { return "LoadILLSANS"; } /// Algorithm's version for identification. @see Algorithm::version -int LoadILLSANS::version() const { return 1; }; +int LoadILLSANS::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string LoadILLSANS::category() const { return "DataHandling"; } diff --git a/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp b/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp index ca7d7a0dcf2b..61cb6b4339f1 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp @@ -38,7 +38,7 @@ namespace Mantid { namespace DataHandling { -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadISISNexus2); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadISISNexus2) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadLLB.cpp b/Code/Mantid/Framework/DataHandling/src/LoadLLB.cpp index b6fa8df3d966..ab280168840e 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadLLB.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadLLB.cpp @@ -18,7 +18,7 @@ using namespace Kernel; using namespace API; using namespace NeXus; -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadLLB); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadLLB) //---------------------------------------------------------------------------------------------- /** Constructor @@ -36,10 +36,10 @@ LoadLLB::~LoadLLB() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string LoadLLB::name() const { return "LoadLLB"; }; +const std::string LoadLLB::name() const { return "LoadLLB"; } /// Algorithm's version for identification. @see Algorithm::version -int LoadLLB::version() const { return 1; }; +int LoadLLB::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string LoadLLB::category() const { return "DataHandling"; } diff --git a/Code/Mantid/Framework/DataHandling/src/LoadMcStas.cpp b/Code/Mantid/Framework/DataHandling/src/LoadMcStas.cpp index 027c60f08be6..26c18005d880 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadMcStas.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadMcStas.cpp @@ -24,7 +24,7 @@ using namespace API; using namespace DataObjects; // Register the algorithm into the AlgorithmFactory -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMcStas); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMcStas) //---------------------------------------------------------------------------------------------- /** Constructor @@ -38,10 +38,10 @@ LoadMcStas::~LoadMcStas() {} //---------------------------------------------------------------------------------------------- // Algorithm's name for identification. @see Algorithm::name -const std::string LoadMcStas::name() const { return "LoadMcStas"; }; +const std::string LoadMcStas::name() const { return "LoadMcStas"; } // Algorithm's version for identification. @see Algorithm::version -int LoadMcStas::version() const { return 1; }; +int LoadMcStas::version() const { return 1; } // Algorithm's category for identification. @see Algorithm::category const std::string LoadMcStas::category() const { return "DataHandling"; } diff --git a/Code/Mantid/Framework/DataHandling/src/LoadMcStasNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadMcStasNexus.cpp index ca5c88515d92..b9d6986d76df 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadMcStasNexus.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadMcStasNexus.cpp @@ -15,7 +15,7 @@ namespace DataHandling { using namespace Kernel; using namespace API; -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMcStasNexus); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMcStasNexus) //---------------------------------------------------------------------------------------------- /** Constructor @@ -29,10 +29,10 @@ LoadMcStasNexus::~LoadMcStasNexus() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string LoadMcStasNexus::name() const { return "LoadMcStasNexus"; }; +const std::string LoadMcStasNexus::name() const { return "LoadMcStasNexus"; } /// Algorithm's version for identification. @see Algorithm::version -int LoadMcStasNexus::version() const { return 1; }; +int LoadMcStasNexus::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string LoadMcStasNexus::category() const { return "DataHandling"; } diff --git a/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus1.cpp b/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus1.cpp index 7a71f4f24f5d..6f59be7278a4 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus1.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus1.cpp @@ -30,7 +30,7 @@ namespace DataHandling { using namespace DataObjects; // Register the algorithm into the algorithm factory -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMuonNexus1); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMuonNexus1) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus2.cpp b/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus2.cpp index d3876404a283..a885a97ada66 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus2.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus2.cpp @@ -27,7 +27,7 @@ namespace Mantid { namespace DataHandling { // Register the algorithm into the algorithm factory -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMuonNexus2); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMuonNexus2) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadNXSPE.cpp b/Code/Mantid/Framework/DataHandling/src/LoadNXSPE.cpp index 5c5b4dc64163..e9da8a302a8c 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadNXSPE.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadNXSPE.cpp @@ -22,7 +22,7 @@ namespace Mantid { namespace DataHandling { -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadNXSPE); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadNXSPE) using namespace Mantid::Kernel; using namespace Mantid::API; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp b/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp index ffbfaac2167d..21f97ef9eb2d 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp @@ -43,7 +43,7 @@ namespace Mantid { namespace DataHandling { // Register the algorithm into the algorithm factory -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadNexusProcessed); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadNexusProcessed) using namespace Mantid::NeXus; using namespace DataObjects; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadPDFgetNFile.cpp b/Code/Mantid/Framework/DataHandling/src/LoadPDFgetNFile.cpp index a0f89f596194..108723a73f57 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadPDFgetNFile.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadPDFgetNFile.cpp @@ -25,7 +25,7 @@ using namespace boost; namespace Mantid { namespace DataHandling { -DECLARE_FILELOADER_ALGORITHM(LoadPDFgetNFile); +DECLARE_FILELOADER_ALGORITHM(LoadPDFgetNFile) //---------------------------------------------------------------------------------------------- /** Constructor diff --git a/Code/Mantid/Framework/DataHandling/src/LoadPreNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadPreNexus.cpp index 55090665c093..4d0766518532 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadPreNexus.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadPreNexus.cpp @@ -31,7 +31,7 @@ using std::vector; namespace Mantid { namespace DataHandling { -DECLARE_FILELOADER_ALGORITHM(LoadPreNexus); +DECLARE_FILELOADER_ALGORITHM(LoadPreNexus) static const string RUNINFO_PARAM("Filename"); static const string MAP_PARAM("MappingFilename"); diff --git a/Code/Mantid/Framework/DataHandling/src/LoadQKK.cpp b/Code/Mantid/Framework/DataHandling/src/LoadQKK.cpp index cee4c47b1cd1..859b592c087d 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadQKK.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadQKK.cpp @@ -26,7 +26,7 @@ namespace Mantid { namespace DataHandling { // Register the algorithm into the AlgorithmFactory -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadQKK); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadQKK) /** * Return the confidence with with this algorithm can load the file diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp index 453b4745c08f..6ee8786c72d6 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp @@ -24,7 +24,7 @@ namespace DataHandling { using namespace Mantid::API; using namespace Mantid::Kernel; -DECLARE_FILELOADER_ALGORITHM(LoadRKH); +DECLARE_FILELOADER_ALGORITHM(LoadRKH) /** * Return the confidence with with this algorithm can load the file diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp index 421add0dc041..9d95242111e2 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp @@ -24,7 +24,7 @@ namespace Mantid { namespace DataHandling { -DECLARE_FILELOADER_ALGORITHM(LoadRaw3); +DECLARE_FILELOADER_ALGORITHM(LoadRaw3) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadReflTBL.cpp b/Code/Mantid/Framework/DataHandling/src/LoadReflTBL.cpp index bdbd87357b83..31c713233a6b 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadReflTBL.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadReflTBL.cpp @@ -15,7 +15,7 @@ namespace Mantid { namespace DataHandling { -DECLARE_FILELOADER_ALGORITHM(LoadReflTBL); +DECLARE_FILELOADER_ALGORITHM(LoadReflTBL) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSINQFocus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSINQFocus.cpp index 482729016aae..c06cdf04b68c 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadSINQFocus.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadSINQFocus.cpp @@ -18,7 +18,7 @@ using namespace Kernel; using namespace API; using namespace NeXus; -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadSINQFocus); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadSINQFocus) //---------------------------------------------------------------------------------------------- /** Constructor @@ -38,10 +38,10 @@ LoadSINQFocus::~LoadSINQFocus() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string LoadSINQFocus::name() const { return "LoadSINQFocus"; }; +const std::string LoadSINQFocus::name() const { return "LoadSINQFocus"; } /// Algorithm's version for identification. @see Algorithm::version -int LoadSINQFocus::version() const { return 1; }; +int LoadSINQFocus::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string LoadSINQFocus::category() const { return "DataHandling"; } diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSNSspec.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSNSspec.cpp index a1c3ffd90e60..bbef0ccaf558 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadSNSspec.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadSNSspec.cpp @@ -13,7 +13,7 @@ namespace Mantid { namespace DataHandling { -DECLARE_FILELOADER_ALGORITHM(LoadSNSspec); +DECLARE_FILELOADER_ALGORITHM(LoadSNSspec) /** * Return the confidence with with this algorithm can load the file diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSPE.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSPE.cpp index 25e3b4c72b79..004b48b0a2b1 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadSPE.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadSPE.cpp @@ -18,7 +18,7 @@ namespace DataHandling { using namespace Kernel; using namespace API; -DECLARE_FILELOADER_ALGORITHM(LoadSPE); +DECLARE_FILELOADER_ALGORITHM(LoadSPE) /** * Return the confidence with with this algorithm can load the file diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSassena.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSassena.cpp index e1f23f9bd4b9..2f749d8a0784 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadSassena.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadSassena.cpp @@ -15,7 +15,7 @@ namespace Mantid { namespace DataHandling { -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadSassena); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadSassena) /** * Return the confidence with with this algorithm can load the file diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSavuTomoConfig.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSavuTomoConfig.cpp index 172ca4b47c5b..50184d1d4eab 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadSavuTomoConfig.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadSavuTomoConfig.cpp @@ -12,7 +12,7 @@ namespace Mantid { namespace DataHandling { // Register the algorithm into the algorithm factory -DECLARE_ALGORITHM(LoadSavuTomoConfig); +DECLARE_ALGORITHM(LoadSavuTomoConfig) using namespace Mantid::API; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSpice2D.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSpice2D.cpp index 1d8a877675e9..49b271ef9221 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadSpice2D.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadSpice2D.cpp @@ -36,7 +36,7 @@ using Poco::XML::Text; namespace Mantid { namespace DataHandling { // Register the algorithm into the AlgorithmFactory -DECLARE_FILELOADER_ALGORITHM(LoadSpice2D); +DECLARE_FILELOADER_ALGORITHM(LoadSpice2D) // Parse string and convert to numeric type template diff --git a/Code/Mantid/Framework/DataHandling/src/LoadTOFRawNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadTOFRawNexus.cpp index 549ddc74278a..d477812c6246 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadTOFRawNexus.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadTOFRawNexus.cpp @@ -13,7 +13,7 @@ namespace Mantid { namespace DataHandling { -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadTOFRawNexus); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadTOFRawNexus) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/DataHandling/src/NexusTester.cpp b/Code/Mantid/Framework/DataHandling/src/NexusTester.cpp index 19657640086d..2f1ed8f0471b 100644 --- a/Code/Mantid/Framework/DataHandling/src/NexusTester.cpp +++ b/Code/Mantid/Framework/DataHandling/src/NexusTester.cpp @@ -30,10 +30,10 @@ NexusTester::~NexusTester() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string NexusTester::name() const { return "NexusTester"; }; +const std::string NexusTester::name() const { return "NexusTester"; } /// Algorithm's version for identification. @see Algorithm::version -int NexusTester::version() const { return 1; }; +int NexusTester::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string NexusTester::category() const { diff --git a/Code/Mantid/Framework/DataHandling/src/PDLoadCharacterizations.cpp b/Code/Mantid/Framework/DataHandling/src/PDLoadCharacterizations.cpp index 8e73ca0e825c..34b98ec08a15 100644 --- a/Code/Mantid/Framework/DataHandling/src/PDLoadCharacterizations.cpp +++ b/Code/Mantid/Framework/DataHandling/src/PDLoadCharacterizations.cpp @@ -36,10 +36,10 @@ PDLoadCharacterizations::~PDLoadCharacterizations() {} /// Algorithm's name for identification. @see Algorithm::name const std::string PDLoadCharacterizations::name() const { return "PDLoadCharacterizations"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int PDLoadCharacterizations::version() const { return 1; }; +int PDLoadCharacterizations::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string PDLoadCharacterizations::category() const { diff --git a/Code/Mantid/Framework/DataHandling/src/SNSDataArchive.cpp b/Code/Mantid/Framework/DataHandling/src/SNSDataArchive.cpp index 2ecc8bd1680a..ca088cab0faf 100644 --- a/Code/Mantid/Framework/DataHandling/src/SNSDataArchive.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SNSDataArchive.cpp @@ -32,7 +32,7 @@ const std::string BASE_URL("http://icat.sns.gov:2080/icat-rest-ws/datafile/filename/"); } -DECLARE_ARCHIVESEARCH(SNSDataArchive, SNSDataSearch); +DECLARE_ARCHIVESEARCH(SNSDataArchive, SNSDataSearch) /** * @param filenames : List of files to search diff --git a/Code/Mantid/Framework/DataHandling/src/SavePAR.cpp b/Code/Mantid/Framework/DataHandling/src/SavePAR.cpp index 8d2ff9739bf6..d318f94f549b 100644 --- a/Code/Mantid/Framework/DataHandling/src/SavePAR.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SavePAR.cpp @@ -14,7 +14,7 @@ namespace Mantid { namespace DataHandling { // Register the algorithm into the AlgorithmFactory -DECLARE_ALGORITHM(SavePAR); +DECLARE_ALGORITHM(SavePAR) using namespace Mantid::Kernel; using namespace Mantid::API; diff --git a/Code/Mantid/Framework/DataHandling/src/SavePHX.cpp b/Code/Mantid/Framework/DataHandling/src/SavePHX.cpp index ecb428de9af8..7c221896f8be 100644 --- a/Code/Mantid/Framework/DataHandling/src/SavePHX.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SavePHX.cpp @@ -14,7 +14,7 @@ namespace Mantid { namespace DataHandling { // Register the algorithm into the AlgorithmFactory -DECLARE_ALGORITHM(SavePHX); +DECLARE_ALGORITHM(SavePHX) using namespace Mantid::Kernel; using namespace Mantid::API; diff --git a/Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp b/Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp index 9bee776e07f2..931538cbb948 100644 --- a/Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SaveParameterFile.cpp @@ -36,10 +36,10 @@ SaveParameterFile::~SaveParameterFile() {} /// Algorithm's name for identification. @see Algorithm::name const std::string SaveParameterFile::name() const { return "SaveParameterFile"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int SaveParameterFile::version() const { return 1; }; +int SaveParameterFile::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string SaveParameterFile::category() const { diff --git a/Code/Mantid/Framework/DataHandling/src/SortTableWorkspace.cpp b/Code/Mantid/Framework/DataHandling/src/SortTableWorkspace.cpp index 98b38f0fe8e4..6909250252c2 100644 --- a/Code/Mantid/Framework/DataHandling/src/SortTableWorkspace.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SortTableWorkspace.cpp @@ -24,7 +24,7 @@ SortTableWorkspace::~SortTableWorkspace() {} //---------------------------------------------------------------------------------------------- /// Algorithm's version for identification. @see Algorithm::version -int SortTableWorkspace::version() const { return 1; }; +int SortTableWorkspace::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string SortTableWorkspace::category() const { return "Utility"; } @@ -32,7 +32,7 @@ const std::string SortTableWorkspace::category() const { return "Utility"; } /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary const std::string SortTableWorkspace::summary() const { return "Sort a TableWorkspace."; -}; +} //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/VectorColumn.h b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/VectorColumn.h index 72c1e5031354..54952d823c76 100644 --- a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/VectorColumn.h +++ b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/VectorColumn.h @@ -171,7 +171,7 @@ template class DLLExport VectorColumn : public API::Column { #define DECLARE_VECTORCOLUMN(Type, TypeName) \ template <> std::string VectorColumn::typeName() { \ return #TypeName; \ - }; \ + } \ Kernel::RegistrationHelper register_column_##TypeName(( \ API::ColumnFactory::Instance().subscribe>(#TypeName), \ 0)); diff --git a/Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp b/Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp index b844cf396877..b3d7e129cc92 100644 --- a/Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp +++ b/Code/Mantid/Framework/DataObjects/src/PeakColumn.cpp @@ -67,7 +67,7 @@ const std::string typeFromName(const std::string &name) { "\"" "Peak column names/types must be explicitly marked in PeakColumn.cpp"); } -}; +} } //---------------------------------------------------------------------------------------------- diff --git a/Code/Mantid/Framework/DataObjects/src/PeaksWorkspace.cpp b/Code/Mantid/Framework/DataObjects/src/PeaksWorkspace.cpp index 4259cce7f869..890e3e1e447e 100644 --- a/Code/Mantid/Framework/DataObjects/src/PeaksWorkspace.cpp +++ b/Code/Mantid/Framework/DataObjects/src/PeaksWorkspace.cpp @@ -36,7 +36,7 @@ using namespace Mantid::Geometry; namespace Mantid { namespace DataObjects { /// Register the workspace as a type -DECLARE_WORKSPACE(PeaksWorkspace); +DECLARE_WORKSPACE(PeaksWorkspace) //--------------------------------------------------------------------------------------------- /** Constructor. Create a table with all the required columns. diff --git a/Code/Mantid/Framework/DataObjects/src/TableWorkspace.cpp b/Code/Mantid/Framework/DataObjects/src/TableWorkspace.cpp index 138856ae152e..d2eac1267795 100644 --- a/Code/Mantid/Framework/DataObjects/src/TableWorkspace.cpp +++ b/Code/Mantid/Framework/DataObjects/src/TableWorkspace.cpp @@ -204,7 +204,7 @@ TableWorkspace *TableWorkspace::clone() const { // copy logs/properties. copy->m_LogManager = boost::make_shared(*this->m_LogManager); return copy; -}; +} /** * Sort. diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryElementFactory.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryElementFactory.cpp index 40b6ba8c633a..cdf42076ca54 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryElementFactory.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryElementFactory.cpp @@ -425,11 +425,11 @@ void SymmetryElementFactoryImpl::insertPrototype( m_prototypes.insert(std::make_pair(identifier, prototype)); } -DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementIdentityGenerator); -DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementTranslationGenerator); -DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementInversionGenerator); -DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementRotationGenerator); -DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementMirrorGenerator); +DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementIdentityGenerator) +DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementTranslationGenerator) +DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementInversionGenerator) +DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementRotationGenerator) +DECLARE_SYMMETRY_ELEMENT_GENERATOR(SymmetryElementMirrorGenerator) } // namespace Geometry } // namespace Mantid diff --git a/Code/Mantid/Framework/ISISLiveData/src/FakeISISEventDAE.cpp b/Code/Mantid/Framework/ISISLiveData/src/FakeISISEventDAE.cpp index 6d5a6fa75c92..c699dfb94119 100644 --- a/Code/Mantid/Framework/ISISLiveData/src/FakeISISEventDAE.cpp +++ b/Code/Mantid/Framework/ISISLiveData/src/FakeISISEventDAE.cpp @@ -19,7 +19,7 @@ namespace Mantid { namespace ISISLiveData { // Register the algorithm into the algorithm factory -DECLARE_ALGORITHM(FakeISISEventDAE); +DECLARE_ALGORITHM(FakeISISEventDAE) using namespace Kernel; using namespace API; diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ChecksumHelper.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ChecksumHelper.h index 5a4f70794fe3..54a6b5fcf22e 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ChecksumHelper.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ChecksumHelper.h @@ -40,7 +40,7 @@ MANTID_KERNEL_DLL std::string sha1FromString(const std::string &input); MANTID_KERNEL_DLL std::string sha1FromFile(const std::string &filepath); /// create a git checksum from a file (these match the git hash-object command) MANTID_KERNEL_DLL std::string gitSha1FromFile(const std::string &filepath); -}; +} } // namespace Kernel } // namespace Mantid diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h index 85f67ac066da..bd55cf9b501c 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h @@ -198,10 +198,10 @@ void toValue(const std::string &strvalue, std::vector> &value, } \ } -PROPERTYWITHVALUE_TOVALUE(int); -PROPERTYWITHVALUE_TOVALUE(long); -PROPERTYWITHVALUE_TOVALUE(uint32_t); -PROPERTYWITHVALUE_TOVALUE(uint64_t); +PROPERTYWITHVALUE_TOVALUE(int) +PROPERTYWITHVALUE_TOVALUE(long) +PROPERTYWITHVALUE_TOVALUE(uint32_t) +PROPERTYWITHVALUE_TOVALUE(uint64_t) #if defined(__APPLE__) PROPERTYWITHVALUE_TOVALUE(unsigned long); #endif diff --git a/Code/Mantid/Framework/Kernel/src/FilteredTimeSeriesProperty.cpp b/Code/Mantid/Framework/Kernel/src/FilteredTimeSeriesProperty.cpp index 07d01c24be0b..52a8e817ddbf 100644 --- a/Code/Mantid/Framework/Kernel/src/FilteredTimeSeriesProperty.cpp +++ b/Code/Mantid/Framework/Kernel/src/FilteredTimeSeriesProperty.cpp @@ -53,16 +53,16 @@ FilteredTimeSeriesProperty::unfiltered() const { // -------------------------- Concrete instantiation // ----------------------------------------------- -INSTANTIATE(int); -INSTANTIATE(long); -INSTANTIATE(long long); -INSTANTIATE(unsigned int); -INSTANTIATE(unsigned long); -INSTANTIATE(unsigned long long); -INSTANTIATE(float); -INSTANTIATE(double); -INSTANTIATE(std::string); -INSTANTIATE(bool); +INSTANTIATE(int) +INSTANTIATE(long) +INSTANTIATE(long long) +INSTANTIATE(unsigned int) +INSTANTIATE(unsigned long) +INSTANTIATE(unsigned long long) +INSTANTIATE(float) +INSTANTIATE(double) +INSTANTIATE(std::string) +INSTANTIATE(bool) ///@endcond diff --git a/Code/Mantid/Framework/Kernel/src/IPropertyManager.cpp b/Code/Mantid/Framework/Kernel/src/IPropertyManager.cpp index 0d1730b581d7..36961d439154 100644 --- a/Code/Mantid/Framework/Kernel/src/IPropertyManager.cpp +++ b/Code/Mantid/Framework/Kernel/src/IPropertyManager.cpp @@ -7,23 +7,23 @@ #include ///@cond -DEFINE_IPROPERTYMANAGER_GETVALUE(int16_t); -DEFINE_IPROPERTYMANAGER_GETVALUE(uint16_t); -DEFINE_IPROPERTYMANAGER_GETVALUE(int32_t); -DEFINE_IPROPERTYMANAGER_GETVALUE(uint32_t); -DEFINE_IPROPERTYMANAGER_GETVALUE(int64_t); -DEFINE_IPROPERTYMANAGER_GETVALUE(uint64_t); -DEFINE_IPROPERTYMANAGER_GETVALUE(bool); -DEFINE_IPROPERTYMANAGER_GETVALUE(double); -DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector); -DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector); -DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector); -DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector); -DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector); -DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector); -DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector); -DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector); -DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector>); +DEFINE_IPROPERTYMANAGER_GETVALUE(int16_t) +DEFINE_IPROPERTYMANAGER_GETVALUE(uint16_t) +DEFINE_IPROPERTYMANAGER_GETVALUE(int32_t) +DEFINE_IPROPERTYMANAGER_GETVALUE(uint32_t) +DEFINE_IPROPERTYMANAGER_GETVALUE(int64_t) +DEFINE_IPROPERTYMANAGER_GETVALUE(uint64_t) +DEFINE_IPROPERTYMANAGER_GETVALUE(bool) +DEFINE_IPROPERTYMANAGER_GETVALUE(double) +DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector) +DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector) +DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector) +DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector) +DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector) +DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector) +DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector) +DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector) +DEFINE_IPROPERTYMANAGER_GETVALUE(std::vector>) namespace Mantid { namespace Kernel { diff --git a/Code/Mantid/Framework/Kernel/src/MatrixProperty.cpp b/Code/Mantid/Framework/Kernel/src/MatrixProperty.cpp index 3ff63a07bf74..ddd680bdac9e 100644 --- a/Code/Mantid/Framework/Kernel/src/MatrixProperty.cpp +++ b/Code/Mantid/Framework/Kernel/src/MatrixProperty.cpp @@ -43,7 +43,7 @@ template class MANTID_KERNEL_DLL MatrixProperty; /** * IPropertyManager::getValue definitions */ -DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::DblMatrix); -DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::IntMatrix); -DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::Matrix); +DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::DblMatrix) +DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::IntMatrix) +DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::Matrix) ///@endcond diff --git a/Code/Mantid/Framework/Kernel/src/PropertyWithValue.cpp b/Code/Mantid/Framework/Kernel/src/PropertyWithValue.cpp index e087f25a23fc..038a26cc359a 100644 --- a/Code/Mantid/Framework/Kernel/src/PropertyWithValue.cpp +++ b/Code/Mantid/Framework/Kernel/src/PropertyWithValue.cpp @@ -10,16 +10,16 @@ namespace Kernel { template DLLExport class PropertyWithValue>; // Explicit instantiations -INSTANTIATE(int); -INSTANTIATE(long); -INSTANTIATE(long long); -INSTANTIATE(unsigned short int); -INSTANTIATE(unsigned int); -INSTANTIATE(unsigned long); -INSTANTIATE(unsigned long long); -INSTANTIATE(bool); -INSTANTIATE(double); -INSTANTIATE(std::string); +INSTANTIATE(int) +INSTANTIATE(long) +INSTANTIATE(long long) +INSTANTIATE(unsigned short int) +INSTANTIATE(unsigned int) +INSTANTIATE(unsigned long) +INSTANTIATE(unsigned long long) +INSTANTIATE(bool) +INSTANTIATE(double) +INSTANTIATE(std::string) /// @endcond } // namespace Kernel diff --git a/Code/Mantid/Framework/Kernel/src/Statistics.cpp b/Code/Mantid/Framework/Kernel/src/Statistics.cpp index 9af3f0335c5d..6a021e757806 100644 --- a/Code/Mantid/Framework/Kernel/src/Statistics.cpp +++ b/Code/Mantid/Framework/Kernel/src/Statistics.cpp @@ -405,14 +405,14 @@ std::vector getMomentsAboutMean(const std::vector &x, // --------------------------- Concrete instantiations // --------------------------------------------- -INSTANTIATE(float); -INSTANTIATE(double); -INSTANTIATE(int); -INSTANTIATE(long); -INSTANTIATE(long long); -INSTANTIATE(unsigned int); -INSTANTIATE(unsigned long); -INSTANTIATE(unsigned long long); +INSTANTIATE(float) +INSTANTIATE(double) +INSTANTIATE(int) +INSTANTIATE(long) +INSTANTIATE(long long) +INSTANTIATE(unsigned int) +INSTANTIATE(unsigned long) +INSTANTIATE(unsigned long long) } // namespace Kernel } // namespace Mantid diff --git a/Code/Mantid/Framework/Kernel/src/TimeSeriesProperty.cpp b/Code/Mantid/Framework/Kernel/src/TimeSeriesProperty.cpp index e129b7010c28..c6057895d5fd 100644 --- a/Code/Mantid/Framework/Kernel/src/TimeSeriesProperty.cpp +++ b/Code/Mantid/Framework/Kernel/src/TimeSeriesProperty.cpp @@ -2026,16 +2026,16 @@ TimeSeriesProperty::setValueFromProperty(const Property &right) { // -------------------------- Concrete instantiation // ----------------------------------------------- -INSTANTIATE(int); -INSTANTIATE(long); -INSTANTIATE(long long); -INSTANTIATE(unsigned int); -INSTANTIATE(unsigned long); -INSTANTIATE(unsigned long long); -INSTANTIATE(float); -INSTANTIATE(double); -INSTANTIATE(std::string); -INSTANTIATE(bool); +INSTANTIATE(int) +INSTANTIATE(long) +INSTANTIATE(long long) +INSTANTIATE(unsigned int) +INSTANTIATE(unsigned long) +INSTANTIATE(unsigned long long) +INSTANTIATE(float) +INSTANTIATE(double) +INSTANTIATE(std::string) +INSTANTIATE(bool) /// @endcond diff --git a/Code/Mantid/Framework/Kernel/src/Unit.cpp b/Code/Mantid/Framework/Kernel/src/Unit.cpp index 82e3541bc80d..8495405f2101 100644 --- a/Code/Mantid/Framework/Kernel/src/Unit.cpp +++ b/Code/Mantid/Framework/Kernel/src/Unit.cpp @@ -1108,10 +1108,10 @@ double Time::singleFromTOF(const double tof) const { double Time::conversionTOFMax() const { return std::numeric_limits::quiet_NaN(); -}; +} double Time::conversionTOFMin() const { return std::numeric_limits::quiet_NaN(); -}; +} Unit *Time::clone() const { return new Time(*this); } diff --git a/Code/Mantid/Framework/Kernel/test/TypedValidatorTest.h b/Code/Mantid/Framework/Kernel/test/TypedValidatorTest.h index 79693e0335b9..124c4655af43 100644 --- a/Code/Mantid/Framework/Kernel/test/TypedValidatorTest.h +++ b/Code/Mantid/Framework/Kernel/test/TypedValidatorTest.h @@ -24,8 +24,8 @@ namespace /// Dummy object to hold in a shared_ptr for test struct Holder {}; - DECLARE_TEST_VALIDATOR(SharedPtrTypedValidator, boost::shared_ptr); - DECLARE_TEST_VALIDATOR(PODTypedValidator, double); + DECLARE_TEST_VALIDATOR(SharedPtrTypedValidator, boost::shared_ptr) + DECLARE_TEST_VALIDATOR(PODTypedValidator, double) class FakeDataItem : public Mantid::Kernel::DataItem { public: @@ -34,7 +34,7 @@ namespace virtual bool threadSafe() const { return true; } virtual const std::string toString() const { return "FakeDataItem{}"; } }; - DECLARE_TEST_VALIDATOR(DataItemSptrTypedValidator, boost::shared_ptr); + DECLARE_TEST_VALIDATOR(DataItemSptrTypedValidator, boost::shared_ptr) } class TypedValidatorTest : public CxxTest::TestSuite diff --git a/Code/Mantid/Framework/LiveData/src/MonitorLiveData.cpp b/Code/Mantid/Framework/LiveData/src/MonitorLiveData.cpp index 8262af09878f..8491c3d349bd 100644 --- a/Code/Mantid/Framework/LiveData/src/MonitorLiveData.cpp +++ b/Code/Mantid/Framework/LiveData/src/MonitorLiveData.cpp @@ -27,7 +27,7 @@ MonitorLiveData::~MonitorLiveData() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string MonitorLiveData::name() const { return "MonitorLiveData"; }; +const std::string MonitorLiveData::name() const { return "MonitorLiveData"; } /// Algorithm's category for identification. @see Algorithm::category const std::string MonitorLiveData::category() const { @@ -35,7 +35,7 @@ const std::string MonitorLiveData::category() const { } /// Algorithm's version for identification. @see Algorithm::version -int MonitorLiveData::version() const { return 1; }; +int MonitorLiveData::version() const { return 1; } //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/LiveData/src/SNSLiveEventDataListener.cpp b/Code/Mantid/Framework/LiveData/src/SNSLiveEventDataListener.cpp index 50b2621e222a..b70faa984ea9 100644 --- a/Code/Mantid/Framework/LiveData/src/SNSLiveEventDataListener.cpp +++ b/Code/Mantid/Framework/LiveData/src/SNSLiveEventDataListener.cpp @@ -54,7 +54,7 @@ Mantid::Kernel::DateAndTime timeFromPacket(const ADARA::PacketHeader &hdr) { namespace Mantid { namespace LiveData { -DECLARE_LISTENER(SNSLiveEventDataListener); +DECLARE_LISTENER(SNSLiveEventDataListener) // The DECLARE_LISTENER macro seems to confuse some editors' syntax checking. // The semi-colon limits the complaints to one line. It has no actual effect // on the code. diff --git a/Code/Mantid/Framework/LiveData/src/StartLiveData.cpp b/Code/Mantid/Framework/LiveData/src/StartLiveData.cpp index c890cac2ab60..49338ad3a41d 100644 --- a/Code/Mantid/Framework/LiveData/src/StartLiveData.cpp +++ b/Code/Mantid/Framework/LiveData/src/StartLiveData.cpp @@ -37,10 +37,10 @@ StartLiveData::~StartLiveData() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string StartLiveData::name() const { return "StartLiveData"; }; +const std::string StartLiveData::name() const { return "StartLiveData"; } /// Algorithm's version for identification. @see Algorithm::version -int StartLiveData::version() const { return 1; }; +int StartLiveData::version() const { return 1; } //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/MDAlgorithms/src/AndMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/AndMD.cpp index 613414e8bec2..4f18cf8d1850 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/AndMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/AndMD.cpp @@ -22,10 +22,10 @@ AndMD::~AndMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string AndMD::name() const { return "AndMD"; }; +const std::string AndMD::name() const { return "AndMD"; } /// Algorithm's version for identification. @see Algorithm::version -int AndMD::version() const { return 1; }; +int AndMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- /// Run the algorithm with a MDHisotWorkspace as output and operand diff --git a/Code/Mantid/Framework/MDAlgorithms/src/BinaryOperationMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/BinaryOperationMD.cpp index 5868cf52579e..c618b3692d45 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/BinaryOperationMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/BinaryOperationMD.cpp @@ -32,10 +32,10 @@ BinaryOperationMD::~BinaryOperationMD() {} /// Algorithm's name for identification. @see Algorithm::name const std::string BinaryOperationMD::name() const { return "BinaryOperationMD"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int BinaryOperationMD::version() const { return 1; }; +int BinaryOperationMD::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string BinaryOperationMD::category() const { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/BooleanBinaryOperationMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/BooleanBinaryOperationMD.cpp index 3c000629af72..26d6ce085794 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/BooleanBinaryOperationMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/BooleanBinaryOperationMD.cpp @@ -22,10 +22,10 @@ BooleanBinaryOperationMD::~BooleanBinaryOperationMD() {} /// Algorithm's name for identification. @see Algorithm::name const std::string BooleanBinaryOperationMD::name() const { return "BooleanBinaryOperationMD"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int BooleanBinaryOperationMD::version() const { return 1; }; +int BooleanBinaryOperationMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- /// diff --git a/Code/Mantid/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp b/Code/Mantid/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp index 82b7e4dabb17..9a435bf5db1b 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp @@ -52,7 +52,7 @@ const std::string CalculateCoverageDGS::name() const { } /// Algorithm's version for identification. @see Algorithm::version -int CalculateCoverageDGS::version() const { return 1; }; +int CalculateCoverageDGS::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CalculateCoverageDGS::category() const { @@ -63,7 +63,7 @@ const std::string CalculateCoverageDGS::category() const { const std::string CalculateCoverageDGS::summary() const { return "Calculate the reciprocal space coverage for direct geometry " "spectrometers"; -}; +} /** *Stores the X values from each H,K,L dimension as member variables diff --git a/Code/Mantid/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp b/Code/Mantid/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp index e7959d9c9fbb..28178f447fa3 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp @@ -43,10 +43,10 @@ CompareMDWorkspaces::~CompareMDWorkspaces() {} /// Algorithm's name for identification. @see Algorithm::name const std::string CompareMDWorkspaces::name() const { return "CompareMDWorkspaces"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CompareMDWorkspaces::version() const { return 1; }; +int CompareMDWorkspaces::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CompareMDWorkspaces::category() const { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToDetectorFaceMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToDetectorFaceMD.cpp index 414eb440975e..a2adcd804e46 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToDetectorFaceMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToDetectorFaceMD.cpp @@ -37,10 +37,10 @@ ConvertToDetectorFaceMD::~ConvertToDetectorFaceMD() {} /// Algorithm's name for identification. @see Algorithm::name const std::string ConvertToDetectorFaceMD::name() const { return "ConvertToDetectorFaceMD"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int ConvertToDetectorFaceMD::version() const { return 1; }; +int ConvertToDetectorFaceMD::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ConvertToDetectorFaceMD::category() const { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToMDMinMaxGlobal.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToMDMinMaxGlobal.cpp index b4ccc704bb3a..a20bd7ded854 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/ConvertToMDMinMaxGlobal.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/ConvertToMDMinMaxGlobal.cpp @@ -34,10 +34,10 @@ ConvertToMDMinMaxGlobal::~ConvertToMDMinMaxGlobal() {} /// Algorithm's name for identification. @see Algorithm::name const std::string ConvertToMDMinMaxGlobal::name() const { return "ConvertToMDMinMaxGlobal"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int ConvertToMDMinMaxGlobal::version() const { return 1; }; +int ConvertToMDMinMaxGlobal::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ConvertToMDMinMaxGlobal::category() const { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/CreateMDHistoWorkspace.cpp b/Code/Mantid/Framework/MDAlgorithms/src/CreateMDHistoWorkspace.cpp index 6684e1cac420..71f53a681177 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/CreateMDHistoWorkspace.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/CreateMDHistoWorkspace.cpp @@ -32,10 +32,10 @@ CreateMDHistoWorkspace::~CreateMDHistoWorkspace() {} /// Algorithm's name for identification. @see Algorithm::name const std::string CreateMDHistoWorkspace::name() const { return "CreateMDHistoWorkspace"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int CreateMDHistoWorkspace::version() const { return 1; }; +int CreateMDHistoWorkspace::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string CreateMDHistoWorkspace::category() const { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/DivideMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/DivideMD.cpp index a471bc0c91f1..d5a31cf34ce8 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/DivideMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/DivideMD.cpp @@ -27,10 +27,10 @@ DivideMD::~DivideMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string DivideMD::name() const { return "DivideMD"; }; +const std::string DivideMD::name() const { return "DivideMD"; } /// Algorithm's version for identification. @see Algorithm::version -int DivideMD::version() const { return 1; }; +int DivideMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- diff --git a/Code/Mantid/Framework/MDAlgorithms/src/EqualToMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/EqualToMD.cpp index f53d3f33f7f2..32216e09f5f1 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/EqualToMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/EqualToMD.cpp @@ -22,10 +22,10 @@ EqualToMD::~EqualToMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string EqualToMD::name() const { return "EqualToMD"; }; +const std::string EqualToMD::name() const { return "EqualToMD"; } /// Algorithm's version for identification. @see Algorithm::version -int EqualToMD::version() const { return 1; }; +int EqualToMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- /// Extra properties diff --git a/Code/Mantid/Framework/MDAlgorithms/src/EvaluateMDFunction.cpp b/Code/Mantid/Framework/MDAlgorithms/src/EvaluateMDFunction.cpp index d395663cb7ba..10f64648dac4 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/EvaluateMDFunction.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/EvaluateMDFunction.cpp @@ -28,7 +28,7 @@ EvaluateMDFunction::~EvaluateMDFunction() {} //---------------------------------------------------------------------------------------------- /// Algorithm's version for identification. @see Algorithm::version -int EvaluateMDFunction::version() const { return 1; }; +int EvaluateMDFunction::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string EvaluateMDFunction::category() const { @@ -38,7 +38,7 @@ const std::string EvaluateMDFunction::category() const { /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary const std::string EvaluateMDFunction::summary() const { return "Evaluates an MD function on a MD histo workspace."; -}; +} //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ExponentialMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ExponentialMD.cpp index 50ffffa72ead..7da6298e57aa 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/ExponentialMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/ExponentialMD.cpp @@ -22,10 +22,10 @@ ExponentialMD::~ExponentialMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string ExponentialMD::name() const { return "ExponentialMD"; }; +const std::string ExponentialMD::name() const { return "ExponentialMD"; } /// Algorithm's version for identification. @see Algorithm::version -int ExponentialMD::version() const { return 1; }; +int ExponentialMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- diff --git a/Code/Mantid/Framework/MDAlgorithms/src/GreaterThanMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/GreaterThanMD.cpp index 8818bc87c81e..f98766cfff7d 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/GreaterThanMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/GreaterThanMD.cpp @@ -22,10 +22,10 @@ GreaterThanMD::~GreaterThanMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string GreaterThanMD::name() const { return "GreaterThanMD"; }; +const std::string GreaterThanMD::name() const { return "GreaterThanMD"; } /// Algorithm's version for identification. @see Algorithm::version -int GreaterThanMD::version() const { return 1; }; +int GreaterThanMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- /// Run the algorithm with a MDHisotWorkspace as output and operand diff --git a/Code/Mantid/Framework/MDAlgorithms/src/IntegrateFlux.cpp b/Code/Mantid/Framework/MDAlgorithms/src/IntegrateFlux.cpp index 95092d1e84b7..1bb592d391f3 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/IntegrateFlux.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/IntegrateFlux.cpp @@ -32,7 +32,7 @@ class NoEventWorkspaceDeleting { const std::string IntegrateFlux::name() const { return "IntegrateFlux"; } /// Algorithm's version for identification. @see Algorithm::version -int IntegrateFlux::version() const { return 1; }; +int IntegrateFlux::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string IntegrateFlux::category() const { return "MDAlgorithms"; } @@ -40,7 +40,7 @@ const std::string IntegrateFlux::category() const { return "MDAlgorithms"; } /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary const std::string IntegrateFlux::summary() const { return "Interates spectra in a matrix workspace at a set of points."; -}; +} //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. diff --git a/Code/Mantid/Framework/MDAlgorithms/src/LessThanMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/LessThanMD.cpp index da8b7db1879f..ba6e3f654cb3 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/LessThanMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/LessThanMD.cpp @@ -22,10 +22,10 @@ LessThanMD::~LessThanMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string LessThanMD::name() const { return "LessThanMD"; }; +const std::string LessThanMD::name() const { return "LessThanMD"; } /// Algorithm's version for identification. @see Algorithm::version -int LessThanMD::version() const { return 1; }; +int LessThanMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- /// Run the algorithm with a MDHisotWorkspace as output and operand diff --git a/Code/Mantid/Framework/MDAlgorithms/src/LoadILLAscii.cpp b/Code/Mantid/Framework/MDAlgorithms/src/LoadILLAscii.cpp index ffe7780809d4..aff2b3ba119c 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/LoadILLAscii.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/LoadILLAscii.cpp @@ -82,10 +82,10 @@ int LoadILLAscii::confidence(Kernel::FileDescriptor &descriptor) const { //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string LoadILLAscii::name() const { return "LoadILLAscii"; }; +const std::string LoadILLAscii::name() const { return "LoadILLAscii"; } /// Algorithm's version for identification. @see Algorithm::version -int LoadILLAscii::version() const { return 1; }; +int LoadILLAscii::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string LoadILLAscii::category() const { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/LoadMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/LoadMD.cpp index d50f3f3a3686..7b7d5eafaad1 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/LoadMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/LoadMD.cpp @@ -34,7 +34,7 @@ using namespace Mantid::MDEvents; namespace Mantid { namespace MDAlgorithms { -DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMD); +DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadMD) //---------------------------------------------------------------------------------------------- /** Constructor diff --git a/Code/Mantid/Framework/MDAlgorithms/src/LoadSQW.cpp b/Code/Mantid/Framework/MDAlgorithms/src/LoadSQW.cpp index 30682a7f2d17..5f2e8770c49c 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/LoadSQW.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/LoadSQW.cpp @@ -43,7 +43,7 @@ template T interpretAs(std::vector &Buf, size_t ind = 0) { } } -DECLARE_FILELOADER_ALGORITHM(LoadSQW); +DECLARE_FILELOADER_ALGORITHM(LoadSQW) /// Constructor LoadSQW::LoadSQW() : m_fileName(""), m_fileStream(), diff --git a/Code/Mantid/Framework/MDAlgorithms/src/LogarithmMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/LogarithmMD.cpp index e60b1f162cef..2111d83e333a 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/LogarithmMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/LogarithmMD.cpp @@ -22,10 +22,10 @@ LogarithmMD::~LogarithmMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string LogarithmMD::name() const { return "LogarithmMD"; }; +const std::string LogarithmMD::name() const { return "LogarithmMD"; } /// Algorithm's version for identification. @see Algorithm::version -int LogarithmMD::version() const { return 1; }; +int LogarithmMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MaskMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MaskMD.cpp index 8a9110bf3397..a9f49837d990 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/MaskMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/MaskMD.cpp @@ -41,10 +41,10 @@ MaskMD::~MaskMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string MaskMD::name() const { return "MaskMD"; }; +const std::string MaskMD::name() const { return "MaskMD"; } /// Algorithm's version for identification. @see Algorithm::version -int MaskMD::version() const { return 1; }; +int MaskMD::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string MaskMD::category() const { return "MDAlgorithms"; } diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MergeMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MergeMD.cpp index c21455165f31..2ab9e5075111 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/MergeMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/MergeMD.cpp @@ -31,10 +31,10 @@ MergeMD::~MergeMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string MergeMD::name() const { return "MergeMD"; }; +const std::string MergeMD::name() const { return "MergeMD"; } /// Algorithm's version for identification. @see Algorithm::version -int MergeMD::version() const { return 1; }; +int MergeMD::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string MergeMD::category() const { return "MDAlgorithms"; } diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MinusMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MinusMD.cpp index 5b16eb8e592d..7985cc9b0eb0 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/MinusMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/MinusMD.cpp @@ -27,10 +27,10 @@ MinusMD::~MinusMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string MinusMD::name() const { return "MinusMD"; }; +const std::string MinusMD::name() const { return "MinusMD"; } /// Algorithm's version for identification. @see Algorithm::version -int MinusMD::version() const { return 1; }; +int MinusMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MultiplyMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MultiplyMD.cpp index 38dd9296568b..5ba0de5c4512 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/MultiplyMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/MultiplyMD.cpp @@ -27,10 +27,10 @@ MultiplyMD::~MultiplyMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string MultiplyMD::name() const { return "MultiplyMD"; }; +const std::string MultiplyMD::name() const { return "MultiplyMD"; } /// Algorithm's version for identification. @see Algorithm::version -int MultiplyMD::version() const { return 1; }; +int MultiplyMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- diff --git a/Code/Mantid/Framework/MDAlgorithms/src/NotMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/NotMD.cpp index fbe2573df7e9..00757fb06ef3 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/NotMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/NotMD.cpp @@ -22,10 +22,10 @@ NotMD::~NotMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string NotMD::name() const { return "NotMD"; }; +const std::string NotMD::name() const { return "NotMD"; } /// Algorithm's version for identification. @see Algorithm::version -int NotMD::version() const { return 1; }; +int NotMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- diff --git a/Code/Mantid/Framework/MDAlgorithms/src/OrMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/OrMD.cpp index 2dc5f30133e4..1ff0932783ea 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/OrMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/OrMD.cpp @@ -22,10 +22,10 @@ OrMD::~OrMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string OrMD::name() const { return "OrMD"; }; +const std::string OrMD::name() const { return "OrMD"; } /// Algorithm's version for identification. @see Algorithm::version -int OrMD::version() const { return 1; }; +int OrMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- /// Run the algorithm with a MDHisotWorkspace as output and operand diff --git a/Code/Mantid/Framework/MDAlgorithms/src/PowerMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/PowerMD.cpp index 90cdcc44f543..d4e03afa6bcd 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/PowerMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/PowerMD.cpp @@ -22,10 +22,10 @@ PowerMD::~PowerMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string PowerMD::name() const { return "PowerMD"; }; +const std::string PowerMD::name() const { return "PowerMD"; } /// Algorithm's version for identification. @see Algorithm::version -int PowerMD::version() const { return 1; }; +int PowerMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- diff --git a/Code/Mantid/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp index d8cec796d70f..f705eaaab279 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp @@ -12,7 +12,7 @@ namespace MDAlgorithms { // Register the algorithm into the AlgorithmFactory DECLARE_ALGORITHM(PreprocessDetectorsToMD) -PreprocessDetectorsToMD::PreprocessDetectorsToMD(){}; +PreprocessDetectorsToMD::PreprocessDetectorsToMD(){} //---------------------------------------------------------------------------------------------- /** Initialize the algorithm's properties. */ void PreprocessDetectorsToMD::init() { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/FitResolutionConvolvedModel.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/FitResolutionConvolvedModel.cpp index dbe250985149..da845673529e 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/FitResolutionConvolvedModel.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/FitResolutionConvolvedModel.cpp @@ -11,7 +11,7 @@ namespace Mantid { namespace MDAlgorithms { // Register the algorithm into the AlgorithmFactory -DECLARE_ALGORITHM(FitResolutionConvolvedModel); +DECLARE_ALGORITHM(FitResolutionConvolvedModel) using Kernel::Direction; using Kernel::ListValidator; diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/MullerAnsatz.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/MullerAnsatz.cpp index 2afe41cc2bd2..708ae56914c0 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/MullerAnsatz.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/MullerAnsatz.cpp @@ -8,7 +8,7 @@ namespace Mantid { namespace MDAlgorithms { -DECLARE_FOREGROUNDMODEL(MullerAnsatz); +DECLARE_FOREGROUNDMODEL(MullerAnsatz) using Kernel::Math::BoseEinsteinDistribution; diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/QCoordinate.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/QCoordinate.cpp index cb3d62350f17..ca3ed919e0ad 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/QCoordinate.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/QCoordinate.cpp @@ -4,7 +4,7 @@ namespace Mantid { namespace MDAlgorithms { -DECLARE_FOREGROUNDMODEL(QCoordinate); +DECLARE_FOREGROUNDMODEL(QCoordinate) namespace // anonymous { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/Strontium122.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/Strontium122.cpp index de1d838c4652..d613b2059c84 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/Strontium122.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Models/Strontium122.cpp @@ -5,7 +5,7 @@ namespace Mantid { namespace MDAlgorithms { -DECLARE_FOREGROUNDMODEL(Strontium122); +DECLARE_FOREGROUNDMODEL(Strontium122) using Kernel::Math::BoseEinsteinDistribution; diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitResolutionModel.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitResolutionModel.cpp index cabafe77cd99..3ac60433469c 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitResolutionModel.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitResolutionModel.cpp @@ -23,7 +23,7 @@ using API::Run; using API::IFunction; DECLARE_MDRESOLUTIONCONVOLUTION(TobyFitResolutionModel, - "TobyFitResolutionModel"); + "TobyFitResolutionModel") namespace // anonymous { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/ResolutionConvolvedCrossSection.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/ResolutionConvolvedCrossSection.cpp index 031e84db52c5..ba9dd517a095 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/ResolutionConvolvedCrossSection.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/ResolutionConvolvedCrossSection.cpp @@ -50,7 +50,7 @@ namespace Mantid { namespace MDAlgorithms { -DECLARE_FUNCTION(ResolutionConvolvedCrossSection); +DECLARE_FUNCTION(ResolutionConvolvedCrossSection) namespace { // Attribute names diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/SimulateResolutionConvolvedModel.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/SimulateResolutionConvolvedModel.cpp index e7582e636b6d..e9cb4227084c 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/Quantification/SimulateResolutionConvolvedModel.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/Quantification/SimulateResolutionConvolvedModel.cpp @@ -18,7 +18,7 @@ namespace Mantid { namespace MDAlgorithms { // Register the algorithm into the AlgorithmFactory -DECLARE_ALGORITHM(SimulateResolutionConvolvedModel); +DECLARE_ALGORITHM(SimulateResolutionConvolvedModel) using namespace API; using namespace Kernel; diff --git a/Code/Mantid/Framework/MDAlgorithms/src/SaveZODS.cpp b/Code/Mantid/Framework/MDAlgorithms/src/SaveZODS.cpp index 1b7ad75e9a5b..df0b220d5799 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/SaveZODS.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/SaveZODS.cpp @@ -28,10 +28,10 @@ SaveZODS::~SaveZODS() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string SaveZODS::name() const { return "SaveZODS"; }; +const std::string SaveZODS::name() const { return "SaveZODS"; } /// Algorithm's version for identification. @see Algorithm::version -int SaveZODS::version() const { return 1; }; +int SaveZODS::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string SaveZODS::category() const { return "MDAlgorithms"; } diff --git a/Code/Mantid/Framework/MDAlgorithms/src/SetMDUsingMask.cpp b/Code/Mantid/Framework/MDAlgorithms/src/SetMDUsingMask.cpp index bb35f8b10486..2363f5970a63 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/SetMDUsingMask.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/SetMDUsingMask.cpp @@ -27,10 +27,10 @@ SetMDUsingMask::~SetMDUsingMask() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string SetMDUsingMask::name() const { return "SetMDUsingMask"; }; +const std::string SetMDUsingMask::name() const { return "SetMDUsingMask"; } /// Algorithm's version for identification. @see Algorithm::version -int SetMDUsingMask::version() const { return 1; }; +int SetMDUsingMask::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string SetMDUsingMask::category() const { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/ThresholdMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/ThresholdMD.cpp index 217943daffb0..bb03a8dfb786 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/ThresholdMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/ThresholdMD.cpp @@ -34,10 +34,10 @@ ThresholdMD::~ThresholdMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string ThresholdMD::name() const { return "ThresholdMD"; }; +const std::string ThresholdMD::name() const { return "ThresholdMD"; } /// Algorithm's version for identification. @see Algorithm::version -int ThresholdMD::version() const { return 1; }; +int ThresholdMD::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ThresholdMD::category() const { return "MDAlgorithms"; } diff --git a/Code/Mantid/Framework/MDAlgorithms/src/TransformMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/TransformMD.cpp index 20cd88620837..896c29c74d76 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/TransformMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/TransformMD.cpp @@ -29,10 +29,10 @@ TransformMD::~TransformMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string TransformMD::name() const { return "TransformMD"; }; +const std::string TransformMD::name() const { return "TransformMD"; } /// Algorithm's version for identification. @see Algorithm::version -int TransformMD::version() const { return 1; }; +int TransformMD::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string TransformMD::category() const { return "MDAlgorithms"; } diff --git a/Code/Mantid/Framework/MDAlgorithms/src/UnaryOperationMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/UnaryOperationMD.cpp index 3d6d07f994e7..38862d9c2143 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/UnaryOperationMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/UnaryOperationMD.cpp @@ -25,10 +25,10 @@ UnaryOperationMD::~UnaryOperationMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string UnaryOperationMD::name() const { return "UnaryOperationMD"; }; +const std::string UnaryOperationMD::name() const { return "UnaryOperationMD"; } /// Algorithm's version for identification. @see Algorithm::version -int UnaryOperationMD::version() const { return 1; }; +int UnaryOperationMD::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string UnaryOperationMD::category() const { diff --git a/Code/Mantid/Framework/MDAlgorithms/src/XorMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/XorMD.cpp index 2a388274f38b..c960c27df589 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/XorMD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/XorMD.cpp @@ -22,10 +22,10 @@ XorMD::~XorMD() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string XorMD::name() const { return "XorMD"; }; +const std::string XorMD::name() const { return "XorMD"; } /// Algorithm's version for identification. @see Algorithm::version -int XorMD::version() const { return 1; }; +int XorMD::version() const { return 1; } //---------------------------------------------------------------------------------------------- /// Run the algorithm with a MDHisotWorkspace as output and operand diff --git a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransformAligned.h b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransformAligned.h index cc57d1f8ca3e..5dd40ca97fbf 100644 --- a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransformAligned.h +++ b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransformAligned.h @@ -9,13 +9,13 @@ namespace Mantid { namespace MDEvents { /// Unique type declaration for which dimensions are used in the input workspace -DECLARE_VECTOR_PARAMETER(DimensionsToBinFromParam, size_t); +DECLARE_VECTOR_PARAMETER(DimensionsToBinFromParam, size_t) /// Unique type declaration for the offset of coordinates -DECLARE_VECTOR_PARAMETER(OriginOffsetParam, coord_t); +DECLARE_VECTOR_PARAMETER(OriginOffsetParam, coord_t) /// Unique type declaration for the step size in transformation -DECLARE_VECTOR_PARAMETER(ScalingParam, coord_t); +DECLARE_VECTOR_PARAMETER(ScalingParam, coord_t) /** A restricted version of CoordTransform which transforms from one set of dimensions to another, allowing: diff --git a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransformDistance.h b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransformDistance.h index 2c332767cc17..4da70fdac7e0 100644 --- a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransformDistance.h +++ b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/CoordTransformDistance.h @@ -12,11 +12,11 @@ namespace Mantid { namespace MDEvents { /// Unique CoordCenterVectorParam type declaration for ndimensional coordinate /// centers -DECLARE_VECTOR_PARAMETER(CoordCenterVectorParam, coord_t); +DECLARE_VECTOR_PARAMETER(CoordCenterVectorParam, coord_t) /// Unique DimensionsUsedVectorParam type declaration for boolean masks over /// dimensions -DECLARE_VECTOR_PARAMETER(DimensionsUsedVectorParam, bool); +DECLARE_VECTOR_PARAMETER(DimensionsUsedVectorParam, bool) /** A non-linear coordinate transform that takes * a point from nd dimensions and converts it to a diff --git a/Code/Mantid/Framework/MDEvents/src/ConvToMDBase.cpp b/Code/Mantid/Framework/MDEvents/src/ConvToMDBase.cpp index 2bb6898f1a07..34beee6fd332 100644 --- a/Code/Mantid/Framework/MDEvents/src/ConvToMDBase.cpp +++ b/Code/Mantid/Framework/MDEvents/src/ConvToMDBase.cpp @@ -94,7 +94,7 @@ size_t ConvToMDBase::initialize( m_coordinateSystem = WSD.getCoordinateSystem(); return n_spectra; -}; +} /** empty default constructor */ ConvToMDBase::ConvToMDBase() diff --git a/Code/Mantid/Framework/MDEvents/src/ConvertToReflectometryQ.cpp b/Code/Mantid/Framework/MDEvents/src/ConvertToReflectometryQ.cpp index c8785b26cb21..1c5df9e388a8 100644 --- a/Code/Mantid/Framework/MDEvents/src/ConvertToReflectometryQ.cpp +++ b/Code/Mantid/Framework/MDEvents/src/ConvertToReflectometryQ.cpp @@ -136,10 +136,10 @@ ConvertToReflectometryQ::~ConvertToReflectometryQ() {} /// Algorithm's name for identification. @see Algorithm::name const std::string ConvertToReflectometryQ::name() const { return "ConvertToReflectometryQ"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int ConvertToReflectometryQ::version() const { return 1; }; +int ConvertToReflectometryQ::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ConvertToReflectometryQ::category() const { diff --git a/Code/Mantid/Framework/MDEvents/src/FitMD.cpp b/Code/Mantid/Framework/MDEvents/src/FitMD.cpp index dbb17e2e1f4f..64d2ce71eb3e 100644 --- a/Code/Mantid/Framework/MDEvents/src/FitMD.cpp +++ b/Code/Mantid/Framework/MDEvents/src/FitMD.cpp @@ -23,7 +23,7 @@ namespace Mantid { namespace MDEvents { -DECLARE_DOMAINCREATOR(FitMD); +DECLARE_DOMAINCREATOR(FitMD) using namespace API; using namespace Kernel; diff --git a/Code/Mantid/Framework/MDEvents/src/ImportMDEventWorkspace.cpp b/Code/Mantid/Framework/MDEvents/src/ImportMDEventWorkspace.cpp index 778dae5954c6..25613ad38949 100644 --- a/Code/Mantid/Framework/MDEvents/src/ImportMDEventWorkspace.cpp +++ b/Code/Mantid/Framework/MDEvents/src/ImportMDEventWorkspace.cpp @@ -81,10 +81,10 @@ ImportMDEventWorkspace::~ImportMDEventWorkspace() {} /// Algorithm's name for identification. @see Algorithm::name const std::string ImportMDEventWorkspace::name() const { return "ImportMDEventWorkspace"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int ImportMDEventWorkspace::version() const { return 1; }; +int ImportMDEventWorkspace::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ImportMDEventWorkspace::category() const { diff --git a/Code/Mantid/Framework/MDEvents/src/ImportMDHistoWorkspace.cpp b/Code/Mantid/Framework/MDEvents/src/ImportMDHistoWorkspace.cpp index 3773fc180231..134a84b5007e 100644 --- a/Code/Mantid/Framework/MDEvents/src/ImportMDHistoWorkspace.cpp +++ b/Code/Mantid/Framework/MDEvents/src/ImportMDHistoWorkspace.cpp @@ -31,10 +31,10 @@ ImportMDHistoWorkspace::~ImportMDHistoWorkspace() {} /// Algorithm's name for identification. @see Algorithm::name const std::string ImportMDHistoWorkspace::name() const { return "ImportMDHistoWorkspace"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int ImportMDHistoWorkspace::version() const { return 1; }; +int ImportMDHistoWorkspace::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string ImportMDHistoWorkspace::category() const { diff --git a/Code/Mantid/Framework/MDEvents/src/MDBox.cpp b/Code/Mantid/Framework/MDEvents/src/MDBox.cpp index 510d96f65f5f..6f4964c01fdd 100644 --- a/Code/Mantid/Framework/MDEvents/src/MDBox.cpp +++ b/Code/Mantid/Framework/MDEvents/src/MDBox.cpp @@ -296,7 +296,7 @@ TMDE(void MDBox)::getEventsData(std::vector &coordTable, #ifdef MDBOX_TRACK_CENTROID this->calculateCentroid(this->m_centroid); #endif -}; +} /** The method to convert the table of data into vector of events * Used to load events from plain binary file * @param coordTable -- vector of events parameters, which will be converted @@ -305,7 +305,7 @@ TMDE(void MDBox)::getEventsData(std::vector &coordTable, */ TMDE(void MDBox)::setEventsData(const std::vector &coordTable) { MDE::dataToEvents(coordTable, this->data); -}; +} //----------------------------------------------------------------------------------------------- /** Allocate and return a vector with a copy of all events contained diff --git a/Code/Mantid/Framework/MDEvents/src/MDTransfModQ.cpp b/Code/Mantid/Framework/MDEvents/src/MDTransfModQ.cpp index c5066f6a2b21..64150e9fa8a1 100644 --- a/Code/Mantid/Framework/MDEvents/src/MDTransfModQ.cpp +++ b/Code/Mantid/Framework/MDEvents/src/MDTransfModQ.cpp @@ -4,7 +4,7 @@ namespace Mantid { namespace MDEvents { // register the class, whith conversion factory under ModQ name -DECLARE_MD_TRANSFID(MDTransfModQ, |Q|); +DECLARE_MD_TRANSFID(MDTransfModQ, |Q|) /**method calculates the units, the transformation expects the input ws to be in. If the input ws is in different units, diff --git a/Code/Mantid/Framework/MDEvents/src/MDTransfNoQ.cpp b/Code/Mantid/Framework/MDEvents/src/MDTransfNoQ.cpp index ea013bd32395..f8022527affa 100644 --- a/Code/Mantid/Framework/MDEvents/src/MDTransfNoQ.cpp +++ b/Code/Mantid/Framework/MDEvents/src/MDTransfNoQ.cpp @@ -4,7 +4,7 @@ namespace Mantid { namespace MDEvents { // register the class, whith conversion factory under NoQ name -DECLARE_MD_TRANSFID(MDTransfNoQ, CopyToMD); +DECLARE_MD_TRANSFID(MDTransfNoQ, CopyToMD) /** Method fills-in all additional properties requested by user and not defined *by matrix workspace itselt. @@ -177,7 +177,7 @@ MDTransfNoQ::inputUnitID(Kernel::DeltaEMode::Type mode, return pXAxis->unit()->unitID(); } -MDTransfNoQ::MDTransfNoQ() : m_NMatrixDim(0), m_YAxis(NULL), m_Det(NULL){}; +MDTransfNoQ::MDTransfNoQ() : m_NMatrixDim(0), m_YAxis(NULL), m_Det(NULL){} } // End MDAlgorighms namespace } // End Mantid namespace diff --git a/Code/Mantid/Framework/MDEvents/src/MDTransfQ3D.cpp b/Code/Mantid/Framework/MDEvents/src/MDTransfQ3D.cpp index aacc63c1c093..4b28ee722568 100644 --- a/Code/Mantid/Framework/MDEvents/src/MDTransfQ3D.cpp +++ b/Code/Mantid/Framework/MDEvents/src/MDTransfQ3D.cpp @@ -4,7 +4,7 @@ namespace Mantid { namespace MDEvents { // register the class, whith conversion factory under Q3D name -DECLARE_MD_TRANSFID(MDTransfQ3D, Q3D); +DECLARE_MD_TRANSFID(MDTransfQ3D, Q3D) /** method returns number of matrix dimensions calculated by this class * as function of energy analysis mode */ diff --git a/Code/Mantid/Framework/MDEvents/src/MDWSDescription.cpp b/Code/Mantid/Framework/MDEvents/src/MDWSDescription.cpp index 10b30e0d7135..e0ec2978af54 100644 --- a/Code/Mantid/Framework/MDEvents/src/MDWSDescription.cpp +++ b/Code/Mantid/Framework/MDEvents/src/MDWSDescription.cpp @@ -128,7 +128,7 @@ Kernel::Matrix MDWSDescription::getGoniometerMatr() const { return m_InWS->run().getGoniometer().getR(); else return Kernel::Matrix(3, 3, true); -}; +} /** the function builds MD event WS description from existing workspace. * Primary used to obtain existing ws parameters diff --git a/Code/Mantid/Framework/MDEvents/src/UnitsConversionHelper.cpp b/Code/Mantid/Framework/MDEvents/src/UnitsConversionHelper.cpp index 9ef8f0b06ef0..8ae927468775 100644 --- a/Code/Mantid/Framework/MDEvents/src/UnitsConversionHelper.cpp +++ b/Code/Mantid/Framework/MDEvents/src/UnitsConversionHelper.cpp @@ -366,7 +366,7 @@ UnitsConversionHelper::UnitsConversionHelper() : m_UnitCnvrsn(CnvrtToMD::ConvertNo), m_Factor(1), m_Power(1), m_Emode(-1), // undefined m_L1(1), m_Efix(1), m_TwoTheta(0), m_L2(1), m_pTwoThetas(NULL), - m_pL2s(NULL), m_pEfixedArray(NULL){}; + m_pL2s(NULL), m_pEfixedArray(NULL){} } // endNamespace MDEvents } // endNamespace Mantid diff --git a/Code/Mantid/Framework/MDEvents/src/UserFunctionMD.cpp b/Code/Mantid/Framework/MDEvents/src/UserFunctionMD.cpp index 7b2eb2d1dd07..bb44a5191855 100644 --- a/Code/Mantid/Framework/MDEvents/src/UserFunctionMD.cpp +++ b/Code/Mantid/Framework/MDEvents/src/UserFunctionMD.cpp @@ -11,7 +11,7 @@ namespace Mantid { namespace MDEvents { // Subscribe the function into the factory. -DECLARE_FUNCTION(UserFunctionMD); +DECLARE_FUNCTION(UserFunctionMD) /// Default constructor UserFunctionMD::UserFunctionMD() { diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp index 71dd4571e321..99e7e215f5d7 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Algorithm.cpp @@ -33,9 +33,9 @@ namespace typedef void(*declarePropertyType4)(boost::python::object & self, const std::string &, const boost::python::object &, const int); // Overload types - BOOST_PYTHON_FUNCTION_OVERLOADS(declarePropertyType1_Overload, PythonAlgorithm::declarePyAlgProperty, 2, 3); - BOOST_PYTHON_FUNCTION_OVERLOADS(declarePropertyType2_Overload, PythonAlgorithm::declarePyAlgProperty, 3, 6); - BOOST_PYTHON_FUNCTION_OVERLOADS(declarePropertyType3_Overload, PythonAlgorithm::declarePyAlgProperty, 4, 5); + BOOST_PYTHON_FUNCTION_OVERLOADS(declarePropertyType1_Overload, PythonAlgorithm::declarePyAlgProperty, 2, 3) + BOOST_PYTHON_FUNCTION_OVERLOADS(declarePropertyType2_Overload, PythonAlgorithm::declarePyAlgProperty, 3, 6) + BOOST_PYTHON_FUNCTION_OVERLOADS(declarePropertyType3_Overload, PythonAlgorithm::declarePyAlgProperty, 4, 5) } void export_leaf_classes() diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp index 12bfc84afbc6..4719f8e95912 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmFactory.cpp @@ -97,7 +97,7 @@ GCC_DIAG_OFF(cast-qual) FileLoaderRegistry::Instance().unsubscribe(descr.first, descr.second); } - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(existsOverloader, exists, 1, 2); + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(existsOverloader, exists, 1, 2) ///@endcond } diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp index d44c0a1f6063..4296086b4f68 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmManager.cpp @@ -59,8 +59,8 @@ namespace ///@cond //------------------------------------------------------------------------------------------------------ /// Define overload generators - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(create_overloads,AlgorithmManagerImpl::create, 1,2); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createUnmanaged_overloads,AlgorithmManagerImpl::createUnmanaged, 1,2); + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(create_overloads,AlgorithmManagerImpl::create, 1,2) + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createUnmanaged_overloads,AlgorithmManagerImpl::createUnmanaged, 1,2) ///@endcond } diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp index 0a1e917bd120..4151bcbebf84 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp @@ -27,7 +27,7 @@ namespace //------------------------------- Overload macros --------------------------- // Overloads for operator() function which has 1 optional argument - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Axis_getValue, Axis::getValue, 1, 2); + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Axis_getValue, Axis::getValue, 1, 2) /** * Extract the axis values as a sequence. A numpy array is used if the diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ExperimentInfo.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ExperimentInfo.cpp index 4f784af07eae..b02c444f40f4 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ExperimentInfo.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ExperimentInfo.cpp @@ -11,7 +11,7 @@ using Mantid::PythonInterface::Policies::RemoveConstSharedPtr; using namespace boost::python; /// Overload generator for getInstrumentFilename -BOOST_PYTHON_FUNCTION_OVERLOADS(getInstrumentFilename_Overload, ExperimentInfo::getInstrumentFilename, 1, 2); +BOOST_PYTHON_FUNCTION_OVERLOADS(getInstrumentFilename_Overload, ExperimentInfo::getInstrumentFilename, 1, 2) void export_ExperimentInfo() { diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp index caa28aea2a08..d43ac0538b79 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/IFunction.cpp @@ -35,10 +35,10 @@ namespace // -- Set property overloads -- // setProperty(index,value,explicit) typedef void(IFunction::*setParameterType1)(size_t,const double & value,bool); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(setParameterType1_Overloads, setParameter, 2, 3); + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(setParameterType1_Overloads, setParameter, 2, 3) // setProperty(index,value,explicit) typedef void(IFunction::*setParameterType2)(const std::string &,const double & value,bool); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(setParameterType2_Overloads, setParameter, 2, 3); + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(setParameterType2_Overloads, setParameter, 2, 3) ///@endcond diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp index 6ec0dcda804d..11dd4f9b8bff 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp @@ -13,7 +13,7 @@ using namespace boost::python; namespace { ///@cond - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Workspace_isDirtyOverloads, Workspace::isDirty, 0, 1); + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Workspace_isDirtyOverloads, Workspace::isDirty, 0, 1) ///@endcond } diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp index 6ff101d8dddd..e7cc6802b0fa 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp @@ -34,9 +34,9 @@ namespace } /// Overload generator for create - BOOST_PYTHON_FUNCTION_OVERLOADS(createFromParent_Overload, createFromParentPtr, 2, 5); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createTable_Overload, createTable, 0, 1); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createPeaks_Overload, createPeaks, 0, 1); + BOOST_PYTHON_FUNCTION_OVERLOADS(createFromParent_Overload, createFromParentPtr, 2, 5) + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createTable_Overload, createTable, 0, 1) + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(createPeaks_Overload, createPeaks, 0, 1) } void export_WorkspaceFactory() diff --git a/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Component.cpp b/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Component.cpp index 406a438bcb3d..02856d5765b9 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Component.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Component.cpp @@ -9,15 +9,15 @@ using namespace boost::python; namespace { // Default parameter function overloads - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getParameterNames,Component::getParameterNames,0,1); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_hasParameter,Component::hasParameter,1,2); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getNumberParameter,Component::getNumberParameter,1,2); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getBoolParameter,Component::getBoolParameter,1,2); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getPositionParameter,Component::getPositionParameter,1,2); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getRotationParameter,Component::getRotationParameter,1,2); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getStringParameter,Component::getStringParameter,1,2); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getIntParameter,Component::getIntParameter,1,2); - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getParameterType,Component::getParameterType,1,2); + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getParameterNames,Component::getParameterNames,0,1) + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_hasParameter,Component::hasParameter,1,2) + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getNumberParameter,Component::getNumberParameter,1,2) + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getBoolParameter,Component::getBoolParameter,1,2) + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getPositionParameter,Component::getPositionParameter,1,2) + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getRotationParameter,Component::getRotationParameter,1,2) + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getStringParameter,Component::getStringParameter,1,2) + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getIntParameter,Component::getIntParameter,1,2) + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(Component_getParameterType,Component::getParameterType,1,2) } diff --git a/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp b/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp index 16bcc7cf7b19..74b37cfebead 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/geometry/src/Exports/Goniometer.cpp @@ -14,7 +14,7 @@ namespace // { ///@cond // define overloaded functions - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getEulerAngles_overloads, Goniometer::getEulerAngles, 0, 1); + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getEulerAngles_overloads, Goniometer::getEulerAngles, 0, 1) ///@endcond /// Set the U vector via a numpy array diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp index 6213ffb71c9e..bc85d3edd85f 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp @@ -133,18 +133,18 @@ namespace Mantid { namespace PythonInterface INSTANTIATE_CLONEND(ElementType) ///@cond Doxygen doesn't seem to like this... - INSTANTIATE_CLONE(int); - INSTANTIATE_CLONE(long); - INSTANTIATE_CLONE(long long); - INSTANTIATE_CLONE(unsigned int); - INSTANTIATE_CLONE(unsigned long); - INSTANTIATE_CLONE(unsigned long long); - INSTANTIATE_CLONE(double); - INSTANTIATE_CLONE(float); + INSTANTIATE_CLONE(int) + INSTANTIATE_CLONE(long) + INSTANTIATE_CLONE(long long) + INSTANTIATE_CLONE(unsigned int) + INSTANTIATE_CLONE(unsigned long) + INSTANTIATE_CLONE(unsigned long long) + INSTANTIATE_CLONE(double) + INSTANTIATE_CLONE(float) // Need further 1D specialisation for string INSTANTIATE_CLONE1D(std::string) // Need further ND specialisation for bool - INSTANTIATE_CLONEND(bool); + INSTANTIATE_CLONEND(bool) ///@endcond } } diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp index 8151c09da2f9..759fe6b6e038 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp @@ -163,15 +163,15 @@ namespace Mantid template DLLExport struct NDArrayToVector; ///@cond Doxygen doesn't seem to like this... - INSTANTIATE_TOVECTOR(int); - INSTANTIATE_TOVECTOR(long); - INSTANTIATE_TOVECTOR(long long); - INSTANTIATE_TOVECTOR(unsigned int); - INSTANTIATE_TOVECTOR(unsigned long); - INSTANTIATE_TOVECTOR(unsigned long long); - INSTANTIATE_TOVECTOR(double); - INSTANTIATE_TOVECTOR(bool); - INSTANTIATE_TOVECTOR(std::string); + INSTANTIATE_TOVECTOR(int) + INSTANTIATE_TOVECTOR(long) + INSTANTIATE_TOVECTOR(long long) + INSTANTIATE_TOVECTOR(unsigned int) + INSTANTIATE_TOVECTOR(unsigned long) + INSTANTIATE_TOVECTOR(unsigned long long) + INSTANTIATE_TOVECTOR(double) + INSTANTIATE_TOVECTOR(bool) + INSTANTIATE_TOVECTOR(std::string) ///@endcond } } diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayTypeIndex.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayTypeIndex.cpp index a1efd28e193c..5a7981231fa9 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayTypeIndex.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayTypeIndex.cpp @@ -24,15 +24,15 @@ namespace Mantid template DLLExport struct NDArrayTypeIndex;\ - DEFINE_TYPE_MAPPING(int, NPY_INT); - DEFINE_TYPE_MAPPING(long, NPY_LONG); - DEFINE_TYPE_MAPPING(long long, NPY_LONGLONG); - DEFINE_TYPE_MAPPING(unsigned int, NPY_UINT); - DEFINE_TYPE_MAPPING(unsigned long, NPY_ULONG); - DEFINE_TYPE_MAPPING(unsigned long long, NPY_ULONGLONG); - DEFINE_TYPE_MAPPING(bool, NPY_BOOL); - DEFINE_TYPE_MAPPING(double, NPY_DOUBLE); - DEFINE_TYPE_MAPPING(float, NPY_FLOAT); + DEFINE_TYPE_MAPPING(int, NPY_INT) + DEFINE_TYPE_MAPPING(long, NPY_LONG) + DEFINE_TYPE_MAPPING(long long, NPY_LONGLONG) + DEFINE_TYPE_MAPPING(unsigned int, NPY_UINT) + DEFINE_TYPE_MAPPING(unsigned long, NPY_ULONG) + DEFINE_TYPE_MAPPING(unsigned long long, NPY_ULONGLONG) + DEFINE_TYPE_MAPPING(bool, NPY_BOOL) + DEFINE_TYPE_MAPPING(double, NPY_DOUBLE) + DEFINE_TYPE_MAPPING(float, NPY_FLOAT) } } } diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/WrapWithNumpy.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/WrapWithNumpy.cpp index d353890b416d..8b56c8eb7a17 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/WrapWithNumpy.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/WrapWithNumpy.cpp @@ -65,14 +65,14 @@ namespace Mantid { namespace PythonInterface template DLLExport PyObject *wrapWithNDArray(const ElementType*, const int ndims, Py_intptr_t *dims, const NumpyWrapMode); ///@cond Doxygen doesn't seem to like this... - INSTANTIATE_WRAPNUMPY(int); - INSTANTIATE_WRAPNUMPY(long); - INSTANTIATE_WRAPNUMPY(long long); - INSTANTIATE_WRAPNUMPY(unsigned int); - INSTANTIATE_WRAPNUMPY(unsigned long); - INSTANTIATE_WRAPNUMPY(unsigned long long); - INSTANTIATE_WRAPNUMPY(double); - INSTANTIATE_WRAPNUMPY(float); + INSTANTIATE_WRAPNUMPY(int) + INSTANTIATE_WRAPNUMPY(long) + INSTANTIATE_WRAPNUMPY(long long) + INSTANTIATE_WRAPNUMPY(unsigned int) + INSTANTIATE_WRAPNUMPY(unsigned long) + INSTANTIATE_WRAPNUMPY(unsigned long long) + INSTANTIATE_WRAPNUMPY(double) + INSTANTIATE_WRAPNUMPY(float) ///@endcond } } diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/ConfigService.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/ConfigService.cpp index 762f446435d5..45a9d0f8a559 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/ConfigService.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/ConfigService.cpp @@ -31,9 +31,9 @@ namespace } /// Overload generator for getInstrument - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getInstrument_Overload, getInstrument, 0, 1); + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getInstrument_Overload, getInstrument, 0, 1) /// Overload generator for getString - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getString_Overload, getString, 1, 2); + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getString_Overload, getString, 1, 2) } void export_ConfigService() diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/Statistics.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/Statistics.cpp index 8fc7a039ebfc..3bfa9244083a 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/Statistics.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/Statistics.cpp @@ -94,7 +94,7 @@ namespace } } // Define an overload to handle the default argument - BOOST_PYTHON_FUNCTION_OVERLOADS(getStatisticsOverloads, getStatisticsNumpy, 1, 2); + BOOST_PYTHON_FUNCTION_OVERLOADS(getStatisticsOverloads, getStatisticsNumpy, 1, 2) //============================ Z score ============================================ // Function pointer to real implementation of Zscore functions @@ -132,7 +132,7 @@ namespace return getZScoreNumpyImpl(&getZscore, data, sorted); } // Define an overload to handle the default argument - BOOST_PYTHON_FUNCTION_OVERLOADS(getZscoreOverloads, getZscoreNumpy, 1, 2); + BOOST_PYTHON_FUNCTION_OVERLOADS(getZscoreOverloads, getZscoreNumpy, 1, 2) /** * Proxy for @see Mantid::Kernel::getModifiedZscore so that it can accept numpy arrays, @@ -143,7 +143,7 @@ namespace return getZScoreNumpyImpl(&getModifiedZscore, data, sorted); } // Define an overload to handle the default argument - BOOST_PYTHON_FUNCTION_OVERLOADS(getModifiedZscoreOverloads, getModifiedZscoreNumpy, 1, 2); + BOOST_PYTHON_FUNCTION_OVERLOADS(getModifiedZscoreOverloads, getModifiedZscoreNumpy, 1, 2) //============================ getMoments ============================================ @@ -194,7 +194,7 @@ namespace } // Define an overload to handle the default argument - BOOST_PYTHON_FUNCTION_OVERLOADS(getMomentsAboutOriginOverloads, getMomentsAboutOriginNumpy, 2, 3); + BOOST_PYTHON_FUNCTION_OVERLOADS(getMomentsAboutOriginOverloads, getMomentsAboutOriginNumpy, 2, 3) /** * Proxy for @see Mantid::Kernel::getMomentsAboutMean so that it can accept numpy arrays @@ -207,7 +207,7 @@ namespace } // Define an overload to handle the default argument - BOOST_PYTHON_FUNCTION_OVERLOADS(getMomentsAboutMeanOverloads, getMomentsAboutMeanNumpy, 2, 3); + BOOST_PYTHON_FUNCTION_OVERLOADS(getMomentsAboutMeanOverloads, getMomentsAboutMeanNumpy, 2, 3) ///@endcond } diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/TimeSeriesProperty.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/TimeSeriesProperty.cpp index 093438843132..2f9bf5300092 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/TimeSeriesProperty.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/TimeSeriesProperty.cpp @@ -38,7 +38,6 @@ namespace .def("getStatistics", &TimeSeriesProperty::getStatistics) \ .def("timeAverageValue", &TimeSeriesProperty::timeAverageValue) \ ; - ; } void export_TimeSeriesProperty_Double() diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Registry/SequenceTypeHandler.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Registry/SequenceTypeHandler.cpp index 067aa64fc4d2..627bc2d4cd00 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Registry/SequenceTypeHandler.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Registry/SequenceTypeHandler.cpp @@ -128,15 +128,15 @@ namespace Mantid #define INSTANTIATE(ElementType)\ template DLLExport struct SequenceTypeHandler >; - INSTANTIATE(int); - INSTANTIATE(long); - INSTANTIATE(long long); - INSTANTIATE(unsigned int); - INSTANTIATE(unsigned long); - INSTANTIATE(unsigned long long); - INSTANTIATE(double); - INSTANTIATE(std::string); - INSTANTIATE(bool); + INSTANTIATE(int) + INSTANTIATE(long) + INSTANTIATE(long long) + INSTANTIATE(unsigned int) + INSTANTIATE(unsigned long) + INSTANTIATE(unsigned long long) + INSTANTIATE(double) + INSTANTIATE(std::string) + INSTANTIATE(bool) ///@endcond } } diff --git a/Code/Mantid/Framework/PythonInterface/test/testhelpers/WorkspaceCreationHelperModule.cpp b/Code/Mantid/Framework/PythonInterface/test/testhelpers/WorkspaceCreationHelperModule.cpp index 032de062643f..0ae46ae14274 100644 --- a/Code/Mantid/Framework/PythonInterface/test/testhelpers/WorkspaceCreationHelperModule.cpp +++ b/Code/Mantid/Framework/PythonInterface/test/testhelpers/WorkspaceCreationHelperModule.cpp @@ -16,11 +16,11 @@ using namespace WorkspaceCreationHelper; using namespace Mantid::MDEvents::MDEventsTestHelper; -BOOST_PYTHON_FUNCTION_OVERLOADS(create2DWorkspaceWithFullInstrument_overloads, create2DWorkspaceWithFullInstrument, 2, 4); +BOOST_PYTHON_FUNCTION_OVERLOADS(create2DWorkspaceWithFullInstrument_overloads, create2DWorkspaceWithFullInstrument, 2, 4) -BOOST_PYTHON_FUNCTION_OVERLOADS(makeFakeMDHistoWorkspace_overloads, makeFakeMDHistoWorkspace, 2, 7); +BOOST_PYTHON_FUNCTION_OVERLOADS(makeFakeMDHistoWorkspace_overloads, makeFakeMDHistoWorkspace, 2, 7) -BOOST_PYTHON_FUNCTION_OVERLOADS(create2DWorkspaceWithRectangularInstrument_overloads, create2DWorkspaceWithRectangularInstrument, 3, 3); +BOOST_PYTHON_FUNCTION_OVERLOADS(create2DWorkspaceWithRectangularInstrument_overloads, create2DWorkspaceWithRectangularInstrument, 3, 3) namespace { diff --git a/Code/Mantid/Framework/ScriptRepository/inc/MantidScriptRepository/ScriptRepositoryImpl.h b/Code/Mantid/Framework/ScriptRepository/inc/MantidScriptRepository/ScriptRepositoryImpl.h index 64c0750492af..89900eeee1bc 100644 --- a/Code/Mantid/Framework/ScriptRepository/inc/MantidScriptRepository/ScriptRepositoryImpl.h +++ b/Code/Mantid/Framework/ScriptRepository/inc/MantidScriptRepository/ScriptRepositoryImpl.h @@ -171,7 +171,7 @@ class SCRIPT_DLL_EXPORT ScriptRepositoryImpl : public ScriptRepository { std::string getParentFolder(const std::string &entry); }; -}; // namespace API -}; // namespace Mantid +} // namespace API +} // namespace Mantid #endif // _MANTIDSCRIPTREPOSITORY_SCRIPTREPOSITORYIMPL_H_ diff --git a/Code/Mantid/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp b/Code/Mantid/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp index 1f0f1ea81759..a3e8d448ce08 100644 --- a/Code/Mantid/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp +++ b/Code/Mantid/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp @@ -1200,7 +1200,7 @@ void ScriptRepositoryImpl::setIgnorePatterns(const std::string &patterns) { boost::replace_all(newignore, "*", ".*"); ignoreregex = std::string("(").append(newignore).append(")"); } -}; +} /** @todo describe */ diff --git a/Code/Mantid/Framework/TestHelpers/src/ScopedFileHelper.cpp b/Code/Mantid/Framework/TestHelpers/src/ScopedFileHelper.cpp index e8708decc761..243f36ff1373 100644 --- a/Code/Mantid/Framework/TestHelpers/src/ScopedFileHelper.cpp +++ b/Code/Mantid/Framework/TestHelpers/src/ScopedFileHelper.cpp @@ -41,13 +41,13 @@ ScopedFile &ScopedFile::operator=(const ScopedFile &other) { other.release(); } return *this; -}; +} /// Copy construction. ScopedFile::ScopedFile(const ScopedFile &other) { this->m_filename = other.m_filename; other.release(); -}; +} /** Common method used by all constructors. Creates a file containing the ASCII file diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsAbsoluteUnitsReduction.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsAbsoluteUnitsReduction.cpp index f8cff1c7562e..7f146efc89ad 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsAbsoluteUnitsReduction.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsAbsoluteUnitsReduction.cpp @@ -30,10 +30,10 @@ DgsAbsoluteUnitsReduction::~DgsAbsoluteUnitsReduction() {} /// Algorithm's name for identification. @see Algorithm::name const std::string DgsAbsoluteUnitsReduction::name() const { return "DgsAbsoluteUnitsReduction"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int DgsAbsoluteUnitsReduction::version() const { return 1; }; +int DgsAbsoluteUnitsReduction::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string DgsAbsoluteUnitsReduction::category() const { diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp index 9b5d8f18600f..643c68fa0c22 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp @@ -42,10 +42,10 @@ DgsConvertToEnergyTransfer::~DgsConvertToEnergyTransfer() {} /// Algorithm's name for identification. @see Algorithm::name const std::string DgsConvertToEnergyTransfer::name() const { return "DgsConvertToEnergyTransfer"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int DgsConvertToEnergyTransfer::version() const { return 1; }; +int DgsConvertToEnergyTransfer::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string DgsConvertToEnergyTransfer::category() const { diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsDiagnose.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsDiagnose.cpp index bbb21dc2cd59..85be54fcfc2f 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsDiagnose.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsDiagnose.cpp @@ -30,10 +30,10 @@ DgsDiagnose::~DgsDiagnose() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string DgsDiagnose::name() const { return "DgsDiagnose"; }; +const std::string DgsDiagnose::name() const { return "DgsDiagnose"; } /// Algorithm's version for identification. @see Algorithm::version -int DgsDiagnose::version() const { return 1; }; +int DgsDiagnose::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string DgsDiagnose::category() const { diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsPreprocessData.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsPreprocessData.cpp index 56bce546f2d6..56258b060d0b 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsPreprocessData.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsPreprocessData.cpp @@ -38,10 +38,10 @@ DgsPreprocessData::~DgsPreprocessData() {} /// Algorithm's name for identification. @see Algorithm::name const std::string DgsPreprocessData::name() const { return "DgsPreprocessData"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int DgsPreprocessData::version() const { return 1; }; +int DgsPreprocessData::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string DgsPreprocessData::category() const { diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp index 0b8a08209705..f5dc93a0b54a 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp @@ -39,10 +39,10 @@ DgsReduction::~DgsReduction() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string DgsReduction::name() const { return "DgsReduction"; }; +const std::string DgsReduction::name() const { return "DgsReduction"; } /// Algorithm's version for identification. @see Algorithm::version -int DgsReduction::version() const { return 1; }; +int DgsReduction::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string DgsReduction::category() const { diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsRemap.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsRemap.cpp index 5a15d54b2679..d4008ae2aa53 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsRemap.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsRemap.cpp @@ -24,10 +24,10 @@ DgsRemap::~DgsRemap() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string DgsRemap::name() const { return "DgsRemap"; }; +const std::string DgsRemap::name() const { return "DgsRemap"; } /// Algorithm's version for identification. @see Algorithm::version -int DgsRemap::version() const { return 1; }; +int DgsRemap::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string DgsRemap::category() const { return "Workflow\\Inelastic"; } diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonCalculateAsymmetry.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonCalculateAsymmetry.cpp index a508a720150c..a70b9f91146e 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonCalculateAsymmetry.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonCalculateAsymmetry.cpp @@ -28,10 +28,10 @@ MuonCalculateAsymmetry::~MuonCalculateAsymmetry() {} /// Algorithm's name for identification. @see Algorithm::name const std::string MuonCalculateAsymmetry::name() const { return "MuonCalculateAsymmetry"; -}; +} /// Algorithm's version for identification. @see Algorithm::version -int MuonCalculateAsymmetry::version() const { return 1; }; +int MuonCalculateAsymmetry::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string MuonCalculateAsymmetry::category() const { diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonLoad.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonLoad.cpp index 9d2771c1ea43..0690f08d3c2c 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonLoad.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/MuonLoad.cpp @@ -28,10 +28,10 @@ MuonLoad::~MuonLoad() {} //---------------------------------------------------------------------------------------------- /// Algorithm's name for identification. @see Algorithm::name -const std::string MuonLoad::name() const { return "MuonLoad"; }; +const std::string MuonLoad::name() const { return "MuonLoad"; } /// Algorithm's version for identification. @see Algorithm::version -int MuonLoad::version() const { return 1; }; +int MuonLoad::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string MuonLoad::category() const { return "Workflow\\Muon"; } diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/StepScan.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/StepScan.cpp index 616e1df5844f..4541b25d6eae 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/StepScan.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/StepScan.cpp @@ -19,10 +19,10 @@ StepScan::StepScan() {} StepScan::~StepScan() {} /// Algorithm's name for identification. @see Algorithm::name -const std::string StepScan::name() const { return "StepScan"; }; +const std::string StepScan::name() const { return "StepScan"; } /// Algorithm's version for identification. @see Algorithm::version -int StepScan::version() const { return 1; }; +int StepScan::version() const { return 1; } /// Algorithm's category for identification. @see Algorithm::category const std::string StepScan::category() const { return "Workflow\\Alignment"; } diff --git a/Code/Mantid/MantidPlot/src/ExpDecayDialog.cpp b/Code/Mantid/MantidPlot/src/ExpDecayDialog.cpp index 98154dc22ff8..cd3347749305 100644 --- a/Code/Mantid/MantidPlot/src/ExpDecayDialog.cpp +++ b/Code/Mantid/MantidPlot/src/ExpDecayDialog.cpp @@ -158,7 +158,7 @@ void ExpDecayDialog::setGraph(Graph *g) connect (graph, SIGNAL(closedGraph()), this, SLOT(close())); connect (graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange())); -}; +} void ExpDecayDialog::activateCurve(const QString& curveName) { @@ -178,7 +178,7 @@ void ExpDecayDialog::activateCurve(const QString& curveName) if (slopes < 2) boxAmplitude->setText(QString::number(c->maxYValue() - c->minYValue(), 'g', precision)); -}; +} void ExpDecayDialog::changeDataRange() { diff --git a/Code/Mantid/MantidPlot/src/FFTDialog.cpp b/Code/Mantid/MantidPlot/src/FFTDialog.cpp index f83ac4f22c94..e6453e17b295 100644 --- a/Code/Mantid/MantidPlot/src/FFTDialog.cpp +++ b/Code/Mantid/MantidPlot/src/FFTDialog.cpp @@ -186,7 +186,7 @@ void FFTDialog::setGraph(Graph *g) graph = g; boxName->insertStringList (g->analysableCurvesList()); activateCurve(boxName->currentText()); -}; +} void FFTDialog::activateCurve(const QString& curveName) { @@ -202,7 +202,7 @@ void FFTDialog::activateCurve(const QString& curveName) double x1 = d_table->text(1, col).toDouble(); boxSampling->setText(QString::number(x1 - x0)); } -}; +} void FFTDialog::setTable(Table *t) { @@ -233,7 +233,7 @@ void FFTDialog::setTable(Table *t) boxReal->setCurrentItem(t->colIndex(l[0])); boxImaginary->setCurrentItem(t->colIndex(l[1])); } -}; +} void FFTDialog::setMatrix(Matrix *m) { diff --git a/Code/Mantid/MantidPlot/src/FilterDialog.cpp b/Code/Mantid/MantidPlot/src/FilterDialog.cpp index 6f02ae0d0fef..1e16d247b595 100644 --- a/Code/Mantid/MantidPlot/src/FilterDialog.cpp +++ b/Code/Mantid/MantidPlot/src/FilterDialog.cpp @@ -190,4 +190,4 @@ void FilterDialog::setGraph(Graph *g) { graph = g; boxName->addItems (g->analysableCurvesList()); -}; +} diff --git a/Code/Mantid/MantidPlot/src/FitDialog.cpp b/Code/Mantid/MantidPlot/src/FitDialog.cpp index 27936290bc3a..701adfc599bc 100644 --- a/Code/Mantid/MantidPlot/src/FitDialog.cpp +++ b/Code/Mantid/MantidPlot/src/FitDialog.cpp @@ -559,7 +559,7 @@ void FitDialog::setGraph(Graph *g) connect (d_graph, SIGNAL(closedGraph()), this, SLOT(close())); connect (d_graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange())); -}; +} void FitDialog::activateCurve(const QString& curveName) { @@ -573,7 +573,7 @@ void FitDialog::activateCurve(const QString& curveName) boxTo->setValue(QMAX(start, end)); //Set the same color as the data curve chosen for fit (Feature Request #4031) boxColor->setColor(c->pen().color()); -}; +} void FitDialog::saveUserFunction() { diff --git a/Code/Mantid/MantidPlot/src/Graph.h b/Code/Mantid/MantidPlot/src/Graph.h index 07cab9df6848..7480107f3b16 100644 --- a/Code/Mantid/MantidPlot/src/Graph.h +++ b/Code/Mantid/MantidPlot/src/Graph.h @@ -881,7 +881,7 @@ private slots: }; -Q_DECLARE_METATYPE(Graph::CurveType); +Q_DECLARE_METATYPE(Graph::CurveType) #endif // GRAPH_H diff --git a/Code/Mantid/MantidPlot/src/InterpolationDialog.cpp b/Code/Mantid/MantidPlot/src/InterpolationDialog.cpp index 4d0ceb1722ec..efc62a720287 100644 --- a/Code/Mantid/MantidPlot/src/InterpolationDialog.cpp +++ b/Code/Mantid/MantidPlot/src/InterpolationDialog.cpp @@ -173,7 +173,7 @@ void InterpolationDialog::setGraph(Graph *g) connect (graph, SIGNAL(closedGraph()), this, SLOT(close())); connect (graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange())); -}; +} void InterpolationDialog::activateCurve(const QString& curveName) { @@ -189,7 +189,7 @@ void InterpolationDialog::activateCurve(const QString& curveName) graph->range(graph->curveIndex(curveName), &start, &end); boxStart->setText(QString::number(QMIN(start, end), 'g', app->d_decimal_digits)); boxEnd->setText(QString::number(QMAX(start, end), 'g', app->d_decimal_digits)); -}; +} void InterpolationDialog::changeDataRange() { diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.cpp index 6caf14cffda8..a2649437b34b 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentTreeWidget.cpp @@ -17,7 +17,7 @@ InstrumentTreeWidget::InstrumentTreeWidget(QWidget *w):QTreeView(w), m_treeModel(0) { connect(this,SIGNAL(clicked(const QModelIndex)),this,SLOT(sendComponentSelectedSignal(const QModelIndex))); -}; +} void InstrumentTreeWidget::setInstrumentActor(InstrumentActor* instrActor) { diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp index 2ef4c3335a47..68905abb2156 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp @@ -2310,7 +2310,7 @@ MultiLayer* MantidUI::mergePlots(MultiLayer* mlayer_1, MultiLayer* mlayer_2) mlayer_2->close(); return mlayer_1; -}; +} MantidMatrix* MantidUI::getMantidMatrix(const QString& wsName) { diff --git a/Code/Mantid/MantidPlot/src/MdiSubWindow.cpp b/Code/Mantid/MantidPlot/src/MdiSubWindow.cpp index 3e003d1b593f..f0b014fb79a8 100644 --- a/Code/Mantid/MantidPlot/src/MdiSubWindow.cpp +++ b/Code/Mantid/MantidPlot/src/MdiSubWindow.cpp @@ -98,7 +98,7 @@ void MdiSubWindow::updateCaption() wrapper->setWindowTitle(windowTitle()); } emit captionChanged(objectName(), d_label); -}; +} void MdiSubWindow::resizeEvent( QResizeEvent* e ) { diff --git a/Code/Mantid/MantidPlot/src/MultiLayer.h b/Code/Mantid/MantidPlot/src/MultiLayer.h index e561a61a0fd4..cba7586a9b75 100644 --- a/Code/Mantid/MantidPlot/src/MultiLayer.h +++ b/Code/Mantid/MantidPlot/src/MultiLayer.h @@ -266,7 +266,7 @@ class LayerButton: public QPushButton void clicked(LayerButton*); }; -Q_DECLARE_METATYPE(MultiLayer*); +Q_DECLARE_METATYPE(MultiLayer*) class WaterfallFillDialog : QDialog diff --git a/Code/Mantid/MantidPlot/src/Plot3DDialog.cpp b/Code/Mantid/MantidPlot/src/Plot3DDialog.cpp index f1cab9fe0ed1..a231acee361e 100644 --- a/Code/Mantid/MantidPlot/src/Plot3DDialog.cpp +++ b/Code/Mantid/MantidPlot/src/Plot3DDialog.cpp @@ -594,7 +594,7 @@ void Plot3DDialog::setPlot(Graph3D *g) connect( boxLegend, SIGNAL(toggled(bool)), d_plot, SLOT(showColorLegend(bool))); connect( boxResolution, SIGNAL(valueChanged(int)), d_plot, SLOT(setResolution(int))); connect( boxDistance, SIGNAL(valueChanged(int)), d_plot, SLOT(setLabelsDistance(int))); -}; +} void Plot3DDialog::worksheet() { diff --git a/Code/Mantid/MantidPlot/src/PolynomFitDialog.cpp b/Code/Mantid/MantidPlot/src/PolynomFitDialog.cpp index ae9655bcc774..f1e19dc48096 100644 --- a/Code/Mantid/MantidPlot/src/PolynomFitDialog.cpp +++ b/Code/Mantid/MantidPlot/src/PolynomFitDialog.cpp @@ -146,7 +146,7 @@ void PolynomFitDialog::setGraph(Graph *g) connect (graph, SIGNAL(closedGraph()), this, SLOT(close())); connect (graph, SIGNAL(dataRangeChanged()), this, SLOT(changeDataRange())); -}; +} void PolynomFitDialog::activateCurve(const QString& curveName) { @@ -156,7 +156,7 @@ void PolynomFitDialog::activateCurve(const QString& curveName) boxStart->setText(QString::number(start, 'g', 15)); boxEnd->setText(QString::number(end, 'g', 15)); boxPoints->setValue(QMAX(n_points, 100)); -}; +} void PolynomFitDialog::changeDataRange() { diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/Message.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/Message.h index 0f5c32d37b4c..c14f3a1fd7ad 100644 --- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/Message.h +++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/Message.h @@ -58,6 +58,6 @@ namespace MantidQt } /// Required to operate in signals/slots -Q_DECLARE_METATYPE(MantidQt::API::Message); +Q_DECLARE_METATYPE(MantidQt::API::Message) #endif //MESSAGE_H_ diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h index cd4cd846ea52..f630804187fa 100644 --- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h +++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/RepoModel.h @@ -257,7 +257,7 @@ const QString DELETABLEENTRY = "deletable"; }; -}; // namespace API -};// namespace Mantid +} // namespace API +} // namespace Mantid #endif /* MANTID_API_SCRIPTREPOSITORYVIEW_H_ */ diff --git a/Code/Mantid/MantidQt/API/src/MdConstants.cpp b/Code/Mantid/MantidQt/API/src/MdConstants.cpp index d07c67b26b2e..5eae09154303 100644 --- a/Code/Mantid/MantidQt/API/src/MdConstants.cpp +++ b/Code/Mantid/MantidQt/API/src/MdConstants.cpp @@ -12,9 +12,9 @@ namespace MantidQt { initializeSettingsConstants(); initializeViewConstants(); - }; + } - MdConstants::~MdConstants(){}; + MdConstants::~MdConstants(){} void MdConstants::initializeSettingsConstants() { diff --git a/Code/Mantid/MantidQt/API/src/PropertyWidget.cpp b/Code/Mantid/MantidQt/API/src/PropertyWidget.cpp index 4b938ef3b945..2af591dd9396 100644 --- a/Code/Mantid/MantidQt/API/src/PropertyWidget.cpp +++ b/Code/Mantid/MantidQt/API/src/PropertyWidget.cpp @@ -171,7 +171,7 @@ namespace API /** * Destructor. */ - ClickableLabel::~ClickableLabel() {}; + ClickableLabel::~ClickableLabel() {} /** * Catches the mouse press event and emits the signal. diff --git a/Code/Mantid/MantidQt/API/src/RepoModel.cpp b/Code/Mantid/MantidQt/API/src/RepoModel.cpp index 14e3a8ebbc84..0fd6e88b36bc 100644 --- a/Code/Mantid/MantidQt/API/src/RepoModel.cpp +++ b/Code/Mantid/MantidQt/API/src/RepoModel.cpp @@ -940,21 +940,21 @@ bool RepoModel::isUploading(const QModelIndex & index)const{ /// @return string to define the LOCAL_ONLY state -const QString & RepoModel::localOnlySt(){return LOCALONLY;}; +const QString & RepoModel::localOnlySt(){return LOCALONLY;} /// @return string to define the REMOTE_ONLY state -const QString & RepoModel::remoteOnlySt(){return REMOTEONLY;}; +const QString & RepoModel::remoteOnlySt(){return REMOTEONLY;} /// @return string to define the LOCAL_CHANGED state -const QString & RepoModel::localChangedSt(){return LOCALCHANGED;}; +const QString & RepoModel::localChangedSt(){return LOCALCHANGED;} /// @return string to define the REMOTE_CHANGED state -const QString & RepoModel::remoteChangedSt(){return REMOTECHANGED;}; +const QString & RepoModel::remoteChangedSt(){return REMOTECHANGED;} /// @return string to define the BOTH_UNCHANGED state -const QString & RepoModel::updatedSt(){return BOTHUNCHANGED;}; +const QString & RepoModel::updatedSt(){return BOTHUNCHANGED;} /// @return string to define the BOTH_CHANGED state -const QString & RepoModel::bothChangedSt(){return BOTHCHANGED;}; +const QString & RepoModel::bothChangedSt(){return BOTHCHANGED;} /// @return string to define the downloading state -const QString & RepoModel::downloadSt(){return DOWNLOADST;}; +const QString & RepoModel::downloadSt(){return DOWNLOADST;} /// @return string to define the uploading state -const QString & RepoModel::uploadSt(){return UPLOADST;}; +const QString & RepoModel::uploadSt(){return UPLOADST;} diff --git a/Code/Mantid/MantidQt/API/src/ScriptRepositoryView.cpp b/Code/Mantid/MantidQt/API/src/ScriptRepositoryView.cpp index 96cd7bcd4f4b..5f76e642dc0e 100644 --- a/Code/Mantid/MantidQt/API/src/ScriptRepositoryView.cpp +++ b/Code/Mantid/MantidQt/API/src/ScriptRepositoryView.cpp @@ -377,7 +377,7 @@ bool ScriptRepositoryView::RepoDelegate::editorEvent(QEvent *event, QSize ScriptRepositoryView::RepoDelegate::sizeHint(const QStyleOptionViewItem & /*option*/, const QModelIndex & /*index*/ ) const{ return QSize(35,35); -} ; +} ////////////////////////////////////////////////// diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp index 1cad4d1c3eed..e16e6621686d 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp +++ b/Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp @@ -14,7 +14,7 @@ namespace MantidQt { namespace CustomDialogs { - DECLARE_DIALOG(CatalogPublishDialog); + DECLARE_DIALOG(CatalogPublishDialog) /** * Default constructor. diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp index 96b80b7c1a10..314e3b9d9e81 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp +++ b/Code/Mantid/MantidQt/CustomDialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp @@ -22,7 +22,7 @@ namespace MantidQt namespace CustomDialogs { // Declare the dialog. Name must match the class name - DECLARE_DIALOG(ConvertTableToMatrixWorkspaceDialog); + DECLARE_DIALOG(ConvertTableToMatrixWorkspaceDialog) //-------------------------------------------------------------------------- // Public methods diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/CreateSampleShapeDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/CreateSampleShapeDialog.cpp index c0345f3727b1..02aa58ba0026 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/src/CreateSampleShapeDialog.cpp +++ b/Code/Mantid/MantidQt/CustomDialogs/src/CreateSampleShapeDialog.cpp @@ -24,7 +24,7 @@ namespace MantidQt { namespace CustomDialogs { - DECLARE_DIALOG(CreateSampleShapeDialog); + DECLARE_DIALOG(CreateSampleShapeDialog) } } diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/FitDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/FitDialog.cpp index 7b4217a2dc42..d39863b1b776 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/src/FitDialog.cpp +++ b/Code/Mantid/MantidQt/CustomDialogs/src/FitDialog.cpp @@ -31,7 +31,7 @@ namespace CustomDialogs { // Declare the dialog. Name must match the class name -DECLARE_DIALOG(FitDialog); +DECLARE_DIALOG(FitDialog) //------------------------------------------------------ // InputWorkspaceWidget methods diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/LOQScriptInputDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/LOQScriptInputDialog.cpp index 5fdda1e5b182..15280c6c137d 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/src/LOQScriptInputDialog.cpp +++ b/Code/Mantid/MantidQt/CustomDialogs/src/LOQScriptInputDialog.cpp @@ -13,7 +13,7 @@ namespace MantidQt { namespace CustomDialogs { - DECLARE_DIALOG(LOQScriptInputDialog); + DECLARE_DIALOG(LOQScriptInputDialog) } } diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp index 2f88ee8c8972..7c4f993de8de 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp +++ b/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp @@ -41,7 +41,7 @@ namespace MantidQt } // Declare the dialog. Name must match the class name - DECLARE_DIALOG(LoadDialog); + DECLARE_DIALOG(LoadDialog) //-------------------------------------------------------------------------- // Public methods diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/LoadInstrumentDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/LoadInstrumentDialog.cpp index 37192b4c2999..5716406111d9 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/src/LoadInstrumentDialog.cpp +++ b/Code/Mantid/MantidQt/CustomDialogs/src/LoadInstrumentDialog.cpp @@ -11,7 +11,7 @@ namespace MantidQt { namespace CustomDialogs { - DECLARE_DIALOG(LoadInstrumentDialog); + DECLARE_DIALOG(LoadInstrumentDialog) /** Constructor diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/SortTableWorkspaceDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/SortTableWorkspaceDialog.cpp index 5b2a0dc90887..7a81d7a310dc 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/src/SortTableWorkspaceDialog.cpp +++ b/Code/Mantid/MantidQt/CustomDialogs/src/SortTableWorkspaceDialog.cpp @@ -15,7 +15,7 @@ namespace CustomDialogs { // Declare the dialog. Name must match the class name -DECLARE_DIALOG(SortTableWorkspaceDialog); +DECLARE_DIALOG(SortTableWorkspaceDialog) /// Default constructor diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp index 65330a4d7d5f..0450d6bd8eaf 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp +++ b/Code/Mantid/MantidQt/CustomDialogs/src/StartLiveDataDialog.cpp @@ -64,7 +64,7 @@ namespace MantidQt { namespace CustomDialogs { - DECLARE_DIALOG(StartLiveDataDialog); + DECLARE_DIALOG(StartLiveDataDialog) //---------------------- // Public member functions diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/DataComparison.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/DataComparison.cpp index ef9f33f7c4f1..240476a99036 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/DataComparison.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/DataComparison.cpp @@ -17,7 +17,7 @@ namespace MantidQt { namespace CustomInterfaces { - DECLARE_SUBWINDOW(DataComparison); + DECLARE_SUBWINDOW(DataComparison) } } diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp index 2220d18b31e6..bbb7e3d71242 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp @@ -21,7 +21,7 @@ namespace MantidQt { namespace CustomInterfaces { - DECLARE_SUBWINDOW(DirectConvertToEnergy); + DECLARE_SUBWINDOW(DirectConvertToEnergy) } } diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectBayes.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectBayes.cpp index b1c8f32029d5..5b804a41d513 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectBayes.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectBayes.cpp @@ -14,7 +14,7 @@ namespace MantidQt { namespace CustomInterfaces { - DECLARE_SUBWINDOW(IndirectBayes); + DECLARE_SUBWINDOW(IndirectBayes) } } diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataAnalysis.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataAnalysis.cpp index fccc4b5d9b65..c4e6b7053193 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataAnalysis.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataAnalysis.cpp @@ -27,7 +27,7 @@ namespace CustomInterfaces namespace IDA { // Add this class to the list of specialised dialogs in this namespace - DECLARE_SUBWINDOW(IndirectDataAnalysis); + DECLARE_SUBWINDOW(IndirectDataAnalysis) /** * Constructor. diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataReduction.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataReduction.cpp index f167fa71ea6e..3bc7f982fb87 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataReduction.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDataReduction.cpp @@ -29,7 +29,7 @@ namespace MantidQt { namespace CustomInterfaces { - DECLARE_SUBWINDOW(IndirectDataReduction); + DECLARE_SUBWINDOW(IndirectDataReduction) } } diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDiffractionReduction.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDiffractionReduction.cpp index ec4de290209d..9516a1d50162 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDiffractionReduction.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDiffractionReduction.cpp @@ -33,7 +33,7 @@ namespace // anon } } // anon namespace -DECLARE_SUBWINDOW(IndirectDiffractionReduction); +DECLARE_SUBWINDOW(IndirectDiffractionReduction) using namespace Mantid::API; using namespace MantidQt::CustomInterfaces; diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectSimulation.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectSimulation.cpp index d0e38f7b34a0..79454dfac030 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectSimulation.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectSimulation.cpp @@ -14,7 +14,7 @@ namespace MantidQt { namespace CustomInterfaces { - DECLARE_SUBWINDOW(IndirectSimulation); + DECLARE_SUBWINDOW(IndirectSimulation) } } diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectTools.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectTools.cpp index f1f20f03fe2e..12d5730862cb 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectTools.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectTools.cpp @@ -13,7 +13,7 @@ namespace MantidQt { namespace CustomInterfaces { - DECLARE_SUBWINDOW(IndirectTools); + DECLARE_SUBWINDOW(IndirectTools) } } diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp index 12e730113c93..39964eda49a6 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MantidEV.cpp @@ -16,7 +16,7 @@ namespace CustomInterfaces { //Register the class with the factory -DECLARE_SUBWINDOW(MantidEV); +DECLARE_SUBWINDOW(MantidEV) using namespace Mantid::Kernel; using namespace Mantid::API; diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MultiDatasetFit.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MultiDatasetFit.cpp index d2f78f8aea27..096dd495cc22 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/MultiDatasetFit.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MultiDatasetFit.cpp @@ -701,7 +701,7 @@ void EditLocalParameterDialog::valueChanged(int row, int col) /*==========================================================================================*/ //Register the class with the factory -DECLARE_SUBWINDOW(MultiDatasetFit); +DECLARE_SUBWINDOW(MultiDatasetFit) /** * Constructor diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCInterface.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCInterface.cpp index cfcce6e7aaef..4de693e73db6 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCInterface.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCInterface.cpp @@ -15,7 +15,7 @@ namespace MantidQt { namespace CustomInterfaces { - DECLARE_SUBWINDOW(ALCInterface); + DECLARE_SUBWINDOW(ALCInterface) const QStringList ALCInterface::STEP_NAMES = QStringList() << "Data loading" << "Baseline modelling" << "Peak fitting"; diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp index 22c2f7fd75ae..9e408a5109f3 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp @@ -63,7 +63,7 @@ namespace MantidQt { namespace CustomInterfaces { - DECLARE_SUBWINDOW(MuonAnalysis); + DECLARE_SUBWINDOW(MuonAnalysis) using namespace Mantid::API; using namespace Mantid::Kernel; diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp index 7882684398a5..11776a19d352 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp @@ -14,7 +14,7 @@ namespace MantidQt { using namespace Mantid::API; - DECLARE_SUBWINDOW(QtReflMainView); + DECLARE_SUBWINDOW(QtReflMainView) //---------------------------------------------------------------------------------------------- /** Constructor diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp index 1767acd57efd..c1be652ce189 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp @@ -59,7 +59,7 @@ namespace MantidQt { namespace CustomInterfaces { - DECLARE_SUBWINDOW(SANSRunWindow); + DECLARE_SUBWINDOW(SANSRunWindow) using namespace MantidQt::MantidWidgets; diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/SampleTransmission.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/SampleTransmission.cpp index c44be8a5c1cd..6a95f432c7da 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/SampleTransmission.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/SampleTransmission.cpp @@ -19,7 +19,7 @@ namespace MantidQt { namespace CustomInterfaces { - DECLARE_SUBWINDOW(SampleTransmission); + DECLARE_SUBWINDOW(SampleTransmission) } } diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp index 1281594d11f4..9b5df3cf3c27 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/StepScan.cpp @@ -21,7 +21,7 @@ namespace CustomInterfaces { //Register the class with the factory -DECLARE_SUBWINDOW(StepScan); +DECLARE_SUBWINDOW(StepScan) using namespace Mantid::Kernel; using namespace Mantid::API; diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/SlicingAlgorithmDialog.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/SlicingAlgorithmDialog.cpp index e6d8d87c6c1c..61a4e257246b 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/src/SlicingAlgorithmDialog.cpp +++ b/Code/Mantid/MantidQt/MantidWidgets/src/SlicingAlgorithmDialog.cpp @@ -16,8 +16,8 @@ namespace MantidQt { namespace MantidWidgets { - DECLARE_DIALOG(SliceMDDialog); - DECLARE_DIALOG(BinMDDialog); + DECLARE_DIALOG(SliceMDDialog) + DECLARE_DIALOG(BinMDDialog) /** Constructor diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/vtkPeaksFilter.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/vtkPeaksFilter.cxx index fdf20fa28303..27c35049f11b 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/vtkPeaksFilter.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/vtkPeaksFilter.cxx @@ -17,7 +17,7 @@ #include #include -vtkStandardNewMacro(vtkPeaksFilter); +vtkStandardNewMacro(vtkPeaksFilter) using namespace Mantid::VATES; diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.cxx index a9eef434d14e..e9b15021d609 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.cxx @@ -11,7 +11,7 @@ #include #include -vtkStandardNewMacro(vtkScaleWorkspace); +vtkStandardNewMacro(vtkScaleWorkspace) using namespace Mantid::VATES; diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/vtkSplatterPlot.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/vtkSplatterPlot.cxx index b2266585c532..7a60a3852bef 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/vtkSplatterPlot.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/vtkSplatterPlot.cxx @@ -20,7 +20,7 @@ using namespace Mantid::API; using namespace Mantid::VATES; -vtkStandardNewMacro(vtkSplatterPlot); +vtkStandardNewMacro(vtkSplatterPlot) /// Constructor vtkSplatterPlot::vtkSplatterPlot() : m_numberPoints(0), m_topPercentile(0.0), diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/vtkEventNexusReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/vtkEventNexusReader.cxx index db709eb1240a..6edd4d02dad2 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/vtkEventNexusReader.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/vtkEventNexusReader.cxx @@ -18,7 +18,7 @@ #include "MantidVatesAPI/FilteringUpdateProgressAction.h" #include "MantidVatesAPI/MDLoadingViewAdapter.h" -vtkStandardNewMacro(vtkEventNexusReader); +vtkStandardNewMacro(vtkEventNexusReader) using namespace Mantid::VATES; using Mantid::Geometry::IMDDimension_sptr; diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/vtkMDEWNexusReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/vtkMDEWNexusReader.cxx index 6cd9ab74d996..880b277761c1 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/vtkMDEWNexusReader.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/vtkMDEWNexusReader.cxx @@ -21,7 +21,7 @@ #include -vtkStandardNewMacro(vtkMDEWNexusReader); +vtkStandardNewMacro(vtkMDEWNexusReader) using namespace Mantid::VATES; using Mantid::Geometry::IMDDimension_sptr; diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx index 95f90f535cc8..834965eb2c5c 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx @@ -19,7 +19,7 @@ #include "MantidVatesAPI/FilteringUpdateProgressAction.h" #include "MantidVatesAPI/MDLoadingViewAdapter.h" -vtkStandardNewMacro(vtkMDHWNexusReader); +vtkStandardNewMacro(vtkMDHWNexusReader) using namespace Mantid::VATES; using Mantid::Geometry::IMDDimension_sptr; diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/vtkNexusPeaksReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/vtkNexusPeaksReader.cxx index d04f458bb6ed..7e228505d086 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/vtkNexusPeaksReader.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/vtkNexusPeaksReader.cxx @@ -23,7 +23,7 @@ #include #include -vtkStandardNewMacro(vtkNexusPeaksReader); +vtkStandardNewMacro(vtkNexusPeaksReader) using namespace Mantid::VATES; using Mantid::Geometry::IMDDimension_sptr; diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/vtkPeaksReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/vtkPeaksReader.cxx index a63fce33d42a..70a227c7af43 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/vtkPeaksReader.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/vtkPeaksReader.cxx @@ -22,7 +22,7 @@ #include -vtkStandardNewMacro(vtkPeaksReader); +vtkStandardNewMacro(vtkPeaksReader) using namespace Mantid::VATES; using Mantid::Geometry::IMDDimension_sptr; diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/vtkSQWEventReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/vtkSQWEventReader.cxx index d964c50c2d61..ef61e72c3cc6 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/vtkSQWEventReader.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/vtkSQWEventReader.cxx @@ -19,7 +19,7 @@ #include "MantidVatesAPI/FilteringUpdateProgressAction.h" #include "MantidVatesAPI/MDLoadingViewAdapter.h" -vtkStandardNewMacro(vtkSQWEventReader); +vtkStandardNewMacro(vtkSQWEventReader) using namespace Mantid::VATES; using Mantid::Geometry::IMDDimension_sptr; diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.cxx index 12fc54a626e1..196dd73e69c8 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.cxx @@ -19,7 +19,7 @@ using namespace Mantid::VATES; -vtkStandardNewMacro(vtkMDEWSource); +vtkStandardNewMacro(vtkMDEWSource) /// Constructor vtkMDEWSource::vtkMDEWSource() : m_wsName(""), m_depth(1000), m_time(0), m_presenter(NULL), m_isStartup(true), m_startupTimeValue(0) diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx index 26ed4e7eba59..e2757e29cacb 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx @@ -19,7 +19,7 @@ using namespace Mantid::VATES; -vtkStandardNewMacro(vtkMDHWSource); +vtkStandardNewMacro(vtkMDHWSource) /// Constructor vtkMDHWSource::vtkMDHWSource() : m_wsName(""), m_time(0), m_presenter(NULL) diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.cxx index 6709e928e1f7..e3ff1ab962be 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/vtkPeaksSource.cxx @@ -16,7 +16,7 @@ #include "MantidAPI/AnalysisDataService.h" -vtkStandardNewMacro(vtkPeaksSource); +vtkStandardNewMacro(vtkPeaksSource) using namespace Mantid::VATES; using Mantid::Geometry::IMDDimension_sptr; diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/vtkSinglePeakMarkerSource.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/vtkSinglePeakMarkerSource.cxx index e8da4f13ecdc..d607310440f8 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/vtkSinglePeakMarkerSource.cxx +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/vtkSinglePeakMarkerSource.cxx @@ -6,7 +6,7 @@ #include "MantidVatesAPI/vtkSinglePeakMarker.h" -vtkStandardNewMacro(vtkSinglePeakMarkerSource); +vtkStandardNewMacro(vtkSinglePeakMarkerSource) using namespace Mantid::VATES; diff --git a/Code/Mantid/Vates/VatesAPI/src/LoadVTK.cpp b/Code/Mantid/Vates/VatesAPI/src/LoadVTK.cpp index 29c450db97fe..4bc43553b977 100644 --- a/Code/Mantid/Vates/VatesAPI/src/LoadVTK.cpp +++ b/Code/Mantid/Vates/VatesAPI/src/LoadVTK.cpp @@ -66,7 +66,7 @@ namespace Mantid { namespace VATES { - DECLARE_FILELOADER_ALGORITHM(LoadVTK); + DECLARE_FILELOADER_ALGORITHM(LoadVTK) /** * Return the confidence with with this algorithm can load the file diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/AutoScaleRangeGenerator.cpp b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/AutoScaleRangeGenerator.cpp index b82e74ce8f4d..8bb04709ace7 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/AutoScaleRangeGenerator.cpp +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/AutoScaleRangeGenerator.cpp @@ -39,7 +39,7 @@ namespace SimpleGui { //Set the initial log scale state due to the mode m_mdSettings.setLastSessionLogScale(getLogScale()); - }; + } /** * Gets the log scale for the mode diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/BackgroundRgbProvider.cpp b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/BackgroundRgbProvider.cpp index 7cba3778ed2e..59b0757a0176 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/BackgroundRgbProvider.cpp +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/src/BackgroundRgbProvider.cpp @@ -29,13 +29,13 @@ namespace Mantid BackgroundRgbProvider::BackgroundRgbProvider() { - }; + } BackgroundRgbProvider::~BackgroundRgbProvider() { // Need to record the background color update(); - }; + } std::vector BackgroundRgbProvider::getRgb(bool viewSwitched) { From 6ed38238d02e0d5208a99cd41cbe5a1ca1a5282e Mon Sep 17 00:00:00 2001 From: Martyn Gigg Date: Thu, 19 Mar 2015 11:42:13 +0000 Subject: [PATCH 039/126] Option to ignore directories in FileFinder Added tests to cover the behaviour. Refs #11395 --- .../Framework/API/inc/MantidAPI/FileFinder.h | 2 +- Code/Mantid/Framework/API/src/FileFinder.cpp | 13 ++++++- .../Framework/API/test/FileFinderTest.h | 38 ++++++++++++++++++- 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/FileFinder.h b/Code/Mantid/Framework/API/inc/MantidAPI/FileFinder.h index 410ef30b7541..a970c7300834 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/FileFinder.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/FileFinder.h @@ -50,7 +50,7 @@ Code Documentation is available at: */ class MANTID_API_DLL FileFinderImpl { public: - std::string getFullPath(const std::string &filename) const; + std::string getFullPath(const std::string &filename, const bool ignoreDirs = false) const; std::string getPath(const std::vector &archs, const std::set &filename, const std::vector &extensions) const; diff --git a/Code/Mantid/Framework/API/src/FileFinder.cpp b/Code/Mantid/Framework/API/src/FileFinder.cpp index 3c07e3517894..cdf24e803544 100644 --- a/Code/Mantid/Framework/API/src/FileFinder.cpp +++ b/Code/Mantid/Framework/API/src/FileFinder.cpp @@ -101,11 +101,12 @@ bool FileFinderImpl::getCaseSensitive() const { /** * Return the full path to the file given its name * @param filename :: A file name (without path) including extension + * @param ignoreDirs :: If true, directories that match are skipped unless the path given is already absolute * @return The full path if the file exists and can be found in one of the * search locations * or an empty string otherwise. */ -std::string FileFinderImpl::getFullPath(const std::string &filename) const { +std::string FileFinderImpl::getFullPath(const std::string &filename, const bool ignoreDirs) const { std::string fName = Kernel::Strings::strip(filename); g_log.debug() << "getFullPath(" << fName << ")\n"; // If this is already a full path, nothing to do @@ -116,7 +117,7 @@ std::string FileFinderImpl::getFullPath(const std::string &filename) const { // circumstances with extensions that have wild cards try { Poco::File fullPath(Poco::Path().resolve(fName)); - if (fullPath.exists()) + if (fullPath.exists() && (!ignoreDirs || !fullPath.isDirectory())) return fullPath.path(); } catch (std::exception &) { } @@ -137,12 +138,20 @@ std::string FileFinderImpl::getFullPath(const std::string &filename) const { std::set files; Kernel::Glob::glob(pathPattern, files, m_globOption); if (!files.empty()) { + Poco::File matchPath(*files.begin()); + if(ignoreDirs && matchPath.isDirectory()) { + continue; + } return *files.begin(); + } #ifdef _WIN32 } else { Poco::Path path(*it, fName); Poco::File file(path); + if(ignoreDirs && file.isDirectory()) { + continue; + } if (file.exists()) { return path.toString(); } diff --git a/Code/Mantid/Framework/API/test/FileFinderTest.h b/Code/Mantid/Framework/API/test/FileFinderTest.h index 728a394221e0..927b0d4c8efa 100644 --- a/Code/Mantid/Framework/API/test/FileFinderTest.h +++ b/Code/Mantid/Framework/API/test/FileFinderTest.h @@ -105,12 +105,48 @@ class FileFinderTest: public CxxTest::TestSuite m_facFile.remove(); } - void testGetFullPath() + void testGetFullPathWithFilename() { std::string path = FileFinder::Instance().getFullPath("CSP78173.raw"); TS_ASSERT(!path.empty()); } + void testGetFullPathWithDirectoryFindsDirectoryPath() + { + // Use the Schema directory under instrument + std::string path = FileFinder::Instance().getFullPath("Schema"); + TS_ASSERT(!path.empty()); + + // Code has separate path for path relative to working directory so check that too + std::string tempTestName("__FileFinderTestTempTestDir__"); + Poco::File tempTestDir(Poco::Path().resolve(tempTestName)); + tempTestDir.createDirectory(); + + path = FileFinder::Instance().getFullPath(tempTestName); + TS_ASSERT(!path.empty()); + + tempTestDir.remove(); + + } + + void testGetFullPathSkipsDirectoriesOnRequest() + { + // Use the Schema directory under instrument + const bool ignoreDirs(true); + std::string path = FileFinder::Instance().getFullPath("Schema", ignoreDirs); + TSM_ASSERT("Expected an empty path when looking for a directory, instead I found " + path, path.empty()); + + // Code has separate path for path relative to working directory so check that too + std::string tempTestName("__FileFinderTestTempTestDir__"); + Poco::File tempTestDir(Poco::Path().resolve(tempTestName)); + tempTestDir.createDirectory(); + + path = FileFinder::Instance().getFullPath(tempTestName, ignoreDirs); + TSM_ASSERT("Expected an empty path when looking for a directory relative to current, instead I found " + path, path.empty()); + + tempTestDir.remove(); + } + void testMakeFileNameForISIS() { // Set the facility From cd2f4449df7d695d60d729e5a7c13c6a772f36c8 Mon Sep 17 00:00:00 2001 From: Martyn Gigg Date: Thu, 19 Mar 2015 11:42:40 +0000 Subject: [PATCH 040/126] Only search for files in LoadMask. Refs #11395 --- Code/Mantid/Framework/DataHandling/src/LoadMask.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Mantid/Framework/DataHandling/src/LoadMask.cpp b/Code/Mantid/Framework/DataHandling/src/LoadMask.cpp index 18b3017942cc..732ae455b6e9 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadMask.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadMask.cpp @@ -833,8 +833,9 @@ void LoadMask::parseISISStringToVector(string ins, /** Initialize the Mask Workspace with instrument */ void LoadMask::intializeMaskWorkspace() { + const bool ignoreDirs(true); const std::string idfPath = - API::FileFinder::Instance().getFullPath(m_instrumentPropValue); + API::FileFinder::Instance().getFullPath(m_instrumentPropValue, ignoreDirs); MatrixWorkspace_sptr tempWs(new DataObjects::Workspace2D()); From 5c6cfc41877e59808bc9d23efca575db894cbc0e Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Thu, 19 Mar 2015 14:09:19 +0000 Subject: [PATCH 041/126] Re #11397 Mask workspace become lost when sctipt has been stopped in the middle of the calculations and started again. It is not to fail on printing diagnostics results. --- .../scripts/Inelastic/Direct/DirectEnergyConversion.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py b/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py index 8d841b685955..9f2c4b485ba1 100644 --- a/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py +++ b/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py @@ -1526,6 +1526,11 @@ def get_failed_spectra_list_from_masks(masked_wksp): failed_spectra = [] if masked_wksp is None: return (failed_spectra,0) + try: + name = masked_wksp.name() + except Exeption as ex: + + return (failed_spectra,0) masking_wksp,sp_list = ExtractMask(masked_wksp) DeleteWorkspace(masking_wksp) From eb6b2f465c9fc7c531afbd0b9ff4977f9c6b7788 Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Thu, 19 Mar 2015 14:13:33 +0000 Subject: [PATCH 042/126] Re #11397 Custom file name function does not work in multirep mode Surprisingly it has been working before. --- Code/Mantid/scripts/Inelastic/Direct/PropertiesDescriptors.py | 2 +- Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/scripts/Inelastic/Direct/PropertiesDescriptors.py b/Code/Mantid/scripts/Inelastic/Direct/PropertiesDescriptors.py index 6087fdad365d..fbf3397571c7 100644 --- a/Code/Mantid/scripts/Inelastic/Direct/PropertiesDescriptors.py +++ b/Code/Mantid/scripts/Inelastic/Direct/PropertiesDescriptors.py @@ -316,7 +316,7 @@ def __get__(self,instance,owner=None): if instance is None: return self if not self._custom_print is None: - return self._custom_print(instance,owner) + return self._custom_print() if self._file_name: return self._file_name diff --git a/Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py b/Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py index d3c7ff4af87c..4b0fcc90b92f 100644 --- a/Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py +++ b/Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py @@ -425,7 +425,7 @@ def iliad_wrapper(*args): else: pass # we should set already set up variables using - custom_print_function = host.set_custom_output_filename() + custom_print_function = host.set_custom_output_filename if not custom_print_function is None: PropertyManager.save_file_name.set_custom_print(custom_print_function) # From e32c35b292457b216b357a2f3a9ec61a8c22b4d2 Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Thu, 19 Mar 2015 14:16:50 +0000 Subject: [PATCH 043/126] Re #11397 Stub to allow heterogeneous binning of monitor workspace. (incompleted) --- .../scripts/Inelastic/Direct/RunDescriptor.py | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Code/Mantid/scripts/Inelastic/Direct/RunDescriptor.py b/Code/Mantid/scripts/Inelastic/Direct/RunDescriptor.py index 0612ae94e297..7e567c8e95e7 100644 --- a/Code/Mantid/scripts/Inelastic/Direct/RunDescriptor.py +++ b/Code/Mantid/scripts/Inelastic/Direct/RunDescriptor.py @@ -1023,19 +1023,31 @@ def copy_spectrum2monitors(data_ws,mon_ws,spectraID): # x_param = mon_ws.readX(0) - bins = [x_param[0],x_param[1] - x_param[0],x_param[-1]] + homo_binning,dx_min=RunDescriptor._is_binning_homogeneous(x_param) + bins = [x_param[0],dx_min,x_param[-1]] ExtractSingleSpectrum(InputWorkspace=data_ws,OutputWorkspace='tmp_mon',WorkspaceIndex=ws_index) Rebin(InputWorkspace='tmp_mon',OutputWorkspace='tmp_mon',Params=bins,PreserveEvents='0') - # should be vice versa but Conjoin invalidate ws pointers and hopefully - # nothing could happen with workspace during conjoining - #AddSampleLog(Workspace=monWS,LogName=done_log_name,LogText=str(ws_index),LogType='Number') mon_ws_name = mon_ws.getName() - ConjoinWorkspaces(InputWorkspace1=mon_ws,InputWorkspace2='tmp_mon') + if not homo_binning: + Rebin(InputWorkspace=mon_ws_name,OutputWorkspace=mon_ws_name,Params=bins,PreserveEvents='0') + ConjoinWorkspaces(InputWorkspace1=mon_ws_name,InputWorkspace2='tmp_mon') mon_ws = mtd[mon_ws_name] if 'tmp_mon' in mtd: DeleteWorkspace(WorkspaceName='tmp_mon') return mon_ws + # + @staticmethod + def _is_binning_homogeneous(x_param): + """Verify if binning in monitor workspace is homogeneous""" + dx=x_param[1:]-x_param[0:-1] + dx_min=min(dx) + dx_max=max(dx) + if dx_max-dx_min>1.e-9: + return False,dx_min + else: + return True,dx_min + #-------------------------------------------------------------------------------------------------------------------- def clear_monitors(self): """ method removes monitor workspace form analysis data service if it is there From 2cde6a4b81b782678d839791b5683b6358bb6d2b Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Thu, 19 Mar 2015 15:53:56 +0100 Subject: [PATCH 044/126] Refs #11043. Add tests for PawleyFit --- .../inc/MantidCurveFitting/PawleyFit.h | 10 +- .../Framework/CurveFitting/src/PawleyFit.cpp | 127 +++++---- .../CurveFitting/test/PawleyFitTest.h | 246 +++++++++++++++++- 3 files changed, 319 insertions(+), 64 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h index 45f0d1e82775..4c00d9b1c35c 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFit.h @@ -51,14 +51,16 @@ class DLLExport PawleyFit : public API::Algorithm { const std::string summary() const; const std::string category() const { return "Diffraction"; } - double getTransformedCenter(const Kernel::Unit_sptr &unit, double d) const; - protected: - std::vector hklsFromString(const std::string &hklString) const; + double getTransformedCenter(double d, const Kernel::Unit_sptr &unit) const; + void addHKLsToFunction(PawleyFunction_sptr &pawleyFn, const API::ITableWorkspace_sptr &tableWs, - const Kernel::Unit_sptr &unit) const; + const Kernel::Unit_sptr &unit, double startX, + double endX) const; + Kernel::V3D getHKLFromColumn(size_t i, + const API::Column_const_sptr &hklColumn) const; Kernel::V3D getHkl(const std::string &hklString) const; API::ITableWorkspace_sptr diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index 3deb7b08f575..630a5d63ee50 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -20,26 +20,16 @@ using namespace Geometry; DECLARE_ALGORITHM(PawleyFit); +/// Default constructor PawleyFit::PawleyFit() : Algorithm(), m_dUnit() {} +/// Returns the summary const std::string PawleyFit::summary() const { return "This algorithm performs a Pawley-fit on the supplied workspace."; } -std::vector PawleyFit::hklsFromString(const std::string &hklString) const { - std::vector hklStrings; - boost::split(hklStrings, hklString, boost::is_any_of(";")); - - std::vector hkls(hklStrings.size()); - for (size_t i = 0; i < hkls.size(); ++i) { - std::istringstream strm(hklStrings[i]); - strm >> hkls[i]; - } - - return hkls; -} - -double PawleyFit::getTransformedCenter(const Unit_sptr &unit, double d) const { +/// Transforms the specified value from d-spacing to the supplied unit. +double PawleyFit::getTransformedCenter(double d, const Unit_sptr &unit) const { if (boost::dynamic_pointer_cast(unit) || boost::dynamic_pointer_cast(unit)) { return d; @@ -49,9 +39,32 @@ double PawleyFit::getTransformedCenter(const Unit_sptr &unit, double d) const { 0); } +/** + * Add HKLs from a TableWorkspace to the PawleyFunction. + * + * This method tries to extract reflections from the specified TableWorkspace. + * For the extraction to work properly it needs to have columns with the + * following labels: + * HKL, d, Intensity, FWHM (rel.) + * + * The latter three must be convertible to double, otherwise the there will be + * no peaks in the function. The value of d is converted to the unit of the + * workspace to obtain an absolute FWHM-value, since FWHM (rel.) is defined + * as FWHM / center. + * + * The HKLs can either be a column of V3D or a string column that contains 3 + * numbers separated by space, comma, semi-colon, or [ ] + * + * @param pawleyFn :: PawleyFunction which the HKLs should be added to. + * @param tableWs :: TableWorkspace that contains the reflection information. + * @param unit :: Unit of the workspace. + * @param startX :: Lowest allowed x-value for reflection position. + * @param endX :: Highest allowed x-value for reflection position. + */ void PawleyFit::addHKLsToFunction(PawleyFunction_sptr &pawleyFn, const ITableWorkspace_sptr &tableWs, - const Unit_sptr &unit) const { + const Unit_sptr &unit, double startX, + double endX) const { if (!tableWs || !pawleyFn) { throw std::invalid_argument("Can only process non-null function & table."); } @@ -66,16 +79,18 @@ void PawleyFit::addHKLsToFunction(PawleyFunction_sptr &pawleyFn, for (size_t i = 0; i < tableWs->rowCount(); ++i) { try { - V3D hkl = getHkl(hklColumn->cell(i)); + V3D hkl = getHKLFromColumn(i, hklColumn); double d = (*dColumn)[i]; - double center = getTransformedCenter(unit, d); + double center = getTransformedCenter(d, unit); double fwhm = (*fwhmColumn)[i] * center; double height = (*intensityColumn)[i]; - pawleyFn->addPeak(hkl, fwhm, height); + if (center > startX && center < endX) { + pawleyFn->addPeak(hkl, fwhm, height); + } } - catch (...) { + catch (std::bad_alloc) { // do nothing. } } @@ -87,9 +102,23 @@ void PawleyFit::addHKLsToFunction(PawleyFunction_sptr &pawleyFn, } } +/// Tries to extract Miller indices as V3D from column. +V3D PawleyFit::getHKLFromColumn(size_t i, + const Column_const_sptr &hklColumn) const { + if (hklColumn->type() == "V3D") { + return hklColumn->cell(i); + } + + return getHkl(hklColumn->cell(i)); +} + +/// Try to extract a V3D from the given string with different separators. V3D PawleyFit::getHkl(const std::string &hklString) const { + auto delimiters = boost::is_any_of(" ,[];"); + + std::string workingCopy = boost::trim_copy_if(hklString, delimiters); std::vector indicesStr; - boost::split(indicesStr, hklString, boost::is_any_of(" ")); + boost::split(indicesStr, workingCopy, delimiters); if (indicesStr.size() != 3) { throw std::invalid_argument("Input string cannot be parsed as HKL."); @@ -103,6 +132,8 @@ V3D PawleyFit::getHkl(const std::string &hklString) const { return hkl; } +/// Creates a table containing the cell parameters stored in the supplied +/// function. ITableWorkspace_sptr PawleyFit::getLatticeFromFunction(const PawleyFunction_sptr &pawleyFn) const { if (!pawleyFn) { @@ -129,6 +160,7 @@ PawleyFit::getLatticeFromFunction(const PawleyFunction_sptr &pawleyFn) const { return latticeParameterTable; } +/// Extracts all profile parameters from the supplied function. ITableWorkspace_sptr PawleyFit::getPeakParametersFromFunction( const PawleyFunction_sptr &pawleyFn) const { if (!pawleyFn) { @@ -162,6 +194,8 @@ ITableWorkspace_sptr PawleyFit::getPeakParametersFromFunction( return peakParameterTable; } +/// Returns a composite function consisting of the Pawley function and Chebyshev +/// background if enabled in the algorithm. IFunction_sptr PawleyFit::getCompositeFunction(const PawleyFunction_sptr &pawleyFn) const { CompositeFunction_sptr composite = boost::make_shared(); @@ -180,6 +214,7 @@ PawleyFit::getCompositeFunction(const PawleyFunction_sptr &pawleyFn) const { return composite; } +/// Initialization of properties. void PawleyFit::init() { declareProperty(new WorkspaceProperty("InputWorkspace", "", Direction::Input), @@ -189,8 +224,8 @@ void PawleyFit::init() { declareProperty("WorkspaceIndex", 0, "Spectrum on which the fit should be performed."); - declareProperty("StartX", 0, "Lower border of fitted data range."); - declareProperty("EndX", 0, "Upper border of fitted data range."); + declareProperty("StartX", 0.0, "Lower border of fitted data range."); + declareProperty("EndX", 0.0, "Upper border of fitted data range."); std::vector crystalSystems; crystalSystems.push_back("Cubic"); @@ -212,13 +247,8 @@ void PawleyFit::init() { "Specification of initial unit cell, given as 'a, b, c, " "alpha, beta, gamma'."); - declareProperty("MillerIndices", "[1,0,0];[1,1,0]", - "Semi-colon separated list of Miller indices given in the " - "format '[h,k,l]'."); - declareProperty( - new WorkspaceProperty("PeakTable", "", Direction::Input, - PropertyMode::Optional), + new WorkspaceProperty("PeakTable", "", Direction::Input), "Table with peak information. Can be used instead of " "supplying a list of indices for better starting parameters."); @@ -258,6 +288,7 @@ void PawleyFit::init() { m_dUnit = UnitFactory::Instance().create("dSpacing"); } +/// Execution of algorithm. void PawleyFit::exec() { // Setup PawleyFunction with cell from input parameters PawleyFunction_sptr pawleyFn = boost::dynamic_pointer_cast( @@ -271,29 +302,6 @@ void PawleyFit::exec() { MatrixWorkspace_const_sptr ws = getProperty("InputWorkspace"); int wsIndex = getProperty("WorkspaceIndex"); - // and also the peak table, if there is one - Property *peakTableProperty = getPointerToProperty("PeakTable"); - if (!peakTableProperty->isDefault()) { - ITableWorkspace_sptr peakTable = getProperty("PeakTable"); - - Axis *xAxis = ws->getAxis(0); - Unit_sptr xUnit = xAxis->unit(); - - addHKLsToFunction(pawleyFn, peakTable, xUnit); - } else { - std::vector hkls = hklsFromString(getProperty("MillerIndices")); - - const MantidVec &data = ws->readY(static_cast(wsIndex)); - pawleyFn->setPeaks(hkls, 0.005, - *(std::max_element(data.begin(), data.end()))); - } - - // Determine if zero-shift should be refined - bool refineZeroShift = getProperty("RefineZeroShift"); - if (!refineZeroShift) { - pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift")); - } - // Get x-range start and end values, depending on user input const MantidVec &xData = ws->readX(static_cast(wsIndex)); double startX = xData.front(); @@ -308,7 +316,19 @@ void PawleyFit::exec() { Property *endXProperty = getPointerToProperty("EndX"); if (!endXProperty->isDefault()) { double endXInput = getProperty("EndX"); - endX = std::max(endX, endXInput); + endX = std::min(endX, endXInput); + } + + // Get HKLs from TableWorkspace + ITableWorkspace_sptr peakTable = getProperty("PeakTable"); + Axis *xAxis = ws->getAxis(0); + Unit_sptr xUnit = xAxis->unit(); + addHKLsToFunction(pawleyFn, peakTable, xUnit, startX, endX); + + // Determine if zero-shift should be refined + bool refineZeroShift = getProperty("RefineZeroShift"); + if (!refineZeroShift) { + pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift")); } pawleyFn->setMatrixWorkspace(ws, static_cast(wsIndex), startX, endX); @@ -318,8 +338,11 @@ void PawleyFit::exec() { fit->setProperty("Function", getCompositeFunction(pawleyFn)); fit->setProperty("InputWorkspace", boost::const_pointer_cast(ws)); + fit->setProperty("StartX", startX); + fit->setProperty("EndX", endX); fit->setProperty("WorkspaceIndex", wsIndex); fit->setProperty("CreateOutput", true); + fit->execute(); // Create output diff --git a/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h b/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h index 0d1049578f03..85674d0d3704 100644 --- a/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h @@ -4,26 +4,256 @@ #include #include "MantidCurveFitting/PawleyFit.h" +#include "MantidAPI/AlgorithmManager.h" +#include "MantidAPI/FunctionFactory.h" +#include "MantidAPI/TableRow.h" +#include "MantidAPI/WorkspaceFactory.h" +#include "MantidKernel/V3D.h" +#include "MantidTestHelpers/WorkspaceCreationHelper.h" using Mantid::CurveFitting::PawleyFit; using namespace Mantid::API; +using namespace Mantid::Kernel; -class PawleyFitTest : public CxxTest::TestSuite -{ +class PawleyFitTest : public CxxTest::TestSuite { public: // This pair of boilerplate methods prevent the suite being created statically // This means the constructor isn't called when running other tests static PawleyFitTest *createSuite() { return new PawleyFitTest(); } - static void destroySuite( PawleyFitTest *suite ) { delete suite; } + static void destroySuite(PawleyFitTest *suite) { delete suite; } + void testGetHKL() { + TestablePawleyFit pfit; - void test_Something() - { - TSM_ASSERT( "You forgot to write a test!", 0); + V3D referenceHKL(1, 2, 3); + + TS_ASSERT_EQUALS(pfit.getHkl("1 2 3"), referenceHKL); + TS_ASSERT_EQUALS(pfit.getHkl(" 1 2 3 "), referenceHKL); + TS_ASSERT_EQUALS(pfit.getHkl("1 2 3"), referenceHKL); + TS_ASSERT_EQUALS(pfit.getHkl("1,2,3"), referenceHKL); + TS_ASSERT_EQUALS(pfit.getHkl("1;2;3"), referenceHKL); + TS_ASSERT_EQUALS(pfit.getHkl("[1,2,3]"), referenceHKL); + TS_ASSERT_EQUALS(pfit.getHkl("[1;2 3]"), referenceHKL); } + void testFitHexagonalCellQ() { + /* Like in the PawleyFunctionTest, some reflections are needed. + * In this case, 5 reflections that belong to a hexagonal cell + * are used and stored in a TableWorkspace that has a suitable + * format for PawleyFit. The unit of the workspace is MomentumTransfer. + */ -}; + ITableWorkspace_sptr hkls = getHCPTable(); + MatrixWorkspace_sptr ws = + getWorkspace(getFunctionString(hkls, true), (2.0 * M_PI) / 2.1, + (2.0 * M_PI) / 1.0, 1000, "MomentumTransfer"); + + IAlgorithm_sptr pFit = AlgorithmManager::Instance().create("PawleyFit"); + pFit->setProperty("InputWorkspace", ws); + pFit->setProperty("WorkspaceIndex", 0); + pFit->setProperty("CrystalSystem", "Hexagonal"); + pFit->setProperty("InitialCell", "2.444 2.441 3.937 90 90 120"); + pFit->setProperty("PeakTable", hkls); + pFit->setProperty("OutputWorkspace", "HCP_output"); + pFit->setProperty("RefinedPeakParameterTable", "HCP_peaks"); + pFit->setProperty("RefinedCellTable", "HCP_cell"); + + TS_ASSERT_THROWS_NOTHING(pFit->execute()); + + // Examine table with cell parameters. + ITableWorkspace_sptr cellWs = + AnalysisDataService::Instance().retrieveWS("HCP_cell"); + + // Three rows (a, c, ZeroShift) + TS_ASSERT_EQUALS(cellWs->rowCount(), 3); + + // Error of 'a' should be small + TS_ASSERT_LESS_THAN(fabs(cellWs->cell(0, 2)), 1e-5); + // a should be almost equal to 2.45 + TS_ASSERT_DELTA(cellWs->cell(0, 1), 2.45, 1e-5); + + // Error of 'c' should also be small + TS_ASSERT_LESS_THAN(fabs(cellWs->cell(1, 2)), 1e-6); + // c should be almost equal to 3.93 + TS_ASSERT_DELTA(cellWs->cell(1, 1), 3.93, 1e-6); + + // Check number of peak parameters. + ITableWorkspace_sptr peakWs = + AnalysisDataService::Instance().retrieveWS( + "HCP_peaks"); + TS_ASSERT_EQUALS(peakWs->rowCount(), 5 * 3); // 5 functions with 3 params. + + AnalysisDataService::Instance().remove("HCP_output"); + AnalysisDataService::Instance().remove("HCP_peaks"); + AnalysisDataService::Instance().remove("HCP_cell"); + } + + void testFitOrthorhombicCelld() { + /* In analogy to the above example, an orthorhombic cell is fitted, + * this time in dSpacing and with a FlatBackground added. + */ + + ITableWorkspace_sptr hkls = getOrthorhombicTable(); + MatrixWorkspace_sptr ws = getWorkspace(getFunctionString(hkls, false), 1.5, + 2.1, 1000, "dSpacing"); + + IAlgorithm_sptr pFit = AlgorithmManager::Instance().create("PawleyFit"); + pFit->setProperty("InputWorkspace", ws); + pFit->setProperty("WorkspaceIndex", 0); + pFit->setProperty("CrystalSystem", "Orthorhombic"); + pFit->setProperty("InitialCell", "2.44 3.13 4.07 90 90 90"); + pFit->setProperty("PeakTable", hkls); + pFit->setProperty("OutputWorkspace", "OP_output"); + pFit->setProperty("RefinedPeakParameterTable", "OP_peaks"); + pFit->setProperty("RefinedCellTable", "OP_cell"); + + pFit->execute(); + + // Examine table with cell parameters. + ITableWorkspace_sptr cellWs = + AnalysisDataService::Instance().retrieveWS("OP_cell"); + + // Three rows (a, b, c, ZeroShift) + TS_ASSERT_EQUALS(cellWs->rowCount(), 4); + + // Error of 'a' should be small + TS_ASSERT_LESS_THAN(fabs(cellWs->cell(0, 2)), 1e-4); + // a should be almost equal to 2.45 + TS_ASSERT_DELTA(cellWs->cell(0, 1), 2.45, 2e-3); + + // Error of 'b' should also be small + TS_ASSERT_LESS_THAN(fabs(cellWs->cell(1, 2)), 1e-4); + // b should be almost equal to 3.12 + TS_ASSERT_DELTA(cellWs->cell(1, 1), 3.12, 2e-3); + + // Error of 'c' should also be small + TS_ASSERT_LESS_THAN(fabs(cellWs->cell(2, 2)), 1e-4); + // b should be almost equal to 4.06 + TS_ASSERT_DELTA(cellWs->cell(2, 1), 4.06, 2e-3); + + // Check number of peak parameters. + ITableWorkspace_sptr peakWs = + AnalysisDataService::Instance().retrieveWS("OP_peaks"); + TS_ASSERT_EQUALS(peakWs->rowCount(), 7 * 3); // 5 functions with 3 params. + + AnalysisDataService::Instance().remove("OP_output"); + AnalysisDataService::Instance().remove("OP_peaks"); + AnalysisDataService::Instance().remove("OP_cell"); + } + +private: + class TestablePawleyFit : public PawleyFit { + friend class PawleyFitTest; + + public: + TestablePawleyFit() : PawleyFit() {} + ~TestablePawleyFit() {} + }; + + ITableWorkspace_sptr getHCPTable() { + ITableWorkspace_sptr tableWs = WorkspaceFactory::Instance().createTable(); + tableWs->addColumn("V3D", "HKL"); + tableWs->addColumn("double", "d"); + tableWs->addColumn("double", "FWHM (rel.)"); + // Check that string columns are converted if they contain numbers + tableWs->addColumn("str", "Intensity"); + + TableRow row0 = tableWs->appendRow(); + row0 << V3D(0, 0, 2) << 1.965 << 0.004 << "3800.0"; + + TableRow row1 = tableWs->appendRow(); + row1 << V3D(1, 0, 1) << 1.867037 << 0.004 << "16400.0"; + TableRow row2 = tableWs->appendRow(); + row2 << V3D(1, 0, 2) << 1.441702 << 0.005 << "3700.0"; + TableRow row3 = tableWs->appendRow(); + row3 << V3D(1, 0, 3) << 1.114663 << 0.006 << "5900.0"; + TableRow row4 = tableWs->appendRow(); + row4 << V3D(2, -1, 0) << 1.225 << 0.004 << "5100.0"; + return tableWs; + } + + ITableWorkspace_sptr getOrthorhombicTable() { + ITableWorkspace_sptr tableWs = WorkspaceFactory::Instance().createTable(); + tableWs->addColumn("V3D", "HKL"); + tableWs->addColumn("double", "d"); + tableWs->addColumn("double", "FWHM (rel.)"); + // Check that string columns are converted if they contain numbers + tableWs->addColumn("str", "Intensity"); + + TableRow row0 = tableWs->appendRow(); + row0 << V3D(0, 0, 2) << 2.03000 << 0.004 << "110.628118"; + + TableRow row1 = tableWs->appendRow(); + row1 << V3D(0, 1, 2) << 1.701542 << 0.0042 << "180.646775"; + + TableRow row2 = tableWs->appendRow(); + row2 << V3D(0, 2, 0) << 1.560000 << 0.00483 << "79.365613"; + + TableRow row3 = tableWs->appendRow(); + row3 << V3D(1, 0, 1) << 2.097660 << 0.0041 << "228.086161"; + + TableRow row4 = tableWs->appendRow(); + row4 << V3D(1, 0, 2) << 1.563144 << 0.004 << "159.249424"; + + TableRow row5 = tableWs->appendRow(); + row5 << V3D(1, 1, 0) << 1.926908 << 0.004 << "209.913635"; + + TableRow row6 = tableWs->appendRow(); + row6 << V3D(1, 1, 1) << 1.740797 << 0.00472 << "372.446264"; + + return tableWs; + } + + std::string getFunctionString(const ITableWorkspace_sptr &table, bool useQ) { + std::vector functionStrings; + + for (size_t i = 0; i < table->rowCount(); ++i) { + TableRow row = table->getRow(i); + std::ostringstream fn; + double d = row.Double(1); + double center = useQ ? (2.0 * M_PI) / d : d; + double fwhmAbs = row.Double(2) * center; + fn << "name=Gaussian,PeakCentre=" << center + << ",Sigma=" << fwhmAbs / (2.0 * sqrt(2.0 * log(2.0))) + << ",Height=" << row.String(3); + + functionStrings.push_back(fn.str()); + } + + return boost::join(functionStrings, ";"); + } + + MatrixWorkspace_sptr getWorkspace(const std::string &functionString, + double xMin, double xMax, size_t n, + const std::string &unit, double bg = 0.0) { + IFunction_sptr siFn = + FunctionFactory::Instance().createInitialized(functionString); + + auto ws = WorkspaceFactory::Instance().create("Workspace2D", 1, n, n); + + FunctionDomain1DVector xValues(xMin, xMax, n); + FunctionValues yValues(xValues); + std::vector eValues(n, 1.0); + + siFn->function(xValues, yValues); + + std::vector &xData = ws->dataX(0); + std::vector &yData = ws->dataY(0); + std::vector &eData = ws->dataE(0); + + for (size_t i = 0; i < n; ++i) { + xData[i] = xValues[i]; + yData[i] = yValues[i] + bg; + eData[i] = eValues[i]; + } + + WorkspaceCreationHelper::addNoise(ws, 0, -0.5, 0.5); + + ws->getAxis(0)->setUnit(unit); + + return ws; + } +}; -#endif /* MANTID_CURVEFITTING_PAWLEYFITTEST_H_ */ \ No newline at end of file +#endif /* MANTID_CURVEFITTING_PAWLEYFITTEST_H_ */ From 77f0d75e27b73fbfcce8bd34b6451dd0af04e0fb Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Thu, 19 Mar 2015 11:35:06 -0400 Subject: [PATCH 045/126] Refs #11400. Mark ParaView and SIP headers as system headers. --- Code/Mantid/MantidPlot/CMakeLists.txt | 2 +- Code/Mantid/MantidQt/Python/CMakeLists.txt | 2 +- .../Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt | 5 +++-- .../Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt | 7 ++++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Code/Mantid/MantidPlot/CMakeLists.txt b/Code/Mantid/MantidPlot/CMakeLists.txt index 68daaff89d6f..6314b89a3f66 100644 --- a/Code/Mantid/MantidPlot/CMakeLists.txt +++ b/Code/Mantid/MantidPlot/CMakeLists.txt @@ -548,7 +548,7 @@ add_custom_command ( OUTPUT ${SIP_SRC} ) # Needed for sip.h header that can end up in a different place to to the main Python include directory -include_directories ( ${SIP_INCLUDE_DIR} ) +include_directories ( SYSTEM ${SIP_INCLUDE_DIR} ) # Needed for sip generated files to find includes in src include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/Code/Mantid/MantidQt/Python/CMakeLists.txt b/Code/Mantid/MantidQt/Python/CMakeLists.txt index 0624231af29b..92a7f22f8f99 100644 --- a/Code/Mantid/MantidQt/Python/CMakeLists.txt +++ b/Code/Mantid/MantidQt/Python/CMakeLists.txt @@ -49,7 +49,7 @@ add_custom_command ( OUTPUT ${SIP_SRC} ) # Needed for sip.h header that can end up in a different place to to the main Python include directory -include_directories ( ${SIP_INCLUDE_DIR} ) +include_directories ( SYSTEM ${SIP_INCLUDE_DIR} ) # Needed for sip generated files to find includes in src include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt b/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt index f2af04d6f4fd..0ccd2ead71b5 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt +++ b/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt @@ -39,11 +39,12 @@ set( TEST_SUITES add_executable( ${PROJECT_NAME} ${INCLUDE_FILES} ${SOURCE_FILES} ${MOC_SRCS} ) target_link_libraries( ${PROJECT_NAME} +VatesSimpleGuiQtWidgets +VatesSimpleGuiViewWidgets +SYSTEM pqCore pqComponents pqApplicationComponents ${QT_LIBRARIES} ${MANTID_SUBPROJECT_LIBS} -VatesSimpleGuiQtWidgets -VatesSimpleGuiViewWidgets ) if( SQUISH_FOUND ) diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt index 278a8015e40d..6d64ce35f82c 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt @@ -124,15 +124,16 @@ set_property( TARGET VatesSimpleGuiViewWidgets PROPERTY FOLDER MantidVatesSimple target_link_libraries( VatesSimpleGuiViewWidgets VatesSimpleGuiQtWidgets -pqApplicationComponents -pqComponents -${QT_LIBRARIES} MantidQtAPI VatesAPI ${MANTID_SUBPROJECT_LIBS} MantidQtSliceViewer MantidQtFactory MantidWidgets +SYSTEM +pqApplicationComponents +pqComponents +${QT_LIBRARIES} ) # Create test file projects From 0d9abe258b0140e2d222964f1d6569500fb8dd49 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Thu, 19 Mar 2015 15:48:21 +0000 Subject: [PATCH 046/126] Use logy scale for spectrum data Refs #11389 --- Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp index 88b8e682820e..d25d925ecce5 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp +++ b/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp @@ -596,10 +596,11 @@ QwtPlotCurve * PreviewPlot::addCurve(MatrixWorkspace_sptr ws, const size_t specI } // Create the plot data - QwtWorkspaceSpectrumData wsData(*ws, static_cast(specIndex), false, false); + bool logYScale = getAxisType(QwtPlot::yLeft) == "Logarithmic"; + QwtWorkspaceSpectrumData wsData(*ws, static_cast(specIndex), logYScale, false); // Create the new curve - QwtPlotCurve *curve = new QwtPlotCurve(); + QwtPlotCurve * curve = new QwtPlotCurve(); curve->setData(wsData); curve->setPen(curveColour); curve->attach(m_uiForm.plot); From 75a8398c8c15af166b405bfc18904fc023758e5a Mon Sep 17 00:00:00 2001 From: Roman Tolchenov Date: Thu, 19 Mar 2015 17:02:25 +0000 Subject: [PATCH 047/126] Re #11405. Do not ignore files from ...:checksum stream. --- .../Framework/DataHandling/src/LoadRawHelper.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRawHelper.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRawHelper.cpp index 7be90aaaf9eb..cd4c235958d1 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadRawHelper.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadRawHelper.cpp @@ -1197,13 +1197,15 @@ LoadRawHelper::searchForLogFiles(const std::string &pathToRawFile) { try { Kernel::Glob::glob(Poco::Path(dir).resolve(pattern), potentialLogFiles); - // push potential log files from set to list. - potentialLogFilesList.insert(potentialLogFilesList.begin(), - potentialLogFiles.begin(), - potentialLogFiles.end()); } catch (std::exception &) { } } + + // push potential log files from set to list. + potentialLogFilesList.insert(potentialLogFilesList.begin(), + potentialLogFiles.begin(), + potentialLogFiles.end()); + // Remove extension from path, and append .log to path. std::string logName = pathToRawFile.substr(0, pathToRawFile.rfind('.')) + ".log"; From 00badb07aa993cc253f8be14e8ed5c38a7b5a389 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Thu, 19 Mar 2015 14:18:02 -0400 Subject: [PATCH 048/126] Refs #11400. Use variatic template in place of variatic macro. --- .../Framework/DataHandling/src/SaveSPE.cpp | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp b/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp index 25dd7c0b6e3c..4e8c99bb8090 100644 --- a/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp @@ -25,21 +25,22 @@ DECLARE_ALGORITHM(SaveSPE) * @throws std::runtime_error :: throws when there is a problem writing to disk, * usually disk space or permissions based */ - -#if __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -#endif - -#define FPRINTF_WITH_EXCEPTION(stream, format, ...) \ - if (fprintf(stream, format, ##__VA_ARGS__) <= 0) { \ - throw std::runtime_error( \ - "Error writing to file. Check folder permissions and disk space."); \ + +namespace { + +template +void FPRINTF_WITH_EXCEPTION(FILE *stream, const char *format, vargs... args) { + if (fprintf(stream, format, args...) <= 0) { + throw std::runtime_error( + "Error writing to file. Check folder permissions and disk space."); } - -#if __clang__ -#pragma clang diagnostic pop -#endif +} + +// special case needed for case with only two arguments. +void FPRINTF_WITH_EXCEPTION(FILE *stream, const char *format) { + FPRINTF_WITH_EXCEPTION(stream, format, ""); +} +} using namespace Kernel; using namespace API; From 3e65d9ff9ef986db57c032ea5550ff74c4503f5d Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Thu, 19 Mar 2015 18:28:13 +0000 Subject: [PATCH 049/126] Re #11397 Dealt with the issue, mentioned in the ticket. A load mask gets fully defined IDF to avoid problems with fining this file from instrument name. --- .../Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py b/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py index 9f2c4b485ba1..90a715d36515 100644 --- a/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py +++ b/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py @@ -204,8 +204,8 @@ def diagnose(self, white,diag_sample=None,**kwargs): # data file. SNS or 1 to 1 maps may probably avoid this # stuff and can load masks directly white_data = white.get_ws_clone('white_ws_clone') - - diag_mask = LoadMask(Instrument=self.instr_name,InputFile=self.hard_mask_file,\ + idf_file = api.ExperimentInfo.getInstrumentFilename(self.instr_name) + diag_mask = LoadMask(Instrument=idf_file,InputFile=self.hard_mask_file,\ OutputWorkspace='hard_mask_ws') MaskDetectors(Workspace=white_data, MaskedWorkspace=diag_mask) white.add_masked_ws(white_data) From aeee5d734d32908d6f8089e0dca00bc8b69639f1 Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Thu, 19 Mar 2015 19:49:10 +0000 Subject: [PATCH 050/126] Re #11397 Make better protection for masking workspace property value for case when script stopped by user and then restarted. --- .../Direct/DirectEnergyConversion.py | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py b/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py index 90a715d36515..6cb7b9f4b644 100644 --- a/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py +++ b/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py @@ -383,7 +383,7 @@ def convert_to_energy(self,wb_run=None,sample_run=None,ei_guess=None,rebin=None, masking = self.spectra_masks # estimate and report the number of failing detectors - nMaskedSpectra = get_failed_spectra_list_from_masks(masking) + nMaskedSpectra = get_failed_spectra_list_from_masks(masking,prop_man) if masking: nSpectra = masking.getNumberHistograms() else: @@ -492,8 +492,6 @@ def convert_to_energy(self,wb_run=None,sample_run=None,ei_guess=None,rebin=None, #prop_man.wb_run = None # clear combined mask self.spectra_masks = None - if 'masking' in mtd: - DeleteWorkspace(masking) return result def _do_abs_corrections(self,deltaE_ws_sample,cashed_mono_int,ei_guess,\ @@ -982,18 +980,37 @@ def prop_man(self,value): ######### @property def spectra_masks(self): - """ The property keeps a workspace with masks, stored for further usage """ + """ The property keeps a workspace with masks workspace name, + stored for further usage""" # check if spectra masks is defined if hasattr(self,'_spectra_masks'): - return self._spectra_masks + if self._spectra_masks in mtd: + return mtd[self._spectra_masks] + else: + self._spectra_masks = None + return None else: return None @spectra_masks.setter def spectra_masks(self,value): """ set up spectra masks """ - self._spectra_masks = value + if value is None: + if hasattr(self,'_spectra_masks') and not self._spectra_masks is None: + if self._spectra_masks in mtd: + DeleteWorkspace(self._spectra_masks) + self._spectra_masks=None + elif isinstance(value,api.Workspace): + self._spectra_masks = value.name() + elif isinstance(value,str): + if value in mtd: + self._spectra_masks = value + else: + self._spectra_masks = None + else: + self._spectra_masks = None + return #------------------------------------------------------------------------------- def apply_absolute_normalization(self,sample_ws,monovan_run=None,ei_guess=None,wb_mono=None,abs_norm_factor_is=None): """ Function applies absolute normalization factor to the target workspace @@ -1515,7 +1532,7 @@ def _build_white_tag(self): white_tag = 'NormBy:{0}_IntergatedIn:{1:0>10.2f}:{2:0>10.2f}'.format(self.normalise_method,low,upp) return white_tag -def get_failed_spectra_list_from_masks(masked_wksp): +def get_failed_spectra_list_from_masks(masked_wksp,prop_man): """Compile a list of spectra numbers that are marked as masked in the masking workspace @@ -1529,7 +1546,7 @@ def get_failed_spectra_list_from_masks(masked_wksp): try: name = masked_wksp.name() except Exeption as ex: - + prop_man.log("***WARNING: cached mask workspace invalidated. Incorrect masking reported") return (failed_spectra,0) masking_wksp,sp_list = ExtractMask(masked_wksp) From bc3e8f073d692f2d9b354bcaf732086d2eaa9510 Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Thu, 19 Mar 2015 20:02:46 +0000 Subject: [PATCH 051/126] Re #11397 Minor typo --- .../Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py b/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py index 6cb7b9f4b644..6ef761fff556 100644 --- a/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py +++ b/Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py @@ -366,7 +366,7 @@ def convert_to_energy(self,wb_run=None,sample_run=None,ei_guess=None,rebin=None, masks_done = False if not prop_man.run_diagnostics: header = "*** Diagnostics including hard masking is skipped " - masks_done = Treu + masks_done = True #if Reducer.save_and_reuse_masks : # SAVE AND REUSE MASKS if self.spectra_masks: @@ -985,7 +985,7 @@ def spectra_masks(self): # check if spectra masks is defined if hasattr(self,'_spectra_masks'): - if self._spectra_masks in mtd: + if not self._spectra_masks is None and self._spectra_masks in mtd: return mtd[self._spectra_masks] else: self._spectra_masks = None From 130ba5ca77cfa6610a0d0c75decd9a4f7fb4108b Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Thu, 19 Mar 2015 13:10:44 -0700 Subject: [PATCH 052/126] Refs #11400. use include_directories to include paraview headers. --- .../Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt | 7 ++++--- .../Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt b/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt index 0ccd2ead71b5..bcb80bf44f18 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt +++ b/Code/Mantid/Vates/VatesSimpleGui/StandAloneExec/CMakeLists.txt @@ -38,13 +38,14 @@ set( TEST_SUITES add_executable( ${PROJECT_NAME} ${INCLUDE_FILES} ${SOURCE_FILES} ${MOC_SRCS} ) +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) + target_link_libraries( ${PROJECT_NAME} -VatesSimpleGuiQtWidgets -VatesSimpleGuiViewWidgets -SYSTEM pqCore pqComponents pqApplicationComponents ${QT_LIBRARIES} ${MANTID_SUBPROJECT_LIBS} +VatesSimpleGuiQtWidgets +VatesSimpleGuiViewWidgets ) if( SQUISH_FOUND ) diff --git a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt index 6d64ce35f82c..98fb3b2fe584 100644 --- a/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt +++ b/Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt @@ -122,7 +122,13 @@ set_target_properties( VatesSimpleGuiViewWidgets PROPERTIES OUTPUT_NAME MantidVa # Add to the 'VatesSimpleGui' group in VS set_property( TARGET VatesSimpleGuiViewWidgets PROPERTY FOLDER MantidVatesSimpleGui ) + +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) + target_link_libraries( VatesSimpleGuiViewWidgets +pqApplicationComponents +pqComponents +${QT_LIBRARIES} VatesSimpleGuiQtWidgets MantidQtAPI VatesAPI @@ -130,10 +136,6 @@ ${MANTID_SUBPROJECT_LIBS} MantidQtSliceViewer MantidQtFactory MantidWidgets -SYSTEM -pqApplicationComponents -pqComponents -${QT_LIBRARIES} ) # Create test file projects From 0275d97bbeec692a96d008bb9ce60f517b229d36 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Thu, 19 Mar 2015 13:13:44 -0700 Subject: [PATCH 053/126] Refs #11400. Change warning style. --- Code/Mantid/MantidPlot/src/zlib123/minigzip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Mantid/MantidPlot/src/zlib123/minigzip.c b/Code/Mantid/MantidPlot/src/zlib123/minigzip.c index 5df454d1a821..6f12762c8ece 100644 --- a/Code/Mantid/MantidPlot/src/zlib123/minigzip.c +++ b/Code/Mantid/MantidPlot/src/zlib123/minigzip.c @@ -252,7 +252,7 @@ void file_uncompress(file) { outfile = file; infile = buf; - // Add the .gz suffix to the filename in buf/infile + /* Add the .gz suffix to the filename in buf/infile */ strcat(buf, GZ_SUFFIX); } in = gzopen(infile, "rb"); From 4f4dbb9a53b68a1e88474dd6a46cd421c85ae950 Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Thu, 19 Mar 2015 20:51:16 +0000 Subject: [PATCH 054/126] Re #11397 Unit test for workspaces with heterogeneous binning --- Code/Mantid/scripts/test/RunDescriptorTest.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Code/Mantid/scripts/test/RunDescriptorTest.py b/Code/Mantid/scripts/test/RunDescriptorTest.py index 1515fbf1a040..1a8956188d83 100644 --- a/Code/Mantid/scripts/test/RunDescriptorTest.py +++ b/Code/Mantid/scripts/test/RunDescriptorTest.py @@ -155,6 +155,34 @@ def test_copy_spectra2monitors(self): self.assertEqual(mon_ws.getNumberHistograms(),3) self.assertEqual(mon_ws.getIndexFromSpectrumNumber(3),2) + def test_copy_spectra2monitors_heterogen(self): + propman = self.prop_man + run_ws = CreateSampleWorkspace( Function='Multiple Peaks', WorkspaceType = 'Event',NumBanks=1, BankPixelWidth=5, NumEvents=100) + run_ws_monitors = CreateSampleWorkspace( Function='Multiple Peaks', WorkspaceType = 'Histogram',NumBanks=2, BankPixelWidth=1, NumEvents=100) + + run_ws_monitors = Rebin(run_ws_monitors,Params='1,-0.01,20000') + x=run_ws_monitors.readX(0) + dx = x[1:]-x[:-1] + min_step0 = min(dx) + + propman.monovan_run = run_ws + propman.spectra_to_monitors_list = 3 + + mon_ws = PropertyManager.monovan_run.get_monitors_ws() + self.assertTrue(isinstance(mon_ws, api.Workspace)) + self.assertEqual(mon_ws.getNumberHistograms(),3) + self.assertEqual(mon_ws.getIndexFromSpectrumNumber(3),2) + + x=mon_ws.readX(0) + dx = x[1:]-x[:-1] + min_step1 = min(dx) + max_step1 = max(dx) + + self.assertAlmostEqual(min_step0,min_step1,5) + self.assertAlmostEqual(max_step1,min_step1,5) + + + def test_ws_name(self): run_ws = CreateSampleWorkspace( Function='Multiple Peaks', NumBanks=1, BankPixelWidth=4, NumEvents=100) propman = self.prop_man From 14af060915f4b4ee276fd60c3ae6dee8fcc79e09 Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Thu, 19 Mar 2015 21:30:28 +0000 Subject: [PATCH 055/126] Re #11397 Unit test for custom file name --- .../scripts/test/ReductionWrapperTest.py | 50 +++++++++++++++++-- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/Code/Mantid/scripts/test/ReductionWrapperTest.py b/Code/Mantid/scripts/test/ReductionWrapperTest.py index 83f558655efa..bdafbe4d2a70 100644 --- a/Code/Mantid/scripts/test/ReductionWrapperTest.py +++ b/Code/Mantid/scripts/test/ReductionWrapperTest.py @@ -1,16 +1,50 @@ import os,sys -#os.environ["PATH"] = r"c:/Mantid/Code/builds/br_master/bin/Release;"+os.environ["PATH"] +os.environ["PATH"] = r"c:/Mantid/Code/builds/br_master/bin/Release;"+os.environ["PATH"] from mantid.simpleapi import * from mantid import api,config -from Direct.ReductionWrapper import ReductionWrapper +from Direct.ReductionWrapper import * import MariReduction as mr # import unittest +class test_helper(ReductionWrapper): + def __init__(self,web_var=None): + """ sets properties defaults for the instrument with Name""" + ReductionWrapper.__init__(self,'MAR',web_var) + + def set_custom_output_filename(self): + """define custom name of output files if standard one is not satisfactory + In addition to that, example of accessing reduction properties + Changing them if necessary + """ + def custom_name(prop_man): + """ sample function which builds filename from + incident energy and run number and adds some auxiliary information + to it. + """ + + # Note -- properties have the same names as the list of advanced and + # main properties + ei = PropertyManager.incident_energy.get_current() + # sample run is more then just list of runs, so we use + # the formalization below to access its methods + run_num = prop_man.sample_run + name = "SOMETHING{0}_{1:<3.2f}meV_rings".format(run_num ,ei) + return name + + # Uncomment this to use custom filename function + # Note: the properties are stored in prop_man class accessed as + # below. + return custom_name(self.reducer.prop_man) + # use this method to use standard file name generating function + #return None + @iliad + def reduce(self, input_file = None, output_directory = None): + return '' #----------------------------------------------------------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------------------------------------------------------- @@ -34,8 +68,6 @@ def test_default_fails(self): self.assertRaises(NotImplementedError,red.def_advanced_properties) self.assertTrue('reduce' in dir(red)) - - def test_export_advanced_values(self): red = mr.ReduceMARI() @@ -126,6 +158,16 @@ def test_validate_settings(self): self.assertEqual(level,1) self.assertEqual(len(errors),1) + def test_custom_print_name(self): + th=test_helper() + th.reducer.prop_man.sample_run = 100 + th.reducer.prop_man.incident_energy=[10.01,20] + + th.reduce() + + save_file = th.reducer.prop_man.save_file_name + self.assertEqual(save_file,'SOMETHING100_10.01meV_rings') + if __name__=="__main__": From 081c899e802928b53d4153bac36aaa5f27b5224b Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Thu, 19 Mar 2015 21:59:00 +0000 Subject: [PATCH 056/126] Re #11397 fixing DirectPropertyManagerTest and more unit tests for custom print function --- Code/Mantid/scripts/test/DirectPropertyManagerTest.py | 4 ++-- Code/Mantid/scripts/test/ReductionWrapperTest.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/scripts/test/DirectPropertyManagerTest.py b/Code/Mantid/scripts/test/DirectPropertyManagerTest.py index 344df3a9d670..3cde32203d62 100644 --- a/Code/Mantid/scripts/test/DirectPropertyManagerTest.py +++ b/Code/Mantid/scripts/test/DirectPropertyManagerTest.py @@ -1088,14 +1088,14 @@ def test_custom_print(self): propman.sample_run = 1000 propman.incident_energy = 20. - def custom_print(propman,PropertyManager): + def custom_print(propman): ei = propman.incident_energy run_n = PropertyManager.sample_run.run_number() name = "RUN{0}atEi{1:<4.1f}meV_One2One".format(run_n,ei) return name - PropertyManager.save_file_name.set_custom_print(custom_print) + PropertyManager.save_file_name.set_custom_print(lambda : custom_print(self.prop_man)) self.assertEqual(propman.save_file_name,'RUN1000atEi20.0meV_One2One') diff --git a/Code/Mantid/scripts/test/ReductionWrapperTest.py b/Code/Mantid/scripts/test/ReductionWrapperTest.py index bdafbe4d2a70..36425842625b 100644 --- a/Code/Mantid/scripts/test/ReductionWrapperTest.py +++ b/Code/Mantid/scripts/test/ReductionWrapperTest.py @@ -1,5 +1,5 @@ import os,sys -os.environ["PATH"] = r"c:/Mantid/Code/builds/br_master/bin/Release;"+os.environ["PATH"] +#os.environ["PATH"] = r"c:/Mantid/Code/builds/br_master/bin/Release;"+os.environ["PATH"] from mantid.simpleapi import * from mantid import api,config From 4ea831cfd463ec72a204c1e5069d783495b1d912 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Thu, 19 Mar 2015 15:56:19 -0700 Subject: [PATCH 057/126] Refs #11400. use union to fix casting warnings. --- Code/Mantid/MantidPlot/src/PluginFit.cpp | 68 ++++++++++++++++++++---- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/Code/Mantid/MantidPlot/src/PluginFit.cpp b/Code/Mantid/MantidPlot/src/PluginFit.cpp index 708994c0bbb4..ddfa8edacd23 100644 --- a/Code/Mantid/MantidPlot/src/PluginFit.cpp +++ b/Code/Mantid/MantidPlot/src/PluginFit.cpp @@ -64,6 +64,39 @@ void PluginFit::init() d_fit_type = Plugin; } + +namespace{ +typedef union { + double (*func)(const gsl_vector *, void *); + void* ptr; +} simplex_union; + +typedef union { + int (*func)(const gsl_vector *, void *, gsl_vector *); + void* ptr; +} f_union; + +typedef union { + int (*func)(const gsl_vector *, void *,gsl_matrix *); + void* ptr; +} df_union; + +typedef union { + int (*func)(const gsl_vector *, void *, gsl_vector *, gsl_matrix *); + void* ptr; +} fdf_union; + +typedef union { + double (*func)(double, double *); + void* ptr; +} ffe_union; + +typedef union { + char* (*func)(); + void* ptr; +} ff_union; +} + bool PluginFit::load(const QString& pluginName) { if (!QFile::exists (pluginName)){ @@ -75,40 +108,52 @@ bool PluginFit::load(const QString& pluginName) QLibrary lib(pluginName); lib.setAutoUnload(false); - d_fsimplex = (fit_function_simplex) lib.resolve( "function_d" ); + simplex_union simplex; + simplex.ptr = lib.resolve( "function_d" ); + d_fsimplex = simplex.func; if (!d_fsimplex){ QMessageBox::critical(static_cast(parent()), tr("MantidPlot - Plugin Error"), tr("The plugin does not implement a %1 method necessary for simplex fitting.").arg("function_d")); return false; } - d_f = (fit_function) lib.resolve( "function_f" ); + f_union f; + f.ptr = lib.resolve( "function_f" ); + d_f = f.func; if (!d_f){ QMessageBox::critical(static_cast(parent()), tr("MantidPlot - Plugin Error"), tr("The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting.").arg("function_f")); return false; } - d_df = (fit_function_df) lib.resolve( "function_df" ); - if (!d_df){ + df_union df; + df.ptr = lib.resolve( "function_df" ); + d_df = df.func; + if (!(df.ptr)){ QMessageBox::critical(static_cast(parent()), tr("MantidPlot - Plugin Error"), tr("The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting.").arg("function_df")); return false; } - d_fdf = (fit_function_fdf) lib.resolve( "function_fdf" ); + fdf_union fdf; + fdf.ptr = lib.resolve( "function_fdf" ); + d_fdf = fdf.func; if (!d_fdf){ QMessageBox::critical(static_cast(parent()), tr("MantidPlot - Plugin Error"), tr("The plugin does not implement a %1 method necessary for Levenberg-Marquardt fitting.").arg("function_fdf")); return false; } - f_eval = (fitFunctionEval) lib.resolve("function_eval"); + ffe_union ffe; + ffe.ptr = lib.resolve("function_eval"); + f_eval = ffe.func; if (!f_eval) return false; typedef char* (*fitFunc)(); - fitFunc fitFunction = (fitFunc) lib.resolve("parameters"); + ff_union ff; + ff.ptr = lib.resolve("parameters"); + fitFunc fitFunction = ff.func; if (fitFunction){ d_param_names = QString(fitFunction()).split(",", QString::SkipEmptyParts); d_p = (int)d_param_names.count(); @@ -116,17 +161,20 @@ bool PluginFit::load(const QString& pluginName) } else return false; - fitFunc fitExplain = (fitFunc) lib.resolve("explanations"); + ff.ptr = lib.resolve("explanations"); + fitFunc fitExplain = ff.func; if (fitExplain) d_param_explain = QString(fitExplain()).split(",", QString::SkipEmptyParts); else for (int i=0; i Date: Fri, 20 Mar 2015 08:26:48 +0100 Subject: [PATCH 058/126] Refs #11043. Checkpointing work --- .../Framework/CurveFitting/src/PawleyFit.cpp | 10 +++ .../CurveFitting/test/PawleyFitTest.h | 2 + .../docs/source/algorithms/PawleyFit-v1.rst | 72 +++++++++++++++++++ .../source/fitfunctions/PawleyFunction.rst | 20 ++++++ 4 files changed, 104 insertions(+) create mode 100644 Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst create mode 100644 Code/Mantid/docs/source/fitfunctions/PawleyFunction.rst diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index 630a5d63ee50..f525f46fec81 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -270,6 +270,10 @@ void PawleyFit::init() { declareProperty("ChebyshevBackgroundDegree", 0, "Degree of the Chebyshev polynomial, if used as background."); + declareProperty("CalculationOnly", false, "If enabled, no fit is performed, " + "the function is only evaluated " + "and output is generated."); + declareProperty(new WorkspaceProperty("OutputWorkspace", "", Direction::Output), "Workspace that contains measured spectrum, calculated " @@ -341,6 +345,12 @@ void PawleyFit::exec() { fit->setProperty("StartX", startX); fit->setProperty("EndX", endX); fit->setProperty("WorkspaceIndex", wsIndex); + + bool calculationOnly = getProperty("CalculationOnly"); + if (calculationOnly) { + fit->setProperty("MaxIterations", 0); + } + fit->setProperty("CreateOutput", true); fit->execute(); diff --git a/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h b/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h index 85674d0d3704..30b0ca92e8d4 100644 --- a/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/PawleyFitTest.h @@ -103,6 +103,8 @@ class PawleyFitTest : public CxxTest::TestSuite { pFit->setProperty("CrystalSystem", "Orthorhombic"); pFit->setProperty("InitialCell", "2.44 3.13 4.07 90 90 90"); pFit->setProperty("PeakTable", hkls); + pFit->setProperty("EnableChebyshevBackground", true); + pFit->setProperty("ChebyshevBackgroundDegree", 0); pFit->setProperty("OutputWorkspace", "OP_output"); pFit->setProperty("RefinedPeakParameterTable", "OP_peaks"); pFit->setProperty("RefinedCellTable", "OP_cell"); diff --git a/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst b/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst new file mode 100644 index 000000000000..3f069d4202d9 --- /dev/null +++ b/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst @@ -0,0 +1,72 @@ +.. algorithm:: + +.. summary:: + +.. alias:: + +.. properties:: + +Description +----------- + +The algorithm performs a fit of lattice parameters using the principle approach described in a paper by Pawley. In this approach the reflection positions are calculated from lattice parameters and the reflection's Miller indices (:math:`hkl`), while the other profile parameters for each peak are freely refined. + +PawleyFit requires a MatrixWorkspace with at least one spectrum in terms of either :math:`d` or :math:`Q`, the index of the spectrum can be supplied to the algorithm as a parameter. Furthermore, the range which is used for refinement can be changed by setting the corresponding properties. + +In addition, a TableWorkspace with information about the reflections that are found in the spectrum must be passed as well. There must be four columns with the captions "HKL", "d", "FWHM (rel.)" and "Intensity". The HKL column can be supplied either as V3D or as a string with 3 numbers separated by space, comma or semi-colon and possibly surrounded by square brackets. + +Usage +----- + +.. include:: ../usagedata-note.txt + +This small usage example merges two compatible POLDI-files which have been loaded before. + +.. testcode:: ExMergeSilicon + + # Load the first data file and the correct instrument + raw_6903 = LoadSINQFile(Filename = "poldi2013n006903.hdf", Instrument = "POLDI") + LoadInstrument(raw_6903, InstrumentName = "POLDI") + + # Use Integration and SumSpectra to sum all counts in the spectrum. + # The data must be converted to histogram data for Integration to work. + histo_6903 = ConvertToHistogram(raw_6903) + spectra_6903 = Integration(histo_6903) + total_6903 = SumSpectra(spectra_6903) + + # The result has one spectrum with one bin, which contains the total counts. + counts_6903 = int(total_6903.dataY(0)[0]) + print "6903 contains a total of", counts_6903, "counts." + + # The same with the second data file + raw_6904 = LoadSINQFile(Filename = "poldi2013n006904.hdf", Instrument = "POLDI") + LoadInstrument(raw_6904, InstrumentName = "POLDI") + histo_6904 = ConvertToHistogram(raw_6904) + spectra_6904 = Integration(histo_6904) + total_6904 = SumSpectra(spectra_6904) + + counts_6904 = int(total_6904.dataY(0)[0]) + print "6904 contains a total of", counts_6904, "counts." + + # Now PoldiMerge is used to merge the two raw spectra by supplying a list of workspace names. + raw_summed = PoldiMerge("raw_6903,raw_6904") + + # The merged data is integrated as well. + histo_summed = ConvertToHistogram(raw_summed) + spectra_summed = Integration(histo_summed) + total_summed = SumSpectra(spectra_summed) + + print "6903+6904 contains a total of", int(total_summed.dataY(0)[0]), "counts." + print "Summing the counts of the single data files leads to", counts_6903 + counts_6904, "counts." + +Output: + +.. testoutput:: ExMergeSilicon + + 6903 contains a total of 769269 counts. + 6904 contains a total of 766777 counts. + 6903+6904 contains a total of 1536046 counts. + Summing the counts of the single data files leads to 1536046 counts. + + +.. categories:: diff --git a/Code/Mantid/docs/source/fitfunctions/PawleyFunction.rst b/Code/Mantid/docs/source/fitfunctions/PawleyFunction.rst new file mode 100644 index 000000000000..83ebf5b689e6 --- /dev/null +++ b/Code/Mantid/docs/source/fitfunctions/PawleyFunction.rst @@ -0,0 +1,20 @@ +.. _func-PawleyFunction: + +=========== +PawleyFunction +=========== + +.. index:: PawleyFunction + +Description +----------- + +The basic principle of fitting unit cell parameters to a complete powder diffraction pattern has been described by Pawley. Instead allowing each peak to have a freely selectable position, these positions are calculated as a result from the unit cell parameters. All other parameters of the peaks are refined independently. The implementation of the function differs from the method described in the paper in some points, for example the number of parameters can not change during the refinement (no reflections will be added or removed). + +Since the function requires special setup (assignment of HKLs, selection of crystal system and profile function), there is an algorithm that can perform a Pawley-type fit with different input data. Please see the documentation of :ref:`algm-PawleyFit` for details on how to use it. + +.. attributes:: + +.. properties:: + +.. categories:: From 09bab26a90a373bba67c53e174dedd4efc3a6a68 Mon Sep 17 00:00:00 2001 From: Martyn Gigg Date: Fri, 20 Mar 2015 08:07:40 +0000 Subject: [PATCH 059/126] Update the Python export for FileFinder::getFullPath Refs #11395 --- .../mantid/api/src/Exports/FileFinder.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp index 88eb1d1f94ce..0ff7f80e71ef 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp @@ -1,17 +1,22 @@ #include "MantidAPI/FileFinder.h" #include +#include #include using Mantid::API::FileFinder; using Mantid::API::FileFinderImpl; using namespace boost::python; +namespace { + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getFullPathOverloader, getFullPath, 1, 2); +} + void export_FileFinder() { class_("FileFinderImpl", no_init) .def("getFullPath", &FileFinderImpl::getFullPath, - "Return a full path to the given file if it can be found within datasearch.directories paths. " - "An empty string is returned otherwise.") + getFullPathOverloader((arg("path"), arg("ignoreDirs")=false), + "Return a full path to the given file if it can be found within datasearch.directories paths. Directories can be ignored with ignoreDirs=True. An empty string is returned otherwise.")) .def("findRuns", &FileFinderImpl::findRuns, "Find a list of files file given a hint. " "The hint can be a comma separated list of run numbers and can also include ranges of runs, e.g. 123-135 or equivalently 123-35" "If no instrument prefix is given then the current default is used.") From 097a4b14e18a7e9a00e95f9bcebc25f80790de29 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Fri, 20 Mar 2015 10:23:41 +0100 Subject: [PATCH 060/126] Refs #11043. Adding data file for doc test --- Code/Mantid/Testing/Data/DocTest/PawleySilicon.nxs.md5 | 1 + 1 file changed, 1 insertion(+) create mode 100644 Code/Mantid/Testing/Data/DocTest/PawleySilicon.nxs.md5 diff --git a/Code/Mantid/Testing/Data/DocTest/PawleySilicon.nxs.md5 b/Code/Mantid/Testing/Data/DocTest/PawleySilicon.nxs.md5 new file mode 100644 index 000000000000..dfb0fc386fc0 --- /dev/null +++ b/Code/Mantid/Testing/Data/DocTest/PawleySilicon.nxs.md5 @@ -0,0 +1 @@ +f814c587c2dbe2df89b153f1ad95d4f6 From c096241696e29323f0fa187074f81929cc10fffa Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Fri, 20 Mar 2015 10:18:46 +0000 Subject: [PATCH 061/126] Re #11397 Should fix issue with custom print function --- Code/Mantid/scripts/Inelastic/Direct/NonIDF_Properties.py | 1 - Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py | 2 +- Code/Mantid/scripts/test/ReductionWrapperTest.py | 8 +++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/scripts/Inelastic/Direct/NonIDF_Properties.py b/Code/Mantid/scripts/Inelastic/Direct/NonIDF_Properties.py index 31916d02a2ab..8dcc95516524 100644 --- a/Code/Mantid/scripts/Inelastic/Direct/NonIDF_Properties.py +++ b/Code/Mantid/scripts/Inelastic/Direct/NonIDF_Properties.py @@ -36,7 +36,6 @@ def __init__(self,Instrument,run_workspace=None): object.__setattr__(self,'_log_to_mantid',False) object.__setattr__(self,'_current_log_level',3) - object.__setattr__(self,'_save_file_name',None) self._set_instrument_and_facility(Instrument,run_workspace) diff --git a/Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py b/Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py index 4b0fcc90b92f..d3c7ff4af87c 100644 --- a/Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py +++ b/Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py @@ -425,7 +425,7 @@ def iliad_wrapper(*args): else: pass # we should set already set up variables using - custom_print_function = host.set_custom_output_filename + custom_print_function = host.set_custom_output_filename() if not custom_print_function is None: PropertyManager.save_file_name.set_custom_print(custom_print_function) # diff --git a/Code/Mantid/scripts/test/ReductionWrapperTest.py b/Code/Mantid/scripts/test/ReductionWrapperTest.py index 36425842625b..f037da458dd5 100644 --- a/Code/Mantid/scripts/test/ReductionWrapperTest.py +++ b/Code/Mantid/scripts/test/ReductionWrapperTest.py @@ -39,7 +39,7 @@ def custom_name(prop_man): # Uncomment this to use custom filename function # Note: the properties are stored in prop_man class accessed as # below. - return custom_name(self.reducer.prop_man) + return lambda: custom_name(self.reducer.prop_man) # use this method to use standard file name generating function #return None @iliad @@ -168,6 +168,12 @@ def test_custom_print_name(self): save_file = th.reducer.prop_man.save_file_name self.assertEqual(save_file,'SOMETHING100_10.01meV_rings') + th.reducer.prop_man.sample_run = 200 + PropertyManager.incident_energy.next() + save_file = th.reducer.prop_man.save_file_name + self.assertEqual(save_file,'SOMETHING200_20.00meV_rings') + + if __name__=="__main__": From 02515661ea737cacafd5cbdb2b427e931a9501c7 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Fri, 20 Mar 2015 10:46:59 +0000 Subject: [PATCH 062/126] Remove negative Y data from preview plots when log y Refs #11389 --- .../MantidQt/MantidWidgets/src/PreviewPlot.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp index d25d925ecce5..e23fdaf46b21 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp +++ b/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp @@ -5,7 +5,6 @@ #include "MantidAPI/AnalysisDataService.h" #include "MantidAPI/AlgorithmManager.h" -#include "MantidQtAPI/QwtWorkspaceSpectrumData.h" #include #include @@ -17,6 +16,8 @@ #include #include +#include +#include #include using namespace MantidQt::MantidWidgets; @@ -25,6 +26,7 @@ using namespace Mantid::API; namespace { Mantid::Kernel::Logger g_log("PreviewPlot"); + bool isNegative(double value) { return value < 0.0; } } @@ -595,9 +597,17 @@ QwtPlotCurve * PreviewPlot::addCurve(MatrixWorkspace_sptr ws, const size_t specI ws = convertXAlg->getProperty("OutputWorkspace"); } - // Create the plot data + std::vector wsDataY = ws->readY(specIndex); + + // If using log scale need to remove all negative Y values bool logYScale = getAxisType(QwtPlot::yLeft) == "Logarithmic"; - QwtWorkspaceSpectrumData wsData(*ws, static_cast(specIndex), logYScale, false); + if(logYScale) + std::replace_if(wsDataY.begin(), wsDataY.end(), isNegative, DBL_EPSILON); + + // Create the Qwt data + QwtArray dataX = QVector::fromStdVector(ws->readX(specIndex)); + QwtArray dataY = QVector::fromStdVector(wsDataY); + QwtArrayData wsData(dataX, dataY); // Create the new curve QwtPlotCurve * curve = new QwtPlotCurve(); From 610a2b6655a73199d4cf5a8d92fe07b459f5bc41 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Fri, 20 Mar 2015 11:10:41 +0000 Subject: [PATCH 063/126] Get a better default Y scale Refs #11389 --- .../MantidQt/MantidWidgets/src/PreviewPlot.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp index e23fdaf46b21..279c95374bf7 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp +++ b/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp @@ -26,7 +26,6 @@ using namespace Mantid::API; namespace { Mantid::Kernel::Logger g_log("PreviewPlot"); - bool isNegative(double value) { return value < 0.0; } } @@ -602,7 +601,18 @@ QwtPlotCurve * PreviewPlot::addCurve(MatrixWorkspace_sptr ws, const size_t specI // If using log scale need to remove all negative Y values bool logYScale = getAxisType(QwtPlot::yLeft) == "Logarithmic"; if(logYScale) - std::replace_if(wsDataY.begin(), wsDataY.end(), isNegative, DBL_EPSILON); + { + // Remove negative data in order to search for minimum positive value + std::vector validData(wsDataY.size()); + auto it = std::remove_copy_if(wsDataY.begin(), wsDataY.end(), validData.begin(), [](double v){ return v<= 0.0; } ); + validData.resize(std::distance(validData.begin(), it)); + + // Get minimum positive value + double minY = *std::min_element(validData.begin(), validData.end()); + + // Set all negative values to minimum positive value + std::replace_if(wsDataY.begin(), wsDataY.end(), [](double v){return v <= 0.0; }, minY); + } // Create the Qwt data QwtArray dataX = QVector::fromStdVector(ws->readX(specIndex)); From 3cea0c159d959244b3f2e671df1ea6c423fe6e11 Mon Sep 17 00:00:00 2001 From: Martyn Gigg Date: Fri, 20 Mar 2015 11:25:01 +0000 Subject: [PATCH 064/126] Fix conditional logic for Windows only code section. Refs #11395 --- Code/Mantid/Framework/API/src/FileFinder.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Code/Mantid/Framework/API/src/FileFinder.cpp b/Code/Mantid/Framework/API/src/FileFinder.cpp index cdf24e803544..e350531d1107 100644 --- a/Code/Mantid/Framework/API/src/FileFinder.cpp +++ b/Code/Mantid/Framework/API/src/FileFinder.cpp @@ -149,12 +149,9 @@ std::string FileFinderImpl::getFullPath(const std::string &filename, const bool } else { Poco::Path path(*it, fName); Poco::File file(path); - if(ignoreDirs && file.isDirectory()) { - continue; - } - if (file.exists()) { + if (file.exists() && !(ignoreDirs && file.isDirectory())) { return path.toString(); - } + } } #endif } From db47165db5867b841dee0d610ef16e0267d7bd35 Mon Sep 17 00:00:00 2001 From: Federico Montesino Pouzols Date: Fri, 20 Mar 2015 12:15:36 +0000 Subject: [PATCH 065/126] add constness of auth method, and a std namespace, re #11123 --- .../API/inc/MantidAPI/IRemoteJobManager.h | 277 ++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h b/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h new file mode 100644 index 000000000000..8ee6dd776735 --- /dev/null +++ b/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h @@ -0,0 +1,277 @@ +#ifndef MANTID_KERNEL_IREMOTEJOBMANAGER_H +#define MANTID_KERNEL_IREMOTEJOBMANAGER_H + +#include "MantidKernel/DllConfig.h" + +namespace Mantid { +namespace Kernel { +/** +Common interface to different remote job managers (job schedulers, web +services, etc. such as MOAB, Platform LSF, or SLURM). + +IremoteJobManager objects are (in principle) created via the +RemoteJobManagerFactory. There are several "remote algorithms" in +Mantid: Authenticate, SubmitRemoteJob, QueryRemoteJobStatus, +etc. These algorithms are meant to use this interface to the different +specific implementations. Or, from the opposite angle, the methods of +this interface provide the functionality required by the remote +algorithms in a generic way (with respect to different job schedulers +or underlying mechanisms to handle remote jobs). So-called remote job +manager classes can implement this interface to provide +specialisations for Platform LSF, SLURM, MOAB, the Mantid web service +API, etc. + +A typical sequence of calls when you use this interface would be: + +1) Authenticate/log-in (authenticate()) +2) Do transactions + +Where the sequence of calls within a transaction is: + +2.1) Start transaction (startRemoteTransaction()) +2.2) Do actions +2.3) Stop transaction (stopRemoteTransaction()) + +In 2.2, several types of actions are possible: +- Submit a job to run on the (remote) compute resource (submitRemoteJob()). +- Get status info for one or all jobs (queryRemoteJob() and +queryAllRemoteJobs()). +- Cancel a job (abortRemoteJob()). +- Get list of available files for a transaction on the compute resource +(queryRemoteFile()) +- Upload / download files ( uploadRemoteFile() and downloadRemoteFile()). + + +Copyright © 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge +National Laboratory & European Spallation Source + +This file is part of Mantid. + +Mantid is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +Mantid is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +File change history is stored at: . +Code Documentation is available at: +*/ +class MANTID_KERNEL_DLL IRemoteJobManager { +public: + virtual ~IRemoteJobManager(){}; + + /** + * Status and general information about jobs running on (remote) + * compute resources. + */ + struct RemoteJobInfo { + /// Job ID, usually assigned by a job scheduler as an integer + /// number or similar. + std::string id; + /// name of the job, whether given by the user or automatically + /// assigned by the job scheduler + std::string name; + /// Name of the script or executable. Depending on the specific + /// implementation, job scheduler, etc. this can be an + /// 'application' name, a script name or different ways of + /// specifying what is run + std::string runnableName; + /// Last status retrieved (typically: Pending, Running, Exited, + /// etc.). The values are implementation/job scheduler dependent. + std::string status; + /// ID of the transaction where this job is included + std::string transactionID; + /// Date-time of submission. No particular format can be assumed + std::string submitDate; + /// Date-time the job actually started running. No particular + /// format can be assumed + std::string startDate; + /// Date-time the job finished. No particular format can be + /// assumed + std::string completionTime; + }; + + /** + * Authenticate or log-in, previous to submitting jobs, up/downloading, etc. + * + * @param username User name or credentials + * + * @param password Password (or other type of authentication token) + * string. + * + * @throws std::invalid_argument If any of the inputs is not set + * properly. + * @throws std::runtime_error If authentication fails + */ + virtual void authenticate(const std::string &username, + const std::string &password) = 0; + + /** + * Submit a job (and implicitly request to start it) within a + * transaction. + * + * @param transactionID ID obtained from a startRemoteTransaction() + * + * @param runnable Name of the script or executable for the + * job. This can be a name or path to a file (implementation + * dependent). + * + * @param param Parameters for the job. This is implementation + * dependent and may be a list of command line options, the name of + * a script or configuration file, the contents of a script to run + * or configuration template, etc. For example, for the Mantid web + * service API, this is the content of a python script. + * + * @param taskName (optional) human readable name for this job. + * + * @param numNodes number of nodes to use (optional and dependent on + * implementation and compute resource) + * + * @parm coresPerNode number of cores to use in each node (optional + * and dependent on implemenation and compute resource) + * + * @return jobID string for the job started (if successful). + * + * @throws std::invalid_argument If any of the inputs is not set + * properly. + * @throws std::runtime_error if job submission fails. + */ + virtual std::string + submitRemoteJob(const std::string &transactionID, const std::string &runnable, + const std::string ¶m, const std::string &taskName = "", + const int numNodes = 1, const int coresPerNode = 1) = 0; + + /** + * Get/download a file from the (remote) compute resource. + * + * @param transactionID ID obtained from a startRemoteTransaction() + * + * @param remoteFileName Name of file on the (remote) compute + * resource. This can be a full or relative path or a simple file + * name, depending on implementation. + * + * @param localFileName Where to place the downloaded file on the + * local machine. + * + * @throws std::invalid_argument If any of the inputs is not set + * properly. + * @throws std::runtime_error If the download operation fails + */ + virtual void downloadRemoteFile(const std::string &transactionID, + const std::string &remoteFileName, + const std::string &localFileName) = 0; + + /** + * Get information (status etc.) for all running jobs on the remote + * compute resource + * + * @return Status and general info for all the jobs found on the + * (remote) compute resource. Each of them should come identified by + * its ID. + * + * @throws std::runtime_error If the query fails + */ + virtual std::vector queryAllRemoteJobs() const = 0; + + /** + * Get the list of files available for a transaction at the (remote) + * compute resource. + * + * @param transactionID ID obtained from startRemoteTransaction() + * + * @return The names of all the available files + * + * @throws std::invalid_argument If there's an issue with the + * transaction ID + * + * @throws std::runtime_error If the query fails + */ + virtual std::vector + queryRemoteFile(const std::string &transactionID) const = 0; + + /** + * Get information (status etc.) for an (in principle) running job + * + * @param jobID ID of a job as obtained from submitRemoteJob() + * + * @return Status and general info for the job requested + * + * @throws std::invalid_argument If there's an issue with the + * job ID + * + * @throws std::runtime_error If the query fails + */ + virtual RemoteJobInfo queryRemoteJob(const std::string &jobID) const = 0; + + /** + * Start a transaction before up/downloading files and submitting + * jobs + * + * @return ID of the transaction as produced by the job scheduler + * and/or remote job manager. + * + * @throws std::runtime_error If the transaction creation fails + */ + virtual std::string startRemoteTransaction() = 0; + + /** + * Finish a transaction. This implicitly can cancel all the + * operations (jobs) associated with this transaction. + * + * @param transactionID An Id of a transaction, as returned by + * startRemoteTransaction() + * + * @throws std::invalid_argument If there's an issue with the + * transaction ID + * + * @throws std::runtime_error If the stop operation fails + */ + virtual void stopRemoteTransaction(const std::string &transactionID) = 0; + + /** + * Cancel a job (expected to be currently running on the remote resource) + * + * @param jobID ID for a job in a transaction, as returned by + * submitRemoteJob() + * + * @throws std::invalid_argument If there's an issue with the + * job ID + * @throws std::runtime_error If the abort/cancel operation fails + */ + virtual void abortRemoteJob(const std::string &jobID) = 0; + + /** + * Upload file for a transaction on the rmeote compute resource + * + * @param transactionID ID, as you get them from + * startRemoteTransaction() + * + * @param remoteFileName Name of file on the (remote) compute + * resource. This can be a full or relative path or a simple file + * name, depending on implementation. + * + * @param localFileName Path to the file to upload + * + * @throws std::invalid_argument If there's an issue with the + * arguments passed + * @throws std::runtime_error If the upload fails + */ + virtual void uploadRemoteFile(const std::string &transactionID, + const std::string &remoteFileName, + const std::string &localFileName) = 0; +}; + +// shared pointer type for the IRemoteJobManager +typedef boost::shared_ptr IRemoteJobManager_sptr; + +} // namespace Kernel +} // namespace Mantid + +#endif // MANTID_KERNEL_IREMOTEJOBMANAGER_H From 4d7dae89acff799302f3b338306f47fec34fecce Mon Sep 17 00:00:00 2001 From: Federico Montesino Pouzols Date: Fri, 20 Mar 2015 12:16:39 +0000 Subject: [PATCH 066/126] move the IRemoteJobManager interface Kernel->API, re #11123 --- Code/Mantid/Framework/API/CMakeLists.txt | 1 + Code/Mantid/Framework/Kernel/CMakeLists.txt | 1 - .../inc/MantidKernel/IRemoteJobManager.h | 276 ------------------ 3 files changed, 1 insertion(+), 277 deletions(-) delete mode 100644 Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h diff --git a/Code/Mantid/Framework/API/CMakeLists.txt b/Code/Mantid/Framework/API/CMakeLists.txt index f87f4cede245..97f66fde0547 100644 --- a/Code/Mantid/Framework/API/CMakeLists.txt +++ b/Code/Mantid/Framework/API/CMakeLists.txt @@ -220,6 +220,7 @@ set ( INC_FILES inc/MantidAPI/IPeakFunction.h inc/MantidAPI/IPeaksWorkspace.h inc/MantidAPI/IPowderDiffPeakFunction.h + inc/MantidAPI/IRemoteJobManager.h inc/MantidAPI/ISpectrum.h inc/MantidAPI/ISplittersWorkspace.h inc/MantidAPI/ITableWorkspace.h diff --git a/Code/Mantid/Framework/Kernel/CMakeLists.txt b/Code/Mantid/Framework/Kernel/CMakeLists.txt index 6f70ef56c341..887bba027157 100644 --- a/Code/Mantid/Framework/Kernel/CMakeLists.txt +++ b/Code/Mantid/Framework/Kernel/CMakeLists.txt @@ -165,7 +165,6 @@ set ( INC_FILES inc/MantidKernel/InstrumentInfo.h inc/MantidKernel/InternetHelper.h inc/MantidKernel/Interpolation.h - inc/MantidKernel/IRemoteJobManager.h inc/MantidKernel/LibraryManager.h inc/MantidKernel/LibraryWrapper.h inc/MantidKernel/ListValidator.h diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h deleted file mode 100644 index 359619a09de1..000000000000 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/IRemoteJobManager.h +++ /dev/null @@ -1,276 +0,0 @@ -#ifndef MANTID_KERNEL_IREMOTEJOBMANAGER_H -#define MANTID_KERNEL_IREMOTEJOBMANAGER_H - -#include "MantidKernel/DllConfig.h" - -namespace Mantid { -namespace Kernel { -/** -Common interface to different remote job managers (job schedulers, web -services, etc. such as MOAB, Platform LSF, or SLURM). - -IremoteJobManager objects are (in principle) created via the -RemoteJobManagerFactory. There are several "remote algorithms" in -Mantid: Authenticate, SubmitRemoteJob, QueryRemoteJobStatus, -etc. These algorithms are meant to use this interface to the different -specific implementations. Or, from the opposite angle, the methods of -this interface provide the functionality required by the remote -algorithms in a generic way (with respect to different job schedulers -or underlying mechanisms to handle remote jobs). So-called remote job -manager classes can implement this interface to provide -specialisations for Platform LSF, SLURM, MOAB, the Mantid web service -API, etc. - -A typical sequence of calls when you use this interface would be: - -1) Authenticate/log-in (authenticate()) -2) Do transactions - -Where the sequence of calls within a transaction is: - -2.1) Start transaction (startRemoteTransaction()) -2.2) Do actions -2.3) Stop transaction (stopRemoteTransaction()) - -In 2.2, several types of actions are possible: -- Submit a job to run on the (remote) compute resource (submitRemoteJob()). -- Get status info for one or all jobs (queryRemoteJob() and -queryAllRemoteJobs()). -- Cancel a job (abortRemoteJob()). -- Get list of available files for a transaction on the compute resource -(queryRemoteFile()) -- Upload / download files ( uploadRemoteFile() and downloadRemoteFile()). - - -Copyright © 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge -National Laboratory & European Spallation Source - -This file is part of Mantid. - -Mantid is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -Mantid is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -File change history is stored at: . -Code Documentation is available at: -*/ -class MANTID_KERNEL_DLL IRemoteJobManager { -public: - virtual ~IRemoteJobManager(){}; - - /** - * Status and general information about jobs running on (remote) - * compute resources. - */ - struct RemoteJobInfo { - /// Job ID, usually assigned by a job scheduler as an integer - /// number or similar. - std::string id; - /// name of the job, whether given by the user or automatically - /// assigned by the job scheduler - std::string name; - /// Name of the script or executable. Depending on the specific - /// implementation, job scheduler, etc. this can be an - /// 'application' name, a script name or different ways of - /// specifying what is run - std::string runnableName; - /// Last status retrieved (typically: Pending, Running, Exited, - /// etc.). The values are implementation/job scheduler dependent. - std::string status; - /// ID of the transaction where this job is included - std::string transactionID; - /// Date-time of submission. No particular format can be assumed - std::string submitDate; - /// Date-time the job actually started running. No particular - /// format can be assumed - std::string startDate; - /// Date-time the job finished. No particular format can be - /// assumed - std::string completionTime; - }; - - /** - * Authenticate or log-in, previous to submitting jobs, up/downloading, etc. - * - * @param username User name or credentials - * - * @param password Password (or other type of authentication token) - * string. - * - * @throws std::invalid_argument If any of the inputs is not set - * properly. - * @throws std::runtime_error If authentication fails - */ - virtual void authenticate(std::string &username, std::string &password) = 0; - - /** - * Submit a job (and implicitly request to start it) within a - * transaction. - * - * @param transactionID ID obtained from a startRemoteTransaction() - * - * @param runnable Name of the script or executable for the - * job. This can be a name or path to a file (implementation - * dependent). - * - * @param param Parameters for the job. This is implementation - * dependent and may be a list of command line options, the name of - * a script or configuration file, the contents of a script to run - * or configuration template, etc. For example, for the Mantid web - * service API, this is the content of a python script. - * - * @param taskName (optional) human readable name for this job. - * - * @param numNodes number of nodes to use (optional and dependent on - * implementation and compute resource) - * - * @parm coresPerNode number of cores to use in each node (optional - * and dependent on implemenation and compute resource) - * - * @return jobID string for the job started (if successful). - * - * @throws std::invalid_argument If any of the inputs is not set - * properly. - * @throws std::runtime_error if job submission fails. - */ - virtual std::string - submitRemoteJob(const std::string &transactionID, const std::string &runnable, - const std::string ¶m, const std::string &taskName = "", - const int numNodes = 1, const int coresPerNode = 1) = 0; - - /** - * Get/download a file from the (remote) compute resource. - * - * @param transactionID ID obtained from a startRemoteTransaction() - * - * @param remoteFileName Name of file on the (remote) compute - * resource. This can be a full or relative path or a simple file - * name, depending on implementation. - * - * @param localFileName Where to place the downloaded file on the - * local machine. - * - * @throws std::invalid_argument If any of the inputs is not set - * properly. - * @throws std::runtime_error If the download operation fails - */ - virtual void downloadRemoteFile(const std::string &transactionID, - const std::string &remoteFileName, - const std::string &localFileName) = 0; - - /** - * Get information (status etc.) for all running jobs on the remote - * compute resource - * - * @return Status and general info for all the jobs found on the - * (remote) compute resource. Each of them should come identified by - * its ID. - * - * @throws std::runtime_error If the query fails - */ - virtual std::vector queryAllRemoteJobs() const = 0; - - /** - * Get the list of files available for a transaction at the (remote) - * compute resource. - * - * @param transactionID ID obtained from startRemoteTransaction() - * - * @return The names of all the available files - * - * @throws std::invalid_argument If there's an issue with the - * transaction ID - * - * @throws std::runtime_error If the query fails - */ - virtual std::vector - queryRemoteFile(const std::string &transactionID) const = 0; - - /** - * Get information (status etc.) for an (in principle) running job - * - * @param jobID ID of a job as obtained from submitRemoteJob() - * - * @return Status and general info for the job requested - * - * @throws std::invalid_argument If there's an issue with the - * job ID - * - * @throws std::runtime_error If the query fails - */ - virtual RemoteJobInfo queryRemoteJob(const std::string &jobID) const = 0; - - /** - * Start a transaction before up/downloading files and submitting - * jobs - * - * @return ID of the transaction as produced by the job scheduler - * and/or remote job manager. - * - * @throws std::runtime_error If the transaction creation fails - */ - virtual std::string startRemoteTransaction() = 0; - - /** - * Finish a transaction. This implicitly can cancel all the - * operations (jobs) associated with this transaction. - * - * @param transactionID An Id of a transaction, as returned by - * startRemoteTransaction() - * - * @throws std::invalid_argument If there's an issue with the - * transaction ID - * - * @throws std::runtime_error If the stop operation fails - */ - virtual void stopRemoteTransaction(const std::string &transactionID) = 0; - - /** - * Cancel a job (expected to be currently running on the remote resource) - * - * @param jobID ID for a job in a transaction, as returned by - * submitRemoteJob() - * - * @throws std::invalid_argument If there's an issue with the - * job ID - * @throws std::runtime_error If the abort/cancel operation fails - */ - virtual void abortRemoteJob(const std::string &jobID) = 0; - - /** - * Upload file for a transaction on the rmeote compute resource - * - * @param transactionID ID, as you get them from - * startRemoteTransaction() - * - * @param remoteFileName Name of file on the (remote) compute - * resource. This can be a full or relative path or a simple file - * name, depending on implementation. - * - * @param localFileName Path to the file to upload - * - * @throws std::invalid_argument If there's an issue with the - * arguments passed - * @throws std::runtime_error If the upload fails - */ - virtual void uploadRemoteFile(const std::string &transactionID, - const std::string &remoteFileName, - const std::string &localFileName) = 0; -}; - -// shared pointer type for the IRemoteJobManager -typedef boost::shared_ptr IRemoteJobManager_sptr; - -} // namespace Kernel -} // namespace Mantid - -#endif // MANTID_KERNEL_IREMOTEJOBMANAGER_H From 9c952a5335c0c81ad7e4e765956bc3c3b621b1f3 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Fri, 20 Mar 2015 14:38:45 +0100 Subject: [PATCH 067/126] Refs #11043. Complete docs and doc-test --- .../docs/source/algorithms/PawleyFit-v1.rst | 124 +++++++++++------- .../source/fitfunctions/PawleyFunction.rst | 4 +- .../PawleyFitResultTheoreticalSilicon.png | Bin 0 -> 65002 bytes 3 files changed, 77 insertions(+), 51 deletions(-) create mode 100644 Code/Mantid/docs/source/images/PawleyFitResultTheoreticalSilicon.png diff --git a/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst b/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst index 3f069d4202d9..4b775e08b343 100644 --- a/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst +++ b/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst @@ -9,64 +9,90 @@ Description ----------- -The algorithm performs a fit of lattice parameters using the principle approach described in a paper by Pawley. In this approach the reflection positions are calculated from lattice parameters and the reflection's Miller indices (:math:`hkl`), while the other profile parameters for each peak are freely refined. +The algorithm performs a fit of lattice parameters using the principle approach described in a paper by Pawley [Pawley]_. In this approach the reflection positions are calculated from lattice parameters and the reflection's Miller indices (:math:`hkl`), while the other profile parameters for each peak are freely refined. PawleyFit requires a MatrixWorkspace with at least one spectrum in terms of either :math:`d` or :math:`Q`, the index of the spectrum can be supplied to the algorithm as a parameter. Furthermore, the range which is used for refinement can be changed by setting the corresponding properties. -In addition, a TableWorkspace with information about the reflections that are found in the spectrum must be passed as well. There must be four columns with the captions "HKL", "d", "FWHM (rel.)" and "Intensity". The HKL column can be supplied either as V3D or as a string with 3 numbers separated by space, comma or semi-colon and possibly surrounded by square brackets. +In addition, a TableWorkspace with information about the reflections that are found in the spectrum must be passed as well. There must be four columns with the captions "HKL", "d", "FWHM (rel.)" and "Intensity". The HKL column can be supplied either as V3D or as a string with 3 numbers separated by space, comma or semi-colon and possibly surrounded by square brackets. One way to obtain such a table is to use three algorithms that are used in analysis of POLDI data, which produce tables in a suitable format. Details are given in the usage example section. Usage ----- .. include:: ../usagedata-note.txt -This small usage example merges two compatible POLDI-files which have been loaded before. - -.. testcode:: ExMergeSilicon - - # Load the first data file and the correct instrument - raw_6903 = LoadSINQFile(Filename = "poldi2013n006903.hdf", Instrument = "POLDI") - LoadInstrument(raw_6903, InstrumentName = "POLDI") - - # Use Integration and SumSpectra to sum all counts in the spectrum. - # The data must be converted to histogram data for Integration to work. - histo_6903 = ConvertToHistogram(raw_6903) - spectra_6903 = Integration(histo_6903) - total_6903 = SumSpectra(spectra_6903) - - # The result has one spectrum with one bin, which contains the total counts. - counts_6903 = int(total_6903.dataY(0)[0]) - print "6903 contains a total of", counts_6903, "counts." - - # The same with the second data file - raw_6904 = LoadSINQFile(Filename = "poldi2013n006904.hdf", Instrument = "POLDI") - LoadInstrument(raw_6904, InstrumentName = "POLDI") - histo_6904 = ConvertToHistogram(raw_6904) - spectra_6904 = Integration(histo_6904) - total_6904 = SumSpectra(spectra_6904) - - counts_6904 = int(total_6904.dataY(0)[0]) - print "6904 contains a total of", counts_6904, "counts." - - # Now PoldiMerge is used to merge the two raw spectra by supplying a list of workspace names. - raw_summed = PoldiMerge("raw_6903,raw_6904") - - # The merged data is integrated as well. - histo_summed = ConvertToHistogram(raw_summed) - spectra_summed = Integration(histo_summed) - total_summed = SumSpectra(spectra_summed) - - print "6903+6904 contains a total of", int(total_summed.dataY(0)[0]), "counts." - print "Summing the counts of the single data files leads to", counts_6903 + counts_6904, "counts." - -Output: - -.. testoutput:: ExMergeSilicon - - 6903 contains a total of 769269 counts. - 6904 contains a total of 766777 counts. - 6903+6904 contains a total of 1536046 counts. - Summing the counts of the single data files leads to 1536046 counts. +For the usage example there is a calculated, theoretical diffraction pattern (including a bit of noise) for Silicon, which crystallizes in space group :math:`Fd\overline{3}m` and has a cubic cell with lattice parameter :math:`a=5.43119246\,\mathrm{\AA{}}`. +.. testcode:: ExPawleySilicon + + import numpy as np + + # Load spectrum for Silicon in the d-range down to 0.7 + si_spectrum = Load("PawleySilicon.nxs") + + # In order to index the peaks later on, generate reflection for Si + Si = PoldiCreatePeaksFromCell(SpaceGroup='F d -3 m', + Atoms='Si 0 0 0 1.0 0.05', + a=5.43, LatticeSpacingMin=0.7) + + print "Silicon has", Si.rowCount(), "unique reflections with d > 0.7." + + # Find peaks in the spectrum + si_peaks = PoldiPeakSearch(si_spectrum) + + # Index the peaks, will generate a workspace named 'Indexed_Si' + indexed = PoldiIndexKnownCompounds(si_peaks, CompoundWorkspaces='Si') + + si_peaks_indexed = AnalysisDataService.retrieve('Indexed_Si') + + # 3 peaks have two possibilities for indexing, because their d-values are identical + print "The number of peaks that were indexed:", si_peaks_indexed.rowCount() + + # Run the actual fit with lattice parameters that are slightly off + si_fitted = PawleyFit(si_spectrum, + CrystalSystem='Cubic', + InitialCell='5.436 5.436 5.436', + PeakTable=si_peaks_indexed, + RefinedCellTable='si_cell', RefinedPeakParameterTable='si_params') + + si_cell = AnalysisDataService.retrieve("si_cell") + + a = np.round(si_cell.cell(0, 1), 6) + a_err = np.round(si_cell.cell(0, 2), 6) + a_diff = np.round(np.fabs(a - 5.43119246), 6) + + print "The lattice parameter was refined to a =", a, "+/-", a_err + print "The deviation from the actual parameter (a=5.43119246) is:", a_diff + print "This difference corresponds to", np.round(a_diff / a_err, 2), "standard deviations." + +Running this script will generate a bit of output about the results of the different steps. At the end the lattice parameter differs less than one standard deviation from the actual value. + +.. testoutput:: ExPawleySilicon + + Silicon has 18 unique reflections with d > 0.7. + The number of peaks that were indexed: 15 + The lattice parameter was refined to a = 5.431205 +/- 1.6e-05 + The deviation from the actual parameter (a=5.43119246) is: 1.3e-05 + This difference corresponds to 0.81 standard deviations. + +.. testcleanup:: ExPawleySilicon + + AnalysisDataService.remove("si_spectrum") + AnalysisDataService.remove("Si") + AnalysisDataService.remove("si_peaks") + AnalysisDataService.remove("indexed") + AnalysisDataService.remove("si_fitted") + AnalysisDataService.remove("si_cell") + AnalysisDataService.remove("si_params") + +It's important to check the output data, which is found in the workspace labeled si_fitted. Plotting it should show that the residuals are just containing background noise and no systematic deviations. Of course, depending on the sample and the measurement this will differ between cases. + +.. figure:: /images/PawleyFitResultTheoreticalSilicon.png + :figwidth: 15 cm + :align: center + :alt: Result of the Pawley fit example with silicon. + + Result of the Pawley fit example with silicon. + +.. [Pawley] Pawley, G. S. “Unit-Cell Refinement from Powder Diffraction Scans.”, J. Appl. Crystallogr. 14, 1981, 357. doi:10.1107/S0021889881009618. .. categories:: diff --git a/Code/Mantid/docs/source/fitfunctions/PawleyFunction.rst b/Code/Mantid/docs/source/fitfunctions/PawleyFunction.rst index 83ebf5b689e6..f4b633306023 100644 --- a/Code/Mantid/docs/source/fitfunctions/PawleyFunction.rst +++ b/Code/Mantid/docs/source/fitfunctions/PawleyFunction.rst @@ -1,8 +1,8 @@ .. _func-PawleyFunction: -=========== +============== PawleyFunction -=========== +============== .. index:: PawleyFunction diff --git a/Code/Mantid/docs/source/images/PawleyFitResultTheoreticalSilicon.png b/Code/Mantid/docs/source/images/PawleyFitResultTheoreticalSilicon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce92ee4e37bea1e5ef4ac39eafce559922ab41ed GIT binary patch literal 65002 zcmdSBby$?!8#X$Mih0@97rUDB=60wRJUjYpa#>pJI;b7o&#XW)I;taq&^?)!e8rJu|rv9qTypGKijXT=`~KSrUB z-$9{{dYn88Klx>kI|hH@+1wMCKY8+G--z@ud^~0OK*a`yBK(2;ebLZPTWLKFB;* zpYPdp>lhxs=-|L7HT8Eb0(%`!^f%eE#5Tk*A2_I5GcBB)wr@W=TomoQ+Xidb14zr3 zmm7!#`;D6WmA-xZCK`M>Vz-GajEmQGR{lUBcw%Zw>cg!(*^kvMd>f{tiBi2C1$A{F z#R3UVor<_+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U9!_3ZNOdNWIBsz}fF5usg@Tp!TrEo{W8v1O~^s5T2X< zx?2DRXlQ6IEcE3X)Z~Kz6W}Q)bX_g&x8(D=wHCr6V0MKF1X3)KqWK^Ypb3RdR2~5p z@w$95eYz=JUS59Ou8sn9fbc%N>kGyW)S@JC<0jC+RLlb;+rS0{=XpaA&4JYwz`}w% zcEQ}-+&nKyQc(%KF@^_d0y;huIbf<`j+U~4%~EZEe%+I<+}6@^8Inl^ zyt}x#I0CShv{OfecQcd|8Xto3++_Z1xt`nRFv$P*-~Zph&VND~hd#zD^yBkO?->C3 PEx|LGid^1fq~HGlm%1gX literal 0 HcmV?d00001 From 8d3907a29a0b3e152bf53ce109b3c0b02989e24d Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Fri, 20 Mar 2015 14:49:26 +0100 Subject: [PATCH 068/126] Refs #11043. Adding some logging --- .../Framework/CurveFitting/src/PawleyFit.cpp | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index f525f46fec81..2f7907e3f47e 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -297,10 +297,25 @@ void PawleyFit::exec() { // Setup PawleyFunction with cell from input parameters PawleyFunction_sptr pawleyFn = boost::dynamic_pointer_cast( FunctionFactory::Instance().createFunction("PawleyFunction")); + g_log.information() << "Setting up Pawley function..." << std::endl; + + std::string profileFunction = getProperty("PeakProfileFunction"); + pawleyFn->setProfileFunction(profileFunction); + g_log.information() << " Selected profile function: " << profileFunction + << std::endl; + + std::string crystalSystem = getProperty("CrystalSystem"); + pawleyFn->setCrystalSystem(crystalSystem); + g_log.information() << " Selected crystal system: " << crystalSystem + << std::endl; - pawleyFn->setProfileFunction(getProperty("PeakProfileFunction")); - pawleyFn->setCrystalSystem(getProperty("CrystalSystem")); pawleyFn->setUnitCell(getProperty("InitialCell")); + PawleyParameterFunction_sptr pawleyParameterFunction = + pawleyFn->getPawleyParameterFunction(); + g_log.information() + << " Initial unit cell: " + << unitCellToStr(pawleyParameterFunction->getUnitCellFromParameters()) + << std::endl; // Get the input workspace with the data MatrixWorkspace_const_sptr ws = getProperty("InputWorkspace"); @@ -323,20 +338,30 @@ void PawleyFit::exec() { endX = std::min(endX, endXInput); } + g_log.information() << " Refined range: " << startX << " - " << endX + << std::endl; + // Get HKLs from TableWorkspace ITableWorkspace_sptr peakTable = getProperty("PeakTable"); Axis *xAxis = ws->getAxis(0); Unit_sptr xUnit = xAxis->unit(); addHKLsToFunction(pawleyFn, peakTable, xUnit, startX, endX); + g_log.information() << " Peaks in PawleyFunction: " + << pawleyFn->getPeakCount() << std::endl; + // Determine if zero-shift should be refined bool refineZeroShift = getProperty("RefineZeroShift"); if (!refineZeroShift) { pawleyFn->fix(pawleyFn->parameterIndex("f0.ZeroShift")); + } else { + g_log.information() << " Refining ZeroShift." << std::endl; } pawleyFn->setMatrixWorkspace(ws, static_cast(wsIndex), startX, endX); + g_log.information() << "Setting up Fit..." << std::endl; + // Generate Fit-algorithm with required properties. Algorithm_sptr fit = createChildAlgorithm("Fit", -1, -1, true); fit->setProperty("Function", getCompositeFunction(pawleyFn)); @@ -355,6 +380,8 @@ void PawleyFit::exec() { fit->execute(); + g_log.information() << "Generating output..." << std::endl; + // Create output MatrixWorkspace_sptr output = fit->getProperty("OutputWorkspace"); setProperty("OutputWorkspace", output); From fb68d0d8a851492e0f5f5fd91f43cfbc23dc3cae Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Fri, 20 Mar 2015 15:14:30 +0100 Subject: [PATCH 069/126] Refs #11043. Forgot to add export symbol --- .../CurveFitting/inc/MantidCurveFitting/PawleyFunction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h index b8d26a9786ac..cb0e9fb7acae 100644 --- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/PawleyFunction.h @@ -106,7 +106,7 @@ typedef boost::shared_ptr PawleyParameterFunction_sptr; File change history is stored at: Code Documentation is available at: */ -class PawleyFunction : public API::FunctionParameterDecorator { +class DLLExport PawleyFunction : public API::FunctionParameterDecorator { public: PawleyFunction(); virtual ~PawleyFunction() {} From 3c449fc9aad8813344acd2c04d6397625555ba6e Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Fri, 20 Mar 2015 07:18:54 -0700 Subject: [PATCH 070/126] Refs #11400. use macros on platforms without variatic templates. --- Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp | 11 +++++++++++ Code/Mantid/MantidPlot/src/PluginFit.cpp | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp b/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp index 4e8c99bb8090..6b6878a8e890 100644 --- a/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SaveSPE.cpp @@ -26,6 +26,16 @@ DECLARE_ALGORITHM(SaveSPE) * usually disk space or permissions based */ +// use macro on platforms without variadic templates. +#if defined(__INTEL_COMPILER) || ( defined(_MSC_VER) && _MSC_VER < 1800 ) + +#define FPRINTF_WITH_EXCEPTION(stream, format, ...) \ + if (fprintf(stream, format, ##__VA_ARGS__) <= 0) { \ + throw std::runtime_error( \ + "Error writing to file. Check folder permissions and disk space."); \ + } + +#else namespace { template @@ -41,6 +51,7 @@ void FPRINTF_WITH_EXCEPTION(FILE *stream, const char *format) { FPRINTF_WITH_EXCEPTION(stream, format, ""); } } +#endif using namespace Kernel; using namespace API; diff --git a/Code/Mantid/MantidPlot/src/PluginFit.cpp b/Code/Mantid/MantidPlot/src/PluginFit.cpp index ddfa8edacd23..7ca2fdbe6df8 100644 --- a/Code/Mantid/MantidPlot/src/PluginFit.cpp +++ b/Code/Mantid/MantidPlot/src/PluginFit.cpp @@ -67,8 +67,8 @@ void PluginFit::init() namespace{ typedef union { - double (*func)(const gsl_vector *, void *); - void* ptr; + double (*func)(const gsl_vector *, void *); + void* ptr; } simplex_union; typedef union { From ee1f3fbd39024b06f011f14943a62b0fd87f4070 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Fri, 20 Mar 2015 14:57:09 +0000 Subject: [PATCH 071/126] Fix build issues Refs #11389 --- Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp index 279c95374bf7..02e6f32243c4 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp +++ b/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp @@ -26,6 +26,7 @@ using namespace Mantid::API; namespace { Mantid::Kernel::Logger g_log("PreviewPlot"); + bool isNegative(double v) { return v <= 0.0; } } @@ -604,14 +605,14 @@ QwtPlotCurve * PreviewPlot::addCurve(MatrixWorkspace_sptr ws, const size_t specI { // Remove negative data in order to search for minimum positive value std::vector validData(wsDataY.size()); - auto it = std::remove_copy_if(wsDataY.begin(), wsDataY.end(), validData.begin(), [](double v){ return v<= 0.0; } ); + auto it = std::remove_copy_if(wsDataY.begin(), wsDataY.end(), validData.begin(), isNegative); validData.resize(std::distance(validData.begin(), it)); // Get minimum positive value double minY = *std::min_element(validData.begin(), validData.end()); // Set all negative values to minimum positive value - std::replace_if(wsDataY.begin(), wsDataY.end(), [](double v){return v <= 0.0; }, minY); + std::replace_if(wsDataY.begin(), wsDataY.end(), isNegative, minY); } // Create the Qwt data From e0a263c7ab7c7fdd8b8f020ac5c6eaa8aa8552c5 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Fri, 20 Mar 2015 15:57:47 +0100 Subject: [PATCH 072/126] Refs #11043. Fix lattice parameter typo in doctest I accidentally inserted an additional 2 into the decimals of the lattice parameter of Si. --- Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst b/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst index 4b775e08b343..1927a7a07f2b 100644 --- a/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst +++ b/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst @@ -20,7 +20,7 @@ Usage .. include:: ../usagedata-note.txt -For the usage example there is a calculated, theoretical diffraction pattern (including a bit of noise) for Silicon, which crystallizes in space group :math:`Fd\overline{3}m` and has a cubic cell with lattice parameter :math:`a=5.43119246\,\mathrm{\AA{}}`. +For the usage example there is a calculated, theoretical diffraction pattern (including a bit of noise) for Silicon, which crystallizes in space group :math:`Fd\overline{3}m` and has a cubic cell with lattice parameter :math:`a=5.4311946\,\mathrm{\AA{}}`. .. testcode:: ExPawleySilicon @@ -58,10 +58,10 @@ For the usage example there is a calculated, theoretical diffraction pattern (in a = np.round(si_cell.cell(0, 1), 6) a_err = np.round(si_cell.cell(0, 2), 6) - a_diff = np.round(np.fabs(a - 5.43119246), 6) + a_diff = np.round(np.fabs(a - 5.4311946), 6) print "The lattice parameter was refined to a =", a, "+/-", a_err - print "The deviation from the actual parameter (a=5.43119246) is:", a_diff + print "The deviation from the actual parameter (a=5.4311946) is:", a_diff print "This difference corresponds to", np.round(a_diff / a_err, 2), "standard deviations." Running this script will generate a bit of output about the results of the different steps. At the end the lattice parameter differs less than one standard deviation from the actual value. @@ -71,8 +71,8 @@ Running this script will generate a bit of output about the results of the diffe Silicon has 18 unique reflections with d > 0.7. The number of peaks that were indexed: 15 The lattice parameter was refined to a = 5.431205 +/- 1.6e-05 - The deviation from the actual parameter (a=5.43119246) is: 1.3e-05 - This difference corresponds to 0.81 standard deviations. + The deviation from the actual parameter (a=5.4311946) is: 1e-05 + This difference corresponds to 0.63 standard deviations. .. testcleanup:: ExPawleySilicon From ba594221a430a83882515c5fad3e102e44b32287 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Fri, 20 Mar 2015 11:18:10 -0400 Subject: [PATCH 073/126] Refs #11400. RHEL 6 fixes for extra comma and semicolon. --- .../Framework/API/inc/MantidAPI/ScriptRepository.h | 2 +- .../LiveData/inc/MantidLiveData/ADARA/ADARA.h | 10 +++++----- .../LiveData/inc/MantidLiveData/ADARA/ADARAPackets.h | 2 +- .../Quantification/Resolution/TobyFitYVector.h | 2 +- .../inc/MantidQtCustomInterfaces/IReflPresenter.h | 2 +- .../inc/MantidQtCustomInterfaces/SANSRunWindow.h | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h b/Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h index 9e5b8ba6b7fb..97b91a4e7dc1 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h @@ -48,7 +48,7 @@ enum SCRIPTSTATUS { LOCAL_ONLY = (1u << 1), REMOTE_CHANGED = (1u << 2), LOCAL_CHANGED = (1u << 3), - BOTH_CHANGED = (REMOTE_CHANGED | LOCAL_CHANGED), + BOTH_CHANGED = (REMOTE_CHANGED | LOCAL_CHANGED) }; /** diff --git a/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARA.h b/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARA.h index a6a6afb3ab11..97757097758d 100644 --- a/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARA.h +++ b/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARA.h @@ -29,7 +29,7 @@ enum Enum { DEVICE_DESC_V0 = ADARA_PKT_TYPE(0x8000, 0), VAR_VALUE_U32_V0 = ADARA_PKT_TYPE(0x8001, 0), VAR_VALUE_DOUBLE_V0 = ADARA_PKT_TYPE(0x8002, 0), - VAR_VALUE_STRING_V0 = ADARA_PKT_TYPE(0x8003, 0), + VAR_VALUE_STRING_V0 = ADARA_PKT_TYPE(0x8003, 0) }; } @@ -57,7 +57,7 @@ enum Enum { RUN_EOF = 2, RUN_BOF = 3, END_RUN = 4, - STATE = 5, + STATE = 5 }; } @@ -86,7 +86,7 @@ enum Enum { READ_PERMISSION = 20, WRITE_PERMISSION = 21, UPSTREAM_DISCONNECTED = 0xfffe, - NOT_REPORTED = 0xffff, + NOT_REPORTED = 0xffff }; } @@ -96,7 +96,7 @@ enum Enum { MINOR_ALARM = 1, MAJOR_ALARM = 2, INVALID = 3, - NOT_REPORTED = 0xffff, + NOT_REPORTED = 0xffff }; } @@ -107,7 +107,7 @@ enum Enum { SCAN_STOP, PAUSE, RESUME, - OVERALL_RUN_COMMENT, + OVERALL_RUN_COMMENT }; } diff --git a/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARAPackets.h b/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARAPackets.h index a331a294c25b..9a616c43892a 100644 --- a/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARAPackets.h +++ b/Code/Mantid/Framework/LiveData/inc/MantidLiveData/ADARA/ADARAPackets.h @@ -162,7 +162,7 @@ class DLLExport BankedEventPkt : public Packet { PULSE_VETO = 0x0004, MISSING_RTDL = 0x0008, MAPPING_ERROR = 0x0010, - DUPLICATE_PULSE = 0x0020, + DUPLICATE_PULSE = 0x0020 }; uint32_t pulseCharge(void) const { return m_fields[0]; } diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitYVector.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitYVector.h index d5dd3631ca87..6993c3e3656b 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitYVector.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/Resolution/TobyFitYVector.h @@ -77,7 +77,7 @@ class DLLExport TobyFitYVector { 8, // width-coordinate of point of detection in detector frame DetectorHeightCoord = 9, // height-coordinate of point of detection in detector frame - DetectionTime = 10, // deviation in detection time of neutron + DetectionTime = 10 // deviation in detection time of neutron }; /// Returns the number of parameters, i.e. length of the Y vector diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IReflPresenter.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IReflPresenter.h index 52720837cbe2..9acf1b47564a 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IReflPresenter.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IReflPresenter.h @@ -64,7 +64,7 @@ namespace MantidQt ImportTableFlag, ExportTableFlag, PlotRowFlag, - PlotGroupFlag, + PlotGroupFlag }; //Tell the presenter something happened diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.h index 5535d1f82c21..c8bf9318f1ba 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.h @@ -105,7 +105,7 @@ class SANSRunWindow : public MantidQt::API::UserSubWindow enum Tab { RUN_NUMBERS, REDUCTION_SETTINGS, GEOMETRY, MASKING, - LOGGING, ADD_RUNS, DIAGNOSTICS, ONE_D_ANALYSIS, + LOGGING, ADD_RUNS, DIAGNOSTICS, ONE_D_ANALYSIS }; /// Initialize the layout From 3c0d774c0b7c1a60f5f7b578ad58d6764ec5a082 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Fri, 20 Mar 2015 15:32:19 +0000 Subject: [PATCH 074/126] Add skeleton docs page and generate unit test data Refs #10753 --- .../ApplyPaalmanPingsCorrectionTest.py | 105 ++++++++++++++++++ .../python/plugins/algorithms/CMakeLists.txt | 1 + .../ApplyPaalmanPingsCorrection-v1.rst | 33 ++++++ 3 files changed, 139 insertions(+) create mode 100644 Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py create mode 100644 Code/Mantid/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py new file mode 100644 index 000000000000..41cdf7b2a64a --- /dev/null +++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py @@ -0,0 +1,105 @@ +import unittest +from mantid.kernel import * +from mantid.api import * +from mantid.simpleapi import Load, ConvertUnits, CreateSimulationWorkspace, RebinToWorkspace, Scale, DeleteWorkspace + + +class ApplyPaalmanPingsCorrectionTest(unittest.TestCase): + + def setUp(self): + """ + Create sample workspaces. + """ + + # Load the sample and can + sample_ws = Load('irs26176_graphite002_red.nxs') + can_ws = Load('irs26173_graphite002_red.nxs') + + # Convert sample and can to wavelength + sample_ws = ConvertUnits(InputWorkspace=sample_ws, + Target='Wavelength', + EMode='Indirect', + EFixed=1.845) + can_ws = ConvertUnits(InputWorkspace=can_ws, + Target='Wavelength', + EMode='Indirect', + EFixed=1.845) + + self._sample_ws = sample_ws + self._can_ws = can_ws + + # Create a dummy correction workspace roughtly similar to the sample + ws = CreateSimulationWorkspace(Instrument='IRIS', + BinParams='6,0.1,8', + UnitX='Wavelength') + + # Rebin the dummy workspace to match the smaple + ws = RebinToWorkspace(WorkspaceToRebin=ws, + WorkspaceToMatch=sample_ws) + + # Test correction workspace names + self._ass_ws_name = '__ApplyPaalmanPingsCorrection_ass' + self._acc_ws_name = '__ApplyPaalmanPingsCorrection_acc' + self._acsc_ws_name = '__ApplyPaalmanPingsCorrection_acsc' + self._assc_ws_name = '__ApplyPaalmanPingsCorrection_assc' + + # Scale them to make them look like correction factors + Scale(InputWorkspace=ws, + Factor=0.54, + Operation='Multiply', + OutputWorkspace=self._ass_ws_name) + + Scale(InputWorkspace=ws, + Factor=0.9, + Operation='Multiply', + OutputWorkspace=self._acc_ws_name) + + Scale(InputWorkspace=ws, + Factor=0.54, + Operation='Multiply', + OutputWorkspace=self._acsc_ws_name) + + Scale(InputWorkspace=ws, + Factor=0.56, + Operation='Multiply', + OutputWorkspace=self._assc_ws_name) + + # Delete the dummy workspace + DeleteWorkspace(ws) + + + def tearDown(self): + """ + Remove workspaces from ADS. + """ + + # Sample and can + DeleteWorkspace(self._sample_ws) + DeleteWorkspace(self._can_ws) + + # Simulated corrections + DeleteWorkspace(self._ass_ws_name) + DeleteWorkspace(self._acc_ws_name) + DeleteWorkspace(self._acsc_ws_name) + DeleteWorkspace(self._assc_ws_name) + + + def _verify_workspace(self, ws_name): + """ + Do validation on a correction workspace. + + @param ws_name Name of workspace to validate + """ + + pass # TODO + + + def test(self): + """ + """ + + pass # TODO + + +if __name__=="__main__": + unittest.main() diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt index c743e5d6eb01..3f6e759cdf1b 100644 --- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt +++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt @@ -3,6 +3,7 @@ ## set ( TEST_PY_FILES + ApplyPaalmanPingsCorrectionTest.py CalculateSampleTransmissionTest.py CheckForSampleLogsTest.py ConjoinSpectraTest.py diff --git a/Code/Mantid/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst b/Code/Mantid/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst new file mode 100644 index 000000000000..65991fbedd3a --- /dev/null +++ b/Code/Mantid/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst @@ -0,0 +1,33 @@ +.. algorithm:: + +.. summary:: + +.. alias:: + +.. properties:: + +Description +----------- + +Applies absorption corrections calculated in the Paalman & Pings absorption +factor format: :math:`A_{s,s}` (correction factor for scattering and absorption +in sample), :math:`A_{s,sc}` (scattering in sample and absorption in sample and +container), :math:`A_{c,sc}` (scattering in container and absorption in sample +and container) and :math:`A_{c,c}` (scattering and absorption in container). + +Usage +----- + +**Example:** + +.. testcode:: exSampleAndCan + + TODO + +Output: + +.. testoutput:: exSampleAndCan + + TODO + +.. categories:: From a905bd1afa82313890c28efe03ddc9504c38d6cd Mon Sep 17 00:00:00 2001 From: Federico Montesino Pouzols Date: Sat, 21 Mar 2015 12:42:48 +0000 Subject: [PATCH 075/126] and update namespace, re #11123 --- .../Framework/API/inc/MantidAPI/IRemoteJobManager.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h b/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h index 8ee6dd776735..096289b52882 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h @@ -1,10 +1,10 @@ #ifndef MANTID_KERNEL_IREMOTEJOBMANAGER_H #define MANTID_KERNEL_IREMOTEJOBMANAGER_H -#include "MantidKernel/DllConfig.h" +#include "MantidAPI/DllConfig.h" namespace Mantid { -namespace Kernel { +namespace API { /** Common interface to different remote job managers (job schedulers, web services, etc. such as MOAB, Platform LSF, or SLURM). @@ -63,7 +63,7 @@ along with this program. If not, see . File change history is stored at: . Code Documentation is available at: */ -class MANTID_KERNEL_DLL IRemoteJobManager { +class MANTID_API_DLL IRemoteJobManager { public: virtual ~IRemoteJobManager(){}; @@ -271,7 +271,7 @@ class MANTID_KERNEL_DLL IRemoteJobManager { // shared pointer type for the IRemoteJobManager typedef boost::shared_ptr IRemoteJobManager_sptr; -} // namespace Kernel +} // namespace API } // namespace Mantid #endif // MANTID_KERNEL_IREMOTEJOBMANAGER_H From b7b6bd07e721dd961ee505926075f96400f584ca Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Sat, 21 Mar 2015 16:25:41 +0100 Subject: [PATCH 076/126] Refs #11417. Add failing test case --- Code/Mantid/Framework/Kernel/test/MatrixTest.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Code/Mantid/Framework/Kernel/test/MatrixTest.h b/Code/Mantid/Framework/Kernel/test/MatrixTest.h index f504f2436584..e3438cc49d4d 100644 --- a/Code/Mantid/Framework/Kernel/test/MatrixTest.h +++ b/Code/Mantid/Framework/Kernel/test/MatrixTest.h @@ -429,6 +429,15 @@ class MatrixTest: public CxxTest::TestSuite DblMatrix M4(4,4, true); TS_ASSERT_THROWS(M4.operator *(v), Mantid::Kernel::Exception::MisMatch); + + DblMatrix M23 = boost::lexical_cast("Matrix(2,3)-0.23,0.55,5.22,2.96,4.2,0.1"); + TS_ASSERT_THROWS_NOTHING(M23.operator *(v)); + + nv = M23 * v; + + TS_ASSERT_DELTA(nv.X(), -0.403000000000000, 1e-15); + TS_ASSERT_DELTA(nv.Y(), 25.663000000000000, 1e-15); + TS_ASSERT_EQUALS(nv.Z(), 0); } private: From ff00bd102fe55451e99d292ce5aaa31b41447fca Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Sat, 21 Mar 2015 16:29:01 +0100 Subject: [PATCH 077/126] Refs #11417. Fix matrices with less than 3 rows --- Code/Mantid/Framework/Kernel/src/Matrix.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Code/Mantid/Framework/Kernel/src/Matrix.cpp b/Code/Mantid/Framework/Kernel/src/Matrix.cpp index e6a50066fe5d..e4611db0f6f4 100644 --- a/Code/Mantid/Framework/Kernel/src/Matrix.cpp +++ b/Code/Mantid/Framework/Kernel/src/Matrix.cpp @@ -351,11 +351,15 @@ V3D Matrix::operator*(const V3D &Vx) const @return Matrix(This * A) */ { - if (ny != 3 || nx != 3) + if (ny != 3) throw Kernel::Exception::MisMatch(ny, 3, "Matrix::operator*(V3D)"); - return V3D(V[0][0] * Vx.X() + V[0][1] * Vx.Y() + V[0][2] * Vx.Z(), - V[1][0] * Vx.X() + V[1][1] * Vx.Y() + V[1][2] * Vx.Z(), - V[2][0] * Vx.X() + V[2][1] * Vx.Y() + V[2][2] * Vx.Z()); + + V3D v; + for(size_t i = 0; i < nx; ++i) { + v[i] = V[i][0] * Vx.X() + V[i][1] * Vx.Y() + V[i][2] * Vx.Z(); + } + + return v; } template From 34c649b632afeb951b25d1e1ed1f959d9f1b052a Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Sat, 21 Mar 2015 16:31:54 +0100 Subject: [PATCH 078/126] Refs #11417. Add another failing test case Instead of throwing a size mismatch exception, it throws an out of range exception from V3D. --- Code/Mantid/Framework/Kernel/test/MatrixTest.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Code/Mantid/Framework/Kernel/test/MatrixTest.h b/Code/Mantid/Framework/Kernel/test/MatrixTest.h index e3438cc49d4d..d27c2752545a 100644 --- a/Code/Mantid/Framework/Kernel/test/MatrixTest.h +++ b/Code/Mantid/Framework/Kernel/test/MatrixTest.h @@ -438,6 +438,9 @@ class MatrixTest: public CxxTest::TestSuite TS_ASSERT_DELTA(nv.X(), -0.403000000000000, 1e-15); TS_ASSERT_DELTA(nv.Y(), 25.663000000000000, 1e-15); TS_ASSERT_EQUALS(nv.Z(), 0); + + DblMatrix M43 = boost::lexical_cast("Matrix(4,3)-0.23,0.55,5.22,2.96,4.2,0.1,-0.23,0.55,5.22,2.96,4.2,0.1"); + TS_ASSERT_THROWS(M43.operator *(v), Mantid::Kernel::Exception::MisMatch); } private: From 05dc7bdbb64193872319c7546cae1387346323c0 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Sat, 21 Mar 2015 16:33:35 +0100 Subject: [PATCH 079/126] Refs #11417. Fixing case for matrices with more than 3 rows --- Code/Mantid/Framework/Kernel/src/Matrix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Mantid/Framework/Kernel/src/Matrix.cpp b/Code/Mantid/Framework/Kernel/src/Matrix.cpp index e4611db0f6f4..425b07ab4f3d 100644 --- a/Code/Mantid/Framework/Kernel/src/Matrix.cpp +++ b/Code/Mantid/Framework/Kernel/src/Matrix.cpp @@ -351,7 +351,7 @@ V3D Matrix::operator*(const V3D &Vx) const @return Matrix(This * A) */ { - if (ny != 3) + if (ny != 3 || nx > 3) throw Kernel::Exception::MisMatch(ny, 3, "Matrix::operator*(V3D)"); V3D v; From 5bfd5a92adf3a9e0e6d427e95d8a8bdcde67370f Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Sat, 21 Mar 2015 20:14:06 +0000 Subject: [PATCH 080/126] Re #11397 Better testing for Multirep ranges routine --- .../tests/analysis/ISIS_LETReduction.py | 2 +- .../tests/analysis/ISIS_MAPS_DGSReduction.py | 2 +- .../tests/analysis/ISIS_MariReduction.py | 4 ++-- .../test/DirectEnergyConversionTest.py | 20 ++++++++++++++----- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Code/Mantid/Testing/SystemTests/tests/analysis/ISIS_LETReduction.py b/Code/Mantid/Testing/SystemTests/tests/analysis/ISIS_LETReduction.py index d030a5185bcf..7f7bad55c35f 100644 --- a/Code/Mantid/Testing/SystemTests/tests/analysis/ISIS_LETReduction.py +++ b/Code/Mantid/Testing/SystemTests/tests/analysis/ISIS_LETReduction.py @@ -236,7 +236,7 @@ def custom_name(prop_man): # Uncomment this to use custom filename function # Note: the properties are stored in prop_man class accessed as # below. - #return custom_name(self.reducer.prop_man) + #return lambda : custom_name(self.reducer.prop_man) # use this method to use standard file name generating function return None diff --git a/Code/Mantid/Testing/SystemTests/tests/analysis/ISIS_MAPS_DGSReduction.py b/Code/Mantid/Testing/SystemTests/tests/analysis/ISIS_MAPS_DGSReduction.py index 33f32227f94e..3f93c239ea87 100644 --- a/Code/Mantid/Testing/SystemTests/tests/analysis/ISIS_MAPS_DGSReduction.py +++ b/Code/Mantid/Testing/SystemTests/tests/analysis/ISIS_MAPS_DGSReduction.py @@ -90,7 +90,7 @@ def custom_name(prop_man): # Uncomment this to use custom filename function # Note: the properties are stored in prop_man class accessed as # below. - #return custom_name(self.reducer.prop_man) + #return lambda : custom_name(self.reducer.prop_man) # use this method to use standard file name generating function return None diff --git a/Code/Mantid/Testing/SystemTests/tests/analysis/ISIS_MariReduction.py b/Code/Mantid/Testing/SystemTests/tests/analysis/ISIS_MariReduction.py index e3611b6e2112..0cd60bad6ddf 100644 --- a/Code/Mantid/Testing/SystemTests/tests/analysis/ISIS_MariReduction.py +++ b/Code/Mantid/Testing/SystemTests/tests/analysis/ISIS_MariReduction.py @@ -73,13 +73,13 @@ def custom_name(prop_man): # sample run is more then just list of runs, so we use # the formalization below to access its methods run_num = PropertyManager.sample_run.run_number() - name = "RUN{0}atEi{1:<4.1f}meV_One2One".format(run_num ,ei) + name = "RUN{0}atEi{1:<3.2f}meV_One2One".format(run_num ,ei) return name # Uncomment this to use custom filename function # Note: the properties are stored in prop_man class accessed as # below. - #return custom_name(self.reducer.prop_man) + #return lambda : custom_name(self.reducer.prop_man) # use this method to use standard file name generating function return None diff --git a/Code/Mantid/scripts/test/DirectEnergyConversionTest.py b/Code/Mantid/scripts/test/DirectEnergyConversionTest.py index 0b295c6293fb..e5f988c366f5 100644 --- a/Code/Mantid/scripts/test/DirectEnergyConversionTest.py +++ b/Code/Mantid/scripts/test/DirectEnergyConversionTest.py @@ -314,30 +314,35 @@ def test_tof_range(self): red.prop_man.incident_energy = 67 red.prop_man.energy_bins = [-20,0.2,65] - red.prop_man.multirep_tof_specta_list = [5,5] + red.prop_man.multirep_tof_specta_list = [4,5,6] + MoveInstrumentComponent(Workspace='run', ComponentName='Detector', DetectorID=1102, Z=3) + MoveInstrumentComponent(Workspace='run', ComponentName='Detector', DetectorID=1103,Z=6) + tof_range = red.find_tof_range_for_multirep(run) self.assertEqual(len(tof_range),3) run_tof = ConvertUnits(run,Target='TOF',EMode='Direct',EFixed=67.) - x = run_tof.readX(4) + x = run_tof.readX(3) dx=abs(x[1:]-x[:-1]) xMin = min(x) - xMax = max(x) dt = min(dx) + x = run_tof.readX(5) + xMax = max(x) + self.assertAlmostEqual(tof_range[0],xMin) self.assertAlmostEqual(tof_range[1],dt) self.assertAlmostEqual(tof_range[2],xMax) # check another working mode - red.prop_man.multirep_tof_specta_list = 5 + red.prop_man.multirep_tof_specta_list = 4 tof_range1 = red.find_tof_range_for_multirep(run) self.assertAlmostEqual(tof_range[0],tof_range1[0]) self.assertAlmostEqual(tof_range[1],tof_range1[1]) - self.assertAlmostEqual(tof_range[2],tof_range1[2]) + #self.assertAlmostEqual(tof_range[2],tof_range1[2]) def test_multirep_mode(self): # create test workspace @@ -352,6 +357,9 @@ def test_multirep_mode(self): run = CreateSampleWorkspace( Function='Multiple Peaks',WorkspaceType='Event',NumBanks=8, BankPixelWidth=1,\ NumEvents=100000, XUnit='TOF',xMin=tMin,xMax=tMax) LoadInstrument(run,InstrumentName='MARI') + MoveInstrumentComponent(Workspace='run', ComponentName='Detector', DetectorID=1102,Z=1) + # MoveInstrumentComponent(Workspace='run', ComponentName='Detector', DetectorID=1103,Z=4) + # MoveInstrumentComponent(Workspace='run', ComponentName='Detector', DetectorID=1104,Z=5) # do second run2 = CloneWorkspace(run) @@ -365,6 +373,7 @@ def test_multirep_mode(self): tReducer.hard_mask_file=None tReducer.map_file=None tReducer.save_format=None + tReducer.multirep_tof_specta_list = [4,5] result = tReducer.convert_to_energy(wb_ws,run,[67.,122.],[-2,0.02,0.8]) @@ -431,6 +440,7 @@ def test_multirep_abs_units_mode(self): tReducer.prop_man.normalise_method='monitor-1' tReducer.norm_mon_integration_range=[tMin,tMax] + result = tReducer.convert_to_energy(wb_ws,run,[67.,122.],[-2,0.02,0.8],None,mono) self.assertEqual(len(result),2) From 998f98ed1972deb8b277d2a8f30f61ab6318038d Mon Sep 17 00:00:00 2001 From: Roman Tolchenov Date: Mon, 23 Mar 2015 10:40:13 +0000 Subject: [PATCH 081/126] Re #11405. Do not combine log records. --- .../DataHandling/src/LoadISISNexus2.cpp | 2 +- .../DataHandling/src/LoadMuonLog.cpp | 2 +- .../DataHandling/src/LoadNexusLogs.cpp | 2 +- .../DataHandling/test/LoadRaw3Test.h | 1 + .../Mantid/Framework/Kernel/src/LogParser.cpp | 41 ++++++++----------- 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp b/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp index ca7d7a0dcf2b..5a35092b42a2 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp @@ -9,7 +9,7 @@ #include "MantidKernel/BoundedValidator.h" #include "MantidKernel/ConfigService.h" #include "MantidKernel/ListValidator.h" -#include "MantidKernel/LogParser.h" +//#include "MantidKernel/LogParser.h" #include "MantidKernel/LogFilter.h" #include "MantidKernel/TimeSeriesProperty.h" #include "MantidKernel/UnitFactory.h" diff --git a/Code/Mantid/Framework/DataHandling/src/LoadMuonLog.cpp b/Code/Mantid/Framework/DataHandling/src/LoadMuonLog.cpp index efcf09a27060..2cb1e7f47756 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadMuonLog.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadMuonLog.cpp @@ -6,7 +6,7 @@ #include "MantidKernel/TimeSeriesProperty.h" #include "MantidAPI/FileProperty.h" #include "MantidDataObjects/Workspace2D.h" -#include "MantidKernel/LogParser.h" +//#include "MantidKernel/LogParser.h" #include diff --git a/Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp b/Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp index ebbde7d28c0d..a2c2054368e6 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp @@ -4,7 +4,7 @@ #include "MantidDataHandling/LoadNexusLogs.h" #include #include "MantidKernel/TimeSeriesProperty.h" -#include "MantidKernel/LogParser.h" +//#include "MantidKernel/LogParser.h" #include "MantidAPI/FileProperty.h" #include diff --git a/Code/Mantid/Framework/DataHandling/test/LoadRaw3Test.h b/Code/Mantid/Framework/DataHandling/test/LoadRaw3Test.h index 77b4a90852d1..30aea2518a58 100644 --- a/Code/Mantid/Framework/DataHandling/test/LoadRaw3Test.h +++ b/Code/Mantid/Framework/DataHandling/test/LoadRaw3Test.h @@ -115,6 +115,7 @@ class LoadRaw3Test : public CxxTest::TestSuite // boost::shared_ptr sample = output2D->getSample(); Property *l_property = output2D->run().getLogData( std::string("TEMP1") ); TimeSeriesProperty *l_timeSeriesDouble = dynamic_cast*>(l_property); + std::string timeSeriesString = l_timeSeriesDouble->value(); TS_ASSERT_EQUALS( timeSeriesString.substr(0,23), "2007-Nov-13 15:16:20 0" ); diff --git a/Code/Mantid/Framework/Kernel/src/LogParser.cpp b/Code/Mantid/Framework/Kernel/src/LogParser.cpp index c58b0d771555..9cbb528ac706 100644 --- a/Code/Mantid/Framework/Kernel/src/LogParser.cpp +++ b/Code/Mantid/Framework/Kernel/src/LogParser.cpp @@ -45,7 +45,7 @@ Kernel::Property *LogParser::createLogProperty(const std::string &logFName, } // Change times and new values read from file - std::map change_times; + std::multimap change_times; // Read in the data and determin if it is numeric std::string str, old_data; @@ -61,18 +61,18 @@ Kernel::Property *LogParser::createLogProperty(const std::string &logFName, continue; } - if (!Kernel::TimeSeriesProperty::isTimeString(str)) { - // if the line doesn't start with a time treat it as a continuation of the - // previous data - if (change_times.empty() || isNumeric) { // if there are no previous data - std::string mess = - "Cannot parse log file " + logFName + ". Line:" + str; - g_log.error(mess); - throw std::logic_error(mess); - } - change_times[stime] += std::string(" ") + str; - continue; - } + //if (!Kernel::TimeSeriesProperty::isTimeString(str)) { + // // if the line doesn't start with a time treat it as a continuation of the + // // previous data + // if (change_times.empty() || isNumeric) { // if there are no previous data + // std::string mess = + // "Cannot parse log file " + logFName + ". Line:" + str; + // g_log.error(mess); + // throw std::logic_error(mess); + // } + // change_times[stime] += std::string(" ") + str; + // continue; + //} stime = str.substr(0, 19); sdata = str.substr(19); @@ -86,12 +86,7 @@ Kernel::Property *LogParser::createLogProperty(const std::string &logFName, isNumeric = !istr.fail(); old_data = sdata; - // if time is repeated and the data aren't numeric append the new string to - // the old one - if (!isNumeric && change_times[stime].size() > 0) - change_times[stime] += std::string(" ") + sdata; - else - change_times[stime] = sdata; + change_times.insert( std::make_pair(stime,sdata) ); } if (change_times.empty()) @@ -100,7 +95,7 @@ Kernel::Property *LogParser::createLogProperty(const std::string &logFName, if (isNumeric) { Kernel::TimeSeriesProperty *logv = new Kernel::TimeSeriesProperty(name); - std::map::iterator it = change_times.begin(); + auto it = change_times.begin(); for (; it != change_times.end(); ++it) { std::istringstream istr(it->second); double d; @@ -111,7 +106,7 @@ Kernel::Property *LogParser::createLogProperty(const std::string &logFName, } else { Kernel::TimeSeriesProperty *logv = new Kernel::TimeSeriesProperty(name); - std::map::iterator it = change_times.begin(); + auto it = change_times.begin(); for (; it != change_times.end(); ++it) { logv->addValue(it->first, it->second); } @@ -218,7 +213,7 @@ LogParser::LogParser(const Kernel::Property *log) : m_nOfPeriods(1) { m_nOfPeriods = 1; - std::map::const_iterator it = logm.begin(); + auto it = logm.begin(); for (; it != logm.end(); ++it) { std::string scom; @@ -253,7 +248,7 @@ Kernel::TimeSeriesProperty *LogParser::createPeriodLog(int period) const { Kernel::TimeSeriesProperty *p = new Kernel::TimeSeriesProperty("period " + ostr.str()); std::map pMap = periods->valueAsMap(); - std::map::const_iterator it = pMap.begin(); + auto it = pMap.begin(); if (it->second != period) p->addValue(it->first, false); for (; it != pMap.end(); ++it) From fb865b2f332cf7731ae93870c12c6a7c028a0261 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Mon, 23 Mar 2015 10:14:27 -0400 Subject: [PATCH 082/126] Refs #11400. Suppress warnings in sip we cannot control. --- Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in b/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in index 6e64f1e2b3da..14ed9b9629ec 100644 --- a/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in +++ b/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in @@ -8,6 +8,7 @@ #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wcast-qual" + #pragma GCC diagnostic ignored "-Wpedantic" #endif #include "sipmantidqtpythonpart0.cpp" From 2e1e6b62521044c849df947b7b653370bc7e4bf1 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Mon, 23 Mar 2015 14:19:32 +0000 Subject: [PATCH 083/126] Added unit test for apply algo Refs #10753 --- .../ApplyPaalmanPingsCorrection.py | 17 +++ .../ApplyPaalmanPingsCorrectionTest.py | 115 ++++++++++-------- .../irs26176_graphite002_cyl_Abs.nxs.md5 | 1 + 3 files changed, 82 insertions(+), 51 deletions(-) create mode 100644 Code/Mantid/Testing/Data/UnitTest/irs26176_graphite002_cyl_Abs.nxs.md5 diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py index 854a81e1009f..02b30f23d69a 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py @@ -74,13 +74,16 @@ def PyExec(self): if self._use_can: # Use container factors self._correct_sample_can() + correction_type = 'sample_and_can_corrections' else: # Use sample factor only self._correct_sample() + correction_type = 'sample_corrections_only' else: # Do simple subtraction self._subtract() + correction_type = 'can_subtraction' # Record the container scale factor if self._use_can and self._scale_can: @@ -89,8 +92,20 @@ def PyExec(self): LogType='Number', LogText=str(self._can_scale_factor)) + # Record the type of corrections applied + AddSampleLog(Workspace=self._output_ws_name, + LogName='corrections_type', + LogType='String', + LogText=correction_type) + self.setPropertyValue('OutputWorkspace', self._output_ws_name) + # Remove temporary workspaces + if self._corrections in mtd: + DeleteWorkspace(self._corrections) + if self._scaled_container in mtd: + DeleteWorkspace(self._scaled_container) + def validateInputs(self): """ @@ -259,6 +274,8 @@ def _correct_sample_can(self): RHSWorkspace=self._corrections + '_assc', OutputWorkspace=self._output_ws_name) + DeleteWorkspace(corrected_can_ws) + # Register algorithm with Mantid AlgorithmFactory.subscribe(ApplyPaalmanPingsCorrection) diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py index 41cdf7b2a64a..581f3c7e413c 100644 --- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py +++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ApplyPaalmanPingsCorrectionTest.py @@ -1,7 +1,7 @@ import unittest from mantid.kernel import * from mantid.api import * -from mantid.simpleapi import Load, ConvertUnits, CreateSimulationWorkspace, RebinToWorkspace, Scale, DeleteWorkspace +from mantid.simpleapi import Load, ConvertUnits, SplineInterpolation, ApplyPaalmanPingsCorrection, DeleteWorkspace class ApplyPaalmanPingsCorrectionTest(unittest.TestCase): @@ -28,44 +28,19 @@ def setUp(self): self._sample_ws = sample_ws self._can_ws = can_ws - # Create a dummy correction workspace roughtly similar to the sample - ws = CreateSimulationWorkspace(Instrument='IRIS', - BinParams='6,0.1,8', - UnitX='Wavelength') + # Load the corrections workspace + corrections = Load('irs26176_graphite002_cyl_Abs.nxs') - # Rebin the dummy workspace to match the smaple - ws = RebinToWorkspace(WorkspaceToRebin=ws, - WorkspaceToMatch=sample_ws) + # Interpolate each of the correction factor workspaces + # Required to use corrections from the old indirect calculate + # corrections routines + for factor_ws in corrections: + SplineInterpolation(WorkspaceToMatch=sample_ws, + WorkspaceToInterpolate=factor_ws, + OutputWorkspace=factor_ws, + OutputWorkspaceDeriv='') - # Test correction workspace names - self._ass_ws_name = '__ApplyPaalmanPingsCorrection_ass' - self._acc_ws_name = '__ApplyPaalmanPingsCorrection_acc' - self._acsc_ws_name = '__ApplyPaalmanPingsCorrection_acsc' - self._assc_ws_name = '__ApplyPaalmanPingsCorrection_assc' - - # Scale them to make them look like correction factors - Scale(InputWorkspace=ws, - Factor=0.54, - Operation='Multiply', - OutputWorkspace=self._ass_ws_name) - - Scale(InputWorkspace=ws, - Factor=0.9, - Operation='Multiply', - OutputWorkspace=self._acc_ws_name) - - Scale(InputWorkspace=ws, - Factor=0.54, - Operation='Multiply', - OutputWorkspace=self._acsc_ws_name) - - Scale(InputWorkspace=ws, - Factor=0.56, - Operation='Multiply', - OutputWorkspace=self._assc_ws_name) - - # Delete the dummy workspace - DeleteWorkspace(ws) + self._corrections_ws = corrections def tearDown(self): @@ -73,32 +48,70 @@ def tearDown(self): Remove workspaces from ADS. """ - # Sample and can DeleteWorkspace(self._sample_ws) DeleteWorkspace(self._can_ws) - - # Simulated corrections - DeleteWorkspace(self._ass_ws_name) - DeleteWorkspace(self._acc_ws_name) - DeleteWorkspace(self._acsc_ws_name) - DeleteWorkspace(self._assc_ws_name) + DeleteWorkspace(self._corrections_ws) - def _verify_workspace(self, ws_name): + def _verify_workspace(self, ws, correction_type): """ Do validation on a correction workspace. - @param ws_name Name of workspace to validate + @param ws Workspace to validate + @param correction_type Type of correction that should hav ebeen applied """ - pass # TODO + # X axis should be in wavelength + x_unit = ws.getAxis(0).getUnit().unitID() + self.assertEquals(x_unit, 'Wavelength') + # Sample logs should contain correction type + logs = ws.getSampleDetails() + self.assertTrue('corrections_type' in logs) - def test(self): - """ - """ + # Ensure value from sample log is correct + if 'corrections_type' in logs: + log_correction_type = logs['corrections_type'].value + self.assertEqual(log_correction_type, correction_type) + + + def test_can_subtraction(self): + corr = ApplyPaalmanPingsCorrection(SampleWorkspace=self._sample_ws, + CanWorkspace=self._can_ws) + + self._verify_workspace(corr, 'can_subtraction') + + + def test_can_subtraction_with_can_scale(self): + corr = ApplyPaalmanPingsCorrection(SampleWorkspace=self._sample_ws, + CanWorkspace=self._can_ws, + CanScaleFactor=0.9) + + self._verify_workspace(corr, 'can_subtraction') + + + def test_sample_corrections_only(self): + corr = ApplyPaalmanPingsCorrection(SampleWorkspace=self._sample_ws, + CorrectionsWorkspace=self._corrections_ws) + + self._verify_workspace(corr, 'sample_corrections_only') + + + def test_sample_and_can_corrections(self): + corr = ApplyPaalmanPingsCorrection(SampleWorkspace=self._sample_ws, + CorrectionsWorkspace=self._corrections_ws, + CanWorkspace=self._can_ws) + + self._verify_workspace(corr, 'sample_and_can_corrections') + + + def test_sample_and_can_corrections_with_can_scale(self): + corr = ApplyPaalmanPingsCorrection(SampleWorkspace=self._sample_ws, + CorrectionsWorkspace=self._corrections_ws, + CanWorkspace=self._can_ws, + CanScaleFactor=0.9) - pass # TODO + self._verify_workspace(corr, 'sample_and_can_corrections') if __name__=="__main__": diff --git a/Code/Mantid/Testing/Data/UnitTest/irs26176_graphite002_cyl_Abs.nxs.md5 b/Code/Mantid/Testing/Data/UnitTest/irs26176_graphite002_cyl_Abs.nxs.md5 new file mode 100644 index 000000000000..98a9172ca63d --- /dev/null +++ b/Code/Mantid/Testing/Data/UnitTest/irs26176_graphite002_cyl_Abs.nxs.md5 @@ -0,0 +1 @@ +f4b31e993d1747f22074cd17365cf0eb \ No newline at end of file From 5742ed37d1e7284316618d0e1ad07150f57e497f Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Mon, 23 Mar 2015 14:36:25 +0000 Subject: [PATCH 084/126] Clean up workspaces correctly Refs #10753 --- .../WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py index 02b30f23d69a..d37d518831a0 100644 --- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py +++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ApplyPaalmanPingsCorrection.py @@ -222,6 +222,10 @@ def _pre_process_corrections(self): CloneWorkspace(InputWorkspace=input_name, OutputWorkspace=output_name) + # Group the temporary factor workspaces (for easy removal later) + GroupWorkspaces(InputWorkspaces=[self._corrections + '_' + f_type for f_type in factor_types], + OutputWorkspace=self._corrections) + def _subtract(self): """ From 1face0291cc4a1d7d204d6741532ed60a3b75d9b Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Mon, 23 Mar 2015 14:37:36 +0000 Subject: [PATCH 085/126] Search for files in correct case Refs #11419 --- .../docs/source/algorithms/IndirectTransmissionMonitor-v1.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/docs/source/algorithms/IndirectTransmissionMonitor-v1.rst b/Code/Mantid/docs/source/algorithms/IndirectTransmissionMonitor-v1.rst index cce60aab898a..59f76e941979 100644 --- a/Code/Mantid/docs/source/algorithms/IndirectTransmissionMonitor-v1.rst +++ b/Code/Mantid/docs/source/algorithms/IndirectTransmissionMonitor-v1.rst @@ -26,8 +26,8 @@ Usage .. testcode:: exIRISTransmission - sample_ws = Load('IRS26176.raw') - can_ws = Load('IRS26173.raw') + sample_ws = Load('IRS26176.RAW') + can_ws = Load('IRS26173.RAW') transmission_ws = IndirectTransmissionMonitor(SampleWorkspace=sample_ws, CanWorkspace=can_ws) From e81a29bd6d3aececff4250fa3875329c146275a0 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Mon, 23 Mar 2015 15:04:07 +0000 Subject: [PATCH 086/126] Add documentation for apply correction algorithm Refs #10753 --- .../irs26176_graphite002_cyl_Abs.nxs.md5 | 1 + .../ApplyPaalmanPingsCorrection-v1.rst | 53 +++++++++++++++++-- 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 Code/Mantid/Testing/Data/DocTest/irs26176_graphite002_cyl_Abs.nxs.md5 diff --git a/Code/Mantid/Testing/Data/DocTest/irs26176_graphite002_cyl_Abs.nxs.md5 b/Code/Mantid/Testing/Data/DocTest/irs26176_graphite002_cyl_Abs.nxs.md5 new file mode 100644 index 000000000000..98a9172ca63d --- /dev/null +++ b/Code/Mantid/Testing/Data/DocTest/irs26176_graphite002_cyl_Abs.nxs.md5 @@ -0,0 +1 @@ +f4b31e993d1747f22074cd17365cf0eb \ No newline at end of file diff --git a/Code/Mantid/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst b/Code/Mantid/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst index 65991fbedd3a..40af9ecafb8f 100644 --- a/Code/Mantid/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst +++ b/Code/Mantid/docs/source/algorithms/ApplyPaalmanPingsCorrection-v1.rst @@ -15,19 +15,62 @@ in sample), :math:`A_{s,sc}` (scattering in sample and absorption in sample and container), :math:`A_{c,sc}` (scattering in container and absorption in sample and container) and :math:`A_{c,c}` (scattering and absorption in container). +This algorithm can be used to apply absorption corrections calculated with +either the :ref:`algm-CylinderPaalmanPingsCorrection` and +:ref:`algm-FlatPlatePaalmanPingsCorrection` algorithms as well as the legacy +indirect calculate correcteions routine, providing that the sample and container +are first converted to wavelength and the corrections are interpolated to match +the sample as demonstrated in the example below. + Usage ----- -**Example:** +**Example: using with legacy indirect corrections data** + +.. testcode:: exSampleAndCanIRISLegacyCorrections + + # Load the sample and can + sample_ws = Load('irs26176_graphite002_red.nxs') + can_ws = Load('irs26173_graphite002_red.nxs') + + # Convert sample and container workspaces to wavelength + sample_ws = ConvertUnits(InputWorkspace=sample_ws, + Target='Wavelength', + EMode='Indirect', + EFixed=1.845) + can_ws = ConvertUnits(InputWorkspace=can_ws, + Target='Wavelength', + EMode='Indirect', + EFixed=1.845) + + # Load the corrections workspace + corrections_ws = Load('irs26176_graphite002_cyl_Abs.nxs') + + # Interpolate each of the correction factor workspaces to match the + # binning of the smaple + # Required to use corrections from the old indirect calculate + # corrections routines + for factor_ws in corrections_ws: + SplineInterpolation(WorkspaceToMatch=sample_ws, + WorkspaceToInterpolate=factor_ws, + OutputWorkspace=factor_ws, + OutputWorkspaceDeriv='') + + corr = ApplyPaalmanPingsCorrection(SampleWorkspace=sample_ws, + CorrectionsWorkspace=corrections_ws, + CanWorkspace=can_ws) -.. testcode:: exSampleAndCan + print 'Corrected workspace has %d spectra over %d bins' % ( + corr.getNumberHistograms(), corr.blocksize()) - TODO + print 'Type of correction applied: %s' % ( + corr.getRun()['corrections_type'].value) Output: -.. testoutput:: exSampleAndCan +.. testoutput:: exSampleAndCanIRISLegacyCorrections - TODO + Corrected workspace has 10 spectra over 1905 bins + Type of correction applied: sample_and_can_corrections .. categories:: From 08d3845eaeeadde29389e917ec309812bbd00131 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Mon, 23 Mar 2015 20:52:33 +0100 Subject: [PATCH 087/126] Refs #11043. Added reduced chi square to output Added this to the algorithms documentation. --- Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp | 11 +++++++++++ Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst | 9 ++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index 2f7907e3f47e..bf17c6382db9 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -289,6 +289,11 @@ void PawleyFit::init() { Direction::Output), "TableWorkspace with refined peak parameters, including errors."); + declareProperty("ReducedChiSquare", 0.0, "Outputs the reduced chi square " + "value as a measure for the quality " + "of the fit.", + Direction::Output); + m_dUnit = UnitFactory::Instance().create("dSpacing"); } @@ -379,6 +384,10 @@ void PawleyFit::exec() { fit->setProperty("CreateOutput", true); fit->execute(); + double chiSquare = fit->getProperty("OutputChi2overDoF"); + + g_log.information() << "Fit finished, reduced ChiSquare = " << chiSquare + << std::endl; g_log.information() << "Generating output..." << std::endl; @@ -388,6 +397,8 @@ void PawleyFit::exec() { setProperty("RefinedCellTable", getLatticeFromFunction(pawleyFn)); setProperty("RefinedPeakParameterTable", getPeakParametersFromFunction(pawleyFn)); + + setProperty("ReducedChiSquare", chiSquare); } } // namespace CurveFitting diff --git a/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst b/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst index 1927a7a07f2b..3e59022cd040 100644 --- a/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst +++ b/Code/Mantid/docs/source/algorithms/PawleyFit-v1.rst @@ -15,6 +15,8 @@ PawleyFit requires a MatrixWorkspace with at least one spectrum in terms of eith In addition, a TableWorkspace with information about the reflections that are found in the spectrum must be passed as well. There must be four columns with the captions "HKL", "d", "FWHM (rel.)" and "Intensity". The HKL column can be supplied either as V3D or as a string with 3 numbers separated by space, comma or semi-colon and possibly surrounded by square brackets. One way to obtain such a table is to use three algorithms that are used in analysis of POLDI data, which produce tables in a suitable format. Details are given in the usage example section. +Along with the workspaces containing fit results and parameter values, the algorithm also outputs the reduced :math:`\chi^2`-value, which is also written in the log. + Usage ----- @@ -48,11 +50,10 @@ For the usage example there is a calculated, theoretical diffraction pattern (in print "The number of peaks that were indexed:", si_peaks_indexed.rowCount() # Run the actual fit with lattice parameters that are slightly off - si_fitted = PawleyFit(si_spectrum, + si_fitted, si_cell, si_params, chi_square = PawleyFit(si_spectrum, CrystalSystem='Cubic', InitialCell='5.436 5.436 5.436', - PeakTable=si_peaks_indexed, - RefinedCellTable='si_cell', RefinedPeakParameterTable='si_params') + PeakTable=si_peaks_indexed) si_cell = AnalysisDataService.retrieve("si_cell") @@ -63,6 +64,7 @@ For the usage example there is a calculated, theoretical diffraction pattern (in print "The lattice parameter was refined to a =", a, "+/-", a_err print "The deviation from the actual parameter (a=5.4311946) is:", a_diff print "This difference corresponds to", np.round(a_diff / a_err, 2), "standard deviations." + print "The reduced chi square of the fit is:", np.round(chi_square, 3) Running this script will generate a bit of output about the results of the different steps. At the end the lattice parameter differs less than one standard deviation from the actual value. @@ -73,6 +75,7 @@ Running this script will generate a bit of output about the results of the diffe The lattice parameter was refined to a = 5.431205 +/- 1.6e-05 The deviation from the actual parameter (a=5.4311946) is: 1e-05 This difference corresponds to 0.63 standard deviations. + The reduced chi square of the fit is: 1.04 .. testcleanup:: ExPawleySilicon From efe2dbe764e9e7d5203d9f4b74a98a46aa1c106e Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Mon, 23 Mar 2015 13:24:13 -0700 Subject: [PATCH 088/126] Refs #11400. Cleanup sip and python-related warnings. --- .../mantid/api/src/Exports/FileFinder.cpp | 2 +- .../kernel/src/Converters/NDArrayToVector.cpp | 17 ++++++++++++----- Code/Mantid/MantidPlot/src/sipqti.cpp.in | 6 +----- Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in | 7 +------ 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp index 0ff7f80e71ef..d4bec6851b00 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp @@ -8,7 +8,7 @@ using Mantid::API::FileFinderImpl; using namespace boost::python; namespace { - BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getFullPathOverloader, getFullPath, 1, 2); + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getFullPathOverloader, getFullPath, 1, 2) } void export_FileFinder() diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp index 759fe6b6e038..49b15eed0c77 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp @@ -30,16 +30,23 @@ namespace Mantid { // Use the iterator API to iterate through the array // and assign each value to the corresponding vector - PyObject *iter = PyArray_IterNew((PyObject*)arr); + typedef union { + DestElementType* output; + char** input; + } npy_union; + npy_union data; + NpyIter *iter = NpyIter_New(arr, NPY_ITER_READONLY, + NPY_KEEPORDER, NPY_SAFE_CASTING, + NULL); + NpyIter_IterNextFunc *iternext = NpyIter_GetIterNext(iter, NULL); npy_intp index(0); do { - DestElementType *data = (DestElementType*)PyArray_ITER_DATA(iter); - cvector[index] = *data; + data.input = NpyIter_GetDataPtrArray(iter); + cvector[index] = *data.output; ++index; - PyArray_ITER_NEXT(iter); } - while(PyArray_ITER_NOTDONE(iter)); + while(iternext(iter)); } }; diff --git a/Code/Mantid/MantidPlot/src/sipqti.cpp.in b/Code/Mantid/MantidPlot/src/sipqti.cpp.in index 750399d6d8f9..97e1ee261ff1 100644 --- a/Code/Mantid/MantidPlot/src/sipqti.cpp.in +++ b/Code/Mantid/MantidPlot/src/sipqti.cpp.in @@ -3,11 +3,7 @@ // that we can't control //------------------------------------------------------------------------------ #if defined(__GNUC__) && !(defined(__INTEL_COMPILER)) - #pragma GCC diagnostic ignored "-Wuninitialized" - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wunused-variable" - #pragma GCC diagnostic ignored "-Wparentheses" - #pragma GCC diagnostic ignored "-Wcast-qual" + #pragma GCC system_header #endif #include "sip_qtipart0.cpp" diff --git a/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in b/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in index 14ed9b9629ec..ea2dbae4a3f6 100644 --- a/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in +++ b/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in @@ -3,12 +3,7 @@ // that we can't control //------------------------------------------------------------------------------ #if defined(__GNUC__) && !(defined(__INTEL_COMPILER)) - #pragma GCC diagnostic ignored "-Wuninitialized" - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wunused-variable" - #pragma GCC diagnostic ignored "-Wparentheses" - #pragma GCC diagnostic ignored "-Wcast-qual" - #pragma GCC diagnostic ignored "-Wpedantic" + #pragma GCC system_header #endif #include "sipmantidqtpythonpart0.cpp" From 3bd1c5553f219e54675f115c4b39b0d8f5148478 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Mon, 23 Mar 2015 14:37:36 +0000 Subject: [PATCH 089/126] Search for files in correct case Refs #11419 --- .../docs/source/algorithms/IndirectTransmissionMonitor-v1.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/docs/source/algorithms/IndirectTransmissionMonitor-v1.rst b/Code/Mantid/docs/source/algorithms/IndirectTransmissionMonitor-v1.rst index cce60aab898a..59f76e941979 100644 --- a/Code/Mantid/docs/source/algorithms/IndirectTransmissionMonitor-v1.rst +++ b/Code/Mantid/docs/source/algorithms/IndirectTransmissionMonitor-v1.rst @@ -26,8 +26,8 @@ Usage .. testcode:: exIRISTransmission - sample_ws = Load('IRS26176.raw') - can_ws = Load('IRS26173.raw') + sample_ws = Load('IRS26176.RAW') + can_ws = Load('IRS26173.RAW') transmission_ws = IndirectTransmissionMonitor(SampleWorkspace=sample_ws, CanWorkspace=can_ws) From 9762dfb4ba2bfaab5a4e8df0055bd987ae0ba162 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Mon, 23 Mar 2015 17:03:30 -0400 Subject: [PATCH 090/126] Refs #11400. use older numpy iterator functions. --- .../kernel/src/Converters/NDArrayToVector.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp index 49b15eed0c77..85bfa6628900 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp @@ -32,21 +32,18 @@ namespace Mantid // and assign each value to the corresponding vector typedef union { DestElementType* output; - char** input; + void *input; } npy_union; npy_union data; - NpyIter *iter = NpyIter_New(arr, NPY_ITER_READONLY, - NPY_KEEPORDER, NPY_SAFE_CASTING, - NULL); - NpyIter_IterNextFunc *iternext = NpyIter_GetIterNext(iter, NULL); + PyObject *iter = PyArray_IterNew((PyObject *)arr); npy_intp index(0); do { - data.input = NpyIter_GetDataPtrArray(iter); - cvector[index] = *data.output; + data.input = PyArray_ITER_DATA(iter); + cvector[index] = *data.output; ++index; - } - while(iternext(iter)); + PyArray_ITER_NEXT(iter); + } while (PyArray_ITER_NOTDONE(iter)); } }; From e7c4a60cb7bd07b6ad52bdb97d4642ecf16afba1 Mon Sep 17 00:00:00 2001 From: Roman Tolchenov Date: Tue, 24 Mar 2015 08:18:23 +0000 Subject: [PATCH 091/126] Re #11406. Don't swap curves. --- Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp index 2ef4c3335a47..7b8c46dd998f 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp @@ -2634,9 +2634,6 @@ void MantidUI::importNumSeriesLog(const QString &wsName, const QString &logName, } } - iValueCurve = 1; - iFilterCurve = 0; - } //end (valid filter exists) } From 64941ad4a2bad550c9baa490a243be1cce82d2ec Mon Sep 17 00:00:00 2001 From: Martyn Gigg Date: Tue, 24 Mar 2015 08:42:38 +0000 Subject: [PATCH 092/126] Disable all warnings from sip-generated code. As the code is entirely autogenerated we can't do anything about it. Refs #11400 --- Code/Mantid/MantidPlot/src/qti.sip | 6 ++++++ Code/Mantid/MantidPlot/src/sipqti.cpp.in | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Code/Mantid/MantidPlot/src/qti.sip b/Code/Mantid/MantidPlot/src/qti.sip index 2d12a0cb2431..b241c862b0d9 100644 --- a/Code/Mantid/MantidPlot/src/qti.sip +++ b/Code/Mantid/MantidPlot/src/qti.sip @@ -31,6 +31,12 @@ %Module _qti +%UnitCode + #if defined(__GNUC__) && !(defined(__INTEL_COMPILER)) + #pragma GCC system_header + #endif +%End + %Import QtCore/QtCoremod.sip %Import QtGui/QtGuimod.sip %Import mantidqt.sip diff --git a/Code/Mantid/MantidPlot/src/sipqti.cpp.in b/Code/Mantid/MantidPlot/src/sipqti.cpp.in index 97e1ee261ff1..8f4697499b3c 100644 --- a/Code/Mantid/MantidPlot/src/sipqti.cpp.in +++ b/Code/Mantid/MantidPlot/src/sipqti.cpp.in @@ -1,9 +1,8 @@ //------------------------------------------------------------------------------ // A wrapper for the auto-generated sipqtipart?.cpp files to disable warnings -// that we can't control +// that we can't control. The warnings are actually suppressed in qti.sip +// with '#pragma GCC system_header' but that pragma only works if it occurs +// in a file that has been included with '#include' //------------------------------------------------------------------------------ -#if defined(__GNUC__) && !(defined(__INTEL_COMPILER)) - #pragma GCC system_header -#endif #include "sip_qtipart0.cpp" From 13844e2206a759e7b91443c67c4f7e3146e55098 Mon Sep 17 00:00:00 2001 From: Martyn Gigg Date: Tue, 24 Mar 2015 08:49:50 +0000 Subject: [PATCH 093/126] Ignore all warnings in MantidQt sip code. Refs #11400 --- Code/Mantid/MantidPlot/src/sipqti.cpp.in | 1 - Code/Mantid/MantidQt/Python/mantidqt.sip | 6 ++++++ Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in | 14 ++++++-------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Code/Mantid/MantidPlot/src/sipqti.cpp.in b/Code/Mantid/MantidPlot/src/sipqti.cpp.in index 8f4697499b3c..b7661e145264 100644 --- a/Code/Mantid/MantidPlot/src/sipqti.cpp.in +++ b/Code/Mantid/MantidPlot/src/sipqti.cpp.in @@ -4,5 +4,4 @@ // with '#pragma GCC system_header' but that pragma only works if it occurs // in a file that has been included with '#include' //------------------------------------------------------------------------------ - #include "sip_qtipart0.cpp" diff --git a/Code/Mantid/MantidQt/Python/mantidqt.sip b/Code/Mantid/MantidQt/Python/mantidqt.sip index a4f514df9c8a..89b157802ef4 100644 --- a/Code/Mantid/MantidQt/Python/mantidqt.sip +++ b/Code/Mantid/MantidQt/Python/mantidqt.sip @@ -10,6 +10,12 @@ // Define the module name. This has to match the library filename %Module mantidqtpython +%UnitCode + #if defined(__GNUC__) && !(defined(__INTEL_COMPILER)) + #pragma GCC system_header + #endif +%End + /******************************** SIP Imports ****************/ %Import QtCore/QtCoremod.sip %Import QtGui/QtGuimod.sip diff --git a/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in b/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in index ea2dbae4a3f6..c72a0a422afc 100644 --- a/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in +++ b/Code/Mantid/MantidQt/Python/sip_mantidqt.cpp.in @@ -1,9 +1,7 @@ -//------------------------------------------------------------------------------ -// A wrapper for the auto-generated sip*.cpp files to disable warnings -// that we can't control -//------------------------------------------------------------------------------ -#if defined(__GNUC__) && !(defined(__INTEL_COMPILER)) - #pragma GCC system_header -#endif - +//-------------------------------------------------------------------------------------- +// A wrapper for the auto-generated sipmantidqtpythonpart?.cpp files to disable warnings +// that we can't control. The warnings are actually suppressed in qti.sip +// with '#pragma GCC system_header' but that pragma only works if it occurs +// in a file that has been included with '#include' +//------------------------------------------------------------------------------------- #include "sipmantidqtpythonpart0.cpp" From 4e11688199b72b2ab9a80e2a3c66d6bdca68c3f7 Mon Sep 17 00:00:00 2001 From: Roman Tolchenov Date: Tue, 24 Mar 2015 08:52:40 +0000 Subject: [PATCH 094/126] Re #11406. Check for a null pointer. --- .../Mantid/MantidPlot/src/Mantid/MantidUI.cpp | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp index 7b8c46dd998f..ecd6a1c3d119 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp @@ -2732,18 +2732,21 @@ void MantidUI::importNumSeriesLog(const QString &wsName, const QString &logName, if (filter && flt.filter()) { QwtPlotCurve *c = g->curve(iFilterCurve); - // Set the right axis as Y axis for the filter curve. - c->setAxis(2,1); - // Set style #3 (HorizontalSteps) for curve 1 - // Set scale of right Y-axis (#3) from 0 to 1 - g->setCurveStyle(iFilterCurve,3); - g->setScale(3,0,1); - // Fill area under the curve with a pattern - QBrush br = QBrush(Qt::gray, Qt::Dense5Pattern); - g->setCurveBrush(iFilterCurve, br); - // Set line colour - QPen pn = QPen(Qt::gray); - g->setCurvePen(iFilterCurve, pn); + if ( c ) + { + // Set the right axis as Y axis for the filter curve. + c->setAxis(2,1); + // Set style #3 (HorizontalSteps) for curve 1 + // Set scale of right Y-axis (#3) from 0 to 1 + g->setCurveStyle(iFilterCurve,3); + g->setScale(3,0,1); + // Fill area under the curve with a pattern + QBrush br = QBrush(Qt::gray, Qt::Dense5Pattern); + g->setCurveBrush(iFilterCurve, br); + // Set line colour + QPen pn = QPen(Qt::gray); + g->setCurvePen(iFilterCurve, pn); + } } g->setXAxisTitle(t->colLabel(0)); g->setYAxisTitle(t->colLabel(1).section(".",0,0)); From d40794dec0d007bcf1dc86be4339e284e8dd3165 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Tue, 24 Mar 2015 10:01:16 +0000 Subject: [PATCH 095/126] Fix Doxygen error Also update the docs to reflect what this function actually does. --- Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp index 88b8e682820e..622f508723de 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp +++ b/Code/Mantid/MantidQt/MantidWidgets/src/PreviewPlot.cpp @@ -328,9 +328,10 @@ bool PreviewPlot::hasCurve(const QString & curveName) /** - * Attaches a RangeSelector to the plot and stores it. + * Creates a RangeSelector, adds it to the plot and stores it. * * @param rsName Name of range selector + * @param type Type of range selector to add * @return RangeSelector object */ RangeSelector * PreviewPlot::addRangeSelector(const QString & rsName, From 397705a846fa51ab5fbf07b7d50459ff1b1c98b8 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Tue, 24 Mar 2015 13:24:51 +0000 Subject: [PATCH 096/126] Add Shift parameter to DiffSphere Refs #10189 --- Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp b/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp index aafd90d88c51..2638aada766b 100644 --- a/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp @@ -145,6 +145,7 @@ InelasticDiffSphere::InelasticDiffSphere() declareParameter("Diffusion", 0.05, "Diffusion coefficient, in units of " "A^2*THz, if energy in meV, or A^2*PHz " "if energy in ueV"); + declareParameter("Shift", 0.0, "Shift in domain"); declareAttribute("Q", API::IFunction::Attribute(1.0)); } @@ -194,6 +195,7 @@ void InelasticDiffSphere::function1D(double *out, const double *xValues, const double R = getParameter("Radius"); const double D = getParameter("Diffusion"); const double Q = getAttribute("Q").asDouble(); + const double S = getParameter("Shift"); // // Penalize negative parameters if (I < std::numeric_limits::epsilon() || @@ -216,7 +218,7 @@ void InelasticDiffSphere::function1D(double *out, const double *xValues, std::vector YJ; YJ = LorentzianCoefficients(Q * R); // The (2l+1)*A_{n,l} for (size_t i = 0; i < nData; i++) { - double energy = xValues[i]; // from meV to THz (or from micro-eV to PHz) + double energy = xValues[i] - S; // from meV to THz (or from micro-eV to PHz) out[i] = 0.0; for (size_t n = 0; n < ncoeff; n++) { double L = (1.0 / M_PI) * HWHM[n] / From c0ec79c8dec44b257b8e68621eac9043d0acfadf Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Tue, 24 Mar 2015 13:25:31 +0000 Subject: [PATCH 097/126] Also add Shift to DiffRotDiscreteCircle Also had same issue, may as well fix here Refs #10189 --- .../Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp b/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp index 1c2042fbdeef..c814e613c3ce 100644 --- a/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp @@ -54,6 +54,7 @@ InelasticDiffRotDiscreteCircle::InelasticDiffRotDiscreteCircle() declareParameter("Decay", 1.0, "Inverse of transition rate, in nanoseconds " "if energy in micro-ev, or picoseconds if " "energy in mili-eV"); + declareParameter("Shift", 0.0, "Shift in domain"); declareAttribute("Q", API::IFunction::Attribute(0.5)); declareAttribute("N", API::IFunction::Attribute(3)); @@ -82,6 +83,7 @@ void InelasticDiffRotDiscreteCircle::function1D(double *out, const double rate = m_hbar / getParameter("Decay"); // micro-eV or mili-eV const double Q = getAttribute("Q").asDouble(); const int N = getAttribute("N").asInt(); + const double S = getParameter("Shift"); std::vector sph(N); for (int k = 1; k < N; k++) { @@ -97,7 +99,7 @@ void InelasticDiffRotDiscreteCircle::function1D(double *out, } for (size_t i = 0; i < nData; i++) { - double w = xValues[i]; + double w = xValues[i] - S; double S = 0.0; for (int l = 1; l < N; l++) // l goes up to N-1 { From 36223fdaf7f7eb8eae191a5e10fd3f79b0f1fe6b Mon Sep 17 00:00:00 2001 From: Roman Tolchenov Date: Tue, 24 Mar 2015 13:27:02 +0000 Subject: [PATCH 098/126] Re #11405. Re-enabled line continuations. Added tests. --- .../Mantid/Framework/Kernel/src/LogParser.cpp | 32 ++-- .../Framework/Kernel/test/LogParserTest.h | 144 +++++++++++++++--- 2 files changed, 145 insertions(+), 31 deletions(-) diff --git a/Code/Mantid/Framework/Kernel/src/LogParser.cpp b/Code/Mantid/Framework/Kernel/src/LogParser.cpp index 9cbb528ac706..e88d7f883f30 100644 --- a/Code/Mantid/Framework/Kernel/src/LogParser.cpp +++ b/Code/Mantid/Framework/Kernel/src/LogParser.cpp @@ -61,18 +61,26 @@ Kernel::Property *LogParser::createLogProperty(const std::string &logFName, continue; } - //if (!Kernel::TimeSeriesProperty::isTimeString(str)) { - // // if the line doesn't start with a time treat it as a continuation of the - // // previous data - // if (change_times.empty() || isNumeric) { // if there are no previous data - // std::string mess = - // "Cannot parse log file " + logFName + ". Line:" + str; - // g_log.error(mess); - // throw std::logic_error(mess); - // } - // change_times[stime] += std::string(" ") + str; - // continue; - //} + if (!Kernel::TimeSeriesProperty::isTimeString(str)) { + // if the line doesn't start with a time treat it as a continuation of the + // previous data + if (change_times.empty() || isNumeric) { // if there are no previous data + std::string mess = + "Cannot parse log file " + logFName + ". Line:" + str; + g_log.error(mess); + throw std::logic_error(mess); + } + auto range = change_times.equal_range(stime); + if ( range.first != range.second ){ + auto last = range.first; + for(auto it = last; it != range.second; ++it){ + last = it; + } + last->second += std::string(" ") + str; + old_data = last->second; + continue; + } + } stime = str.substr(0, 19); sdata = str.substr(19); diff --git a/Code/Mantid/Framework/Kernel/test/LogParserTest.h b/Code/Mantid/Framework/Kernel/test/LogParserTest.h index 790a09ecef12..882cc3f06b1e 100644 --- a/Code/Mantid/Framework/Kernel/test/LogParserTest.h +++ b/Code/Mantid/Framework/Kernel/test/LogParserTest.h @@ -13,6 +13,20 @@ #include +namespace{ + +class TmpFile{ + Poco::File m_file; +public: + TmpFile(const std::string& fname):m_file(fname){} + ~TmpFile(){remove();} + const std::string& path() const {return m_file.path();} + bool exists() const {return m_file.exists();} + void remove() {if (m_file.exists()) m_file.remove();} +}; + +} + using namespace Mantid::Kernel; class LogParserTest : public CxxTest::TestSuite @@ -27,20 +41,13 @@ class LogParserTest : public CxxTest::TestSuite log_num_early("TST000000_early.txt"), log_num_single("TST000000_single.txt"), log_str("TST000000_str.txt"), - icp_file("TST000000_icpevent.txt") + icp_file("TST000000_icpevent.txt"), + log_str_repeat("TST000000_repeat.txt"), + log_num_repeat("TST000000_num_repeat.txt"), + log_str_continuations("TST000000_str_continue.txt") { } - ~LogParserTest() - { - if ( log_num_good.exists() ) log_num_good.remove(); - if ( log_num_late.exists() ) log_num_late.remove(); - if ( log_num_early.exists() ) log_num_early.remove(); - if ( log_num_single.exists() ) log_num_single.remove(); - if ( log_str.exists() ) log_str.remove(); - if ( icp_file.exists() ) icp_file.remove(); - } - void testGood() { mkICP(); @@ -515,7 +522,67 @@ class LogParserTest : public CxxTest::TestSuite delete log; } -//*/ + void test_str_repeat() + { + mkStrRepeat(); + Property *prop = LogParser::createLogProperty(log_str_repeat.path(),"log"); + const auto *log = dynamic_cast*>(prop); + TS_ASSERT(log); + auto logm = log->valueAsMultiMap(); + auto it = logm.begin(); + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:34"); + TS_ASSERT_EQUALS( it->second, " First line"); ++it; + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:34"); + TS_ASSERT_EQUALS( it->second, " Second line"); ++it; + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33"); + TS_ASSERT_EQUALS( it->second, " First line"); ++it; + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33"); + TS_ASSERT_EQUALS( it->second, " Second line"); ++it; + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33"); + TS_ASSERT_EQUALS( it->second, " Third line"); ++it; + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33"); + TS_ASSERT_EQUALS( it->second, " Fourth line"); ++it; + } + + void test_num_repeat() + { + mkNumRepeat(); + Property *prop = LogParser::createLogProperty(log_str_repeat.path(),"log"); + const auto *log = dynamic_cast*>(prop); + TS_ASSERT(log); + auto logm = log->valueAsMultiMap(); + auto it = logm.begin(); + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:34"); + TS_ASSERT_EQUALS( it->second, 1); ++it; + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:34"); + TS_ASSERT_EQUALS( it->second, 2); ++it; + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33"); + TS_ASSERT_EQUALS( it->second, 3); ++it; + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33"); + TS_ASSERT_EQUALS( it->second, 4); ++it; + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33"); + TS_ASSERT_EQUALS( it->second, 5); ++it; + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:23:33"); + TS_ASSERT_EQUALS( it->second, 6); ++it; + } + + void test_str_continuation() + { + mkStrContinuations(); + Property *prop = LogParser::createLogProperty(log_str_continuations.path(),"log"); + const auto *log = dynamic_cast*>(prop); + TS_ASSERT(log); + auto logm = log->valueAsMultiMap(); + auto it = logm.begin(); + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:31"); + TS_ASSERT_EQUALS( it->second, " First line Second line"); ++it; + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:34"); + TS_ASSERT_EQUALS( it->second, " First line"); ++it; + TS_ASSERT_EQUALS( it->first.toISO8601String(), "2000-09-05T12:22:34"); + TS_ASSERT_EQUALS( it->second, " Second line Third line"); ++it; + } + + private: /// Helper method to run common test code for checking period logs. @@ -646,13 +713,52 @@ class LogParserTest : public CxxTest::TestSuite f << "2000-09-05T14:03:56 line "<<9<<'\n'; f.close(); } -//*/ - Poco::File log_num_good;// run time interval is within first - last times of the log - Poco::File log_num_late;// first time is later than run start - Poco::File log_num_early;// last time is earlier than run ends - Poco::File log_num_single;// single value - Poco::File log_str;// file of strings - Poco::File icp_file;// icpevent file + + void mkStrContinuations() + { + std::ofstream f( log_str_continuations.path().c_str() ); + f << "2000-09-05T12:22:31 First line" << std::endl; + f << "Second line" << std::endl; + f << "2000-09-05T12:22:34 First line" << std::endl; + f << "2000-09-05T12:22:34 Second line" << std::endl; + f << "Third line" << std::endl; + f.close(); + } + + void mkStrRepeat() + { + std::ofstream f( log_str_repeat.path().c_str() ); + f << "2000-09-05T12:22:34 First line" << std::endl; + f << "2000-09-05T12:22:34 Second line" << std::endl; + f << "2000-09-05T12:23:33 First line" << std::endl; + f << "2000-09-05T12:23:33 Second line" << std::endl; + f << "2000-09-05T12:23:33 Third line" << std::endl; + f << "2000-09-05T12:23:33 Fourth line" << std::endl; + f.close(); + } + + void mkNumRepeat() + { + std::ofstream f( log_str_repeat.path().c_str() ); + f << "2000-09-05T12:22:34 1" << std::endl; + f << "2000-09-05T12:22:34 2" << std::endl; + f << "2000-09-05T12:23:33 3" << std::endl; + f << "2000-09-05T12:23:33 4" << std::endl; + f << "2000-09-05T12:23:33 5" << std::endl; + f << "2000-09-05T12:23:33 6" << std::endl; + f.close(); + } + + TmpFile log_num_good;// run time interval is within first - last times of the log + TmpFile log_num_late;// first time is later than run start + TmpFile log_num_early;// last time is earlier than run ends + TmpFile log_num_single;// single value + TmpFile log_str;// file of strings + TmpFile icp_file;// icpevent file + TmpFile log_str_repeat;// string log with repeating lines + TmpFile log_num_repeat;// num log with repeating lines + TmpFile log_str_continuations;// string log with continuation lines + tm ti_data; tm * ti; From 30e5e3a9a449b352c465997a3a6636277cffc8b5 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Tue, 24 Mar 2015 14:08:50 +0000 Subject: [PATCH 099/126] Update inelastic tests to run with shiift param Refs #10189 --- .../test/DiffRotDiscreteCircleTest.h | 127 +++++++++++------- .../CurveFitting/test/DiffSphereTest.h | 125 +++++++++-------- 2 files changed, 148 insertions(+), 104 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/test/DiffRotDiscreteCircleTest.h b/Code/Mantid/Framework/CurveFitting/test/DiffRotDiscreteCircleTest.h index 8eeffacaaff2..f0dba53f28f9 100644 --- a/Code/Mantid/Framework/CurveFitting/test/DiffRotDiscreteCircleTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/DiffRotDiscreteCircleTest.h @@ -25,6 +25,7 @@ class DiffRotDiscreteCircleTest : public CxxTest::TestSuite static DiffRotDiscreteCircleTest *createSuite() { return new DiffRotDiscreteCircleTest(); } static void destroySuite( DiffRotDiscreteCircleTest *suite ) { delete suite; } + // convolve the elastic part with a resolution function, here a Gaussian void testDiffRotDiscreteCircleElastic() { @@ -75,58 +76,17 @@ class DiffRotDiscreteCircleTest : public CxxTest::TestSuite } // testDiffRotDiscreteCircleElastic - /// Fit the convolution of the inelastic part with a Gaussian resolution function void testDiffRotDiscreteCircleInelastic() { - /* Note: it turns out that parameters Intensity and Radius are highly covariant, so that more than one minimum exists. - * Thus, I tied parameter Radius. This is OK since one usually knows the radius of the circle of the jumping diffusion - */ - - // initialize the fitting function in a Fit algorithm - // Parameter units are assumed in micro-eV, Angstroms, Angstroms**(-1), and nano-seconds. Intensities have arbitrary units - std::string funtion_string = "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,Height=1.0,PeakCentre=0.0,Sigma=20.0,ties=(Height=1.0,PeakCentre=0.0,Sigma=20.0);name=InelasticDiffRotDiscreteCircle,N=3,Q=0.5,Intensity=47.014,Radius=1.567,Decay=7.567)"; - - // Initialize the fit function in the Fit algorithm - Mantid::CurveFitting::Fit fitalg; - TS_ASSERT_THROWS_NOTHING( fitalg.initialize() ); - TS_ASSERT( fitalg.isInitialized() ); - fitalg.setProperty( "Function", funtion_string ); - - // create the data workspace by evaluating the fit function in the Fit algorithm - auto data_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); - //saveWorkspace( data_workspace, "/tmp/junk.nxs" ); // for debugging purposes only - - //override the function with new parameters, then do the Fit - funtion_string = "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,Height=1.0,PeakCentre=0.0,Sigma=20.0,ties=(Height=1.0,PeakCentre=0.0,Sigma=20.0);name=InelasticDiffRotDiscreteCircle,N=3,Q=0.5,Intensity=10.0,Radius=1.567,Decay=20.0,ties=(Radius=1.567))"; - fitalg.setProperty( "Function", funtion_string ); - fitalg.setProperty( "InputWorkspace", data_workspace ); - fitalg.setPropertyValue( "WorkspaceIndex", "0" ); - TS_ASSERT_THROWS_NOTHING( TS_ASSERT( fitalg.execute() ) ); - TS_ASSERT( fitalg.isExecuted() ); + runDiffRotDiscreteCircleInelasticTest(0.0); + } - // check Chi-square is small - const double chi_squared = fitalg.getProperty("OutputChi2overDoF"); - TS_ASSERT_LESS_THAN( chi_squared, 0.001 ); - //std::cout << "\nchi_squared = " << chi_squared << "\n"; // only for debugging purposes - // check the parameters of the resolution did not change - Mantid::API::IFunction_sptr fitalg_function = fitalg.getProperty( "Function" ); - auto fitalg_conv = boost::dynamic_pointer_cast( fitalg_function ) ; - Mantid::API::IFunction_sptr fitalg_resolution = fitalg_conv->getFunction( 0 ); - TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "PeakCentre" ), 0.0, 0.00001 ); // allow for a small percent variation - TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Height" ), 1.0, 1.0 * 0.001 ); // allow for a small percent variation - TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Sigma" ), 20.0, 20.0* 0.001 ); // allow for a small percent variation - //std::cout << "\nPeakCentre = " << fitalg_resolution->getParameter("PeakCentre") << " Height= " << fitalg_resolution->getParameter("Height") << " Sigma=" << fitalg_resolution->getParameter("Sigma") << "\n"; // only for debugging purposes - - // check the parameters of the inelastic part - Mantid::API::IFunction_sptr fitalg_structure_factor = fitalg_conv->getFunction( 1 ); - TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Intensity" ), 47.014, 47.014 * 0.05 ); // allow for a small percent variation - TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Radius" ), 1.567, 1.567 * 0.05 ); // allow for a small percent variation - TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Decay" ), 7.567, 7.567 * 0.05 ); // allow for a small percent variation - //std::cout << "\nGOAL: Intensity = 47.014, Radius = 1.567, Decay = 7.567\n"; // only for debugging purposes - //std::cout << "OPTIMIZED: Intensity = " << fitalg_structure_factor->getParameter("Intensity") << " Radius = " << fitalg_structure_factor->getParameter("Radius") << " Decay = " << fitalg_structure_factor->getParameter("Decay") << "\n"; // only for debugging purposes + void testDiffRotDiscreteCircleInelasticWithShift() + { + runDiffRotDiscreteCircleInelasticTest(0.5); + } - } // testDiffRotDiscreteCircleElastic /* Check the particular case for N = 3 * In this case, the inelastic part should reduce to a single Lorentzian in 'w': @@ -293,6 +253,79 @@ class DiffRotDiscreteCircleTest : public CxxTest::TestSuite private: + /// Fit the convolution of the inelastic part with a Gaussian resolution function + void runDiffRotDiscreteCircleInelasticTest(const double S) + { + /* Note: it turns out that parameters Intensity and Radius are highly covariant, so that more than one minimum exists. + * Thus, I tied parameter Radius. This is OK since one usually knows the radius of the circle of the jumping diffusion + */ + const double I(47.014); + const double R(1.567); + const double tao(7.567); + + // initialize the fitting function in a Fit algorithm + // Parameter units are assumed in micro-eV, Angstroms, Angstroms**(-1), and nano-seconds. Intensities have arbitrary units + std::ostringstream function_stream; + function_stream << "(composite=Convolution,FixResolution=true,NumDeriv=true;" + << "name=Gaussian,Height=1.0,PeakCentre=0.0,Sigma=20.0," + << "ties=(Height=1.0,PeakCentre=0.0,Sigma=20.0);" + << "name=InelasticDiffRotDiscreteCircle,N=3,Q=0.5," + << "Intensity=" << I + << ",Radius=" << R + << ",Decay=" << tao + << ",Shift=" << S << ")"; + + // Initialize the fit function in the Fit algorithm + Mantid::CurveFitting::Fit fitalg; + TS_ASSERT_THROWS_NOTHING( fitalg.initialize() ); + TS_ASSERT( fitalg.isInitialized() ); + fitalg.setProperty( "Function", function_stream.str() ); + + function_stream.str( std::string() ); + function_stream.clear(); + + // create the data workspace by evaluating the fit function in the Fit algorithm + auto data_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); + //saveWorkspace( data_workspace, "/tmp/junk.nxs" ); // for debugging purposes only + + //override the function with new parameters, then do the Fit + function_stream << "(composite=Convolution,FixResolution=true,NumDeriv=true;" + << "name=Gaussian,Height=1.0,PeakCentre=0.0,Sigma=20.0," + << "ties=(Height=1.0,PeakCentre=0.0,Sigma=20.0);" + << "name=InelasticDiffRotDiscreteCircle,N=3,Q=0.5," + << "Intensity=10.0,Radius=1.567,Decay=20.0" + << ",ties=(Radius=" << R << "))"; + fitalg.setProperty( "Function", function_stream.str() ); + fitalg.setProperty( "InputWorkspace", data_workspace ); + fitalg.setPropertyValue( "WorkspaceIndex", "0" ); + TS_ASSERT_THROWS_NOTHING( TS_ASSERT( fitalg.execute() ) ); + TS_ASSERT( fitalg.isExecuted() ); + + // check Chi-square is small + const double chi_squared = fitalg.getProperty("OutputChi2overDoF"); + TS_ASSERT_LESS_THAN( chi_squared, 0.001 ); + //std::cout << "\nchi_squared = " << chi_squared << "\n"; // only for debugging purposes + + // check the parameters of the resolution did not change + Mantid::API::IFunction_sptr fitalg_function = fitalg.getProperty( "Function" ); + auto fitalg_conv = boost::dynamic_pointer_cast( fitalg_function ) ; + Mantid::API::IFunction_sptr fitalg_resolution = fitalg_conv->getFunction( 0 ); + TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "PeakCentre" ), 0.0, 0.00001 ); // allow for a small percent variation + TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Height" ), 1.0, 1.0 * 0.001 ); // allow for a small percent variation + TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Sigma" ), 20.0, 20.0* 0.001 ); // allow for a small percent variation + //std::cout << "\nPeakCentre = " << fitalg_resolution->getParameter("PeakCentre") << " Height= " << fitalg_resolution->getParameter("Height") << " Sigma=" << fitalg_resolution->getParameter("Sigma") << "\n"; // only for debugging purposes + + // check the parameters of the inelastic part + Mantid::API::IFunction_sptr fitalg_structure_factor = fitalg_conv->getFunction( 1 ); + TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Intensity" ), I, I * 0.05 ); // allow for a small percent variation + TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Radius" ), R, R * 0.05 ); // allow for a small percent variation + TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Decay" ), tao, tao * 0.05 ); // allow for a small percent variation + TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Shift" ), S, 0.00001 ); // allow for a small percent variation + //std::cout << "\nGOAL: Intensity = 47.014, Radius = 1.567, Decay = 7.567\n"; // only for debugging purposes + //std::cout << "OPTIMIZED: Intensity = " << fitalg_structure_factor->getParameter("Intensity") << " Radius = " << fitalg_structure_factor->getParameter("Radius") << " Decay = " << fitalg_structure_factor->getParameter("Decay") << "\n"; // only for debugging purposes + + } // runDiffRotDiscreteCircleInelasticTest + /// returns a real value from a uniform distribution double random_value(const double & a, const double & b) diff --git a/Code/Mantid/Framework/CurveFitting/test/DiffSphereTest.h b/Code/Mantid/Framework/CurveFitting/test/DiffSphereTest.h index 6b0baeaf008b..9242cb31729d 100644 --- a/Code/Mantid/Framework/CurveFitting/test/DiffSphereTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/DiffSphereTest.h @@ -128,7 +128,17 @@ class DiffSphereTest : public CxxTest::TestSuite void testDiffSphereInelastic() { - // target fitting parameters + runDiffSphereInelasticTest(0.0); + } + + void testDiffSphereInelasticWithShift() + { + runDiffSphereInelasticTest(0.2); + } + + void testDiffSphere() + { + // target parameters const double I_0(47.014); const double R_0(2.1); const double D_0(0.049); @@ -141,14 +151,32 @@ class DiffSphereTest : public CxxTest::TestSuite std::ostringstream funtion_stream; funtion_stream << "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,Height=1.0," << "PeakCentre=0.0,Sigma=0.002,ties=(Height=1.0,PeakCentre=0.0,Sigma=0.002);" - << "name=InelasticDiffSphere,Q=" << boost::lexical_cast( Q ) << ",Intensity=" + << "name=DiffSphere,Q=" << boost::lexical_cast( Q ) << ",Intensity=" << boost::lexical_cast( I_0 ) << ",Radius=" << boost::lexical_cast( R_0 ) << ",Diffusion=" << boost::lexical_cast( D_0 ) << ")"; fitalg.setProperty( "Function", funtion_stream.str() ); - // create the data workspace by evaluating the fit function in the Fit algorithm - auto data_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); - //saveWorkspace( data_workspace, "/tmp/junk_data.nxs" ); // for debugging purposes only + // Find out whether ties were correctly applied + Mantid::API::IFunction_sptr fitalg_function = fitalg.getProperty( "Function" ); // main function + fitalg_function->initialize(); + auto fitalg_conv = boost::dynamic_pointer_cast( fitalg_function ) ; // cast to Convolution + fitalg_function = fitalg_conv->getFunction( 1 ); // DiffSphere + auto fitalg_structure_factor = boost::dynamic_pointer_cast( fitalg_function ); + + fitalg_function = fitalg_structure_factor->getFunction( 0 ); + auto fitalg_elastic = boost::dynamic_pointer_cast( fitalg_function ) ; + TS_ASSERT_DELTA( fitalg_elastic -> getParameter( "Height" ), I_0, std::numeric_limits::epsilon() ); + TS_ASSERT_DELTA( fitalg_elastic -> getParameter( "Radius" ), R_0, std::numeric_limits::epsilon() ); + TS_ASSERT_DELTA( fitalg_elastic -> getAttribute( "Q" ).asDouble(), Q, std::numeric_limits::epsilon() ); + //std::cout << "Height=" << fitalg_elastic -> getParameter( "Height" ) << " Radius=" << fitalg_elastic -> getParameter( "Radius" ) << "\n"; // for debugging purposes only + + fitalg_function = fitalg_structure_factor->getFunction( 1 ); + auto fitalg_inelastic = boost::dynamic_pointer_cast( fitalg_function ) ; + TS_ASSERT_DELTA( fitalg_inelastic -> getParameter( "Intensity" ), I_0, std::numeric_limits::epsilon() ); + TS_ASSERT_DELTA( fitalg_inelastic -> getParameter( "Radius" ), R_0, std::numeric_limits::epsilon() ); + TS_ASSERT_DELTA( fitalg_inelastic -> getParameter( "Diffusion" ), D_0, std::numeric_limits::epsilon() ); + TS_ASSERT_DELTA( fitalg_inelastic -> getAttribute( "Q" ).asDouble(), Q, std::numeric_limits::epsilon() ); + //std::cout << "Intensity=" << fitalg_inelastic->getParameter( "Intensity" ) << " Radius=" << fitalg_inelastic->getParameter( "Radius" ) << " Diffusion=" << fitalg_inelastic->getParameter( "Diffusion" ) <<"\n"; // for debugging purposes only // override the function with new parameters, our initial guess. double I = I_0 * ( 0.75 + ( 0.5 * std::rand() ) / RAND_MAX ); @@ -158,20 +186,20 @@ class DiffSphereTest : public CxxTest::TestSuite funtion_stream.clear(); funtion_stream << "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,Height=1.0," << "PeakCentre=0.0,Sigma=0.002,ties=(Height=1.0,PeakCentre=0.0,Sigma=0.002);" - << "name=InelasticDiffSphere,Q=" << boost::lexical_cast( Q ) << ",Intensity=" + << "name=DiffSphere,Q=" << boost::lexical_cast( Q ) << ",Intensity=" << boost::lexical_cast( I ) << ",Radius=" << boost::lexical_cast( R ) << ",Diffusion=" << boost::lexical_cast( D ) << ")"; fitalg.setProperty( "Function", funtion_stream.str() ); - //auto before_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); // for debugging purposes only - //saveWorkspace( before_workspace, "/tmp/junk_before_fitting.nxs" ); // for debugging purposes only + + // create the data workspace by evaluating the fit function in the Fit algorithm + auto data_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); + //saveWorkspace( data_workspace, "/tmp/junk_data.nxs" ); // for debugging purposes only // Do the fit fitalg.setProperty( "InputWorkspace", data_workspace ); fitalg.setPropertyValue( "WorkspaceIndex", "0" ); TS_ASSERT_THROWS_NOTHING( TS_ASSERT( fitalg.execute() ) ); TS_ASSERT( fitalg.isExecuted() ); - //auto after_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); // for debugging purposes only - //saveWorkspace( after_workspace, "/tmp/junk_after_fitting.nxs" ); // for debugging purposes only // check Chi-square is small const double chi_squared = fitalg.getProperty("OutputChi2overDoF"); @@ -179,28 +207,25 @@ class DiffSphereTest : public CxxTest::TestSuite //std::cout << "\nchi_squared = " << chi_squared << "\n"; // only for debugging purposes // check the parameters of the resolution did not change - Mantid::API::IFunction_sptr fitalg_function = fitalg.getProperty( "Function" ); - auto fitalg_conv = boost::dynamic_pointer_cast( fitalg_function ) ; Mantid::API::IFunction_sptr fitalg_resolution = fitalg_conv->getFunction( 0 ); - TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "PeakCentre" ), 0.0, 0.00001 ); // allow for a small percent variation TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Height" ), 1.0, 1.0 * 0.001 ); // allow for a small percent variation TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Sigma" ), 0.002, 0.002* 0.001 ); // allow for a small percent variation //std::cout << "\nPeakCentre = " << fitalg_resolution->getParameter("PeakCentre") << " Height= " << fitalg_resolution->getParameter("Height") << " Sigma=" << fitalg_resolution->getParameter("Sigma") << "\n"; // only for debugging purposes - // check the parameters of the inelastic part close to the target parameters - Mantid::API::IFunction_sptr fitalg_structure_factor = fitalg_conv->getFunction( 1 ); + // check the parameters of the DiffSphere close to the target parameters TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Intensity" ), I_0, I_0 * 0.05 ); // allow for a small percent variation - TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Radius" ), R_0, R_0 * 0.05 ); // allow for a small percent variation - TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Diffusion" ), D_0, D_0 * 0.05 ); // allow for a small percent variation + TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Radius" ), R_0, R_0 * 0.05 ); // allow for a small percent variation + TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Diffusion" ), D_0, D_0 * 0.05 ); // allow for a small percent variation //std::cout << "\nINITIAL GUESS: Intensity = "<(I)<<", Radius ="<(R)<<", Diffusion = "<(D)<<"\n"; // only for debugging purposes //std::cout << "GOAL: Intensity = "<(I_0)<<", Radius = "<(R_0)<<", Diffusion = "<(D_0)<<"\n"; // only for debugging purposes //std::cout << "OPTIMIZED: Intensity = " << fitalg_structure_factor->getParameter("Intensity") << " Radius = " << fitalg_structure_factor->getParameter("Radius") << " Diffusion = " << fitalg_structure_factor->getParameter("Diffusion") << "\n"; // only for debugging purposes } - void testDiffSphere() +private: + void runDiffSphereInelasticTest(const double S) { - // target parameters + // target fitting parameters const double I_0(47.014); const double R_0(2.1); const double D_0(0.049); @@ -212,33 +237,16 @@ class DiffSphereTest : public CxxTest::TestSuite TS_ASSERT( fitalg.isInitialized() ); std::ostringstream funtion_stream; funtion_stream << "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,Height=1.0," - << "PeakCentre=0.0,Sigma=0.002,ties=(Height=1.0,PeakCentre=0.0,Sigma=0.002);" - << "name=DiffSphere,Q=" << boost::lexical_cast( Q ) << ",Intensity=" + << "PeakCentre=0.0,Sigma=0.002,ties=(Height=1.0,PeakCentre=" << S << ",Sigma=0.002);" + << "name=InelasticDiffSphere,Q=" << boost::lexical_cast( Q ) << ",Intensity=" << boost::lexical_cast( I_0 ) << ",Radius=" << boost::lexical_cast( R_0 ) - << ",Diffusion=" << boost::lexical_cast( D_0 ) << ")"; + << ",Diffusion=" << boost::lexical_cast( D_0 ) + << ",Shift=" << boost::lexical_cast(S) << ")"; fitalg.setProperty( "Function", funtion_stream.str() ); - // Find out whether ties were correctly applied - Mantid::API::IFunction_sptr fitalg_function = fitalg.getProperty( "Function" ); // main function - fitalg_function->initialize(); - auto fitalg_conv = boost::dynamic_pointer_cast( fitalg_function ) ; // cast to Convolution - fitalg_function = fitalg_conv->getFunction( 1 ); // DiffSphere - auto fitalg_structure_factor = boost::dynamic_pointer_cast( fitalg_function ); - - fitalg_function = fitalg_structure_factor->getFunction( 0 ); - auto fitalg_elastic = boost::dynamic_pointer_cast( fitalg_function ) ; - TS_ASSERT_DELTA( fitalg_elastic -> getParameter( "Height" ), I_0, std::numeric_limits::epsilon() ); - TS_ASSERT_DELTA( fitalg_elastic -> getParameter( "Radius" ), R_0, std::numeric_limits::epsilon() ); - TS_ASSERT_DELTA( fitalg_elastic -> getAttribute( "Q" ).asDouble(), Q, std::numeric_limits::epsilon() ); - //std::cout << "Height=" << fitalg_elastic -> getParameter( "Height" ) << " Radius=" << fitalg_elastic -> getParameter( "Radius" ) << "\n"; // for debugging purposes only - - fitalg_function = fitalg_structure_factor->getFunction( 1 ); - auto fitalg_inelastic = boost::dynamic_pointer_cast( fitalg_function ) ; - TS_ASSERT_DELTA( fitalg_inelastic -> getParameter( "Intensity" ), I_0, std::numeric_limits::epsilon() ); - TS_ASSERT_DELTA( fitalg_inelastic -> getParameter( "Radius" ), R_0, std::numeric_limits::epsilon() ); - TS_ASSERT_DELTA( fitalg_inelastic -> getParameter( "Diffusion" ), D_0, std::numeric_limits::epsilon() ); - TS_ASSERT_DELTA( fitalg_inelastic -> getAttribute( "Q" ).asDouble(), Q, std::numeric_limits::epsilon() ); - //std::cout << "Intensity=" << fitalg_inelastic->getParameter( "Intensity" ) << " Radius=" << fitalg_inelastic->getParameter( "Radius" ) << " Diffusion=" << fitalg_inelastic->getParameter( "Diffusion" ) <<"\n"; // for debugging purposes only + // create the data workspace by evaluating the fit function in the Fit algorithm + auto data_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); + //saveWorkspace( data_workspace, "/tmp/junk_data.nxs" ); // for debugging purposes only // override the function with new parameters, our initial guess. double I = I_0 * ( 0.75 + ( 0.5 * std::rand() ) / RAND_MAX ); @@ -247,21 +255,22 @@ class DiffSphereTest : public CxxTest::TestSuite funtion_stream.str( std::string() ); funtion_stream.clear(); funtion_stream << "(composite=Convolution,FixResolution=true,NumDeriv=true;name=Gaussian,Height=1.0," - << "PeakCentre=0.0,Sigma=0.002,ties=(Height=1.0,PeakCentre=0.0,Sigma=0.002);" - << "name=DiffSphere,Q=" << boost::lexical_cast( Q ) << ",Intensity=" + << "PeakCentre=0.0,Sigma=0.002,ties=(Height=1.0,PeakCentre=" << S << ",Sigma=0.002);" + << "name=InelasticDiffSphere,Q=" << boost::lexical_cast( Q ) << ",Intensity=" << boost::lexical_cast( I ) << ",Radius=" << boost::lexical_cast( R ) - << ",Diffusion=" << boost::lexical_cast( D ) << ")"; + << ",Diffusion=" << boost::lexical_cast( D ) + << ",Shift=" << boost::lexical_cast(S) << ")"; fitalg.setProperty( "Function", funtion_stream.str() ); - - // create the data workspace by evaluating the fit function in the Fit algorithm - auto data_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); - //saveWorkspace( data_workspace, "/tmp/junk_data.nxs" ); // for debugging purposes only + //auto before_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); // for debugging purposes only + //saveWorkspace( before_workspace, "/tmp/junk_before_fitting.nxs" ); // for debugging purposes only // Do the fit fitalg.setProperty( "InputWorkspace", data_workspace ); fitalg.setPropertyValue( "WorkspaceIndex", "0" ); TS_ASSERT_THROWS_NOTHING( TS_ASSERT( fitalg.execute() ) ); TS_ASSERT( fitalg.isExecuted() ); + //auto after_workspace = generateWorkspaceFromFitAlgorithm( fitalg ); // for debugging purposes only + //saveWorkspace( after_workspace, "/tmp/junk_after_fitting.nxs" ); // for debugging purposes only // check Chi-square is small const double chi_squared = fitalg.getProperty("OutputChi2overDoF"); @@ -269,24 +278,26 @@ class DiffSphereTest : public CxxTest::TestSuite //std::cout << "\nchi_squared = " << chi_squared << "\n"; // only for debugging purposes // check the parameters of the resolution did not change + Mantid::API::IFunction_sptr fitalg_function = fitalg.getProperty( "Function" ); + auto fitalg_conv = boost::dynamic_pointer_cast( fitalg_function ) ; Mantid::API::IFunction_sptr fitalg_resolution = fitalg_conv->getFunction( 0 ); - TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "PeakCentre" ), 0.0, 0.00001 ); // allow for a small percent variation + + TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "PeakCentre" ), S, 0.00001 ); // allow for a small percent variation TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Height" ), 1.0, 1.0 * 0.001 ); // allow for a small percent variation TS_ASSERT_DELTA( fitalg_resolution -> getParameter( "Sigma" ), 0.002, 0.002* 0.001 ); // allow for a small percent variation //std::cout << "\nPeakCentre = " << fitalg_resolution->getParameter("PeakCentre") << " Height= " << fitalg_resolution->getParameter("Height") << " Sigma=" << fitalg_resolution->getParameter("Sigma") << "\n"; // only for debugging purposes - // check the parameters of the DiffSphere close to the target parameters + // check the parameters of the inelastic part close to the target parameters + Mantid::API::IFunction_sptr fitalg_structure_factor = fitalg_conv->getFunction( 1 ); TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Intensity" ), I_0, I_0 * 0.05 ); // allow for a small percent variation - TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Radius" ), R_0, R_0 * 0.05 ); // allow for a small percent variation - TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Diffusion" ), D_0, D_0 * 0.05 ); // allow for a small percent variation + TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Radius" ), R_0, R_0 * 0.05 ); // allow for a small percent variation + TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Diffusion" ), D_0, D_0 * 0.05 ); // allow for a small percent variation + TS_ASSERT_DELTA( fitalg_structure_factor -> getParameter( "Shift" ), S, 0.0005 ); // allow for a small percent variation //std::cout << "\nINITIAL GUESS: Intensity = "<(I)<<", Radius ="<(R)<<", Diffusion = "<(D)<<"\n"; // only for debugging purposes //std::cout << "GOAL: Intensity = "<(I_0)<<", Radius = "<(R_0)<<", Diffusion = "<(D_0)<<"\n"; // only for debugging purposes //std::cout << "OPTIMIZED: Intensity = " << fitalg_structure_factor->getParameter("Intensity") << " Radius = " << fitalg_structure_factor->getParameter("Radius") << " Diffusion = " << fitalg_structure_factor->getParameter("Diffusion") << "\n"; // only for debugging purposes - } -private: - /// save a worskapece to a nexus file void saveWorkspace( Mantid::DataObjects::Workspace2D_sptr &ws, const std::string &filename ) { From 852236fdfc48857613325de35ae8152fbf6adcbd Mon Sep 17 00:00:00 2001 From: Roman Tolchenov Date: Tue, 24 Mar 2015 14:16:04 +0000 Subject: [PATCH 100/126] Re #11405. Fixing compiler warnings. --- .../Framework/Kernel/test/LogParserTest.h | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Code/Mantid/Framework/Kernel/test/LogParserTest.h b/Code/Mantid/Framework/Kernel/test/LogParserTest.h index 882cc3f06b1e..8ae8ca054154 100644 --- a/Code/Mantid/Framework/Kernel/test/LogParserTest.h +++ b/Code/Mantid/Framework/Kernel/test/LogParserTest.h @@ -13,20 +13,6 @@ #include -namespace{ - -class TmpFile{ - Poco::File m_file; -public: - TmpFile(const std::string& fname):m_file(fname){} - ~TmpFile(){remove();} - const std::string& path() const {return m_file.path();} - bool exists() const {return m_file.exists();} - void remove() {if (m_file.exists()) m_file.remove();} -}; - -} - using namespace Mantid::Kernel; class LogParserTest : public CxxTest::TestSuite @@ -35,6 +21,17 @@ class LogParserTest : public CxxTest::TestSuite static LogParserTest *createSuite() { return new LogParserTest(); } static void destroySuite(LogParserTest *suite) { delete suite; } + + class TmpFile{ + Poco::File m_file; + public: + TmpFile(const std::string& fname):m_file(fname){} + ~TmpFile(){remove();} + const std::string& path() const {return m_file.path();} + bool exists() const {return m_file.exists();} + void remove() {if (m_file.exists()) m_file.remove();} + }; + LogParserTest() :log_num_good("TST000000_good.txt"), log_num_late("TST000000_late.txt"), From f9c905e9c126e2885cc96fba7c7604f9dd010f81 Mon Sep 17 00:00:00 2001 From: Federico Montesino Pouzols Date: Tue, 24 Mar 2015 14:36:14 +0000 Subject: [PATCH 101/126] use DateAndTime in job info struct, re #11123 --- .../Framework/API/inc/MantidAPI/IRemoteJobManager.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h b/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h index 096289b52882..9f650c503545 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h @@ -2,6 +2,7 @@ #define MANTID_KERNEL_IREMOTEJOBMANAGER_H #include "MantidAPI/DllConfig.h" +#include "MantidKernel/DateAndTime.h" namespace Mantid { namespace API { @@ -89,13 +90,14 @@ class MANTID_API_DLL IRemoteJobManager { /// ID of the transaction where this job is included std::string transactionID; /// Date-time of submission. No particular format can be assumed - std::string submitDate; + /// from the specific remote job managers + Mantid::Kernel::DateAndTime submitDate; /// Date-time the job actually started running. No particular /// format can be assumed - std::string startDate; + Mantid::Kernel::DateAndTime startDate; /// Date-time the job finished. No particular format can be /// assumed - std::string completionTime; + Mantid::Kernel::DateAndTime completionTime; }; /** From 9b111262379ee6d7a4899b3a0fe7d4190a4addbe Mon Sep 17 00:00:00 2001 From: Federico Montesino Pouzols Date: Tue, 24 Mar 2015 14:39:49 +0000 Subject: [PATCH 102/126] fix comments, re #11123 --- Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h b/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h index 9f650c503545..2035e271f89e 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/IRemoteJobManager.h @@ -90,7 +90,8 @@ class MANTID_API_DLL IRemoteJobManager { /// ID of the transaction where this job is included std::string transactionID; /// Date-time of submission. No particular format can be assumed - /// from the specific remote job managers + /// from the specific remote job managers, and some of them may + /// not provide this info Mantid::Kernel::DateAndTime submitDate; /// Date-time the job actually started running. No particular /// format can be assumed @@ -276,4 +277,4 @@ typedef boost::shared_ptr IRemoteJobManager_sptr; } // namespace API } // namespace Mantid -#endif // MANTID_KERNEL_IREMOTEJOBMANAGER_H +#endif // MANTID_API_IREMOTEJOBMANAGER_H From f28e6e4c4577adbc88e664e8ca3badb957c066ef Mon Sep 17 00:00:00 2001 From: Vickie Lynch Date: Tue, 24 Mar 2015 11:39:17 -0400 Subject: [PATCH 103/126] Refs #11005 radius=mQ+b --- .../MDAlgorithms/src/IntegratePeaksMD2.cpp | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp b/Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp index e756c4d49ea1..83009e5e60fb 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp @@ -103,10 +103,12 @@ void IntegratePeaksMD2::init() { "Only warning if all of peak outer radius is not on detector (default).\n" "If false, do not integrate if the outer radius is not on a detector."); - declareProperty("AdaptiveQRadius", false, - "Default is false. If true, all input radii are multiplied " - "by the magnitude of Q at the peak center so each peak has a " - "different integration radius. Q includes the 2*pi factor."); + declareProperty("AdaptiveQBackground", false, + "Default is false. If true, all background values" + "vary on a line so that they are" + "background plus AdaptiveQMultiplier multiplied" + "by the magnitude of Q at the peak center so each peak has a " + "different integration radius. Q includes the 2*pi factor."); declareProperty("Cylinder", false, "Default is sphere. Use next five parameters for cylinder."); @@ -142,6 +144,12 @@ void IntegratePeaksMD2::init() { new FileProperty("ProfilesFile", "", FileProperty::OptionalSave, std::vector(1, "profiles")), "Save (Optionally) as Isaw peaks file with profiles included"); + + declareProperty("AdaptiveQMultiplier", 0.0, + "Peak integration radius varies on a line so that it is" + "PeakRadius plus this value multiplied" + "by the magnitude of Q at the peak center so each peak has a " + "different integration radius. Q includes the 2*pi factor."); } //---------------------------------------------------------------------------------------------- @@ -191,7 +199,10 @@ void IntegratePeaksMD2::integrate(typename MDEventWorkspace::sptr ws) { Workspace2D_sptr wsProfile2D, wsFit2D, wsDiff2D; size_t numSteps = 0; bool cylinderBool = getProperty("Cylinder"); - bool adaptiveQRadius = getProperty("AdaptiveQRadius"); + bool adaptiveQBackground = getProperty("AdaptiveQBackground"); + double adaptiveQMultiplier = getProperty("AdaptiveQMultiplier"); + double adaptiveQBackgroundMultiplier = 0.0; + if (adaptiveQBackground) adaptiveQBackgroundMultiplier = adaptiveQMultiplier; std::vector PeakRadiusVector(peakWS->getNumberPeaks(), PeakRadius); std::vector BackgroundInnerRadiusVector(peakWS->getNumberPeaks(), BackgroundInnerRadius); @@ -316,8 +327,8 @@ void IntegratePeaksMD2::integrate(typename MDEventWorkspace::sptr ws) { double background_total = 0.0; if (!cylinderBool) { // modulus of Q - coord_t lenQpeak = 1.0; - if (adaptiveQRadius) { + coord_t lenQpeak = 0.0; + if (adaptiveQMultiplier > 0.0) { lenQpeak = 0.0; for (size_t d = 0; d < nd; d++) { lenQpeak += center[d] * center[d]; @@ -325,9 +336,9 @@ void IntegratePeaksMD2::integrate(typename MDEventWorkspace::sptr ws) { lenQpeak = std::sqrt(lenQpeak); } - PeakRadiusVector[i] = lenQpeak * PeakRadius; - BackgroundInnerRadiusVector[i] = lenQpeak * BackgroundInnerRadius; - BackgroundOuterRadiusVector[i] = lenQpeak * BackgroundOuterRadius; + PeakRadiusVector[i] = adaptiveQMultiplier * lenQpeak + PeakRadius; + BackgroundInnerRadiusVector[i] = adaptiveQBackgroundMultiplier * lenQpeak + BackgroundInnerRadius; + BackgroundOuterRadiusVector[i] = adaptiveQBackgroundMultiplier * lenQpeak + BackgroundOuterRadius; CoordTransformDistance sphere(nd, center, dimensionsUsed); if(Peak* shapeablePeak = dynamic_cast(&p)){ @@ -340,7 +351,7 @@ void IntegratePeaksMD2::integrate(typename MDEventWorkspace::sptr ws) { // Perform the integration into whatever box is contained within. ws->getBox()->integrateSphere( sphere, - static_cast(lenQpeak * PeakRadius * lenQpeak * PeakRadius), + static_cast((adaptiveQMultiplier * lenQpeak + PeakRadius) * (adaptiveQMultiplier * lenQpeak + PeakRadius)), signal, errorSquared); // Integrate around the background radius @@ -348,8 +359,8 @@ void IntegratePeaksMD2::integrate(typename MDEventWorkspace::sptr ws) { if (BackgroundOuterRadius > PeakRadius) { // Get the total signal inside "BackgroundOuterRadius" ws->getBox()->integrateSphere( - sphere, static_cast(lenQpeak * BackgroundOuterRadius * - lenQpeak * BackgroundOuterRadius), + sphere, static_cast((adaptiveQBackgroundMultiplier * lenQpeak + BackgroundOuterRadius) * + (adaptiveQBackgroundMultiplier * lenQpeak + BackgroundOuterRadius)), bgSignal, bgErrorSquared); // Evaluate the signal inside "BackgroundInnerRadius" @@ -359,8 +370,8 @@ void IntegratePeaksMD2::integrate(typename MDEventWorkspace::sptr ws) { // Integrate this 3rd radius, if needed if (BackgroundInnerRadius != PeakRadius) { ws->getBox()->integrateSphere( - sphere, static_cast(lenQpeak * BackgroundInnerRadius * - lenQpeak * BackgroundInnerRadius), + sphere, static_cast((adaptiveQBackgroundMultiplier * lenQpeak + BackgroundInnerRadius) * + (adaptiveQBackgroundMultiplier * lenQpeak + BackgroundInnerRadius)), interiorSignal, interiorErrorSquared); } else { // PeakRadius == BackgroundInnerRadius, so use the previous value From 9b18ee758fffaecf0a8dd5b0e979888530fd5d64 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Tue, 24 Mar 2015 16:41:07 +0000 Subject: [PATCH 104/126] Set parameter alias correctly Refs #10189 --- Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp | 1 + Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp b/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp index c814e613c3ce..1a7861bb23b0 100644 --- a/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/DiffRotDiscreteCircle.cpp @@ -168,6 +168,7 @@ void DiffRotDiscreteCircle::init() { setAlias("f1.Intensity", "Intensity"); setAlias("f1.Radius", "Radius"); setAlias("f1.Decay", "Decay"); + setAlias("f1.Shift", "Shift"); // Set the ties between Elastic and Inelastic parameters addDefaultTies("f0.Height=f1.Intensity,f0.Radius=f1.Radius"); diff --git a/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp b/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp index 2638aada766b..337c738a9f5b 100644 --- a/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/DiffSphere.cpp @@ -274,6 +274,7 @@ void DiffSphere::init() { setAlias("f1.Intensity", "Intensity"); setAlias("f1.Radius", "Radius"); setAlias("f1.Diffusion", "Diffusion"); + setAlias("f1.Shift", "Shift"); // Set the ties between Elastic and Inelastic parameters addDefaultTies("f0.Height=f1.Intensity,f0.Radius=f1.Radius"); From c6802950de789a908734a86cb646adb38c907379 Mon Sep 17 00:00:00 2001 From: Raquel Alvarez Banos Date: Tue, 24 Mar 2015 16:59:30 +0000 Subject: [PATCH 105/126] Re #9495 Add help button to data loading step --- .../MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui index 99c554af2ebb..0bc18df0af13 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui @@ -435,6 +435,13 @@ + + + + ? + + + @@ -498,6 +505,7 @@ differential minTime maxTime + help load From dd52656a09cf0b3f8101864f0985b3530185b139 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Tue, 24 Mar 2015 11:28:49 -0700 Subject: [PATCH 106/126] Refs #11400. Suppress numpy warning by moving to a separate file. --- Code/Mantid/Build/CMake/GNUSetup.cmake | 2 +- .../kernel/Converters/NumpyFunctions.h | 54 +++++++++++++++++++ .../mantid/kernel/CMakeLists.txt | 2 + .../kernel/src/Converters/CloneToNumpy.cpp | 38 +++++++++---- .../kernel/src/Converters/NDArrayToVector.cpp | 16 ++++-- .../kernel/src/Converters/NumpyFunctions.cpp | 22 ++++++++ 6 files changed, 119 insertions(+), 15 deletions(-) create mode 100644 Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/kernel/Converters/NumpyFunctions.h create mode 100644 Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NumpyFunctions.cpp diff --git a/Code/Mantid/Build/CMake/GNUSetup.cmake b/Code/Mantid/Build/CMake/GNUSetup.cmake index aa1eac0b7912..cc91e235a288 100644 --- a/Code/Mantid/Build/CMake/GNUSetup.cmake +++ b/Code/Mantid/Build/CMake/GNUSetup.cmake @@ -15,7 +15,7 @@ elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) endif() # Global warning flags. -set( GNUFLAGS "-Wall -Wextra -pedantic -Wconversion -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -fno-common" ) +set( GNUFLAGS "-Wall -Wextra -Wpedantic -Wconversion -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -fno-common" ) # Disable some warnings about deprecated headers and type conversions that # we can't do anything about # -Wno-deprecated: Do not warn about use of deprecated headers. diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/kernel/Converters/NumpyFunctions.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/kernel/Converters/NumpyFunctions.h new file mode 100644 index 000000000000..452856c09428 --- /dev/null +++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/kernel/Converters/NumpyFunctions.h @@ -0,0 +1,54 @@ +#ifndef NUMPY_FUNCTIONS_H +#define NUMPY_FUNCTIONS_H +/* + Copyright © 2011 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge + National Laboratory & European Spallation Source + + This file is part of Mantid. + + Mantid is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Mantid is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + File change history is stored at: . + Code Documentation is available at: +*/ +#pragma GCC system_header + +#include +#include "MantidKernel/WarningSuppressions.h" +GCC_DIAG_OFF(cast - qual) +// See +// http://docs.scipy.org/doc/numpy/reference/c-api.array.html#PY_ARRAY_UNIQUE_SYMBOL +#define PY_ARRAY_UNIQUE_SYMBOL KERNEL_ARRAY_API +#define NO_IMPORT_ARRAY +#include +GCC_DIAG_ON(cast - qual) + +/**functions containing numpy macros. We put them in a separate header file to + *suppress the warning + *ISO C++ forbids casting between pointer-to-function and pointer-to-object + */ +namespace Mantid { +namespace PythonInterface { +namespace Converters { +namespace Impl { +/// equivalent to macro PyArray_IterNew +PyObject *func_PyArray_IterNew(PyArrayObject *arr); +/// equivalent to macro PyArray_NewFromDescr +PyArrayObject *func_PyArray_NewFromDescr(int datatype, const int ndims, + Py_intptr_t *dims); +} +} +} +} +#endif // NUMPY_FUNCTIONS_H diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/CMakeLists.txt b/Code/Mantid/Framework/PythonInterface/mantid/kernel/CMakeLists.txt index 32975fce4226..02058243e4c2 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/CMakeLists.txt +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/CMakeLists.txt @@ -54,6 +54,7 @@ set ( SRC_FILES src/Converters/CloneToNumpy.cpp src/Converters/NDArrayToVector.cpp src/Converters/NDArrayTypeIndex.cpp + src/Converters/NumpyFunctions.cpp src/Converters/PyArrayType.cpp src/Converters/PyObjectToMatrix.cpp src/Converters/PyObjectToV3D.cpp @@ -71,6 +72,7 @@ set ( SRC_FILES set ( INC_FILES ${HEADER_DIR}/kernel/Converters/CArrayToNDArray.h ${HEADER_DIR}/kernel/Converters/MatrixToNDArray.h + ${HEADER_DIR}/kernel/Converters/NumpyFunctions.h ${HEADER_DIR}/kernel/Converters/NDArrayToVector.h ${HEADER_DIR}/kernel/Converters/NDArrayTypeIndex.h ${HEADER_DIR}/kernel/Converters/WrapWithNumpy.h diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp index bc85d3edd85f..736ddb7ce55d 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp @@ -3,17 +3,30 @@ //----------------------------------------------------------------------------- #include "MantidPythonInterface/kernel/Converters/CloneToNumpy.h" #include "MantidPythonInterface/kernel/Converters/NDArrayTypeIndex.h" -#include "MantidKernel/WarningSuppressions.h" +//#include "MantidKernel/WarningSuppressions.h" #include -GCC_DIAG_OFF(cast-qual) -#define PY_ARRAY_UNIQUE_SYMBOL KERNEL_ARRAY_API -#define NO_IMPORT_ARRAY -#include -GCC_DIAG_ON(cast-qual) +// GCC_DIAG_OFF(cast-qual) +//#define PY_ARRAY_UNIQUE_SYMBOL KERNEL_ARRAY_API +//#define NO_IMPORT_ARRAY +//#include +// GCC_DIAG_ON(cast-qual) + +#include "MantidPythonInterface/kernel/Converters/NumpyFunctions.h" #include +/*PyArrayObject* function_PyArray_NewFromDescr(int datatype, const int ndims, +Py_intptr_t *dims) +{ + return (PyArrayObject*)PyArray_NewFromDescr(&PyArray_Type, + PyArray_DescrFromType(datatype), + ndims, // rank + dims, // Length in each dimension + NULL, NULL, + 0, NULL); +}*/ + namespace Mantid { namespace PythonInterface { namespace Converters @@ -44,13 +57,16 @@ namespace Mantid { namespace PythonInterface { Py_intptr_t dims[1] = { static_cast(cvector.size()) }; int datatype = NDArrayTypeIndex::typenum; - PyArrayObject *nparray = (PyArrayObject*) + /*PyArrayObject *nparray = (PyArrayObject*) PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(datatype), 1, // rank dims, // Length in each dimension NULL, NULL, - 0, NULL); + 0, NULL);*/ + PyArrayObject *nparray = + func_PyArray_NewFromDescr(datatype, 1, &dims[0]); + for(Py_intptr_t i = 0; i < dims[0]; ++i) { void *itemPtr = PyArray_GETPTR1(nparray, i); @@ -71,13 +87,15 @@ namespace Mantid { namespace PythonInterface PyObject *cloneND(const ElementType * carray, const int ndims, Py_intptr_t *dims) { int datatype = NDArrayTypeIndex::typenum; - PyArrayObject *nparray = (PyArrayObject*) + /*PyArrayObject *nparray = (PyArrayObject*) PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(datatype), ndims, // rank dims, // Length in each dimension NULL, NULL, - 0, NULL); + 0, NULL);*/ + PyArrayObject *nparray = + func_PyArray_NewFromDescr(datatype, ndims, &dims[0]); // Compute total number of elements size_t length(dims[0]); if(ndims > 1) diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp index 85bfa6628900..b36169327a7f 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp @@ -6,9 +6,17 @@ #include // See http://docs.scipy.org/doc/numpy/reference/c-api.array.html#PY_ARRAY_UNIQUE_SYMBOL -#define PY_ARRAY_UNIQUE_SYMBOL KERNEL_ARRAY_API -#define NO_IMPORT_ARRAY -#include +//#define PY_ARRAY_UNIQUE_SYMBOL KERNEL_ARRAY_API +//#define NO_IMPORT_ARRAY +//#include + +#include "MantidPythonInterface/kernel/Converters/NumpyFunctions.h" +/*namespace{ +PyObject* function_PyArray_IterNew(PyArrayObject *arr) +{ + return PyArray_IterNew((PyObject *)arr); +} +}*/ namespace Mantid { @@ -35,7 +43,7 @@ namespace Mantid void *input; } npy_union; npy_union data; - PyObject *iter = PyArray_IterNew((PyObject *)arr); + PyObject *iter = Converters::Impl::func_PyArray_IterNew(arr); npy_intp index(0); do { diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NumpyFunctions.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NumpyFunctions.cpp new file mode 100644 index 000000000000..5696352a6cac --- /dev/null +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NumpyFunctions.cpp @@ -0,0 +1,22 @@ +#include "MantidPythonInterface/kernel/Converters/NumpyFunctions.h" + +namespace Mantid { +namespace PythonInterface { +namespace Converters { +namespace Impl { + +PyObject *func_PyArray_IterNew(PyArrayObject *arr) { + return PyArray_IterNew((PyObject *)arr); +} + +PyArrayObject *func_PyArray_NewFromDescr(int datatype, const int ndims, + Py_intptr_t *dims) { + return (PyArrayObject *)PyArray_NewFromDescr( + &PyArray_Type, PyArray_DescrFromType(datatype), ndims, // rank + dims, // Length in each dimension + NULL, NULL, 0, NULL); +} +} +} +} +} From 6ecdb656c166ec0e1e4367ee41186a09c17ec992 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Tue, 24 Mar 2015 12:17:59 -0700 Subject: [PATCH 107/126] Refs #11400. Include paraview headers as system headers. --- .../ParaviewPlugins/ParaViewFilters/PeaksFilter/CMakeLists.txt | 2 +- .../ParaViewFilters/ScaleWorkspace/CMakeLists.txt | 2 +- .../ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt | 2 +- .../ParaViewReaders/EventNexusReader/CMakeLists.txt | 2 +- .../ParaViewReaders/MDEWNexusReader/CMakeLists.txt | 2 +- .../ParaViewReaders/MDHWNexusReader/CMakeLists.txt | 2 +- .../ParaViewReaders/NexusPeaksReader/CMakeLists.txt | 2 +- .../ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt | 2 +- .../ParaViewReaders/SQWEventReader/CMakeLists.txt | 2 +- .../ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt | 2 +- .../ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt | 2 +- .../ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt | 2 +- .../ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt | 2 +- .../ParaViewSources/SinglePeakMarkerSource/CMakeLists.txt | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/CMakeLists.txt index c2820075f5b9..a9f5477cb67e 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/PeaksFilter/CMakeLists.txt @@ -1,5 +1,5 @@ PROJECT(PeaksFilter) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) ADD_PARAVIEW_PLUGIN(MantidParaViewPeaksFilterSMPlugin "1.0" SERVER_MANAGER_XML PeaksFilter.xml SERVER_MANAGER_SOURCES vtkPeaksFilter.cxx diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/CMakeLists.txt index 451c01cae863..056b2b05e3ab 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/CMakeLists.txt @@ -1,5 +1,5 @@ PROJECT(ScaleWorkspace) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) ADD_PARAVIEW_PLUGIN(MantidParaViewScaleWorkspaceSMPlugin "1.0" SERVER_MANAGER_XML ScaleWorkspace.xml SERVER_MANAGER_SOURCES vtkScaleWorkspace.cxx diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt index d6beddcd88c7..3d3208936b16 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/CMakeLists.txt @@ -1,5 +1,5 @@ PROJECT(SplatterPlot) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) ADD_PARAVIEW_PLUGIN(MantidParaViewSplatterPlotSMPlugin "1.0" SERVER_MANAGER_XML SplatterPlot.xml SERVER_MANAGER_SOURCES vtkSplatterPlot.cxx diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/CMakeLists.txt index 798b29582c9b..5537e38b6206 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/EventNexusReader/CMakeLists.txt @@ -1,5 +1,5 @@ project( MantidParaViewEventNexusReader ) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) add_paraview_plugin( MantidParaViewEventNexusReaderSMPlugin "1.0" SERVER_MANAGER_XML EventNexusReader.xml SERVER_MANAGER_SOURCES vtkEventNexusReader.cxx diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/CMakeLists.txt index aa1f3a57ed9c..c7b74fc70f15 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDEWNexusReader/CMakeLists.txt @@ -1,5 +1,5 @@ project( MantidParaViewMDEWNexusReader ) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) add_paraview_plugin( MantidParaViewMDEWNexusReaderSMPlugin "1.0" SERVER_MANAGER_XML MDEWNexusReader.xml SERVER_MANAGER_SOURCES vtkMDEWNexusReader.cxx diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/CMakeLists.txt index 6ad4b9ff3c82..5607de2b63ea 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/CMakeLists.txt @@ -1,5 +1,5 @@ project( MantidParaViewMDHWNexusReader ) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) add_paraview_plugin( MantidParaViewMDHWNexusReaderSMPlugin "1.0" SERVER_MANAGER_XML MDHWNexusReader.xml SERVER_MANAGER_SOURCES vtkMDHWNexusReader.cxx diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/CMakeLists.txt index 685637a59d6a..9a1c7182a763 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/NexusPeaksReader/CMakeLists.txt @@ -1,5 +1,5 @@ project( MantidParaViewNexusPeaksReader ) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) add_paraview_plugin( MantidParaViewNexusPeaksReaderSMPlugin "1.0" SERVER_MANAGER_XML NexusPeaksReader.xml SERVER_MANAGER_SOURCES vtkNexusPeaksReader.cxx diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt index 0944ba066267..3b2407ae8055 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/CMakeLists.txt @@ -1,5 +1,5 @@ project( MantidParaViewPeaksReader ) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) add_paraview_plugin( MantidParaViewPeaksReaderSMPlugin "1.0" SERVER_MANAGER_XML PeaksReader.xml SERVER_MANAGER_SOURCES vtkPeaksReader.cxx diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/CMakeLists.txt index eace77b7a09b..d8d8525c52cf 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWEventReader/CMakeLists.txt @@ -1,5 +1,5 @@ project( MantidParaViewSQWEventReader ) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) add_paraview_plugin( MantidParaViewSQWEventReaderSMPlugin "1.0" SERVER_MANAGER_XML SQWEventReader.xml SERVER_MANAGER_SOURCES vtkSQWEventReader.cxx diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt index cf5dd9ef299f..f06150575442 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/SQWReader/CMakeLists.txt @@ -1,5 +1,5 @@ project( MantidParaViewSQWReader ) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) add_paraview_plugin( MantidParaViewSQWReaderSMPlugin "1.0" SERVER_MANAGER_XML SQWReader.xml SERVER_MANAGER_SOURCES vtkSQWReader.cxx diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt index 1719a68e0bd6..a40f403de2a1 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/CMakeLists.txt @@ -1,5 +1,5 @@ PROJECT(MantidParaViewMDEWSource) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) ADD_PARAVIEW_PLUGIN(MantidParaViewMDEWSourceSMPlugin "1.0" SERVER_MANAGER_XML MDEWSource.xml SERVER_MANAGER_SOURCES vtkMDEWSource.cxx) diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt index d65a9066e679..e3fa0dd9580e 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/CMakeLists.txt @@ -1,5 +1,5 @@ PROJECT(MantidParaViewMDHWSource) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) ADD_PARAVIEW_PLUGIN(MantidParaViewMDHWSourceSMPlugin "1.0" SERVER_MANAGER_XML MDHWSource.xml SERVER_MANAGER_SOURCES vtkMDHWSource.cxx) diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt index bbf6ca293523..188fe0c7fafd 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/PeaksSource/CMakeLists.txt @@ -1,5 +1,5 @@ PROJECT(MantidParaViewPeaksSource) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) ADD_PARAVIEW_PLUGIN(MantidParaViewPeaksSourceSMPlugin "1.0" SERVER_MANAGER_XML PeaksSource.xml SERVER_MANAGER_SOURCES vtkPeaksSource.cxx) diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/CMakeLists.txt b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/CMakeLists.txt index f846a0c12d52..b713178fd46d 100644 --- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/CMakeLists.txt +++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/CMakeLists.txt @@ -1,5 +1,5 @@ PROJECT(MantidParaViewSinglePeakMarkerSource) - +include_directories( SYSTEM ${PARAVIEW_INCLUDE_DIRS} ) ADD_PARAVIEW_PLUGIN(MantidParaViewSinglePeakMarkerSourceSMPlugin "1.0" SERVER_MANAGER_XML SinglePeakMarkerSource.xml SERVER_MANAGER_SOURCES vtkSinglePeakMarkerSource.cxx) From 132fb1148b56158a2afd01043b0cddc53ffb7872 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Tue, 24 Mar 2015 12:22:46 -0700 Subject: [PATCH 108/126] Refs #11400. Remove old code from cpp files. --- .../kernel/src/Converters/CloneToNumpy.cpp | 34 ------------------- .../kernel/src/Converters/NDArrayToVector.cpp | 12 ------- 2 files changed, 46 deletions(-) diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp index 736ddb7ce55d..55534dbc1cc8 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/CloneToNumpy.cpp @@ -3,30 +3,10 @@ //----------------------------------------------------------------------------- #include "MantidPythonInterface/kernel/Converters/CloneToNumpy.h" #include "MantidPythonInterface/kernel/Converters/NDArrayTypeIndex.h" -//#include "MantidKernel/WarningSuppressions.h" -#include - -// GCC_DIAG_OFF(cast-qual) -//#define PY_ARRAY_UNIQUE_SYMBOL KERNEL_ARRAY_API -//#define NO_IMPORT_ARRAY -//#include -// GCC_DIAG_ON(cast-qual) - #include "MantidPythonInterface/kernel/Converters/NumpyFunctions.h" #include -/*PyArrayObject* function_PyArray_NewFromDescr(int datatype, const int ndims, -Py_intptr_t *dims) -{ - return (PyArrayObject*)PyArray_NewFromDescr(&PyArray_Type, - PyArray_DescrFromType(datatype), - ndims, // rank - dims, // Length in each dimension - NULL, NULL, - 0, NULL); -}*/ - namespace Mantid { namespace PythonInterface { namespace Converters @@ -57,13 +37,6 @@ namespace Mantid { namespace PythonInterface { Py_intptr_t dims[1] = { static_cast(cvector.size()) }; int datatype = NDArrayTypeIndex::typenum; - /*PyArrayObject *nparray = (PyArrayObject*) - PyArray_NewFromDescr(&PyArray_Type, - PyArray_DescrFromType(datatype), - 1, // rank - dims, // Length in each dimension - NULL, NULL, - 0, NULL);*/ PyArrayObject *nparray = func_PyArray_NewFromDescr(datatype, 1, &dims[0]); @@ -87,13 +60,6 @@ namespace Mantid { namespace PythonInterface PyObject *cloneND(const ElementType * carray, const int ndims, Py_intptr_t *dims) { int datatype = NDArrayTypeIndex::typenum; - /*PyArrayObject *nparray = (PyArrayObject*) - PyArray_NewFromDescr(&PyArray_Type, - PyArray_DescrFromType(datatype), - ndims, // rank - dims, // Length in each dimension - NULL, NULL, - 0, NULL);*/ PyArrayObject *nparray = func_PyArray_NewFromDescr(datatype, ndims, &dims[0]); // Compute total number of elements diff --git a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp index b36169327a7f..98324f55d71d 100644 --- a/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp +++ b/Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Converters/NDArrayToVector.cpp @@ -4,19 +4,7 @@ #include "MantidPythonInterface/kernel/Converters/NDArrayToVector.h" #include "MantidPythonInterface/kernel/Converters/NDArrayTypeIndex.h" #include - -// See http://docs.scipy.org/doc/numpy/reference/c-api.array.html#PY_ARRAY_UNIQUE_SYMBOL -//#define PY_ARRAY_UNIQUE_SYMBOL KERNEL_ARRAY_API -//#define NO_IMPORT_ARRAY -//#include - #include "MantidPythonInterface/kernel/Converters/NumpyFunctions.h" -/*namespace{ -PyObject* function_PyArray_IterNew(PyArrayObject *arr) -{ - return PyArray_IterNew((PyObject *)arr); -} -}*/ namespace Mantid { From 9d13c5510c48118e3e572a90d27d91b4207d3106 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Tue, 24 Mar 2015 13:20:44 -0700 Subject: [PATCH 109/126] Refs #11400. Change warning flag for rhel6. remove extra ;. --- Code/Mantid/Build/CMake/GNUSetup.cmake | 2 +- Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/Build/CMake/GNUSetup.cmake b/Code/Mantid/Build/CMake/GNUSetup.cmake index cc91e235a288..aa1eac0b7912 100644 --- a/Code/Mantid/Build/CMake/GNUSetup.cmake +++ b/Code/Mantid/Build/CMake/GNUSetup.cmake @@ -15,7 +15,7 @@ elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) endif() # Global warning flags. -set( GNUFLAGS "-Wall -Wextra -Wpedantic -Wconversion -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -fno-common" ) +set( GNUFLAGS "-Wall -Wextra -pedantic -Wconversion -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -fno-common" ) # Disable some warnings about deprecated headers and type conversions that # we can't do anything about # -Wno-deprecated: Do not warn about use of deprecated headers. diff --git a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp index bf17c6382db9..11a110f20013 100644 --- a/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/PawleyFit.cpp @@ -18,7 +18,7 @@ using namespace API; using namespace Kernel; using namespace Geometry; -DECLARE_ALGORITHM(PawleyFit); +DECLARE_ALGORITHM(PawleyFit) /// Default constructor PawleyFit::PawleyFit() : Algorithm(), m_dUnit() {} From 65a64f42d147fdd29478e83661710585c1e0cccd Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Tue, 24 Mar 2015 13:24:41 -0700 Subject: [PATCH 110/126] Refs #11400. #ifdef around gcc #pragma. --- .../MantidPythonInterface/kernel/Converters/NumpyFunctions.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/kernel/Converters/NumpyFunctions.h b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/kernel/Converters/NumpyFunctions.h index 452856c09428..473189403f99 100644 --- a/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/kernel/Converters/NumpyFunctions.h +++ b/Code/Mantid/Framework/PythonInterface/inc/MantidPythonInterface/kernel/Converters/NumpyFunctions.h @@ -22,7 +22,9 @@ File change history is stored at: . Code Documentation is available at: */ +#ifdef __GNUC__ #pragma GCC system_header +#endif #include #include "MantidKernel/WarningSuppressions.h" From a421c906f0e54605c5dbb02f2072a99d9c9aff85 Mon Sep 17 00:00:00 2001 From: Raquel Alvarez Banos Date: Wed, 25 Mar 2015 08:22:38 +0000 Subject: [PATCH 111/126] Re #9495 Make help button smaller --- .../inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui index 0bc18df0af13..41440428b1cb 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.ui @@ -437,6 +437,12 @@ + + + 25 + 25 + + ? From 66bf0a4ee84b06f87ed943c902db45300126802e Mon Sep 17 00:00:00 2001 From: Raquel Alvarez Banos Date: Wed, 25 Mar 2015 08:55:01 +0000 Subject: [PATCH 112/126] Re #9495 Add help button in baseline modelling step --- .../Muon/ALCBaselineModellingView.ui | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.ui index eefba920a9c7..cd4faa0b2f67 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.ui @@ -92,7 +92,20 @@ - + + + + + 25 + 25 + + + + ? + + + + Qt::Horizontal From e37f22c6d4bfa4bf3c53de0e41d2ff4f722b152c Mon Sep 17 00:00:00 2001 From: Raquel Alvarez Banos Date: Wed, 25 Mar 2015 08:55:39 +0000 Subject: [PATCH 113/126] Re #9495 Add help button in peak fitting step --- .../Muon/ALCPeakFittingView.ui | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.ui index 3e078a57def0..6b78d095490f 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.ui @@ -36,7 +36,20 @@ - + + + + + 25 + 25 + + + + ? + + + + Qt::Horizontal From 1386732109f789a55894879337161c126ec04c35 Mon Sep 17 00:00:00 2001 From: Raquel Alvarez Banos Date: Wed, 25 Mar 2015 09:06:28 +0000 Subject: [PATCH 114/126] Re #9495 Link help button to DataLoading help page --- .../MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h | 1 + .../Muon/IALCDataLoadingView.h | 4 ++++ .../CustomInterfaces/src/Muon/ALCDataLoadingView.cpp | 10 ++++++++++ 3 files changed, 15 insertions(+) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h index c7c9ea26d321..e7ae3ae6b3c7 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h @@ -70,6 +70,7 @@ namespace CustomInterfaces void setAvailablePeriods(const std::vector &periods); void setWaitingCursor(); void restoreCursor(); + void help(); // -- End of IALCDataLoadingView interface ----------------------------------------------------- diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCDataLoadingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCDataLoadingView.h index bf6bbc99ad8a..56a61e0bbc23 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCDataLoadingView.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCDataLoadingView.h @@ -109,12 +109,16 @@ namespace CustomInterfaces /// Restore the original cursor virtual void restoreCursor() = 0; + /// Opens the Mantid Wiki web page + virtual void help() = 0; + signals: /// Request to load data void loadRequested(); /// User has selected the first run void firstRunSelected(); + }; } // namespace CustomInterfaces diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp index 5f47cc637933..fe2ac1ebdd82 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp @@ -1,6 +1,8 @@ #include "MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h" +#include #include +#include #include @@ -18,6 +20,8 @@ namespace CustomInterfaces connect(m_ui.load, SIGNAL(clicked()), SIGNAL(loadRequested())); connect(m_ui.firstRun, SIGNAL(fileFindingFinished()), SIGNAL(firstRunSelected())); + connect(m_ui.help, SIGNAL(clicked()), this, SLOT(help())); + m_ui.dataPlot->setCanvasBackground(Qt::white); m_ui.dataPlot->setAxisFont(QwtPlot::xBottom, m_widget->font()); m_ui.dataPlot->setAxisFont(QwtPlot::yLeft, m_widget->font()); @@ -159,6 +163,12 @@ namespace CustomInterfaces } } + void ALCDataLoadingView::help() + { + QDesktopServices::openUrl(QUrl(QString("http://www.mantidproject.org/") + + "Muon_ALC:_Data_Loading")); + } + void ALCDataLoadingView::setWaitingCursor() { QApplication::setOverrideCursor(Qt::WaitCursor); From df34f3672bcb079130644e32ababdd46a1c5f40d Mon Sep 17 00:00:00 2001 From: Raquel Alvarez Banos Date: Wed, 25 Mar 2015 09:14:43 +0000 Subject: [PATCH 115/126] Re #9495 Link help button to BaselineModelling help page --- .../Muon/ALCBaselineModellingView.h | 1 + .../Muon/IALCBaselineModellingView.h | 3 +++ .../src/Muon/ALCBaselineModellingView.cpp | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.h index c4c76a2f20c0..61187efc1176 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCBaselineModellingView.h @@ -67,6 +67,7 @@ namespace CustomInterfaces void deleteSectionSelector(int index); void updateSectionSelector(int index, SectionSelector values); void displayError(const QString& message); + void help(); // -- End of IALCBaselineModellingView interface ------------------------------------------------- private slots: diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCBaselineModellingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCBaselineModellingView.h index b158aa6311b2..1c385f484602 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCBaselineModellingView.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCBaselineModellingView.h @@ -131,6 +131,9 @@ namespace CustomInterfaces */ virtual void displayError(const QString& message) = 0; + /// Links help button to wiki page + virtual void help() = 0; + signals: /// Fit requested void fitRequested(); diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp index 4c285e12dfc9..1a78ab4259ca 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp @@ -6,9 +6,11 @@ #include +#include #include #include #include +#include #include @@ -63,6 +65,8 @@ namespace CustomInterfaces connect(m_ui.sections, SIGNAL(cellChanged(int,int)), SIGNAL(sectionRowModified(int))); connect(m_selectorModifiedMapper, SIGNAL(mapped(int)), SIGNAL(sectionSelectorModified(int))); + + connect(m_ui.help, SIGNAL(clicked()), this, SLOT(help())); } QString ALCBaselineModellingView::function() const @@ -201,5 +205,10 @@ namespace CustomInterfaces selector->setMaximum(values.second); } + void ALCBaselineModellingView::help() { + QDesktopServices::openUrl(QUrl(QString("http://www.mantidproject.org/") + + "Muon_ALC:_Baseline_Modelling")); + } + } // namespace CustomInterfaces } // namespace MantidQt From e2831a64753f9cecc50ebe99a6a6e2cca9fa6b22 Mon Sep 17 00:00:00 2001 From: Raquel Alvarez Banos Date: Wed, 25 Mar 2015 09:20:38 +0000 Subject: [PATCH 116/126] Re #9495 Link help button to PeakFitting help page --- .../MantidQtCustomInterfaces/Muon/ALCPeakFittingView.h | 1 + .../Muon/IALCPeakFittingView.h | 3 +++ .../CustomInterfaces/src/Muon/ALCPeakFittingView.cpp | 10 ++++++++++ 3 files changed, 14 insertions(+) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.h index 50bba6a0348f..4768632e3b77 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/ALCPeakFittingView.h @@ -59,6 +59,7 @@ namespace CustomInterfaces void setParameter(const QString& funcIndex, const QString& paramName, double value); void setPeakPickerEnabled(bool enabled); void setPeakPicker(const IPeakFunction_const_sptr& peak); + void help(); // -- End of IALCPeakFitting interface --------------------------------------------------------- diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCPeakFittingView.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCPeakFittingView.h index 150bdc6850ff..34a4704f7358 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCPeakFittingView.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/IALCPeakFittingView.h @@ -86,6 +86,9 @@ namespace CustomInterfaces /// @param peak :: A new peak to represent virtual void setPeakPicker(const IPeakFunction_const_sptr& peak) = 0; + /// Opens the Mantid Wiki web page + virtual void help() = 0; + signals: /// Request to perform peak fitting void fitRequested(); diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingView.cpp index 99c3f9ca4815..04dd6ca471aa 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingView.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingView.cpp @@ -1,5 +1,7 @@ #include "MantidQtCustomInterfaces/Muon/ALCPeakFittingView.h" +#include +#include #include namespace MantidQt @@ -54,6 +56,8 @@ void ALCPeakFittingView::initialize() connect(m_ui.peaks, SIGNAL(currentFunctionChanged()), SIGNAL(currentFunctionChanged())); connect(m_ui.peaks, SIGNAL(parameterChanged(QString,QString)), SIGNAL(parameterChanged(QString,QString))); + + connect(m_ui.help, SIGNAL(clicked()), this, SLOT(help())); } void ALCPeakFittingView::setDataCurve(const QwtData& data) @@ -100,6 +104,12 @@ void ALCPeakFittingView::setPeakPicker(const IPeakFunction_const_sptr& peak) m_ui.plot->replot(); } +void ALCPeakFittingView::help() +{ + QDesktopServices::openUrl(QUrl(QString("http://www.mantidproject.org/") + + "Muon_ALC:_Peak_Fitting")); +} + } // namespace CustomInterfaces } // namespace Mantid From b825e7b6484eebd06b792e8ee968d4a0dec0b603 Mon Sep 17 00:00:00 2001 From: Raquel Alvarez Banos Date: Wed, 25 Mar 2015 09:43:29 +0000 Subject: [PATCH 117/126] Re #9495 Add new help methods to unit tests --- .../CustomInterfaces/test/ALCBaselineModellingPresenterTest.h | 2 ++ .../CustomInterfaces/test/ALCDataLoadingPresenterTest.h | 1 + .../CustomInterfaces/test/ALCPeakFittingPresenterTest.h | 1 + 3 files changed, 4 insertions(+) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h index 85159616f13a..e209b793032a 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h @@ -49,6 +49,8 @@ class MockALCBaselineModellingView : public IALCBaselineModellingView MOCK_METHOD3(updateSectionSelector, void(size_t, double, double)); MOCK_METHOD1(displayError, void(const QString&)); + + MOCK_METHOD0(help, void()); }; class MockALCBaselineModellingModel : public IALCBaselineModellingModel diff --git a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h index 35b772c9c4bb..873510da9d46 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h @@ -50,6 +50,7 @@ class MockALCDataLoadingView : public IALCDataLoadingView MOCK_METHOD1(setAvailablePeriods, void(const std::vector&)); MOCK_METHOD0(setWaitingCursor, void()); MOCK_METHOD0(restoreCursor, void()); + MOCK_METHOD0(help, void()); void requestLoading() { emit loadRequested(); } void selectFirstRun() { emit firstRunSelected(); } diff --git a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCPeakFittingPresenterTest.h b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCPeakFittingPresenterTest.h index 192811e0ab15..ed28567af98c 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCPeakFittingPresenterTest.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCPeakFittingPresenterTest.h @@ -50,6 +50,7 @@ class MockALCPeakFittingView : public IALCPeakFittingView MOCK_METHOD1(setPeakPicker, void(const IPeakFunction_const_sptr&)); MOCK_METHOD1(setFunction, void(const IFunction_const_sptr&)); MOCK_METHOD3(setParameter, void(const QString&, const QString&, double)); + MOCK_METHOD0(help, void()); }; class MockALCPeakFittingModel : public IALCPeakFittingModel From ac1425447fb73e2247f7009cddfca0630d0fe1d7 Mon Sep 17 00:00:00 2001 From: Raquel Alvarez Banos Date: Wed, 25 Mar 2015 09:51:05 +0000 Subject: [PATCH 118/126] Re #9495 Test call to help methods --- .../test/ALCBaselineModellingPresenterTest.h | 6 ++++++ .../CustomInterfaces/test/ALCDataLoadingPresenterTest.h | 6 ++++++ .../CustomInterfaces/test/ALCPeakFittingPresenterTest.h | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h index e209b793032a..f597c130acc0 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCBaselineModellingPresenterTest.h @@ -340,6 +340,12 @@ class ALCBaselineModellingPresenterTest : public CxxTest::TestSuite m_view->requestFit(); } + + void test_helpPage () + { + EXPECT_CALL(*m_view, help()).Times(1); + m_view->help(); + } }; diff --git a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h index 873510da9d46..850d5812542e 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCDataLoadingPresenterTest.h @@ -261,6 +261,12 @@ class ALCDataLoadingPresenterTest : public CxxTest::TestSuite QwtDataY(2, 0.038717, 1E-6)))); m_view->requestLoading(); } + + void test_helpPage () + { + EXPECT_CALL(*m_view, help()).Times(1); + m_view->help(); + } }; diff --git a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCPeakFittingPresenterTest.h b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCPeakFittingPresenterTest.h index ed28567af98c..36b8851b2caf 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/test/ALCPeakFittingPresenterTest.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/test/ALCPeakFittingPresenterTest.h @@ -259,6 +259,12 @@ class ALCPeakFittingPresenterTest : public CxxTest::TestSuite m_view->changeParameter(QString("f1"), QString("A0")); } + + void test_helpPage () + { + EXPECT_CALL(*m_view, help()).Times(1); + m_view->help(); + } }; From 5ea1dc0d6c523fe2ce7fff86830d57ebb6025742 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Wed, 25 Mar 2015 11:56:21 +0000 Subject: [PATCH 119/126] Disable the mouse button on the magnifier Fixes an issue with this locking zoom on after the context menu is shown using right click Refs #11424 --- Code/Mantid/MantidPlot/src/Graph.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Code/Mantid/MantidPlot/src/Graph.cpp b/Code/Mantid/MantidPlot/src/Graph.cpp index a36e9a89449c..92123c84c1bd 100644 --- a/Code/Mantid/MantidPlot/src/Graph.cpp +++ b/Code/Mantid/MantidPlot/src/Graph.cpp @@ -5360,9 +5360,11 @@ void Graph::enablePanningMagnifier(bool on) delete d_panner; QwtPlotCanvas *cnvs =d_plot->canvas(); //canvas(); - if (on){ + if (on) { cnvs->setCursor(Qt::pointingHandCursor); d_magnifier = new QwtPlotMagnifier(cnvs); + // Disable the mouse button as it causes issues with the context menu + d_magnifier->setMouseButton(Qt::NoButton); d_magnifier->setAxisEnabled(QwtPlot::yRight,false); d_magnifier->setZoomInKey(Qt::Key_Plus, Qt::ShiftModifier); From 2d950287102693b8a3eb8454d7e28ef0af85e62f Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Wed, 25 Mar 2015 09:42:39 -0400 Subject: [PATCH 120/126] Refs #11400. Remove pedantic and Wno-unused-result when gcc=4.4 --- Code/Mantid/Build/CMake/GNUSetup.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Code/Mantid/Build/CMake/GNUSetup.cmake b/Code/Mantid/Build/CMake/GNUSetup.cmake index aa1eac0b7912..81b6e51be4bd 100644 --- a/Code/Mantid/Build/CMake/GNUSetup.cmake +++ b/Code/Mantid/Build/CMake/GNUSetup.cmake @@ -15,7 +15,7 @@ elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) endif() # Global warning flags. -set( GNUFLAGS "-Wall -Wextra -pedantic -Wconversion -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -fno-common" ) +set( GNUFLAGS "-Wall -Wextra -Wconversion -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -fno-common" ) # Disable some warnings about deprecated headers and type conversions that # we can't do anything about # -Wno-deprecated: Do not warn about use of deprecated headers. @@ -24,9 +24,10 @@ set( GNUFLAGS "-Wall -Wextra -pedantic -Wconversion -Winit-self -Wpointer-arith set( GNUFLAGS "${GNUFLAGS} -Wno-deprecated -Wno-write-strings") # Check if we have a new enough version for this flag +# some -pedantic warnings remain with gcc 4.4.7 if ( CMAKE_COMPILER_IS_GNUCXX ) - if (GCC_COMPILER_VERSION VERSION_GREATER "4.3") - set(GNUFLAGS "${GNUFLAGS} -Wno-unused-result") + if (GCC_COMPILER_VERSION VERSION_GREATER "4.4") + set(GNUFLAGS "${GNUFLAGS} -Wno-unused-result -pedantic") endif () elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) set(GNUFLAGS "${GNUFLAGS} -Wno-sign-conversion") From dc29eb2bf4826fe232fb4143b1221208d02871ea Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Wed, 25 Mar 2015 16:18:34 +0000 Subject: [PATCH 121/126] Order sample logs ascending by name by default Refs #11427 --- Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp index fb7636c0e760..343c6551c412 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp @@ -462,6 +462,7 @@ void MantidSampleLogDialog::init() m_tree->header()->resizeSection(3, 90); //units column m_tree->header()->setMovable(false); m_tree->setSortingEnabled(true); + m_tree->sortByColumn(0, Qt::AscendingOrder); } From 64d9a6dc3689c003caffbc772b4ccef838b391b0 Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Wed, 25 Mar 2015 13:35:37 -0400 Subject: [PATCH 122/126] Refs #11400. Change VERSION_GREATER to NOT VERSION_LESS. --- Code/Mantid/Build/CMake/GNUSetup.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Mantid/Build/CMake/GNUSetup.cmake b/Code/Mantid/Build/CMake/GNUSetup.cmake index 81b6e51be4bd..67b373b55a4b 100644 --- a/Code/Mantid/Build/CMake/GNUSetup.cmake +++ b/Code/Mantid/Build/CMake/GNUSetup.cmake @@ -26,7 +26,7 @@ set( GNUFLAGS "${GNUFLAGS} -Wno-deprecated -Wno-write-strings") # Check if we have a new enough version for this flag # some -pedantic warnings remain with gcc 4.4.7 if ( CMAKE_COMPILER_IS_GNUCXX ) - if (GCC_COMPILER_VERSION VERSION_GREATER "4.4") + if (NOT (GCC_COMPILER_VERSION VERSION_LESS "4.5")) set(GNUFLAGS "${GNUFLAGS} -Wno-unused-result -pedantic") endif () elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) From 032c9e5ad361d89032adaa2645ff58821610249e Mon Sep 17 00:00:00 2001 From: Andrei Savici Date: Wed, 25 Mar 2015 13:53:07 -0400 Subject: [PATCH 123/126] Fix cppcheck Reduce scope of variable --- Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp index ecd6a1c3d119..391d89752a44 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp @@ -2530,7 +2530,6 @@ void MantidUI::importNumSeriesLog(const QString &wsName, const QString &logName, t->setColName(1, column1); int iValueCurve = 0; - int iFilterCurve = 1; // Applying filters if (filter > 0) @@ -2731,6 +2730,7 @@ void MantidUI::importNumSeriesLog(const QString &wsName, const QString &logName, if (filter && flt.filter()) { + int iFilterCurve = 1; QwtPlotCurve *c = g->curve(iFilterCurve); if ( c ) { From 9f3b6e1a4d663d478e9eb0420c666e45add3e55d Mon Sep 17 00:00:00 2001 From: Raquel Alvarez Banos Date: Thu, 26 Mar 2015 10:34:34 +0000 Subject: [PATCH 124/126] Re #11428 Use mantid help system --- .../CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp | 6 ++---- .../CustomInterfaces/src/Muon/ALCDataLoadingView.cpp | 7 +++---- .../CustomInterfaces/src/Muon/ALCPeakFittingView.cpp | 7 +++---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp index 1a78ab4259ca..136de6465559 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCBaselineModellingView.cpp @@ -3,14 +3,13 @@ #include "MantidAPI/FunctionFactory.h" #include "MantidAPI/FunctionDomain1D.h" #include "MantidAPI/AlgorithmManager.h" +#include "MantidQtAPI/HelpWindow.h" #include -#include #include #include #include -#include #include @@ -206,8 +205,7 @@ namespace CustomInterfaces } void ALCBaselineModellingView::help() { - QDesktopServices::openUrl(QUrl(QString("http://www.mantidproject.org/") + - "Muon_ALC:_Baseline_Modelling")); + MantidQt::API::HelpWindow::showCustomInterface(NULL, QString("Muon_ALC")); } } // namespace CustomInterfaces diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp index fe2ac1ebdd82..1c10a0abf0a1 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingView.cpp @@ -1,8 +1,8 @@ #include "MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h" -#include +#include "MantidQtAPI/HelpWindow.h" + #include -#include #include @@ -165,8 +165,7 @@ namespace CustomInterfaces void ALCDataLoadingView::help() { - QDesktopServices::openUrl(QUrl(QString("http://www.mantidproject.org/") + - "Muon_ALC:_Data_Loading")); + MantidQt::API::HelpWindow::showCustomInterface(NULL, QString("Muon_ALC")); } void ALCDataLoadingView::setWaitingCursor() diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingView.cpp index 04dd6ca471aa..d8183fe40bf2 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingView.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCPeakFittingView.cpp @@ -1,7 +1,7 @@ #include "MantidQtCustomInterfaces/Muon/ALCPeakFittingView.h" -#include -#include +#include "MantidQtAPI/HelpWindow.h" + #include namespace MantidQt @@ -106,8 +106,7 @@ void ALCPeakFittingView::setPeakPicker(const IPeakFunction_const_sptr& peak) void ALCPeakFittingView::help() { - QDesktopServices::openUrl(QUrl(QString("http://www.mantidproject.org/") + - "Muon_ALC:_Peak_Fitting")); + MantidQt::API::HelpWindow::showCustomInterface(NULL, QString("Muon_ALC")); } } // namespace CustomInterfaces From 183833545ec2d20822baa799abac61c9be9f4a3c Mon Sep 17 00:00:00 2001 From: Raquel Alvarez Banos Date: Thu, 26 Mar 2015 10:44:03 +0000 Subject: [PATCH 125/126] Re #11428 Add ALC documentation --- .../docs/source/interfaces/Muon_ALC.rst | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 Code/Mantid/docs/source/interfaces/Muon_ALC.rst diff --git a/Code/Mantid/docs/source/interfaces/Muon_ALC.rst b/Code/Mantid/docs/source/interfaces/Muon_ALC.rst new file mode 100644 index 000000000000..44496c7921e2 --- /dev/null +++ b/Code/Mantid/docs/source/interfaces/Muon_ALC.rst @@ -0,0 +1,124 @@ +Muon ALC +======== + +.. contents:: Table of Contents + :local: + +Overview +-------- + +The Muon ALC interface, which is short for Avoided Level Crossing, aims at +handling frequent analysis on e.g. HIFI. It uses simple point-and-click to +analyse a sequence of datasets collected with different parameter values, for +instance different magnetic fields, temperature, etc, and study how this +affects asymmetry. There are currently three steps in the analysis. + +Data Loading +------------ + +The Data Loading step, provides an interface for the +:ref:`PlotAsymmetryByLogValue ` algorithm, +in which a sequence of runs are loaded through the fields +*First* and *Last*. All datasets with run number between these limits will be +loaded, and an error message will be shown if any of them is missing. The +user must supply the log data that will be used as X parameter from the list +of available log values. + +.. interface:: ALC + :widget: dataLoadingView + :align: center + :width: 800 + +Options +~~~~~~~ + +First + First run of the sequence of datasets. + +Last + Last run of the sequence of datasets. + +Log + Log value to use as X parameter + +Dead Time Correction + Type of dead time corrections to apply. Options are *None*, in which case no + corrections will be applied, *From Data File*, to load corrections from + the input dataset itself, or *From Custom File*, to load corrections from a + specified nexus file. + +Grouping + Detector grouping to apply. *Auto* will load the grouping information contained + in the run file, while *Custom* allows to specify the list of spectra for both the + forward and backward groups. + +Periods + Period number to use as red data. The *Subtract* option, if checked, allows to + select the green period number that will be subtracted to the red data. + +Calculation + Type of calculation, *Integral* or *Differential*, together with the time limits. + +? + Shows this help page. + +Load + Computes the asymmetry according to selected options and displays it against the + chosen log value. + +Baseline Modelling +------------------ + +In the Baseline Modelling step, the user can fit the baseline by selecting which +sections of the data should be used in the fit, and what the baseline fit +function should be. To select a baseline function, right-click on the *Function* +region, then *Add function* and choose among the different possibilities. Then +pick the desired fitting sections. + +.. interface:: ALC + :widget: baselineModellingView + :align: center + :width: 400 + +Options +~~~~~~~ + +Function + Right-click on the blank area to add a baseline function. + +Sections + Right-click on the blank area to add as many sections as needed to + select the ranges to fit. + +? + Shows this help page. + +Fit + Fits the data. + +Peak Fitting +------------ + +In the Peak Fitting step, data with the baseline subtracted are shown in +the right panel. The user can study the peaks of interest all with the same simple +interface. To add a new peak, right-click on the Peaks region, then select +*Add function* and choose among the different possibilities in the category Peak. + +.. interface:: ALC + :widget: peakFittingView + :align: center + :width: 600 + +Options +~~~~~~~ + +Peaks + Right-click on the blank area to add a peak function. + +? + Shows this help page. + +Fit + Fits the data. + +.. categories:: Interfaces Muon From 944f61b3386704965d915723db4a55bcc08e4f5c Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Thu, 26 Mar 2015 12:01:21 +0000 Subject: [PATCH 126/126] Refs #11411 Remove hack from FindJsonCPP.cmake --- Code/Mantid/Build/CMake/FindJsonCPP.cmake | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Code/Mantid/Build/CMake/FindJsonCPP.cmake b/Code/Mantid/Build/CMake/FindJsonCPP.cmake index c52d1418812b..a28f35fd3334 100644 --- a/Code/Mantid/Build/CMake/FindJsonCPP.cmake +++ b/Code/Mantid/Build/CMake/FindJsonCPP.cmake @@ -9,11 +9,6 @@ # JSONCPP_LIBRARY_DEBUG - library files for linking (debug version) # JSONCPP_LIBRARIES - All required libraries, including the configuration type -# Using unset here is a temporary hack to force FindJson to find the correct -# path in an incremental build. It should be removed a day or two after the -# branch introducing this is merged. -unset ( JSONCPP_INCLUDE_DIR CACHE ) - # Headers find_path ( JSONCPP_INCLUDE_DIR json/reader.h PATH_SUFFIXES jsoncpp )