Commit bdf4de0a authored by David Fairbrother's avatar David Fairbrother
Browse files

Rename to InstrumentFileFinder and add deprecation warn

Renames FileFinderHelper to InstrumentFileFinder following a PR comment.
Additionally it adds a deprecated warning to the Python export
parent ac0414ae
...@@ -39,7 +39,7 @@ set(SRC_FILES ...@@ -39,7 +39,7 @@ set(SRC_FILES
src/Expression.cpp src/Expression.cpp
src/FileBackedExperimentInfo.cpp src/FileBackedExperimentInfo.cpp
src/FileFinder.cpp src/FileFinder.cpp
src/FileFinderHelpers.cpp src/InstrumentFileFinder.cpp
src/FileLoaderRegistry.cpp src/FileLoaderRegistry.cpp
src/FileProperty.cpp src/FileProperty.cpp
src/FrameworkManager.cpp src/FrameworkManager.cpp
...@@ -211,7 +211,7 @@ set(INC_FILES ...@@ -211,7 +211,7 @@ set(INC_FILES
inc/MantidAPI/Expression.h inc/MantidAPI/Expression.h
inc/MantidAPI/FileBackedExperimentInfo.h inc/MantidAPI/FileBackedExperimentInfo.h
inc/MantidAPI/FileFinder.h inc/MantidAPI/FileFinder.h
inc/MantidAPI/FileFinderHelpers.h inc/MantidAPI/InstrumentFileFinder.h
inc/MantidAPI/FileLoaderRegistry.h inc/MantidAPI/FileLoaderRegistry.h
inc/MantidAPI/FileProperty.h inc/MantidAPI/FileProperty.h
inc/MantidAPI/FrameworkManager.h inc/MantidAPI/FrameworkManager.h
...@@ -407,7 +407,7 @@ set(TEST_FILES ...@@ -407,7 +407,7 @@ set(TEST_FILES
ExpressionTest.h ExpressionTest.h
FileBackedExperimentInfoTest.h FileBackedExperimentInfoTest.h
FileFinderTest.h FileFinderTest.h
FileFinderHelpersTest.h InstrumentFileFinderTest.h
FilePropertyTest.h FilePropertyTest.h
FrameworkManagerTest.h FrameworkManagerTest.h
FuncMinimizerFactoryTest.h FuncMinimizerFactoryTest.h
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
namespace Mantid::API { namespace Mantid::API {
class MANTID_API_DLL FileFinderHelpers { class MANTID_API_DLL InstrumentFileFinder {
public: public:
/// Search instrument directories for Parameter file, /// Search instrument directories for Parameter file,
/// return full path name if found, else "". /// return full path name if found, else "".
static std::string getIPFPath(const std::string &instName, static std::string getParameterPath(const std::string &instName,
const std::string &dirHint = ""); const std::string &dirHint = "");
/// Get the IDF using the instrument name and date /// Get the IDF using the instrument name and date
static std::string getInstrumentFilename(const std::string &instrumentName, static std::string getInstrumentFilename(const std::string &instrumentName,
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS // Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 + // SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/ExperimentInfo.h" #include "MantidAPI/ExperimentInfo.h"
#include "MantidAPI/FileFinderHelpers.h"
#include "MantidAPI/InstrumentDataService.h" #include "MantidAPI/InstrumentDataService.h"
#include "MantidAPI/InstrumentFileFinder.h"
#include "MantidAPI/ResizeRectangularDetectorHelper.h" #include "MantidAPI/ResizeRectangularDetectorHelper.h"
#include "MantidAPI/Run.h" #include "MantidAPI/Run.h"
#include "MantidAPI/Sample.h" #include "MantidAPI/Sample.h"
...@@ -1099,7 +1099,7 @@ void ExperimentInfo::setInstumentFromXML(const std::string &nxFilename, ...@@ -1099,7 +1099,7 @@ void ExperimentInfo::setInstumentFromXML(const std::string &nxFilename,
} else { } else {
// XML was not included or was empty // XML was not included or was empty
// Use the instrument name to find the file // Use the instrument name to find the file
instrumentFilename = FileFinderHelpers::getInstrumentFilename( instrumentFilename = InstrumentFileFinder::getInstrumentFilename(
instrumentName, getWorkspaceStartDate()); instrumentName, getWorkspaceStartDate());
// And now load the contents // And now load the contents
instrumentXml = loadInstrumentXML(instrumentFilename); instrumentXml = loadInstrumentXML(instrumentFilename);
......
#include "MantidAPI/FileFinderHelpers.h" #include "MantidAPI/InstrumentFileFinder.h"
#include "MantidKernel/ConfigService.h" #include "MantidKernel/ConfigService.h"
#include "MantidKernel/DateAndTime.h" #include "MantidKernel/DateAndTime.h"
...@@ -24,7 +24,7 @@ using namespace Poco::XML; ...@@ -24,7 +24,7 @@ using namespace Poco::XML;
namespace { namespace {
/// static logger object /// static logger object
Mantid::Kernel::Logger g_log("FileFinderHelpers"); Mantid::Kernel::Logger g_log("InstrumentFileFinder");
// used to terminate SAX process // used to terminate SAX process
class DummyException { class DummyException {
...@@ -88,8 +88,8 @@ namespace Mantid::API { ...@@ -88,8 +88,8 @@ namespace Mantid::API {
*is found *is found
*/ */
std::string std::string
FileFinderHelpers::getInstrumentFilename(const std::string &instrumentName, InstrumentFileFinder::getInstrumentFilename(const std::string &instrumentName,
const std::string &date) { const std::string &date) {
const std::vector<std::string> validFormats = {"xml", "nxs", "hdf5"}; const std::vector<std::string> validFormats = {"xml", "nxs", "hdf5"};
g_log.debug() << "Looking for instrument file for " << instrumentName g_log.debug() << "Looking for instrument file for " << instrumentName
<< " that is valid on '" << date << "'\n"; << " that is valid on '" << date << "'\n";
...@@ -117,8 +117,8 @@ FileFinderHelpers::getInstrumentFilename(const std::string &instrumentName, ...@@ -117,8 +117,8 @@ FileFinderHelpers::getInstrumentFilename(const std::string &instrumentName,
/// Search the directory for the Parameter IDF file and return full path name if /// Search the directory for the Parameter IDF file and return full path name if
/// found, else return "". /// found, else return "".
// directoryName must include a final '/'. // directoryName must include a final '/'.
std::string FileFinderHelpers::getIPFPath(const std::string &instName, std::string InstrumentFileFinder::getParameterPath(const std::string &instName,
const std::string &dirHint) { const std::string &dirHint) {
// Remove the path from the filename, some legacy callers will pass in // Remove the path from the filename, some legacy callers will pass in
// a full path rather than a filename // a full path rather than a filename
Poco::Path filePath(instName); Poco::Path filePath(instName);
...@@ -150,8 +150,8 @@ std::string FileFinderHelpers::getIPFPath(const std::string &instName, ...@@ -150,8 +150,8 @@ std::string FileFinderHelpers::getIPFPath(const std::string &instName,
return ""; return "";
} }
std::string FileFinderHelpers::lookupIPF(const std::string &dir, std::string InstrumentFileFinder::lookupIPF(const std::string &dir,
std::string filename) { std::string filename) {
const std::string ext = ".xml"; const std::string ext = ".xml";
// Remove .xml for example if abc.xml was passed // Remove .xml for example if abc.xml was passed
boost::algorithm::ierase_all(filename, ext); boost::algorithm::ierase_all(filename, ext);
...@@ -204,7 +204,7 @@ std::string FileFinderHelpers::lookupIPF(const std::string &dir, ...@@ -204,7 +204,7 @@ std::string FileFinderHelpers::lookupIPF(const std::string &dir,
* this date * this date
* @return list of absolute paths for each valid file * @return list of absolute paths for each valid file
*/ */
std::vector<std::string> FileFinderHelpers::getResourceFilenames( std::vector<std::string> InstrumentFileFinder::getResourceFilenames(
const std::string &prefix, const std::vector<std::string> &fileFormats, const std::string &prefix, const std::vector<std::string> &fileFormats,
const std::vector<std::string> &directoryNames, const std::string &date) { const std::vector<std::string> &directoryNames, const std::string &date) {
...@@ -214,8 +214,8 @@ std::vector<std::string> FileFinderHelpers::getResourceFilenames( ...@@ -214,8 +214,8 @@ std::vector<std::string> FileFinderHelpers::getResourceFilenames(
const std::string now = const std::string now =
Types::Core::DateAndTime::getCurrentTime().toISO8601String(); Types::Core::DateAndTime::getCurrentTime().toISO8601String();
// Recursively call this method, but with all parameters. // Recursively call this method, but with all parameters.
return FileFinderHelpers::getResourceFilenames(prefix, fileFormats, return InstrumentFileFinder::getResourceFilenames(prefix, fileFormats,
directoryNames, now); directoryNames, now);
} }
// Join all the file formats into a single string // Join all the file formats into a single string
...@@ -310,9 +310,9 @@ std::vector<std::string> FileFinderHelpers::getResourceFilenames( ...@@ -310,9 +310,9 @@ std::vector<std::string> FileFinderHelpers::getResourceFilenames(
* @param[out] outValidFrom :: Used to return valid-from date * @param[out] outValidFrom :: Used to return valid-from date
* @param[out] outValidTo :: Used to return valid-to date * @param[out] outValidTo :: Used to return valid-to date
*/ */
void FileFinderHelpers::getValidFromTo(const std::string &IDFfilename, void InstrumentFileFinder::getValidFromTo(const std::string &IDFfilename,
std::string &outValidFrom, std::string &outValidFrom,
std::string &outValidTo) { std::string &outValidTo) {
SAXParser pParser; SAXParser pParser;
// Create on stack to ensure deletion. Relies on pParser also being local // Create on stack to ensure deletion. Relies on pParser also being local
// variable. // variable.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 + // SPDX - License - Identifier: GPL - 3.0 +
#pragma once #pragma once
#include "MantidAPI/FileFinderHelpers.h" #include "MantidAPI/InstrumentFileFinder.h"
#include "MantidKernel/ConfigService.h" #include "MantidKernel/ConfigService.h"
#include "MantidKernel/DateAndTime.h" #include "MantidKernel/DateAndTime.h"
...@@ -25,7 +25,7 @@ using namespace Mantid::Kernel; ...@@ -25,7 +25,7 @@ using namespace Mantid::Kernel;
using namespace Mantid::API; using namespace Mantid::API;
using Mantid::Types::Core::DateAndTime; using Mantid::Types::Core::DateAndTime;
class FileFinderHelpersTest : public CxxTest::TestSuite { class InstrumentFileFinderTest : public CxxTest::TestSuite {
public: public:
struct fromToEntry { struct fromToEntry {
std::string path; std::string path;
...@@ -54,7 +54,8 @@ public: ...@@ -54,7 +54,8 @@ public:
if (boost::regex_match(l_filenamePart, regex)) { if (boost::regex_match(l_filenamePart, regex)) {
std::string validFrom, validTo; std::string validFrom, validTo;
FileFinderHelpers::getValidFromTo(dir_itr->path(), validFrom, validTo); InstrumentFileFinder::getValidFromTo(dir_itr->path(), validFrom,
validTo);
size_t found; size_t found;
found = l_filenamePart.find("_Definition"); found = l_filenamePart.find("_Definition");
...@@ -102,25 +103,25 @@ public: ...@@ -102,25 +103,25 @@ public:
// Check that instrument dirs are searched correctly // Check that instrument dirs are searched correctly
const std::string expectedFileName = "GEM_parameters.xml"; const std::string expectedFileName = "GEM_parameters.xml";
const auto result = FileFinderHelpers::getIPFPath("GEM"); const auto result = InstrumentFileFinder::getParameterPath("GEM");
TS_ASSERT(boost::icontains(result, expectedFileName)); TS_ASSERT(boost::icontains(result, expectedFileName));
// Should be case insensitive // Should be case insensitive
const auto mixedResult = const auto mixedResult =
FileFinderHelpers::getIPFPath("GEM_defINITION.xml"); InstrumentFileFinder::getParameterPath("GEM_defINITION.xml");
TS_ASSERT_EQUALS(result, mixedResult); TS_ASSERT_EQUALS(result, mixedResult);
} }
void testFindIPFWithDate() { void testFindIPFWithDate() {
const std::string input = "D2B_Definition_2018-03-01.xml"; const std::string input = "D2B_Definition_2018-03-01.xml";
const auto result = FileFinderHelpers::getIPFPath(input); const auto result = InstrumentFileFinder::getParameterPath(input);
const std::string expected = "D2B_Parameters_2018-03-01.xml"; const std::string expected = "D2B_Parameters_2018-03-01.xml";
TS_ASSERT(boost::icontains(result, expected)); TS_ASSERT(boost::icontains(result, expected));
} }
void testFindIPFNonExistant() { void testFindIPFNonExistant() {
const auto result = FileFinderHelpers::getIPFPath("NotThere"); const auto result = InstrumentFileFinder::getParameterPath("NotThere");
TS_ASSERT_EQUALS("", result); TS_ASSERT_EQUALS("", result);
} }
...@@ -133,7 +134,7 @@ public: ...@@ -133,7 +134,7 @@ public:
Poco::File fileHandle(expectedPath); Poco::File fileHandle(expectedPath);
fileHandle.createFile(); fileHandle.createFile();
const auto result = FileFinderHelpers::getIPFPath("test", tmpDir); const auto result = InstrumentFileFinder::getParameterPath("test", tmpDir);
// Ensure file was found and it's in the tmp dir // Ensure file was found and it's in the tmp dir
TS_ASSERT(result.find(filename) != std::string::npos); TS_ASSERT(result.find(filename) != std::string::npos);
TS_ASSERT(result.find(tmpDir) != std::string::npos); TS_ASSERT(result.find(tmpDir) != std::string::npos);
...@@ -141,14 +142,15 @@ public: ...@@ -141,14 +142,15 @@ public:
void testNonExistantIPFWithHint() { void testNonExistantIPFWithHint() {
const auto tmpDir = Poco::Path::temp(); const auto tmpDir = Poco::Path::temp();
const auto result = FileFinderHelpers::getIPFPath("notThere", tmpDir); const auto result =
InstrumentFileFinder::getParameterPath("notThere", tmpDir);
TS_ASSERT(result.empty()); TS_ASSERT(result.empty());
} }
// //
void testHelperFunctions() { void testHelperFunctions() {
ConfigService::Instance().updateFacilities(); ConfigService::Instance().updateFacilities();
FileFinderHelpers helper; InstrumentFileFinder helper;
std::string boevs = std::string boevs =
helper.getInstrumentFilename("BIOSANS", "2100-01-31 22:59:59"); helper.getInstrumentFilename("BIOSANS", "2100-01-31 22:59:59");
TS_ASSERT(!boevs.empty()); TS_ASSERT(!boevs.empty());
...@@ -156,7 +158,7 @@ public: ...@@ -156,7 +158,7 @@ public:
// //
void testHelper_TOPAZ_No_To_Date() { void testHelper_TOPAZ_No_To_Date() {
FileFinderHelpers helper; InstrumentFileFinder helper;
std::string boevs = std::string boevs =
helper.getInstrumentFilename("TOPAZ", "2011-01-31 22:59:59"); helper.getInstrumentFilename("TOPAZ", "2011-01-31 22:59:59");
TS_ASSERT(!boevs.empty()); TS_ASSERT(!boevs.empty());
...@@ -168,7 +170,7 @@ public: ...@@ -168,7 +170,7 @@ public:
const std::string testDir = instDir + "unit_testing"; const std::string testDir = instDir + "unit_testing";
ConfigService::Instance().setString("instrumentDefinition.directory", ConfigService::Instance().setString("instrumentDefinition.directory",
testDir); testDir);
FileFinderHelpers helper; InstrumentFileFinder helper;
std::string boevs = std::string boevs =
helper.getInstrumentFilename("ARGUS", "1909-01-31 22:59:59"); helper.getInstrumentFilename("ARGUS", "1909-01-31 22:59:59");
TS_ASSERT_DIFFERS(boevs.find("TEST1_ValidDateOverlap"), std::string::npos); TS_ASSERT_DIFFERS(boevs.find("TEST1_ValidDateOverlap"), std::string::npos);
...@@ -202,7 +204,7 @@ public: ...@@ -202,7 +204,7 @@ public:
void test_nexus_geometry_getInstrumentFilename() { void test_nexus_geometry_getInstrumentFilename() {
const std::string instrumentName = "LOKI"; const std::string instrumentName = "LOKI";
FileFinderHelpers info; InstrumentFileFinder info;
const auto path = info.getInstrumentFilename(instrumentName, ""); const auto path = info.getInstrumentFilename(instrumentName, "");
TS_ASSERT(!path.empty()); TS_ASSERT(!path.empty());
TS_ASSERT( TS_ASSERT(
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include "MantidAlgorithms/VesuvioL1ThetaResolution.h" #include "MantidAlgorithms/VesuvioL1ThetaResolution.h"
#include "MantidAPI/AlgorithmManager.h" #include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/FileFinderHelpers.h"
#include "MantidAPI/FileProperty.h" #include "MantidAPI/FileProperty.h"
#include "MantidAPI/InstrumentFileFinder.h"
#include "MantidAPI/MatrixWorkspace.h" #include "MantidAPI/MatrixWorkspace.h"
#include "MantidAPI/SpectrumInfo.h" #include "MantidAPI/SpectrumInfo.h"
#include "MantidAPI/TextAxis.h" #include "MantidAPI/TextAxis.h"
...@@ -269,7 +269,7 @@ void VesuvioL1ThetaResolution::loadInstrument() { ...@@ -269,7 +269,7 @@ void VesuvioL1ThetaResolution::loadInstrument() {
MatrixWorkspace_sptr tempWS = MatrixWorkspace_sptr tempWS =
WorkspaceFactory::Instance().create("Workspace2D", 1, 1, 1); WorkspaceFactory::Instance().create("Workspace2D", 1, 1, 1);
const std::string vesuvioIPF = const std::string vesuvioIPF =
FileFinderHelpers::getInstrumentFilename("VESUVIO"); InstrumentFileFinder::getInstrumentFilename("VESUVIO");
// Load an empty VESUVIO instrument workspace // Load an empty VESUVIO instrument workspace
IAlgorithm_sptr loadInst = IAlgorithm_sptr loadInst =
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS // Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 + // SPDX - License - Identifier: GPL - 3.0 +
#include "MantidDataHandling/AppendGeometryToSNSNexus.h" #include "MantidDataHandling/AppendGeometryToSNSNexus.h"
#include "MantidAPI/FileFinderHelpers.h"
#include "MantidAPI/FileProperty.h" #include "MantidAPI/FileProperty.h"
#include "MantidAPI/InstrumentFileFinder.h"
#include "MantidAPI/WorkspaceFactory.h" #include "MantidAPI/WorkspaceFactory.h"
#include "MantidDataObjects/Workspace2D.h" #include "MantidDataObjects/Workspace2D.h"
#include "MantidGeometry/Instrument.h" #include "MantidGeometry/Instrument.h"
...@@ -145,7 +145,7 @@ void AppendGeometryToSNSNexus::exec() { ...@@ -145,7 +145,7 @@ void AppendGeometryToSNSNexus::exec() {
// Now what is the instrument definition filename ? // Now what is the instrument definition filename ?
// TODO: Modify to use /entry/instrument/instrument_xml/data after // TODO: Modify to use /entry/instrument/instrument_xml/data after
// establishing a way to maintain ADARA Geometry Packet // establishing a way to maintain ADARA Geometry Packet
m_idf_filename = FileFinderHelpers::getInstrumentFilename(m_instrument); m_idf_filename = InstrumentFileFinder::getInstrumentFilename(m_instrument);
g_log.debug() << "Loading instrument definition from " << m_idf_filename g_log.debug() << "Loading instrument definition from " << m_idf_filename
<< ".\n"; << ".\n";
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
// SPDX - License - Identifier: GPL - 3.0 + // SPDX - License - Identifier: GPL - 3.0 +
#include <sstream> #include <sstream>
#include "MantidAPI/FileFinderHelpers.h"
#include "MantidAPI/FileProperty.h" #include "MantidAPI/FileProperty.h"
#include "MantidAPI/InstrumentFileFinder.h"
#include "MantidAPI/Run.h" #include "MantidAPI/Run.h"
#include "MantidAPI/SpectraAxis.h" #include "MantidAPI/SpectraAxis.h"
#include "MantidDataHandling/LoadDetectorsGroupingFile.h" #include "MantidDataHandling/LoadDetectorsGroupingFile.h"
...@@ -105,7 +105,7 @@ void LoadDetectorsGroupingFile::exec() { ...@@ -105,7 +105,7 @@ void LoadDetectorsGroupingFile::exec() {
// empty - // empty -
// the most recent will be used. // the most recent will be used.
const std::string instrumentFilename = const std::string instrumentFilename =
FileFinderHelpers::getInstrumentFilename(instrumentName, date); InstrumentFileFinder::getInstrumentFilename(instrumentName, date);
// Load an instrument // Load an instrument
Algorithm_sptr childAlg = this->createChildAlgorithm("LoadInstrument"); Algorithm_sptr childAlg = this->createChildAlgorithm("LoadInstrument");
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS // Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 + // SPDX - License - Identifier: GPL - 3.0 +
#include "MantidDataHandling/LoadInstrument.h" #include "MantidDataHandling/LoadInstrument.h"
#include "MantidAPI/FileFinderHelpers.h"
#include "MantidAPI/FileProperty.h" #include "MantidAPI/FileProperty.h"
#include "MantidAPI/InstrumentDataService.h" #include "MantidAPI/InstrumentDataService.h"
#include "MantidAPI/InstrumentFileFinder.h"
#include "MantidAPI/MatrixWorkspace.h" #include "MantidAPI/MatrixWorkspace.h"
#include "MantidAPI/Progress.h" #include "MantidAPI/Progress.h"
#include "MantidDataHandling/LoadGeometry.h" #include "MantidDataHandling/LoadGeometry.h"
...@@ -139,7 +139,7 @@ void LoadInstrument::exec() { ...@@ -139,7 +139,7 @@ void LoadInstrument::exec() {
"must be specified to load an instrument", "must be specified to load an instrument",
filename); filename);
} else { } else {
filename = FileFinderHelpers::getInstrumentFilename( filename = InstrumentFileFinder::getInstrumentFilename(
instname, ws->getWorkspaceStartDate()); instname, ws->getWorkspaceStartDate());
setPropertyValue("Filename", filename); setPropertyValue("Filename", filename);
} }
...@@ -265,7 +265,7 @@ void LoadInstrument::runLoadParameterFile( ...@@ -265,7 +265,7 @@ void LoadInstrument::runLoadParameterFile(
std::string directoryName = std::string directoryName =
filename.substr(0, dir_end + 1); // include final '/'. filename.substr(0, dir_end + 1); // include final '/'.
std::string fullPathParamIDF = std::string fullPathParamIDF =
FileFinderHelpers::getIPFPath(filename, directoryName); InstrumentFileFinder::getParameterPath(filename, directoryName);
if (!fullPathParamIDF.empty()) { if (!fullPathParamIDF.empty()) {
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
// SPDX - License - Identifier: GPL - 3.0 + // SPDX - License - Identifier: GPL - 3.0 +
#include "MantidDataHandling/LoadNXSPE.h" #include "MantidDataHandling/LoadNXSPE.h"
#include "MantidAPI/ExperimentInfo.h" #include "MantidAPI/ExperimentInfo.h"
#include "MantidAPI/FileFinderHelpers.h"
#include "MantidAPI/FileProperty.h" #include "MantidAPI/FileProperty.h"
#include "MantidAPI/InstrumentFileFinder.h"
#include "MantidAPI/MatrixWorkspace.h" #include "MantidAPI/MatrixWorkspace.h"
#include "MantidAPI/RegisterFileLoader.h" #include "MantidAPI/RegisterFileLoader.h"
#include "MantidAPI/Run.h" #include "MantidAPI/Run.h"
...@@ -331,7 +331,7 @@ void LoadNXSPE::exec() { ...@@ -331,7 +331,7 @@ void LoadNXSPE::exec() {
// NB. LoadParameterFile must be used on a workspace with an instrument // NB. LoadParameterFile must be used on a workspace with an instrument
if (!instrument_name.empty() && instrument_name != "NXSPE") { if (!instrument_name.empty() && instrument_name != "NXSPE") {
std::string IDF_filename = std::string IDF_filename =
FileFinderHelpers::getInstrumentFilename(instrument_name); InstrumentFileFinder::getInstrumentFilename(instrument_name);
std::string instrument_parfile = std::string instrument_parfile =
IDF_filename.substr(0, IDF_filename.find("_Definition")) + IDF_filename.substr(0, IDF_filename.find("_Definition")) +
"_Parameters.xml"; "_Parameters.xml";
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#include "MantidAPI/Axis.h" #include "MantidAPI/Axis.h"
#include "MantidAPI/CommonBinsValidator.h" #include "MantidAPI/CommonBinsValidator.h"
#include "MantidAPI/ExperimentInfo.h" #include "MantidAPI/ExperimentInfo.h"
#include "MantidAPI/FileFinderHelpers.h"
#include "MantidAPI/FileProperty.h" #include "MantidAPI/FileProperty.h"
#include "MantidAPI/InstrumentFileFinder.h"
#include "MantidAPI/Progress.h" #include "MantidAPI/Progress.h"
#include "MantidAPI/Run.h" #include "MantidAPI/Run.h"
#include "MantidAPI/WorkspaceUnitValidator.h" #include "MantidAPI/WorkspaceUnitValidator.h"
...@@ -212,7 +212,7 @@ getInstrumentName(const Mantid::API::MatrixWorkspace_sptr &workspace) { ...@@ -212,7 +212,7 @@ getInstrumentName(const Mantid::API::MatrixWorkspace_sptr &workspace) {
std::string getIDF(const Mantid::API::MatrixWorkspace_sptr &workspace) { std::string getIDF(const Mantid::API::MatrixWorkspace_sptr &workspace) {
auto date = workspace->getWorkspaceStartDate(); auto date = workspace->getWorkspaceStartDate();
auto instrumentName = getInstrumentName(workspace); auto instrumentName = getInstrumentName(workspace);
return FileFinderHelpers::getInstrumentFilename(instrumentName, date); return InstrumentFileFinder::getInstrumentFilename(instrumentName, date);
} }
void addDetectors(H5::Group &group, void addDetectors(H5::Group &group,
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "MantidAPI/AlgorithmManager.h" #include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/AnalysisDataService.h" #include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/FileFinderHelpers.h" #include "MantidAPI/InstrumentFileFinder.h"
#include "MantidAPI/SpectrumInfo.h" #include "MantidAPI/SpectrumInfo.h"
#include "MantidDataHandling/LoadMask.h" #include "MantidDataHandling/LoadMask.h"
#include "MantidDataObjects/MaskWorkspace.h" #include "MantidDataObjects/MaskWorkspace.h"
...@@ -364,7 +364,7 @@ public: ...@@ -364,7 +364,7 @@ public:
TS_ASSERT(source); TS_ASSERT(source);
std::string IDF_name = std::string IDF_name =
API::FileFinderHelpers::getInstrumentFilename("MARI", ""); API::InstrumentFileFinder::getInstrumentFilename("MARI", "");
/*Fake export mask algorithm: */ /*Fake export mask algorithm: */
std::string mask_contents("4 10-12 100 110 120 130 140 200 300"); std::string mask_contents("4 10-12 100 110 120 130 140 200 300");
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "NXcanSASTestHelper.h" #include "NXcanSASTestHelper.h"
#include "MantidAPI/AlgorithmManager.h" #include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/Axis.h" #include "MantidAPI/Axis.h"