10#include <boost/python/class.hpp>
11#include <boost/python/overloads.hpp>
21template <
class Base>
void do_export(
const std::string &name) {
26 class_<GenericDataProcessorAlgorithm<Base>, bases<Base>, std::shared_ptr<Adapter>, boost::noncopyable>(
27 name.c_str(),
"Base class workflow-type algorithms")
29 .def(
"setLoadAlg", &Adapter::setLoadAlgProxy, (arg(
"self"), arg(
"alg")),
30 "Set the name of the algorithm called using the load() method "
33 .def(
"setLoadAlgFileProp", &Adapter::setLoadAlgFilePropProxy, (arg(
"self"), arg(
"file_prop_name")),
34 "Set the name of the file property for the load algorithm when "
36 "the load() method [Default=Filename]")
38 .def(
"setAccumAlg", &Adapter::setAccumAlgProxy, (arg(
"self"), arg(
"alg")),
39 "Set the name of the algorithm called to accumulate a chunk of "
40 "processed data [Default=Plus]")
42 .def(
"copyProperties", &Adapter::copyPropertiesProxy,
43 (arg(
"self"), arg(
"alg"), arg(
"properties") = boost::python::object(), arg(
"version") = -1),
44 "Copy properties from another algorithm")
46 .def(
"determineChunk", &Adapter::determineChunkProxy, (arg(
"self"), arg(
"file_name")),
47 "Return a TableWorkspace containing the information on how to split "
49 "input file when processing in chunks")
51 .def(
"loadChunk", &Adapter::loadChunkProxy, (arg(
"self"), arg(
"row_index")),
"Load a chunk of data")
53 .def(
"load", (loadOverload<Base>)&Adapter::loadProxy, (arg(
"self"), arg(
"input_data"), arg(
"load_quiet") =
false),
54 "Loads the given file or workspace data and returns the workspace. "
55 "If loadQuiet=True then output is not stored in the "
56 "AnalysisDataService.")
58 .def(
"splitInput", &Adapter::splitInputProxy, (arg(
"self"), arg(
"input")), return_value_policy<VectorToNumpy>())
60 .def(
"forwardProperties", &Adapter::forwardPropertiesProxy, arg(
"self"))
62 .def(
"getProcessProperties", &Adapter::getProcessPropertiesProxy, (arg(
"self"), arg(
"property_manager")),
63 "Returns the named property manager from the service or creates "
64 "a new one if it does not exist")
66 .def(
"assemble", &Adapter::assembleProxy, (arg(
"self"), arg(
"partial_wsname"), arg(
"output_wsname")),
67 "If an MPI build, assemble the partial workspaces from all MPI "
69 "Otherwise, simply returns the input workspace")
71 .def(
"saveNexus", &Adapter::saveNexusProxy, (arg(
"self"), arg(
"output_wsname"), arg(
"output_filename")),
72 "Save a workspace as a nexus file. If this is an MPI build then "
74 "happens for the main thread.")
76 .def(
"isMainThread", &Adapter::isMainThreadProxy, arg(
"self"),
77 "Returns true if this algorithm is the main thread for an MPI "
79 "non-MPI build it always returns true")
81 .def(
"getNThreads", &Adapter::getNThreadsProxy, arg(
"self"),
82 "Returns the number of running MPI processes in an MPI build or 1 "
92 do_export<DistributedAlgorithm>(
"DistributedDataProcessorAlgorithm");
void export_SerialDataProcessorAlgorithm()
void export_DataProcessorAlgorithm()
void export_DistributedDataProcessorAlgorithm()
void export_ParallelDataProcessorAlgorithm()
Provides a layer class for boost::python to allow C++ virtual functions to be overridden in a Python ...
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Implements a return value policy that returns a numpy array from a function returning a std::vector b...