Mantid
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Mantid::PythonInterface::DataProcessorAdapter< Base > Class Template Reference

Provides a layer class for boost::python to allow C++ virtual functions to be overridden in a Python object that is derived an DataProcessorAlgorithm. More...

#include <DataProcessorAdapter.h>

Inheritance diagram for Mantid::PythonInterface::DataProcessorAdapter< Base >:
Mantid::PythonInterface::AlgorithmAdapter< API::GenericDataProcessorAlgorithm< Base > > Mantid::API::GenericDataProcessorAlgorithm< Base >

Public Member Functions

API::Workspace_sptr assembleProxy (const std::string &partialWSName, const std::string &outputWSName)
 
void copyPropertiesProxy (const std::string &algName, const boost::python::object &propNames, const int version=-1)
 
 DataProcessorAdapter ()=delete
 Disable default constructor - The PyObject must be supplied to construct the object. More...
 
 DataProcessorAdapter (const DataProcessorAdapter &)=delete
 Disable copy operator. More...
 
 DataProcessorAdapter (PyObject *self)
 A constructor that looks like a Python init method. More...
 
API::ITableWorkspace_sptr determineChunkProxy (const std::string &filename)
 
void forwardPropertiesProxy ()
 
int getNThreadsProxy ()
 
std::shared_ptr< Kernel::PropertyManagergetProcessPropertiesProxy (const std::string &propertyManager=std::string())
 
bool isMainThreadProxy ()
 
void loadChunkProxy (const size_t rowIndex)
 
API::Workspace_sptr loadProxy (const std::string &inputData, const bool loadQuiet=false)
 
DataProcessorAdapteroperator= (const DataProcessorAdapter &)=delete
 Disable assignment operator. More...
 
void saveNexusProxy (const std::string &outputWSName, const std::string &outputFile)
 
void setAccumAlgProxy (const std::string &alg)
 
void setLoadAlgFilePropProxy (const std::string &filePropName)
 
void setLoadAlgProxy (const std::string &alg)
 
std::vector< std::string > splitInputProxy (const std::string &input)
 
- Public Member Functions inherited from Mantid::PythonInterface::AlgorithmAdapter< API::GenericDataProcessorAlgorithm< Base > >
 AlgorithmAdapter ()=delete
 Disable default constructor - The PyObject must be supplied to construct the object. More...
 
 AlgorithmAdapter (const AlgorithmAdapter &)=delete
 Disable copy operator. More...
 
 AlgorithmAdapter (PyObject *self)
 A constructor that looks like a Python init method. More...
 
AlgorithmAdapteroperator= (const AlgorithmAdapter &)=delete
 Disable assignment operator. More...
 
void setWikiSummary (const std::string &summary)
 Set the summary text. More...
 
const std::string name () const override
 Returns the name of the algorithm. More...
 
int version () const override
 Returns a version of the algorithm. More...
 
const std::string summary () const override
 Returns the summary for the algorithm. More...
 
const std::string category () const override
 Returns a category of the algorithm. More...
 
const std::vector< std::string > seeAlso () const override
 Returns seeAlso related algorithms. More...
 
const std::string alias () const override
 Allow the method returning the algorithm aliases to be overridden. More...
 
const std::string aliasDeprecated () const override
 Returns optional documentation URL of the algorithm. More...
 
const std::string helpURL () const override
 Optional documentation URL of the algorithm, empty string if not overridden. More...
 
bool isRunning () const override
 Allow the isRunning method to be overridden. More...
 
void cancel () override
 Allow the cancel method to be overridden. More...
 
bool checkGroups () override
 A return of false will allow processing workspace groups as a whole. More...
 
std::map< std::string, std::string > validateInputs () override
 Returns the validateInputs result of the algorithm. More...
 
- Public Member Functions inherited from Mantid::API::GenericDataProcessorAlgorithm< Base >
 GenericDataProcessorAlgorithm ()
 Constructor. More...
 
Kernel::IPropertyManager::TypedValue getProperty (const std::string &name) const override
 Get the property held by this object. More...
 
std::string getPropertyValue (const std::string &name) const override
 Get the property held by this object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Mantid::PythonInterface::AlgorithmAdapter< API::GenericDataProcessorAlgorithm< Base > >
static void declarePyAlgProperty (boost::python::object &self, Kernel::Property *prop, const std::string &doc="")
 Declare a preconstructed property. More...
 
static void declarePyAlgProperty (boost::python::object &self, const std::string &name, const boost::python::object &defaultValue, const boost::python::object &validator=boost::python::object(), const std::string &doc="", const int direction=Kernel::Direction::Input)
 Declare a property using the type of the defaultValue with a validator and doc string. More...
 
static void declarePyAlgProperty (boost::python::object &self, const std::string &name, const boost::python::object &defaultValue, const std::string &doc, const int direction=Kernel::Direction::Input)
 Declare a property with a documentation string. More...
 
static void declarePyAlgProperty (boost::python::object &self, const std::string &name, const boost::python::object &defaultValue, const int direction)
 Declare a property using the type of the defaultValue. More...
 
- Protected Member Functions inherited from Mantid::PythonInterface::AlgorithmAdapter< API::GenericDataProcessorAlgorithm< Base > >
PyObject * getSelf () const
 Returns the PyObject that owns this wrapper, i.e. More...
 
- Protected Member Functions inherited from Mantid::API::GenericDataProcessorAlgorithm< Base >
Workspace_sptr assemble (const std::string &partialWSName, const std::string &outputWSName)
 Assemble the partial workspaces from all MPI processes. More...
 
Workspace_sptr assemble (Workspace_sptr partialWS)
 Assemble the partial workspaces from all MPI processes. More...
 
void copyProperty (const API::Algorithm_sptr &alg, const std::string &name)
 Copy a property from an existing algorithm. More...
 
std::shared_ptr< AlgorithmcreateChildAlgorithm (const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1) override
 Create a Child Algorithm. More...
 
virtual ITableWorkspace_sptr determineChunk (const std::string &filename)
 
MatrixWorkspace_sptr divide (const MatrixWorkspace_sptr lhs, const double &rhsValue)
 Divide a matrix workspace by a single value. More...
 
MatrixWorkspace_sptr divide (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs)
 Divide a matrix workspace by another matrix workspace. More...
 
void forwardProperties ()
 
int getNThreads ()
 Return the number of MPI processes running. More...
 
std::shared_ptr< Kernel::PropertyManagergetProcessProperties (const std::string &propertyManager=std::string()) const
 Get the property manager object of a given name from the property manager data service, or create a new one. More...
 
bool isMainThread ()
 Return true if we are running on the main thread. More...
 
Workspace_sptr load (const std::string &inputData, const bool loadQuiet=false)
 Determine what kind of input data we have and load it. More...
 
virtual MatrixWorkspace_sptr loadChunk (const size_t rowIndex)
 
void mapPropertyName (const std::string &nameInProp, const std::string &nameInPropManager)
 Declare mapping of property name to name in the PropertyManager. More...
 
MatrixWorkspace_sptr minus (const MatrixWorkspace_sptr lhs, const double &rhsValue)
 Subract a single value from a matrix workspace. More...
 
MatrixWorkspace_sptr minus (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs)
 Subract a matrix workspace by another matrix workspace. More...
 
MatrixWorkspace_sptr multiply (const MatrixWorkspace_sptr lhs, const double &rhsValue)
 Multiply a matrix workspace by a single value. More...
 
MatrixWorkspace_sptr multiply (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs)
 Multiply a matrix workspace by another matrix workspace. More...
 
MatrixWorkspace_sptr plus (const MatrixWorkspace_sptr lhs, const double &rhsValue)
 Add a single value to a matrix workspace. More...
 
MatrixWorkspace_sptr plus (const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs)
 Add a matrix workspace to another matrix workspace. More...
 
void saveNexus (const std::string &outputWSName, const std::string &outputFile)
 Save a workspace as a nexus file, with check for which thread we are executing in. More...
 
void setAccumAlg (const std::string &alg)
 
void setLoadAlg (const std::string &alg)
 
void setLoadAlgFileProp (const std::string &filePropName)
 
void setPropManagerPropName (const std::string &propName)
 
std::vector< std::string > splitInput (const std::string &input)
 
- Protected Attributes inherited from Mantid::API::GenericDataProcessorAlgorithm< Base >
bool m_useMPI
 MPI option. If false, we will use one job event if MPI is available. More...
 

Detailed Description

template<class Base>
class Mantid::PythonInterface::DataProcessorAdapter< Base >

Provides a layer class for boost::python to allow C++ virtual functions to be overridden in a Python object that is derived an DataProcessorAlgorithm.

It also provides access to the protected methods on DataProcessorAlgorithm from the type exported to Python

Definition at line 28 of file DataProcessorAdapter.h.

Constructor & Destructor Documentation

◆ DataProcessorAdapter() [1/3]

template<class Base >
Mantid::PythonInterface::DataProcessorAdapter< Base >::DataProcessorAdapter ( PyObject *  self)

A constructor that looks like a Python init method.

Construct the "wrapper" and stores the reference to the PyObject.

Parameters
selfA reference to the calling Python object

Definition at line 19 of file DataProcessorAdapter.cpp.

◆ DataProcessorAdapter() [2/3]

template<class Base >
Mantid::PythonInterface::DataProcessorAdapter< Base >::DataProcessorAdapter ( )
delete

Disable default constructor - The PyObject must be supplied to construct the object.

◆ DataProcessorAdapter() [3/3]

template<class Base >
Mantid::PythonInterface::DataProcessorAdapter< Base >::DataProcessorAdapter ( const DataProcessorAdapter< Base > &  )
delete

Disable copy operator.

Member Function Documentation

◆ assembleProxy()

template<class Base >
API::Workspace_sptr Mantid::PythonInterface::DataProcessorAdapter< Base >::assembleProxy ( const std::string &  partialWSName,
const std::string &  outputWSName 
)
inline

◆ copyPropertiesProxy()

template<class Base >
void Mantid::PythonInterface::DataProcessorAdapter< Base >::copyPropertiesProxy ( const std::string &  algName,
const boost::python::object &  propNames,
const int  version = -1 
)
inline

◆ determineChunkProxy()

template<class Base >
API::ITableWorkspace_sptr Mantid::PythonInterface::DataProcessorAdapter< Base >::determineChunkProxy ( const std::string &  filename)
inline

◆ forwardPropertiesProxy()

template<class Base >
void Mantid::PythonInterface::DataProcessorAdapter< Base >::forwardPropertiesProxy ( )
inline

◆ getNThreadsProxy()

template<class Base >
int Mantid::PythonInterface::DataProcessorAdapter< Base >::getNThreadsProxy ( )
inline

◆ getProcessPropertiesProxy()

template<class Base >
std::shared_ptr< Kernel::PropertyManager > Mantid::PythonInterface::DataProcessorAdapter< Base >::getProcessPropertiesProxy ( const std::string &  propertyManager = std::string())
inline

◆ isMainThreadProxy()

template<class Base >
bool Mantid::PythonInterface::DataProcessorAdapter< Base >::isMainThreadProxy ( )
inline

◆ loadChunkProxy()

template<class Base >
void Mantid::PythonInterface::DataProcessorAdapter< Base >::loadChunkProxy ( const size_t  rowIndex)
inline

◆ loadProxy()

template<class Base >
API::Workspace_sptr Mantid::PythonInterface::DataProcessorAdapter< Base >::loadProxy ( const std::string &  inputData,
const bool  loadQuiet = false 
)
inline

◆ operator=()

template<class Base >
DataProcessorAdapter & Mantid::PythonInterface::DataProcessorAdapter< Base >::operator= ( const DataProcessorAdapter< Base > &  )
delete

Disable assignment operator.

◆ saveNexusProxy()

template<class Base >
void Mantid::PythonInterface::DataProcessorAdapter< Base >::saveNexusProxy ( const std::string &  outputWSName,
const std::string &  outputFile 
)
inline

◆ setAccumAlgProxy()

template<class Base >
void Mantid::PythonInterface::DataProcessorAdapter< Base >::setAccumAlgProxy ( const std::string &  alg)
inline

◆ setLoadAlgFilePropProxy()

template<class Base >
void Mantid::PythonInterface::DataProcessorAdapter< Base >::setLoadAlgFilePropProxy ( const std::string &  filePropName)
inline

◆ setLoadAlgProxy()

template<class Base >
void Mantid::PythonInterface::DataProcessorAdapter< Base >::setLoadAlgProxy ( const std::string &  alg)
inline

◆ splitInputProxy()

template<class Base >
std::vector< std::string > Mantid::PythonInterface::DataProcessorAdapter< Base >::splitInputProxy ( const std::string &  input)
inline

The documentation for this class was generated from the following files: