Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
4d9b10f1
Commit
4d9b10f1
authored
Feb 22, 2019
by
Jose Borreguero
Browse files
Refs #24797 conform to clang formatting
parent
c5e9ae1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Framework/API/test/ExperimentInfoTest.h
View file @
4d9b10f1
...
...
@@ -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
);
}
...
...
Framework/PythonInterface/mantid/api/src/Exports/ExperimentInfo.cpp
View file @
4d9b10f1
...
...
@@ -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
"
"
\n
returns : 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
"
"
\n
returns : list of absolute paths for each valid file"
)
.
staticmethod
(
"getResourceFilenames"
)
.
def
(
"getInstrumentFilename"
,
&
ExperimentInfo
::
getInstrumentFilename
,
getInstrumentFilename_Overload
(
"Returns IDF filename"
,
(
arg
(
"instrument"
),
arg
(
"date"
)
=
""
)))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment