Commit 4d9b10f1 authored by Jose Borreguero's avatar Jose Borreguero
Browse files

Refs #24797 conform to clang formatting

parent c5e9ae1d
......@@ -590,15 +590,21 @@ public:
std::vector<std::string> formats = {"xml"};
std::vector<std::string> dirs;
dirs.push_back(testDir);
std::vector<std::string> fnames =
helper.getResourceFilenames("ARGUS", formats, dirs, "1909-01-31 22:59:59");
TS_ASSERT_DIFFERS(fnames[0].find("TEST1_ValidDateOverlap"), std::string::npos);
std::vector<std::string> fnames = helper.getResourceFilenames(
"ARGUS", formats, dirs, "1909-01-31 22:59:59");
TS_ASSERT_DIFFERS(fnames[0].find("TEST1_ValidDateOverlap"),
std::string::npos);
TS_ASSERT_EQUALS(fnames.size(), 1);
fnames = helper.getResourceFilenames("ARGUS", formats, dirs, "1909-03-31 22:59:59");
TS_ASSERT_DIFFERS(fnames[0].find("TEST2_ValidDateOverlap"), std::string::npos);
TS_ASSERT_DIFFERS(fnames[1].find("TEST1_ValidDateOverlap"), std::string::npos);
fnames = helper.getResourceFilenames("ARGUS", formats, dirs, "1909-05-31 22:59:59");
TS_ASSERT_DIFFERS(fnames[0].find("TEST1_ValidDateOverlap"), std::string::npos);
fnames = helper.getResourceFilenames("ARGUS", formats, dirs,
"1909-03-31 22:59:59");
TS_ASSERT_DIFFERS(fnames[0].find("TEST2_ValidDateOverlap"),
std::string::npos);
TS_ASSERT_DIFFERS(fnames[1].find("TEST1_ValidDateOverlap"),
std::string::npos);
fnames = helper.getResourceFilenames("ARGUS", formats, dirs,
"1909-05-31 22:59:59");
TS_ASSERT_DIFFERS(fnames[0].find("TEST1_ValidDateOverlap"),
std::string::npos);
TS_ASSERT_EQUALS(fnames.size(), 1);
}
......
......@@ -12,13 +12,13 @@
#include "MantidGeometry/Instrument/ComponentInfo.h"
#include "MantidGeometry/Instrument/DetectorInfo.h"
#include "MantidKernel/WarningSuppressions.h"
#include "MantidPythonInterface/kernel/GetPointer.h"
#include "MantidPythonInterface/kernel/Policies/RemoveConst.h"
#include "MantidPythonInterface/kernel/Converters/PySequenceToVector.h"
#include "MantidPythonInterface/kernel/Converters/ToPyList.h"
#include "MantidPythonInterface/kernel/GetPointer.h"
#include "MantidPythonInterface/kernel/Policies/RemoveConst.h"
#include <boost/python/class.hpp>
#include <boost/python/list.hpp>
#include <boost/python/copy_const_reference.hpp>
#include <boost/python/list.hpp>
#include <boost/python/overloads.hpp>
#include <boost/python/register_ptr_to_python.hpp>
......@@ -31,12 +31,11 @@ GET_POINTER_SPECIALIZATION(ExperimentInfo)
/// Converter from C++ signature to python signature
list getResourceFilenames(const std::string &prefix, const list &fileFormats,
const list &directoryNames, const std::string &date) {
return Converters::ToPyList<std::string>()(ExperimentInfo::getResourceFilenames(
prefix,
Converters::PySequenceToVector<std::string>(fileFormats)(),
Converters::PySequenceToVector<std::string>(directoryNames)(),
date));
const list &directoryNames, const std::string &date) {
return Converters::ToPyList<std::string>()(
ExperimentInfo::getResourceFilenames(
prefix, Converters::PySequenceToVector<std::string>(fileFormats)(),
Converters::PySequenceToVector<std::string>(directoryNames)(), date));
}
GNU_DIAG_OFF("unused-local-typedef")
......@@ -56,20 +55,22 @@ void export_ExperimentInfo() {
.def("getInstrument", &ExperimentInfo::getInstrument,
return_value_policy<RemoveConstSharedPtr>(), args("self"),
"Returns the :class:`~mantid.geometry.Instrument` for this run.")
.def("getResourceFilenames",
&getResourceFilenames,
(arg("prefix"), arg("fileFormats"), arg("directoryNames"), arg("date")),
"Compile a list of files in compliance with name pattern-matching,\n"
"file format, and date-stamp constraints\n\n"
"Ideally, the valid-from and valid-to of any valid file should\n"
"encapsulate the argument date. If this is not possible, then\n"
"the file with the most recent valid-from stamp is selected\n\n"
"prefix: the name of a valid file must begin with this pattern\n"
"fileFormats: valid file extensions\n"
"directoryNames: search only in these directories\n"
"date : valid-from and valid-to of a valid file encapsulate date\n"
"\nreturns : list of absolute paths for each valid file"
).staticmethod("getResourceFilenames")
.def("getResourceFilenames", &getResourceFilenames,
(arg("prefix"), arg("fileFormats"), arg("directoryNames"),
arg("date")),
"Compile a list of files in compliance with name pattern-matching,\n"
"file format, and date-stamp constraints\n\n"
"Ideally, the valid-from and valid-to of any valid file should\n"
"encapsulate the argument date. If this is not possible, then\n"
"the file with the most recent valid-from stamp is selected\n\n"
"prefix: the name of a valid file must begin with this "
"pattern\n"
"fileFormats: valid file extensions\n"
"directoryNames: search only in these directories\n"
"date : valid-from and valid-to of a valid file "
"encapsulate date\n"
"\nreturns : list of absolute paths for each valid file")
.staticmethod("getResourceFilenames")
.def("getInstrumentFilename", &ExperimentInfo::getInstrumentFilename,
getInstrumentFilename_Overload(
"Returns IDF filename", (arg("instrument"), arg("date") = "")))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment