Skip to content
Snippets Groups Projects
Commit d192fb28 authored by Owen Arnold's avatar Owen Arnold
Browse files

refs #5489. rename to ImportMDHistoWorkspace.

parent 3253b565
No related merge requests found
...@@ -23,9 +23,9 @@ set ( SRC_FILES ...@@ -23,9 +23,9 @@ set ( SRC_FILES
src/CreateMDWorkspace.cpp src/CreateMDWorkspace.cpp
src/FakeMDEventData.cpp src/FakeMDEventData.cpp
src/FindPeaksMD.cpp src/FindPeaksMD.cpp
src/ImportMDHistoWorkspace.cpp
src/IntegratePeaksMD.cpp src/IntegratePeaksMD.cpp
src/LoadMD.cpp src/LoadMD.cpp
src/LoadMDHistoWorkspace.cpp
src/LoadSQW.cpp src/LoadSQW.cpp
src/MDBin.cpp src/MDBin.cpp
src/MDBox.cpp src/MDBox.cpp
...@@ -91,9 +91,9 @@ set ( INC_FILES ...@@ -91,9 +91,9 @@ set ( INC_FILES
inc/MantidMDEvents/CreateMDWorkspace.h inc/MantidMDEvents/CreateMDWorkspace.h
inc/MantidMDEvents/FakeMDEventData.h inc/MantidMDEvents/FakeMDEventData.h
inc/MantidMDEvents/FindPeaksMD.h inc/MantidMDEvents/FindPeaksMD.h
inc/MantidMDEvents/ImportMDHistoWorkspace.h
inc/MantidMDEvents/IntegratePeaksMD.h inc/MantidMDEvents/IntegratePeaksMD.h
inc/MantidMDEvents/LoadMD.h inc/MantidMDEvents/LoadMD.h
inc/MantidMDEvents/LoadMDHistoWorkspace.h
inc/MantidMDEvents/LoadSQW.h inc/MantidMDEvents/LoadSQW.h
inc/MantidMDEvents/MDBin.h inc/MantidMDEvents/MDBin.h
inc/MantidMDEvents/MDBox.h inc/MantidMDEvents/MDBox.h
...@@ -153,8 +153,8 @@ set ( TEST_FILES ...@@ -153,8 +153,8 @@ set ( TEST_FILES
test/CreateMDWorkspaceTest.h test/CreateMDWorkspaceTest.h
test/FakeMDEventDataTest.h test/FakeMDEventDataTest.h
test/FindPeaksMDTest.h test/FindPeaksMDTest.h
test/ImportMDHistoWorkspaceTest.h
test/IntegratePeaksMDTest.h test/IntegratePeaksMDTest.h
test/LoadMDHistoWorkspaceTest.h
test/LoadMDTest.h test/LoadMDTest.h
test/LoadSQWTest.h test/LoadSQWTest.h
test/MDBinTest.h test/MDBinTest.h
......
#ifndef MANTID_MDEVENTS_LOADMDHISTOWORKSPACE_H_ #ifndef MANTID_MDEVENTS_IMPORTMDHISTOWORKSPACE_H_
#define MANTID_MDEVENTS_LOADMDHISTOWORKSPACE_H_ #define MANTID_MDEVENTS_IMPORTMDHISTOWORKSPACE_H_
#include "MantidKernel/System.h" #include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h" #include "MantidAPI/Algorithm.h"
...@@ -9,7 +9,8 @@ namespace Mantid ...@@ -9,7 +9,8 @@ namespace Mantid
namespace MDEvents namespace MDEvents
{ {
/** LoadMDHistoWorkspace : TODO: DESCRIPTION /** ImportMDHistoWorkspace : Takes a text file containing structured signal and error information and imports it
as a new MDHistoWorkspace.
@date 2012-06-20 @date 2012-06-20
...@@ -33,11 +34,11 @@ namespace MDEvents ...@@ -33,11 +34,11 @@ namespace MDEvents
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid> File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org> Code Documentation is available at: <http://doxygen.mantidproject.org>
*/ */
class DLLExport LoadMDHistoWorkspace : public API::Algorithm class DLLExport ImportMDHistoWorkspace : public API::Algorithm
{ {
public: public:
LoadMDHistoWorkspace(); ImportMDHistoWorkspace();
virtual ~LoadMDHistoWorkspace(); virtual ~ImportMDHistoWorkspace();
virtual const std::string name() const; virtual const std::string name() const;
virtual int version() const; virtual int version() const;
...@@ -48,11 +49,10 @@ namespace MDEvents ...@@ -48,11 +49,10 @@ namespace MDEvents
void init(); void init();
void exec(); void exec();
}; };
} // namespace MDEvents } // namespace MDEvents
} // namespace Mantid } // namespace Mantid
#endif /* MANTID_MDEVENTS_LOADMDHISTOWORKSPACE_H_ */ #endif /* MANTID_MDEVENTS_IMPORTMDHISTOWORKSPACE_H_ */
\ No newline at end of file \ No newline at end of file
...@@ -13,7 +13,7 @@ Signal and Error inputs are read in such that, the first entries in the file wil ...@@ -13,7 +13,7 @@ Signal and Error inputs are read in such that, the first entries in the file wil
*WIKI*/ *WIKI*/
#include "MantidMDEvents/LoadMDHistoWorkspace.h" #include "MantidMDEvents/ImportMDHistoWorkspace.h"
#include "MantidMDEvents/MDHistoWorkspace.h" #include "MantidMDEvents/MDHistoWorkspace.h"
#include "MantidAPI/FileProperty.h" #include "MantidAPI/FileProperty.h"
#include "MantidAPI/Progress.h" #include "MantidAPI/Progress.h"
...@@ -40,7 +40,7 @@ namespace MDEvents ...@@ -40,7 +40,7 @@ namespace MDEvents
{ {
// Register the algorithm into the AlgorithmFactory // Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM(LoadMDHistoWorkspace) DECLARE_ALGORITHM(ImportMDHistoWorkspace)
/** /**
Functor to compute the product of the set. Functor to compute the product of the set.
...@@ -56,31 +56,31 @@ namespace MDEvents ...@@ -56,31 +56,31 @@ namespace MDEvents
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
/** Constructor /** Constructor
*/ */
LoadMDHistoWorkspace::LoadMDHistoWorkspace() ImportMDHistoWorkspace::ImportMDHistoWorkspace()
{ {
} }
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
/** Destructor /** Destructor
*/ */
LoadMDHistoWorkspace::~LoadMDHistoWorkspace() ImportMDHistoWorkspace::~ImportMDHistoWorkspace()
{ {
} }
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
/// Algorithm's name for identification. @see Algorithm::name /// Algorithm's name for identification. @see Algorithm::name
const std::string LoadMDHistoWorkspace::name() const { return "LoadMDHistoWorkspace";}; const std::string ImportMDHistoWorkspace::name() const { return "ImportMDHistoWorkspace";};
/// Algorithm's version for identification. @see Algorithm::version /// Algorithm's version for identification. @see Algorithm::version
int LoadMDHistoWorkspace::version() const { return 1;}; int ImportMDHistoWorkspace::version() const { return 1;};
/// Algorithm's category for identification. @see Algorithm::category /// Algorithm's category for identification. @see Algorithm::category
const std::string LoadMDHistoWorkspace::category() const { return "General";} const std::string ImportMDHistoWorkspace::category() const { return "General";}
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
/// Sets documentation strings for this algorithm /// Sets documentation strings for this algorithm
void LoadMDHistoWorkspace::initDocs() void ImportMDHistoWorkspace::initDocs()
{ {
this->setWikiSummary("Reads a text file and generates an MDHistoWorkspace from it."); this->setWikiSummary("Reads a text file and generates an MDHistoWorkspace from it.");
this->setOptionalMessage("Reads a text file and generates an MDHistoWorkspace from it."); this->setOptionalMessage("Reads a text file and generates an MDHistoWorkspace from it.");
...@@ -89,7 +89,7 @@ namespace MDEvents ...@@ -89,7 +89,7 @@ namespace MDEvents
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
/** Initialize the algorithm's properties. /** Initialize the algorithm's properties.
*/ */
void LoadMDHistoWorkspace::init() void ImportMDHistoWorkspace::init()
{ {
std::vector<std::string> fileExtensions(1); std::vector<std::string> fileExtensions(1);
fileExtensions[0]=".txt"; fileExtensions[0]=".txt";
...@@ -124,7 +124,7 @@ namespace MDEvents ...@@ -124,7 +124,7 @@ namespace MDEvents
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
/** Execute the algorithm. /** Execute the algorithm.
*/ */
void LoadMDHistoWorkspace::exec() void ImportMDHistoWorkspace::exec()
{ {
// Fetch input properties // Fetch input properties
const int ndims = getProperty("Dimensionality"); const int ndims = getProperty("Dimensionality");
......
#ifndef MANTID_MDEVENTS_LOADMDHISTOWORKSPACETEST_H_ #ifndef MANTID_MDEVENTS_IMPORTMDHISTOWORKSPACETEST_H_
#define MANTID_MDEVENTS_LOADMDHISTOWORKSPACETEST_H_ #define MANTID_MDEVENTS_IMPORTMDHISTOWORKSPACETEST_H_
#include <cxxtest/TestSuite.h> #include <cxxtest/TestSuite.h>
#include "MantidKernel/Timer.h" #include "MantidKernel/Timer.h"
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <fstream> #include <fstream>
#include "MantidMDEvents/LoadMDHistoWorkspace.h" #include "MantidMDEvents/ImportMDHistoWorkspace.h"
#include "MantidAPI/IMDHistoWorkspace.h" #include "MantidAPI/IMDHistoWorkspace.h"
using namespace Mantid; using namespace Mantid;
...@@ -53,7 +53,7 @@ private: ...@@ -53,7 +53,7 @@ private:
void *operator new[](size_t); void *operator new[](size_t);
}; };
class LoadMDHistoWorkspaceTest : public CxxTest::TestSuite class ImportMDHistoWorkspaceTest : public CxxTest::TestSuite
{ {
private: private:
...@@ -64,7 +64,7 @@ private: ...@@ -64,7 +64,7 @@ private:
*/ */
boost::shared_ptr<IAlgorithm> make_standard_algorithm(const MDFileObject& fileObject) boost::shared_ptr<IAlgorithm> make_standard_algorithm(const MDFileObject& fileObject)
{ {
IAlgorithm_sptr alg = IAlgorithm_sptr(new LoadMDHistoWorkspace()); IAlgorithm_sptr alg = IAlgorithm_sptr(new ImportMDHistoWorkspace());
alg->initialize(); alg->initialize();
alg->setRethrows(true); alg->setRethrows(true);
alg->setPropertyValue("FileName", fileObject.getFileName()); alg->setPropertyValue("FileName", fileObject.getFileName());
...@@ -81,12 +81,12 @@ private: ...@@ -81,12 +81,12 @@ private:
public: public:
// This pair of boilerplate methods prevent the suite being created statically // This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests // This means the constructor isn't called when running other tests
static LoadMDHistoWorkspaceTest *createSuite() { return new LoadMDHistoWorkspaceTest(); } static ImportMDHistoWorkspaceTest *createSuite() { return new ImportMDHistoWorkspaceTest(); }
static void destroySuite( LoadMDHistoWorkspaceTest *suite ) { delete suite; } static void destroySuite( ImportMDHistoWorkspaceTest *suite ) { delete suite; }
void test_Init() void test_Init()
{ {
LoadMDHistoWorkspace alg; ImportMDHistoWorkspace alg;
TS_ASSERT_THROWS_NOTHING( alg.initialize() ) TS_ASSERT_THROWS_NOTHING( alg.initialize() )
TS_ASSERT( alg.isInitialized() ) TS_ASSERT( alg.isInitialized() )
} }
...@@ -174,7 +174,7 @@ public: ...@@ -174,7 +174,7 @@ public:
void test_executes_2D() void test_executes_2D()
{ {
MDFileObject fileObject("test_file_for_load_md_histo_workspace_test_.txt", 2*2); MDFileObject fileObject("test_file_for_load_md_histo_workspace_test_.txt", 2*2);
IAlgorithm_sptr alg = IAlgorithm_sptr(new LoadMDHistoWorkspace()); IAlgorithm_sptr alg = IAlgorithm_sptr(new ImportMDHistoWorkspace());
alg->initialize(); alg->initialize();
alg->setPropertyValue("FileName", fileObject.getFileName()); alg->setPropertyValue("FileName", fileObject.getFileName());
alg->setProperty("Dimensionality", 2); alg->setProperty("Dimensionality", 2);
...@@ -229,7 +229,7 @@ public: ...@@ -229,7 +229,7 @@ public:
void test_executes_3D() void test_executes_3D()
{ {
MDFileObject fileObject("test_file_for_load_md_histo_workspace_test_.txt", 2*2*2); MDFileObject fileObject("test_file_for_load_md_histo_workspace_test_.txt", 2*2*2);
IAlgorithm_sptr alg = IAlgorithm_sptr(new LoadMDHistoWorkspace()); IAlgorithm_sptr alg = IAlgorithm_sptr(new ImportMDHistoWorkspace());
alg->initialize(); alg->initialize();
alg->setPropertyValue("FileName", fileObject.getFileName()); alg->setPropertyValue("FileName", fileObject.getFileName());
alg->setProperty("Dimensionality", 3); alg->setProperty("Dimensionality", 3);
...@@ -260,4 +260,4 @@ public: ...@@ -260,4 +260,4 @@ public:
}; };
#endif /* MANTID_MDEVENTS_LOADMDHISTOWORKSPACETEST_H_ */ #endif /* MANTID_MDEVENTS_IMPORTMDHISTOWORKSPACETEST_H_ */
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment