From 18672c6104dfefecf7d55b7f1ca7da5bc241c696 Mon Sep 17 00:00:00 2001 From: David Fairbrother <DavidFair@users.noreply.github.com> Date: Tue, 24 Mar 2020 15:24:16 +0000 Subject: [PATCH] Remove unused vars and methods following tooling changes --- Framework/API/test/RunTest.h | 1 - Framework/Algorithms/test/RingProfileTest.h | 13 ++++-- .../Crystal/src/PeakAlgorithmHelpers.cpp | 2 + .../src/CostFunctions/CostFuncFitting.cpp | 2 +- .../test/Algorithms/LeBailFitTest.h | 41 ------------------- 5 files changed, 13 insertions(+), 46 deletions(-) diff --git a/Framework/API/test/RunTest.h b/Framework/API/test/RunTest.h index caaf5d0a9db..a41f319a7ea 100644 --- a/Framework/API/test/RunTest.h +++ b/Framework/API/test/RunTest.h @@ -630,7 +630,6 @@ public: } void test_Accessing_Single_Value_From_Times_Series_A_Large_Number_Of_Times() { - double value(0.0); for (size_t i = 0; i < 20000; ++i) { m_testRun.getPropertyAsSingleValue(m_propName); } diff --git a/Framework/Algorithms/test/RingProfileTest.h b/Framework/Algorithms/test/RingProfileTest.h index 6081a76e993..3580725c7c2 100644 --- a/Framework/Algorithms/test/RingProfileTest.h +++ b/Framework/Algorithms/test/RingProfileTest.h @@ -39,6 +39,14 @@ public: const std::invalid_argument &); // centre must be 2 or 3 values (x,y) or (x,y,z) + std::vector<double> justOne(1); + justOne[0] = -0.35; + TS_ASSERT_THROWS(alg.setProperty("Centre", justOne), + const std::invalid_argument &); + + std::vector<double> fourInputs(4, -0.45); + TS_ASSERT_THROWS(alg.setProperty("Centre", fourInputs), + const std::invalid_argument &); TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", outWSName)); @@ -140,9 +148,8 @@ public: return goodWS; } - void configure_ring_profile(RingProfile &alg, - const MatrixWorkspace_sptr &inws, - const std::vector<double> ¢re, int num_bins, + void configure_ring_profile(RingProfile &alg, MatrixWorkspace_sptr inws, + std::vector<double> centre, int num_bins, double start_angle = 0, double min_radius = 0, double max_radius = 1000, bool anticlock = true) { TS_ASSERT_THROWS_NOTHING(alg.initialize()); diff --git a/Framework/Crystal/src/PeakAlgorithmHelpers.cpp b/Framework/Crystal/src/PeakAlgorithmHelpers.cpp index 6d01489f6c8..684e7601304 100644 --- a/Framework/Crystal/src/PeakAlgorithmHelpers.cpp +++ b/Framework/Crystal/src/PeakAlgorithmHelpers.cpp @@ -203,6 +203,8 @@ generateOffsetVectors(const std::vector<double> &hOffsets, std::transform( lOffsets.begin(), lOffsets.end(), std::back_inserter(offsets), [&hOffset, &kOffset](double lOffset) { + // it's not quite clear how to interpret them as mnp + // indices so set to 0, 0, 0 return std::make_tuple(0, 0, 0, V3D(hOffset, kOffset, lOffset)); }); } diff --git a/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp b/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp index d458a539489..9e8effe8584 100644 --- a/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp +++ b/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp @@ -136,7 +136,7 @@ void CostFuncFitting::calActiveCovarianceMatrix(GSLMatrix &covar, m_function->functionDeriv(*m_domain, J); // let the GSL to compute the covariance matrix - gsl_multifit_covar(J.getJ(), epsrel, covar.gsl()); + gsl_multifit_covar(j, epsrel, covar.gsl()); } /** Calculates covariance matrix diff --git a/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h b/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h index 1977a54d00d..b43f134bd99 100644 --- a/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h +++ b/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h @@ -424,47 +424,6 @@ API::MatrixWorkspace_sptr generateArgSiPeak220() { return dataws; } -//---------------------------------------------------------------------------------------------- -/** Import data from a column data file - */ -void importDataFromColumnFile(const std::string &filename, - const std::string &wsname) { - DataHandling::LoadAscii2 load; - load.initialize(); - - load.setProperty("FileName", filename); - load.setProperty("OutputWorkspace", wsname); - load.setProperty("Separator", "Automatic"); - load.setProperty("Unit", "TOF"); - - load.execute(); - if (!load.isExecuted()) { - stringstream errss; - errss << "Data file " << filename << " cannot be opened. "; - std::cout << errss.str() << '\n'; - throw std::runtime_error(errss.str()); - } - - MatrixWorkspace_sptr ws = boost::dynamic_pointer_cast<MatrixWorkspace>( - AnalysisDataService::Instance().retrieve(wsname)); - if (!ws) { - stringstream errss; - errss << "LoadAscii failed to generate workspace"; - std::cout << errss.str() << '\n'; - throw std::runtime_error(errss.str()); - } - - // Set error - const MantidVec &vecY = ws->readY(0); - MantidVec &vecE = ws->dataE(0); - size_t numpts = vecY.size(); - for (size_t i = 0; i < numpts; ++i) { - vecE[i] = std::max(1.0, sqrt(vecY[i])); - } - - return; -} - //---------------------------------------------------------------------------------------------- /** Create data workspace without background */ -- GitLab