Mantid
Loading...
Searching...
No Matches
InstrumentFileFinder.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7
9
11
16
17#include <boost/python/class.hpp>
18#include <boost/python/copy_const_reference.hpp>
19#include <boost/python/list.hpp>
20#include <boost/python/overloads.hpp>
21#include <boost/python/register_ptr_to_python.hpp>
22
23#include <string>
24
26using namespace Mantid::PythonInterface;
27using namespace boost::python;
28
30
31GNU_DIAG_OFF("unused-local-typedef")
32// Ignore -Wconversion warnings coming from boost::python
33// Seen with GCC 7.1.1 and Boost 1.63.0
34GNU_DIAG_OFF("conversion")
36BOOST_PYTHON_FUNCTION_OVERLOADS(getInstrumentFilename_Overload, InstrumentFileFinder::getInstrumentFilename, 1, 2)
37BOOST_PYTHON_FUNCTION_OVERLOADS(getParameterPath_Overload, InstrumentFileFinder::getParameterPath, 1, 2)
38GNU_DIAG_ON("conversion")
39GNU_DIAG_ON("unused-local-typedef")
40
42 register_ptr_to_python<std::shared_ptr<InstrumentFileFinder>>();
43
44 class_<InstrumentFileFinder>("InstrumentFileFinder", no_init)
45 // -
46 .def("getInstrumentFilename", &InstrumentFileFinder::getInstrumentFilename,
47 getInstrumentFilename_Overload("Returns IDF filename", (arg("instrument"), arg("date") = "")))
48 .staticmethod("getInstrumentFilename")
49 // -
50 .def("getParameterPath", &InstrumentFileFinder::getParameterPath,
51 getParameterPath_Overload("Returns the full path to the given instrument parameter file "
52 "for the named instrument if it exists in the instrument search "
53 "directories, or the optional user provided path.\n"
54
55 "instName: The name of the instrument to lookup the IPF "
56 "for\n"
57 "directoryHint: (Optional) Searches the user provided path "
58 "before any instrument dirs\n"
59 "returns: The full path as a string if found, else an "
60 "empty string",
61 (arg("instName"), arg("directoryHint") = "")))
62 .staticmethod("getParameterPath");
63}
#define GET_POINTER_SPECIALIZATION(TYPE)
Definition: GetPointer.h:17
void exportInstrumentFileFinder()
Overload generator for getInstrumentFilename.
#define GNU_DIAG_ON(x)
#define GNU_DIAG_OFF(x)
This is a collection of macros for turning compiler warnings off in a controlled manner.
static std::string getParameterPath(const std::string &instName, const std::string &dirHint="")
Search instrument directories for Parameter file, return full path name if found, else "".
static std::string getInstrumentFilename(const std::string &instrumentName, const std::string &date="")
Get the IDF using the instrument name and date.